@mongodb-js/compass-web 0.32.0 → 0.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/128.9e3ffe7449cca93fbcb4.mjs +2 -0
- package/dist/128.9e3ffe7449cca93fbcb4.mjs.LICENSE.txt +8 -0
- package/dist/174.9b919a5407fdc3851924.mjs +23 -0
- package/dist/{651.0fd082f957775274f3cb.mjs.LICENSE.txt → 174.9b919a5407fdc3851924.mjs.LICENSE.txt} +23 -0
- package/dist/221.73c874bae77f258d1063.mjs +2 -0
- package/dist/400.ee421ec0c79f2e659fa8.mjs +378 -0
- package/dist/455.e6b707cae57e3018c29e.mjs +1 -0
- package/dist/48.9ca2dbc319085729bea6.mjs +1 -0
- package/dist/753.c784df67afeae6565839.mjs +2 -0
- package/dist/753.c784df67afeae6565839.mjs.LICENSE.txt +16 -0
- package/dist/772.2baa874c0109bdb1a2cb.mjs +2 -0
- package/dist/{170.0c7c13457f8ab6403681.mjs.LICENSE.txt → 772.2baa874c0109bdb1a2cb.mjs.LICENSE.txt} +0 -9
- package/dist/800.dcb5412b380b659e88ac.mjs +2 -0
- package/dist/{752.be311c1a6bd153169544.mjs.LICENSE.txt → 800.dcb5412b380b659e88ac.mjs.LICENSE.txt} +7 -7
- package/dist/915.2a425bc2ab5dfa3e6a60.mjs +2 -0
- package/dist/915.2a425bc2ab5dfa3e6a60.mjs.LICENSE.txt +6 -0
- package/dist/assets-manifest.json +11 -9
- package/dist/compass-web.d.ts +4 -3
- package/dist/compass-web.mjs +35 -35
- package/dist/index-bde52cb3.8627a1873c0630586210.mjs +1 -0
- package/package.json +44 -42
- package/dist/17.362fcb811ee2ff871d32.mjs +0 -2
- package/dist/170.0c7c13457f8ab6403681.mjs +0 -2
- package/dist/285.2ddf9e15aaf11bb22b0e.mjs +0 -2
- package/dist/285.2ddf9e15aaf11bb22b0e.mjs.LICENSE.txt +0 -5
- package/dist/427.ea0869d385dd7ebc1ee3.mjs +0 -2
- package/dist/427.ea0869d385dd7ebc1ee3.mjs.LICENSE.txt +0 -6
- package/dist/638.dc747e993cad73ab20a0.mjs +0 -372
- package/dist/651.0fd082f957775274f3cb.mjs +0 -23
- package/dist/752.be311c1a6bd153169544.mjs +0 -2
- package/dist/955.d2cd8c12c1697a9c2d41.mjs +0 -2
- package/dist/955.d2cd8c12c1697a9c2d41.mjs.LICENSE.txt +0 -13
- package/dist/index-bde52cb3.0f5ab0c9a2dfc578bd9d.mjs +0 -1
- /package/dist/{17.362fcb811ee2ff871d32.mjs.LICENSE.txt → 221.73c874bae77f258d1063.mjs.LICENSE.txt} +0 -0
- /package/dist/{638.dc747e993cad73ab20a0.mjs.LICENSE.txt → 400.ee421ec0c79f2e659fa8.mjs.LICENSE.txt} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 285.2ddf9e15aaf11bb22b0e.mjs.LICENSE.txt */
|
|
2
|
-
export const __webpack_esm_id__=285;export const __webpack_esm_ids__=[285];export const __webpack_esm_modules__={160:(e,t,n)=>{const a=n(98855);e.exports=(e,t)=>{const n=a(e,t);return n&&n.prerelease.length?n.prerelease:null}},415:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:s}=n(77693),i=n(67767),o=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],p=t.t={};let d=0;const m="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[m,r]],f=(e,t,n)=>{const a=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=d++;i(e,r,t),p[e]=r,u[r]=t,c[r]=a,o[r]=new RegExp(t,n?"g":void 0),l[r]=new RegExp(a,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),f("MAINVERSION",`(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${u[p.PRERELEASEIDENTIFIER]}(?:\\.${u[p.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${u[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[p.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${m}+`),f("BUILD",`(?:\\+(${u[p.BUILDIDENTIFIER]}(?:\\.${u[p.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${u[p.MAINVERSION]}${u[p.PRERELEASE]}?${u[p.BUILD]}?`),f("FULL",`^${u[p.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${u[p.MAINVERSIONLOOSE]}${u[p.PRERELEASELOOSE]}?${u[p.BUILD]}?`),f("LOOSE",`^${u[p.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${u[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${u[p.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:${u[p.PRERELEASE]})?${u[p.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:${u[p.PRERELEASELOOSE]})?${u[p.BUILD]}?)?)?`),f("XRANGE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),f("COERCE",`${u[p.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",u[p.COERCEPLAIN]+`(?:${u[p.PRERELEASE]})?`+`(?:${u[p.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",u[p.COERCE],!0),f("COERCERTLFULL",u[p.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${u[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${u[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${u[p.LONECARET]}${u[p.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${u[p.LONECARET]}${u[p.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${u[p.GTLT]}\\s*(${u[p.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]}|${u[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${u[p.XRANGEPLAIN]})\\s+-\\s+(${u[p.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${u[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[p.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},540:(e,t,n)=>{const a=n(50066),r=n(72857);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},1025:(e,t,n)=>{const a=n(9350);e.exports=(e,t,n,r,s)=>{"string"==typeof n&&(s=r,r=n,n=void 0);try{return new a(e instanceof a?e.version:e,n).inc(t,r,s).version}catch(e){return null}}},1276:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENVS=t.ON_PREM=t.ADL=t.ATLAS=void 0;const n="atlas";t.ATLAS=n,t.ADL="adl";const a="on-prem";t.ON_PREM=a;const r=[n,"adl",a];t.ENVS=r},1280:(e,t,n)=>{n.d(t,{$O:()=>_,$S:()=>X,Au:()=>F,Be:()=>l,Bj:()=>v,Ct:()=>g,Dl:()=>h,ER:()=>Q,Eb:()=>Z,F7:()=>R,FO:()=>ie,Fk:()=>W,Fn:()=>d,G1:()=>T,G8:()=>Y,Hi:()=>z,Il:()=>ae,KA:()=>M,KB:()=>I,Kn:()=>O,LK:()=>P,Mu:()=>i,Ny:()=>b,Pw:()=>y,Rl:()=>s,Tx:()=>U,Uy:()=>E,WN:()=>ne,YA:()=>G,Zm:()=>q,_L:()=>L,_z:()=>$,aC:()=>m,bS:()=>ee,cU:()=>A,dR:()=>J,dZ:()=>se,db:()=>N,em:()=>D,f2:()=>k,fU:()=>oe,fs:()=>f,gP:()=>x,hH:()=>K,jw:()=>j,lo:()=>te,m9:()=>B,nA:()=>u,pY:()=>c,qF:()=>H,qG:()=>C,qm:()=>V,rk:()=>w,rt:()=>S,tB:()=>o,wA:()=>p,xY:()=>re});var a=n(71295),r=n(72510);function s(e,t){return new e({type:"string",...r.A2(t)})}function i(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...r.A2(t)})}function o(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...r.A2(t)})}function l(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...r.A2(t)})}function u(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...r.A2(t)})}function c(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...r.A2(t)})}function p(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...r.A2(t)})}function d(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...r.A2(t)})}function m(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...r.A2(t)})}function h(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...r.A2(t)})}function f(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...r.A2(t)})}function v(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...r.A2(t)})}function g(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...r.A2(t)})}function y(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...r.A2(t)})}function $(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...r.A2(t)})}function b(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...r.A2(t)})}function _(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...r.A2(t)})}function E(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...r.A2(t)})}function x(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...r.A2(t)})}function S(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...r.A2(t)})}function A(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...r.A2(t)})}function I(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...r.A2(t)})}function w(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...r.A2(t)})}function T(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...r.A2(t)})}function N(e,t){return new e({type:"string",format:"date",check:"string_format",...r.A2(t)})}function O(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...r.A2(t)})}function k(e,t){return new e({type:"string",format:"duration",check:"string_format",...r.A2(t)})}function R(e,t){return new e({type:"number",checks:[],...r.A2(t)})}function C(e,t){return new e({type:"number",coerce:!0,checks:[],...r.A2(t)})}function P(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...r.A2(t)})}function L(e,t){return new e({type:"boolean",...r.A2(t)})}function j(e,t){return new e({type:"null",...r.A2(t)})}function M(e){return new e({type:"any"})}function D(e){return new e({type:"unknown"})}function Y(e,t){return new e({type:"never",...r.A2(t)})}function F(e,t){return new a.sm({check:"less_than",...r.A2(t),value:e,inclusive:!1})}function q(e,t){return new a.sm({check:"less_than",...r.A2(t),value:e,inclusive:!0})}function U(e,t){return new a.J_({check:"greater_than",...r.A2(t),value:e,inclusive:!1})}function V(e,t){return new a.J_({check:"greater_than",...r.A2(t),value:e,inclusive:!0})}function z(e,t){return new a.Jk({check:"multiple_of",...r.A2(t),value:e})}function Z(e,t){return new a.Yk({check:"max_length",...r.A2(t),maximum:e})}function B(e,t){return new a.Kk({check:"min_length",...r.A2(t),minimum:e})}function G(e,t){return new a.RM({check:"length_equals",...r.A2(t),length:e})}function W(e,t){return new a.DG({check:"string_format",format:"regex",...r.A2(t),pattern:e})}function K(e){return new a.NI({check:"string_format",format:"lowercase",...r.A2(e)})}function H(e){return new a.kH({check:"string_format",format:"uppercase",...r.A2(e)})}function J(e,t){return new a.Tt({check:"string_format",format:"includes",...r.A2(t),includes:e})}function X(e,t){return new a.J({check:"string_format",format:"starts_with",...r.A2(t),prefix:e})}function Q(e,t){return new a.E6({check:"string_format",format:"ends_with",...r.A2(t),suffix:e})}function ee(e){return new a.v$({check:"overwrite",tx:e})}function te(e){return ee((t=>t.normalize(e)))}function ne(){return ee((e=>e.trim()))}function ae(){return ee((e=>e.toLowerCase()))}function re(){return ee((e=>e.toUpperCase()))}function se(e,t,n){return new e({type:"array",element:t,...r.A2(n)})}function ie(e,t,n){const a=r.A2(n);return a.abort??(a.abort=!0),new e({type:"custom",check:"custom",fn:t,...a})}function oe(e,t,n){return new e({type:"custom",check:"custom",fn:t,...r.A2(n)})}},1451:(e,t,n)=>{const a=n(95323);e.exports=(e,t)=>new a(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},1726:(e,t,n)=>{var a=n(40811);e.exports=new a("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},2420:(e,t,n)=>{n.d(t,{qg:()=>l,EJ:()=>u,xL:()=>c,bp:()=>p});var a=n(84527),r=n(99629),s=n(49189);const i=(e,t)=>{r.a$.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>r.Wk(e,t)},flatten:{value:t=>r.JM(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})},o=(s.xI("ZodError",i),s.xI("ZodError",i,{Parent:Error})),l=a.Tj(o),u=a.Rb(o),c=a.Od(o),p=a.wG(o)},3012:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ACCUMULATORS=void 0,t.ACCUMULATORS=[{name:"$accumulator",value:"$accumulator",score:1,meta:"accumulator",version:"4.4.0"},{name:"$addToSet",value:"$addToSet",score:1,meta:"accumulator",version:"2.2.0"},{name:"$avg",value:"$avg",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$bottom",value:"$bottom",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$bottomN",value:"$bottomN",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$covariancePop",value:"$covariancePop",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$covarianceSamp",value:"$covarianceSamp",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$count",value:"$count",score:1,meta:"accumulator",version:"5.0.0"},{name:"$derivative",value:"$derivative",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$denseRank",value:"$denseRank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$documentNumber",value:"$documentNumber",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$expMovingAvg",value:"$expMovingAvg",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$first",value:"$first",score:1,meta:"accumulator",version:"2.2.0"},{name:"$firstN",value:"$firstN",score:1,meta:"accumulator",version:"5.1.0"},{name:"$integral",value:"$integral",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$last",value:"$last",score:1,meta:"accumulator",version:"2.2.0"},{name:"$lastN",value:"$lastN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$max",value:"$max",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$maxN",value:"$maxN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$median",value:"$median",score:1,meta:"accumulator",version:"7.0.0"},{name:"$min",value:"$min",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$minN",value:"$minN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$percentile",value:"$percentile",score:1,meta:"accumulator",version:"7.0.0"},{name:"$push",value:"$push",score:1,meta:"accumulator",version:"2.2.0"},{name:"$rank",value:"$rank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$stdDevPop",value:"$stdDevPop",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$stdDevSamp",value:"$stdDevSamp",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$shift",value:"$shift",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$sum",value:"$sum",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$top",value:"$top",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$topN",value:"$topN",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$locf",value:"$locf",score:1,meta:"accumulator:window",version:"5.3.0"},{name:"$linearFill",value:"$linearFill",score:1,meta:"accumulator:window",version:"5.3.0"}]},3449:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>a(e,t,n)<0},3508:(e,t,n)=>{n.d(t,{qt:()=>$e,tm:()=>dt,Sj:()=>m,Ml:()=>z,n:()=>W,Lr:()=>D,WF:()=>Y,eN:()=>be,hw:()=>ge,aP:()=>F,Xi:()=>ve,jv:()=>Q,k1:()=>me,Vb:()=>ce,kY:()=>Ie,CZ:()=>ie,Jv:()=>te,Ih:()=>oe,DN:()=>le,Ut:()=>re,Tq:()=>ye,WM:()=>pe,iS:()=>B,PQ:()=>V,l1:()=>fe,rS:()=>M,bv:()=>H,Ii:()=>he,_c:()=>_e,$i:()=>de,EV:()=>Ee,b8:()=>ae,lK:()=>m,Kz:()=>se,ND:()=>L,K5:()=>q,BG:()=>me,y0:()=>ne,aR:()=>m,_Z:()=>U,fZ:()=>J,_:()=>Z,a0:()=>G,bz:()=>Me,YO:()=>qe,o:()=>ke,zM:()=>Re,au:()=>pt,Ie:()=>Se,p6:()=>Ce,fm:()=>R,gM:()=>Ze,QZ:()=>at,k5:()=>et,fH:()=>Je,Nl:()=>we,E$:()=>Be,fn:()=>Ae,RZ:()=>Xe,eu:()=>Qe,Tj:()=>Ke,oi:()=>Oe,fc:()=>tt,Zm:()=>Ye,ch:()=>je,me:()=>st,ai:()=>Ne,Ik:()=>Ue,yN:()=>ct,p7:()=>ut,lq:()=>rt,Di:()=>lt,Tk:()=>ot,vk:()=>it,iv:()=>nt,g1:()=>We,hZ:()=>He,re:()=>Ve,Yj:()=>Te,HR:()=>Pe,Gu:()=>at,PV:()=>Ge,Vx:()=>Le,KC:()=>ze,L5:()=>De,rI:()=>Fe});var a,r=n(14487),s=n(17769),i=n(15625);!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(a||(a={}));var o=n(63761),l=n(21392),u=n(9606).URL;class c{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const p=(e,t)=>{if((0,o.fn)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new r.G(e.common.issues);return this._error=t,this._error}}};function d(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:a,description:r}=e;if(t&&(n||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:r}:{errorMap:(t,r)=>{const{message:s}=e;return"invalid_enum_value"===t.code?{message:s??r.defaultError}:void 0===r.data?{message:s??a??r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:s??n??r.defaultError}},description:r}}class m{get description(){return this._def.description}_getType(e){return(0,l.CR)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,l.CR)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new o.MY,ctx:{common:e.parent.common,data:e.data,parsedType:(0,l.CR)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,o.xP)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,l.CR)(e)},a=this._parseSync({data:e,path:n.path,parent:n});return p(n,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,l.CR)(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return(0,o.fn)(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>(0,o.fn)(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,l.CR)(e)},a=this._parse({data:e,path:n.path,parent:n}),r=await((0,o.xP)(a)?a:Promise.resolve(a));return p(n,r)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,a)=>{const s=e(t),i=()=>a.addIssue({code:r.eq.custom,...n(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(i(),!1))):!!s||(i(),!1)}))}refinement(e,t){return this._refinement(((n,a)=>!!e(n)||(a.addIssue("function"==typeof t?t(n,a):t),!1)))}_refinement(e){return new me({schema:this,typeName:Ie.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return he.create(this,this._def)}nullable(){return fe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this)}promise(){return de.create(this,this._def)}or(e){return J.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new me({...d(this._def),schema:this,typeName:Ie.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ve({...d(this._def),innerType:this,defaultValue:t,typeName:Ie.ZodDefault})}brand(){return new be({typeName:Ie.ZodBranded,type:this,...d(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ge({...d(this._def),innerType:this,catchValue:t,typeName:Ie.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return _e.create(this,e)}readonly(){return Ee.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const h=/^c[^\s-]{8,}$/i,f=/^[0-9a-z]+$/,v=/^[0-9A-HJKMNP-TV-Z]{26}$/i,g=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,y=/^[a-z0-9_-]{21}$/i,$=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,b=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let E;const x=/^(?:(?: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])$/,S=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,A=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,I=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,w=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,T=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,N="((\\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])))",O=new RegExp(`^${N}$`);function k(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function R(e){let t=`${N}T${k(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function C(e,t){if(!$.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(a));return!("object"!=typeof r||null===r||"typ"in r&&"JWT"!==r?.typ||!r.alg||t&&r.alg!==t)}catch{return!1}}function P(e,t){return!("v4"!==t&&t||!S.test(e))||!("v6"!==t&&t||!I.test(e))}class L extends m{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==l.Zp.string){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.string,received:t.parsedType}),o.uY}const t=new o.MY;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{code:r.eq.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{code:r.eq.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const a=e.data.length>i.value,s=e.data.length<i.value;(a||s)&&(n=this._getOrReturnCtx(e,n),a?(0,o.zn)(n,{code:r.eq.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&(0,o.zn)(n,{code:r.eq.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)_.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"email",code:r.eq.invalid_string,message:i.message}),t.dirty());else if("emoji"===i.kind)E||(E=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),E.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"emoji",code:r.eq.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)g.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"uuid",code:r.eq.invalid_string,message:i.message}),t.dirty());else if("nanoid"===i.kind)y.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"nanoid",code:r.eq.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)h.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"cuid",code:r.eq.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)f.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"cuid2",code:r.eq.invalid_string,message:i.message}),t.dirty());else if("ulid"===i.kind)v.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"ulid",code:r.eq.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new u(e.data)}catch{n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"url",code:r.eq.invalid_string,message:i.message}),t.dirty()}else"regex"===i.kind?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"regex",code:r.eq.invalid_string,message:i.message}),t.dirty())):"trim"===i.kind?e.data=e.data.trim():"includes"===i.kind?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{code:r.eq.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.dirty()):"toLowerCase"===i.kind?e.data=e.data.toLowerCase():"toUpperCase"===i.kind?e.data=e.data.toUpperCase():"startsWith"===i.kind?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{code:r.eq.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty()):"endsWith"===i.kind?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{code:r.eq.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty()):"datetime"===i.kind?R(i).test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{code:r.eq.invalid_string,validation:"datetime",message:i.message}),t.dirty()):"date"===i.kind?O.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{code:r.eq.invalid_string,validation:"date",message:i.message}),t.dirty()):"time"===i.kind?new RegExp(`^${k(i)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{code:r.eq.invalid_string,validation:"time",message:i.message}),t.dirty()):"duration"===i.kind?b.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"duration",code:r.eq.invalid_string,message:i.message}),t.dirty()):"ip"===i.kind?(a=e.data,("v4"!==(s=i.version)&&s||!x.test(a))&&("v6"!==s&&s||!A.test(a))&&(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"ip",code:r.eq.invalid_string,message:i.message}),t.dirty())):"jwt"===i.kind?C(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"jwt",code:r.eq.invalid_string,message:i.message}),t.dirty()):"cidr"===i.kind?P(e.data,i.version)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"cidr",code:r.eq.invalid_string,message:i.message}),t.dirty()):"base64"===i.kind?w.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"base64",code:r.eq.invalid_string,message:i.message}),t.dirty()):"base64url"===i.kind?T.test(e.data)||(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{validation:"base64url",code:r.eq.invalid_string,message:i.message}),t.dirty()):l.ZS.assertNever(i);var a,s;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:r.eq.invalid_string,...a.errToObj(n)})}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...a.errToObj(e)})}url(e){return this._addCheck({kind:"url",...a.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...a.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...a.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...a.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...a.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...a.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...a.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...a.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...a.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...a.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...a.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...a.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...a.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...a.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...a.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...a.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...a.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...a.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...a.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...a.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...a.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...a.errToObj(t)})}nonempty(e){return this.min(1,a.errToObj(e))}trim(){return new L({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new L({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new L({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function j(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,r=n>a?n:a;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}L.create=e=>new L({checks:[],typeName:Ie.ZodString,coerce:e?.coerce??!1,...d(e)});class M extends m{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==l.Zp.number){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.number,received:t.parsedType}),o.uY}let t;const n=new o.MY;for(const a of this._def.checks)"int"===a.kind?l.ZS.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,o.zn)(t,{code:r.eq.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),(0,o.zn)(t,{code:r.eq.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),(0,o.zn)(t,{code:r.eq.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):"multipleOf"===a.kind?0!==j(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),(0,o.zn)(t,{code:r.eq.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,o.zn)(t,{code:r.eq.not_finite,message:a.message}),n.dirty()):l.ZS.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,a.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a.toString(t))}setLimit(e,t,n,r){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:a.toString(r)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:a.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:a.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:a.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:a.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:a.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:a.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:a.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:a.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&l.ZS.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}M.create=e=>new M({checks:[],typeName:Ie.ZodNumber,coerce:e?.coerce||!1,...d(e)});class D extends m{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==l.Zp.bigint)return this._getInvalidInput(e);let t;const n=new o.MY;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),(0,o.zn)(t,{code:r.eq.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),(0,o.zn)(t,{code:r.eq.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,o.zn)(t,{code:r.eq.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):l.ZS.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.bigint,received:t.parsedType}),o.uY}gte(e,t){return this.setLimit("min",e,!0,a.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a.toString(t))}setLimit(e,t,n,r){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:a.toString(r)}]})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:a.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:a.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:a.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:a.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}D.create=e=>new D({checks:[],typeName:Ie.ZodBigInt,coerce:e?.coerce??!1,...d(e)});class Y extends m{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==l.Zp.boolean){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.boolean,received:t.parsedType}),o.uY}return(0,o.OK)(e.data)}}Y.create=e=>new Y({typeName:Ie.ZodBoolean,coerce:e?.coerce||!1,...d(e)});class F extends m{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==l.Zp.date){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.date,received:t.parsedType}),o.uY}if(Number.isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{code:r.eq.invalid_date}),o.uY}const t=new o.MY;let n;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{code:r.eq.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),(0,o.zn)(n,{code:r.eq.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):l.ZS.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:a.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:a.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}F.create=e=>new F({checks:[],coerce:e?.coerce||!1,typeName:Ie.ZodDate,...d(e)});class q extends m{_parse(e){if(this._getType(e)!==l.Zp.symbol){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.symbol,received:t.parsedType}),o.uY}return(0,o.OK)(e.data)}}q.create=e=>new q({typeName:Ie.ZodSymbol,...d(e)});class U extends m{_parse(e){if(this._getType(e)!==l.Zp.undefined){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.undefined,received:t.parsedType}),o.uY}return(0,o.OK)(e.data)}}U.create=e=>new U({typeName:Ie.ZodUndefined,...d(e)});class V extends m{_parse(e){if(this._getType(e)!==l.Zp.null){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.null,received:t.parsedType}),o.uY}return(0,o.OK)(e.data)}}V.create=e=>new V({typeName:Ie.ZodNull,...d(e)});class z extends m{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,o.OK)(e.data)}}z.create=e=>new z({typeName:Ie.ZodAny,...d(e)});class Z extends m{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,o.OK)(e.data)}}Z.create=e=>new Z({typeName:Ie.ZodUnknown,...d(e)});class B extends m{_parse(e){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.never,received:t.parsedType}),o.uY}}B.create=e=>new B({typeName:Ie.ZodNever,...d(e)});class G extends m{_parse(e){if(this._getType(e)!==l.Zp.undefined){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.void,received:t.parsedType}),o.uY}return(0,o.OK)(e.data)}}G.create=e=>new G({typeName:Ie.ZodVoid,...d(e)});class W extends m{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==l.Zp.array)return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.array,received:t.parsedType}),o.uY;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,s=t.data.length<a.exactLength.value;(e||s)&&((0,o.zn)(t,{code:e?r.eq.too_big:r.eq.too_small,minimum:s?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&((0,o.zn)(t,{code:r.eq.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&((0,o.zn)(t,{code:r.eq.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>a.type._parseAsync(new c(t,e,t.path,n))))).then((e=>o.MY.mergeArray(n,e)));const s=[...t.data].map(((e,n)=>a.type._parseSync(new c(t,e,t.path,n))));return o.MY.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new W({...this._def,minLength:{value:e,message:a.toString(t)}})}max(e,t){return new W({...this._def,maxLength:{value:e,message:a.toString(t)}})}length(e,t){return new W({...this._def,exactLength:{value:e,message:a.toString(t)}})}nonempty(e){return this.min(1,e)}}function K(e){if(e instanceof H){const t={};for(const n in e.shape){const a=e.shape[n];t[n]=he.create(K(a))}return new H({...e._def,shape:()=>t})}return e instanceof W?new W({...e._def,type:K(e.element)}):e instanceof he?he.create(K(e.unwrap())):e instanceof fe?fe.create(K(e.unwrap())):e instanceof ne?ne.create(e.items.map((e=>K(e)))):e}W.create=(e,t)=>new W({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ie.ZodArray,...d(t)});class H extends m{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=l.ZS.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==l.Zp.object){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.object,received:t.parsedType}),o.uY}const{status:t,ctx:n}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof B&&"strip"===this._def.unknownKeys))for(const e in n.data)s.includes(e)||i.push(e);const u=[];for(const e of s){const t=a[e],r=n.data[e];u.push({key:{status:"valid",value:e},value:t._parse(new c(n,r,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof B){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)u.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)i.length>0&&((0,o.zn)(n,{code:r.eq.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const a=n.data[t];u.push({key:{status:"valid",value:t},value:e._parse(new c(n,a,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of u){const n=await t.key,a=await t.value;e.push({key:n,value:a,alwaysSet:t.alwaysSet})}return e})).then((e=>o.MY.mergeObjectSync(t,e))):o.MY.mergeObjectSync(t,u)}get shape(){return this._def.shape()}strict(e){return a.errToObj,new H({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{const r=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:a.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new H({...this._def,unknownKeys:"strip"})}passthrough(){return new H({...this._def,unknownKeys:"passthrough"})}extend(e){return new H({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new H({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ie.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new H({...this._def,catchall:e})}pick(e){const t={};for(const n of l.ZS.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new H({...this._def,shape:()=>t})}omit(e){const t={};for(const n of l.ZS.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new H({...this._def,shape:()=>t})}deepPartial(){return K(this)}partial(e){const t={};for(const n of l.ZS.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new H({...this._def,shape:()=>t})}required(e){const t={};for(const n of l.ZS.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof he;)e=e._def.innerType;t[n]=e}return new H({...this._def,shape:()=>t})}keyof(){return ue(l.ZS.objectKeys(this.shape))}}H.create=(e,t)=>new H({shape:()=>e,unknownKeys:"strip",catchall:B.create(),typeName:Ie.ZodObject,...d(t)}),H.strictCreate=(e,t)=>new H({shape:()=>e,unknownKeys:"strict",catchall:B.create(),typeName:Ie.ZodObject,...d(t)}),H.lazycreate=(e,t)=>new H({shape:e,unknownKeys:"strip",catchall:B.create(),typeName:Ie.ZodObject,...d(t)});class J extends m{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new r.G(e.ctx.common.issues)));return(0,o.zn)(t,{code:r.eq.invalid_union,unionErrors:n}),o.uY}));{let e;const a=[];for(const r of n){const n={...t,common:{...t.common,issues:[]},parent:null},s=r._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&a.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=a.map((e=>new r.G(e)));return(0,o.zn)(t,{code:r.eq.invalid_union,unionErrors:s}),o.uY}}get options(){return this._def.options}}J.create=(e,t)=>new J({options:e,typeName:Ie.ZodUnion,...d(t)});const X=e=>e instanceof oe?X(e.schema):e instanceof me?X(e.innerType()):e instanceof le?[e.value]:e instanceof ce?e.options:e instanceof pe?l.ZS.objectValues(e.enum):e instanceof ve?X(e._def.innerType):e instanceof U?[void 0]:e instanceof V?[null]:e instanceof he?[void 0,...X(e.unwrap())]:e instanceof fe?[null,...X(e.unwrap())]:e instanceof be||e instanceof Ee?X(e.unwrap()):e instanceof ge?X(e._def.innerType):[];class Q extends m{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.Zp.object)return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.object,received:t.parsedType}),o.uY;const n=this.discriminator,a=t.data[n],s=this.optionsMap.get(a);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):((0,o.zn)(t,{code:r.eq.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),o.uY)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const a=new Map;for(const n of t){const t=X(n.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const r of t){if(a.has(r))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);a.set(r,n)}}return new Q({typeName:Ie.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...d(n)})}}function ee(e,t){const n=(0,l.CR)(e),a=(0,l.CR)(t);if(e===t)return{valid:!0,data:e};if(n===l.Zp.object&&a===l.Zp.object){const n=l.ZS.objectKeys(t),a=l.ZS.objectKeys(e).filter((e=>-1!==n.indexOf(e))),r={...e,...t};for(const n of a){const a=ee(e[n],t[n]);if(!a.valid)return{valid:!1};r[n]=a.data}return{valid:!0,data:r}}if(n===l.Zp.array&&a===l.Zp.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let a=0;a<e.length;a++){const r=ee(e[a],t[a]);if(!r.valid)return{valid:!1};n.push(r.data)}return{valid:!0,data:n}}return n===l.Zp.date&&a===l.Zp.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class te extends m{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(e,a)=>{if((0,o.G4)(e)||(0,o.G4)(a))return o.uY;const s=ee(e.value,a.value);return s.valid?(((0,o.DM)(e)||(0,o.DM)(a))&&t.dirty(),{status:t.value,value:s.data}):((0,o.zn)(n,{code:r.eq.invalid_intersection_types}),o.uY)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>a(e,t))):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}te.create=(e,t,n)=>new te({left:e,right:t,typeName:Ie.ZodIntersection,...d(n)});class ne extends m{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==l.Zp.array)return(0,o.zn)(n,{code:r.eq.invalid_type,expected:l.Zp.array,received:n.parsedType}),o.uY;if(n.data.length<this._def.items.length)return(0,o.zn)(n,{code:r.eq.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),o.uY;!this._def.rest&&n.data.length>this._def.items.length&&((0,o.zn)(n,{code:r.eq.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map(((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new c(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(a).then((e=>o.MY.mergeArray(t,e))):o.MY.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new ne({...this._def,rest:e})}}ne.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ne({items:e,typeName:Ie.ZodTuple,rest:null,...d(t)})};class ae extends m{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==l.Zp.object)return(0,o.zn)(n,{code:r.eq.invalid_type,expected:l.Zp.object,received:n.parsedType}),o.uY;const a=[],s=this._def.keyType,i=this._def.valueType;for(const e in n.data)a.push({key:s._parse(new c(n,e,n.path,e)),value:i._parse(new c(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?o.MY.mergeObjectAsync(t,a):o.MY.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,n){return new ae(t instanceof m?{keyType:e,valueType:t,typeName:Ie.ZodRecord,...d(n)}:{keyType:L.create(),valueType:e,typeName:Ie.ZodRecord,...d(t)})}}class re extends m{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==l.Zp.map)return(0,o.zn)(n,{code:r.eq.invalid_type,expected:l.Zp.map,received:n.parsedType}),o.uY;const a=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map((([e,t],r)=>({key:a._parse(new c(n,e,n.path,[r,"key"])),value:s._parse(new c(n,t,n.path,[r,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of i){const a=await n.key,r=await n.value;if("aborted"===a.status||"aborted"===r.status)return o.uY;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of i){const a=n.key,r=n.value;if("aborted"===a.status||"aborted"===r.status)return o.uY;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}}}}re.create=(e,t,n)=>new re({valueType:t,keyType:e,typeName:Ie.ZodMap,...d(n)});class se extends m{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==l.Zp.set)return(0,o.zn)(n,{code:r.eq.invalid_type,expected:l.Zp.set,received:n.parsedType}),o.uY;const a=this._def;null!==a.minSize&&n.data.size<a.minSize.value&&((0,o.zn)(n,{code:r.eq.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&n.data.size>a.maxSize.value&&((0,o.zn)(n,{code:r.eq.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function i(e){const n=new Set;for(const a of e){if("aborted"===a.status)return o.uY;"dirty"===a.status&&t.dirty(),n.add(a.value)}return{status:t.value,value:n}}const u=[...n.data.values()].map(((e,t)=>s._parse(new c(n,e,n.path,t))));return n.common.async?Promise.all(u).then((e=>i(e))):i(u)}min(e,t){return new se({...this._def,minSize:{value:e,message:a.toString(t)}})}max(e,t){return new se({...this._def,maxSize:{value:e,message:a.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}se.create=(e,t)=>new se({valueType:e,minSize:null,maxSize:null,typeName:Ie.ZodSet,...d(t)});class ie extends m{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.Zp.function)return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.function,received:t.parsedType}),o.uY;function n(e,n){return(0,o.y7)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,s.$W)(),i.A].filter((e=>!!e)),issueData:{code:r.eq.invalid_arguments,argumentsError:n}})}function a(e,n){return(0,o.y7)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,s.$W)(),i.A].filter((e=>!!e)),issueData:{code:r.eq.invalid_return_type,returnTypeError:n}})}const u={errorMap:t.common.contextualErrorMap},c=t.data;if(this._def.returns instanceof de){const e=this;return(0,o.OK)((async function(...t){const s=new r.G([]),i=await e._def.args.parseAsync(t,u).catch((e=>{throw s.addIssue(n(t,e)),s})),o=await Reflect.apply(c,this,i);return await e._def.returns._def.type.parseAsync(o,u).catch((e=>{throw s.addIssue(a(o,e)),s}))}))}{const e=this;return(0,o.OK)((function(...t){const s=e._def.args.safeParse(t,u);if(!s.success)throw new r.G([n(t,s.error)]);const i=Reflect.apply(c,this,s.data),o=e._def.returns.safeParse(i,u);if(!o.success)throw new r.G([a(i,o.error)]);return o.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ie({...this._def,args:ne.create(e).rest(Z.create())})}returns(e){return new ie({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ie({args:e||ne.create([]).rest(Z.create()),returns:t||Z.create(),typeName:Ie.ZodFunction,...d(n)})}}class oe extends m{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}oe.create=(e,t)=>new oe({getter:e,typeName:Ie.ZodLazy,...d(t)});class le extends m{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{received:t.data,code:r.eq.invalid_literal,expected:this._def.value}),o.uY}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ue(e,t){return new ce({values:e,typeName:Ie.ZodEnum,...d(t)})}le.create=(e,t)=>new le({value:e,typeName:Ie.ZodLiteral,...d(t)});class ce extends m{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return(0,o.zn)(t,{expected:l.ZS.joinValues(n),received:t.parsedType,code:r.eq.invalid_type}),o.uY}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return(0,o.zn)(t,{received:t.data,code:r.eq.invalid_enum_value,options:n}),o.uY}return(0,o.OK)(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ce.create(e,{...this._def,...t})}exclude(e,t=this._def){return ce.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}ce.create=ue;class pe extends m{_parse(e){const t=l.ZS.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==l.Zp.string&&n.parsedType!==l.Zp.number){const e=l.ZS.objectValues(t);return(0,o.zn)(n,{expected:l.ZS.joinValues(e),received:n.parsedType,code:r.eq.invalid_type}),o.uY}if(this._cache||(this._cache=new Set(l.ZS.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=l.ZS.objectValues(t);return(0,o.zn)(n,{received:n.data,code:r.eq.invalid_enum_value,options:e}),o.uY}return(0,o.OK)(e.data)}get enum(){return this._def.values}}pe.create=(e,t)=>new pe({values:e,typeName:Ie.ZodNativeEnum,...d(t)});class de extends m{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.Zp.promise&&!1===t.common.async)return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.promise,received:t.parsedType}),o.uY;const n=t.parsedType===l.Zp.promise?t.data:Promise.resolve(t.data);return(0,o.OK)(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}de.create=(e,t)=>new de({type:e,typeName:Ie.ZodPromise,...d(t)});class me extends m{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ie.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,r={addIssue:e=>{(0,o.zn)(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===a.type){const e=a.transform(n.data,r);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return o.uY;const a=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===a.status?o.uY:"dirty"===a.status||"dirty"===t.value?(0,o.jm)(a.value):a}));{if("aborted"===t.value)return o.uY;const a=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===a.status?o.uY:"dirty"===a.status||"dirty"===t.value?(0,o.jm)(a.value):a}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,r);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===a.status?o.uY:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?o.uY:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===a.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,o.fn)(e))return o.uY;const s=a.transform(e.value,r);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>(0,o.fn)(e)?Promise.resolve(a.transform(e.value,r)).then((e=>({status:t.value,value:e}))):o.uY))}l.ZS.assertNever(a)}}me.create=(e,t,n)=>new me({schema:e,typeName:Ie.ZodEffects,effect:t,...d(n)}),me.createWithPreprocess=(e,t,n)=>new me({schema:t,effect:{type:"preprocess",transform:e},typeName:Ie.ZodEffects,...d(n)});class he extends m{_parse(e){return this._getType(e)===l.Zp.undefined?(0,o.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}he.create=(e,t)=>new he({innerType:e,typeName:Ie.ZodOptional,...d(t)});class fe extends m{_parse(e){return this._getType(e)===l.Zp.null?(0,o.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fe.create=(e,t)=>new fe({innerType:e,typeName:Ie.ZodNullable,...d(t)});class ve extends m{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===l.Zp.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ve.create=(e,t)=>new ve({innerType:e,typeName:Ie.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...d(t)});class ge extends m{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return(0,o.xP)(a)?a.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new r.G(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new r.G(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ge.create=(e,t)=>new ge({innerType:e,typeName:Ie.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...d(t)});class ye extends m{_parse(e){if(this._getType(e)!==l.Zp.nan){const t=this._getOrReturnCtx(e);return(0,o.zn)(t,{code:r.eq.invalid_type,expected:l.Zp.nan,received:t.parsedType}),o.uY}return{status:"valid",value:e.data}}}ye.create=e=>new ye({typeName:Ie.ZodNaN,...d(e)});const $e=Symbol("zod_brand");class be extends m{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class _e extends m{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?o.uY:"dirty"===e.status?(t.dirty(),(0,o.jm)(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?o.uY:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new _e({in:e,out:t,typeName:Ie.ZodPipeline})}}class Ee extends m{_parse(e){const t=this._def.innerType._parse(e),n=e=>((0,o.fn)(e)&&(e.value=Object.freeze(e.value)),e);return(0,o.xP)(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function xe(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function Se(e,t={},n){return e?z.create().superRefine(((a,r)=>{const s=e(a);if(s instanceof Promise)return s.then((e=>{if(!e){const e=xe(t,a),s=e.fatal??n??!0;r.addIssue({code:"custom",...e,fatal:s})}}));if(!s){const e=xe(t,a),s=e.fatal??n??!0;r.addIssue({code:"custom",...e,fatal:s})}})):z.create()}Ee.create=(e,t)=>new Ee({innerType:e,typeName:Ie.ZodReadonly,...d(t)});const Ae={object:H.lazycreate};var Ie;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ie||(Ie={}));const we=(e,t={message:`Input not instance of ${e.name}`})=>Se((t=>t instanceof e),t),Te=L.create,Ne=M.create,Oe=ye.create,ke=D.create,Re=Y.create,Ce=F.create,Pe=q.create,Le=U.create,je=V.create,Me=z.create,De=Z.create,Ye=B.create,Fe=G.create,qe=W.create,Ue=H.create,Ve=H.strictCreate,ze=J.create,Ze=Q.create,Be=te.create,Ge=ne.create,We=ae.create,Ke=re.create,He=se.create,Je=ie.create,Xe=oe.create,Qe=le.create,et=ce.create,tt=pe.create,nt=de.create,at=me.create,rt=he.create,st=fe.create,it=me.createWithPreprocess,ot=_e.create,lt=()=>Te().optional(),ut=()=>Ne().optional(),ct=()=>Re().optional(),pt={string:e=>L.create({...e,coerce:!0}),number:e=>M.create({...e,coerce:!0}),boolean:e=>Y.create({...e,coerce:!0}),bigint:e=>D.create({...e,coerce:!0}),date:e=>F.create({...e,coerce:!0})},dt=o.uY},3794:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_VARIABLES=void 0,t.SYSTEM_VARIABLES=[{name:"$$NOW",value:"$$NOW",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current datetime value. NOW returns the same value for all members of the deployment and remains the same throughout all stages of the aggregation pipeline."},{name:"$$CLUSTER_TIME",value:"$$CLUSTER_TIME",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current timestamp value. CLUSTER_TIME is only available on replica sets and sharded clusters. CLUSTER_TIME returns the same value for all members of the deployment and remains the same throughout all stages of the pipeline."},{name:"$$ROOT",value:"$$ROOT",score:1,meta:"variable:system",version:"2.4.0",description:"References the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage."},{name:"$$CURRENT",value:"$$CURRENT",score:1,meta:"variable:system",version:"2.4.0",description:"References the start of the field path being processed in the aggregation pipeline stage. Unless documented otherwise, all stages start with CURRENT the same as ROOT. CURRENT is modifiable. However, since `$<field>` is equivalent to `$$CURRENT.<field>`, rebinding CURRENT changes the meaning of `$` accesses."},{name:"$$REMOVE",value:"$$REMOVE",score:1,meta:"variable:system",version:"3.6.0",description:"A variable which evaluates to the missing value. Allows for the conditional exclusion of fields. In a `$project`, a field set to the variable REMOVE is excluded from the output."},{name:"$$DESCEND",value:"$$DESCEND",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$PRUNE",value:"$$PRUNE",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$KEEP",value:"$$KEEP",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$SEARCH_META",value:"$$SEARCH_META",score:1,meta:"variable:system",version:"5.0.0",description:"A variable that stores the metadata results of an Atlas Search query. In all supported aggregation pipeline stages, a field set to the variable SEARCH_META returns the metadata results for the query. For an example of its usage, see Atlas Search facet and count."},{name:"$$USER_ROLES",value:"$$USER_ROLES",score:1,meta:"variable:system",version:"7.0.0",description:"A variable that stores the role names of the authenticated user running the command."}]},4113:(e,t,n)=>{const a=n(98855);e.exports=(e,t)=>{const n=a(e,null,!0),r=a(t,null,!0),s=n.compare(r);if(0===s)return null;const i=s>0,o=i?n:r,l=i?r:n,u=!!o.prerelease.length;if(l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(o))return l.minor&&!l.patch?"minor":"patch"}const c=u?"pre":"";return n.major!==r.major?c+"major":n.minor!==r.minor?c+"minor":n.patch!==r.patch?c+"patch":"prerelease"}},4292:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},4414:e=>{function t(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=t},4496:(e,t,n)=>{const a=n(50066);e.exports=(e,t)=>new a(e,t).minor},4827:(e,t,n)=>{const a=n(87866);e.exports=(e,t,n)=>a(e,t,"<",n)},5081:(e,t,n)=>{const a=n(66283),r=n(38366);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},5286:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const a=t.test(e),r=t.test(n);return a&&r&&(e=+e,n=+n),e===n?0:a&&!r?-1:r&&!a?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},5544:(e,t,n)=>{const a=n(26620),r=n(32056),s=n(51269),i=n(54838),o=n(18082),l=n(71851);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a(e,n,u);case"!=":return r(e,n,u);case">":return s(e,n,u);case">=":return i(e,n,u);case"<":return o(e,n,u);case"<=":return l(e,n,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},5698:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPE_ALIASES=void 0,t.BSON_TYPE_ALIASES=[{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"string",value:"string",label:"string",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"object",value:"object",label:"object",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"array",value:"array",label:"array",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"binData",value:"binData",label:"binData",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"objectId",value:"objectId",label:"objectId",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"bool",value:"bool",label:"bool",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"date",value:"date",label:"date",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"null",value:"null",label:"null",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"regex",value:"regex",label:"regex",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascript",value:"javascript",label:"javascript",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascriptWithScope",value:"javascriptWithScope",label:"javascriptWithScope",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"int",value:"int",label:"int",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"timestamp",value:"timestamp",label:"timestamp",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"long",value:"long",label:"long",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"decimal",value:"decimal",label:"decimal",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"minKey",value:"minKey",label:"minKey",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"maxKey",value:"maxKey",label:"maxKey",score:1,meta:"bson-type-aliases",version:"3.6.0"}]},5992:(e,t,n)=>{const a=n(99385);e.exports=(e,t,n)=>a(e,t,"<",n)},6340:(e,t,n)=>{var a=n(54420);e.exports=new a({include:[n(15037)]})},7263:(e,t,n)=>{n.d(t,{AC:()=>C,Ak:()=>l,Gl:()=>r,K3:()=>$,OI:()=>_,Os:()=>c,Rp:()=>d,Yj:()=>T,Z0:()=>s,Zg:()=>h,Zv:()=>P,ai:()=>O,ch:()=>R,fO:()=>o,gF:()=>a,hQ:()=>E,kB:()=>I,kM:()=>i,l7:()=>y,nd:()=>N,p0:()=>u,p6:()=>S,r0:()=>b,uR:()=>p,uX:()=>f,ug:()=>v,w$:()=>w,zM:()=>k,zr:()=>g});const a=/^[cC][^\s-]{8,}$/,r=/^[0-9a-z]+$/,s=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,i=/^[0-9a-vA-V]{20}$/,o=/^[A-Za-z0-9]{27}$/,l=/^[a-zA-Z0-9_-]{21}$/,u=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,c=/^([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})$/,p=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,d=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,m="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function h(){return new RegExp(m,"u")}const f=/^(?:(?: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])$/,v=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,g=/^((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])$/,y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,b=/^[A-Za-z0-9_-]*$/,_=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,E=/^\+(?:[0-9]){6,14}[0-9]$/,x="(?:(?:\\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])))",S=new RegExp(`^${x}$`);function A(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function I(e){return new RegExp(`^${A(e)}$`)}function w(e){const t=A({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${x}T(?:${a})$`)}const T=e=>new RegExp(`^${e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*"}$`),N=/^\d+$/,O=/^-?\d+(?:\.\d+)?/i,k=/true|false/i,R=/null/i,C=/^[^A-Z]*$/,P=/^[^a-z]*$/},7774:(e,t,n)=>{n.d(t,{e1:()=>Ve,mD:()=>qt,m2:()=>Ye,Z9:()=>cn,ej:()=>dn,n_:()=>pn,HD:()=>on,Ds:()=>rn,hK:()=>Ze,sl:()=>an,cV:()=>sn,wA:()=>tn,CR:()=>Fe,cb:()=>qe,o8:()=>hn,$C:()=>Be,u1:()=>Ge,$b:()=>nt,G1:()=>Je,zf:()=>We,R:()=>at,v0:()=>Wt,qs:()=>rt,ID:()=>Yt,WL:()=>st,x3:()=>it,HQ:()=>ot,qx:()=>Xe,_Z:()=>Kt,xI:()=>Ht,S:()=>Qt,GU:()=>Xt,hd:()=>nn,N8:()=>Gt,ZZ:()=>Bt,k5:()=>Zt,WZ:()=>Qe,ae:()=>mn,jN:()=>zt});var a=n(12240),r=n(39581),s=n(72510);class i{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??r.fd,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;const a=e._zod.def,r={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},i=this.seen.get(e);if(i)return i.count++,t.schemaPath.includes(e)&&(i.cycle=t.path),i.schema;const l={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,l);const u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{const n={...t,schemaPath:[...t.schemaPath,e],path:t.path},i=e._zod.parent;if(i)l.ref=i,this.process(i,n),this.seen.get(i).isParent=!0;else{const t=l.schema;switch(a.type){case"string":{const n=t;n.type="string";const{minimum:a,maximum:s,format:i,patterns:o,contentEncoding:u}=e._zod.bag;if("number"==typeof a&&(n.minLength=a),"number"==typeof s&&(n.maxLength=s),i&&(n.format=r[i]??i,""===n.format&&delete n.format),u&&(n.contentEncoding=u),o&&o.size>0){const e=[...o];1===e.length?n.pattern=e[0].source:e.length>1&&(l.schema.allOf=[...e.map((e=>({..."draft-7"===this.target?{type:"string"}:{},pattern:e.source})))])}break}case"number":{const n=t,{minimum:a,maximum:r,format:s,multipleOf:i,exclusiveMaximum:o,exclusiveMinimum:l}=e._zod.bag;"string"==typeof s&&s.includes("int")?n.type="integer":n.type="number","number"==typeof l&&(n.exclusiveMinimum=l),"number"==typeof a&&(n.minimum=a,"number"==typeof l&&(l>=a?delete n.minimum:delete n.exclusiveMinimum)),"number"==typeof o&&(n.exclusiveMaximum=o),"number"==typeof r&&(n.maximum=r,"number"==typeof o&&(o<=r?delete n.maximum:delete n.exclusiveMaximum)),"number"==typeof i&&(n.multipleOf=i);break}case"boolean":case"success":t.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema");break;case"null":t.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw new Error("Void cannot be represented in JSON Schema");break;case"never":t.not={};break;case"date":if("throw"===this.unrepresentable)throw new Error("Date cannot be represented in JSON Schema");break;case"array":{const r=t,{minimum:s,maximum:i}=e._zod.bag;"number"==typeof s&&(r.minItems=s),"number"==typeof i&&(r.maxItems=i),r.type="array",r.items=this.process(a.element,{...n,path:[...n.path,"items"]});break}case"object":{const e=t;e.type="object",e.properties={};const r=a.shape;for(const t in r)e.properties[t]=this.process(r[t],{...n,path:[...n.path,"properties",t]});const s=new Set(Object.keys(r)),i=new Set([...s].filter((e=>{const t=a.shape[e]._zod;return"input"===this.io?void 0===t.optin:void 0===t.optout})));i.size>0&&(e.required=Array.from(i)),"never"===a.catchall?._zod.def.type?e.additionalProperties=!1:a.catchall?a.catchall&&(e.additionalProperties=this.process(a.catchall,{...n,path:[...n.path,"additionalProperties"]})):"output"===this.io&&(e.additionalProperties=!1);break}case"union":t.anyOf=a.options.map(((e,t)=>this.process(e,{...n,path:[...n.path,"anyOf",t]})));break;case"intersection":{const e=t,r=this.process(a.left,{...n,path:[...n.path,"allOf",0]}),s=this.process(a.right,{...n,path:[...n.path,"allOf",1]}),i=e=>"allOf"in e&&1===Object.keys(e).length,o=[...i(r)?r.allOf:[r],...i(s)?s.allOf:[s]];e.allOf=o;break}case"tuple":{const r=t;r.type="array";const s=a.items.map(((e,t)=>this.process(e,{...n,path:[...n.path,"prefixItems",t]})));if("draft-2020-12"===this.target?r.prefixItems=s:r.items=s,a.rest){const e=this.process(a.rest,{...n,path:[...n.path,"items"]});"draft-2020-12"===this.target?r.items=e:r.additionalItems=e}a.rest&&(r.items=this.process(a.rest,{...n,path:[...n.path,"items"]}));const{minimum:i,maximum:o}=e._zod.bag;"number"==typeof i&&(r.minItems=i),"number"==typeof o&&(r.maxItems=o);break}case"record":{const e=t;e.type="object",e.propertyNames=this.process(a.keyType,{...n,path:[...n.path,"propertyNames"]}),e.additionalProperties=this.process(a.valueType,{...n,path:[...n.path,"additionalProperties"]});break}case"map":if("throw"===this.unrepresentable)throw new Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw new Error("Set cannot be represented in JSON Schema");break;case"enum":{const e=t,n=(0,s.w5)(a.entries);n.every((e=>"number"==typeof e))&&(e.type="number"),n.every((e=>"string"==typeof e))&&(e.type="string"),e.enum=n;break}case"literal":{const e=t,n=[];for(const e of a.values)if(void 0===e){if("throw"===this.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===this.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");n.push(Number(e))}else n.push(e);if(0===n.length);else if(1===n.length){const t=n[0];e.type=null===t?"null":typeof t,e.const=t}else n.every((e=>"number"==typeof e))&&(e.type="number"),n.every((e=>"string"==typeof e))&&(e.type="string"),n.every((e=>"boolean"==typeof e))&&(e.type="string"),n.every((e=>null===e))&&(e.type="null"),e.enum=n;break}case"file":{const n=t,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:r,maximum:s,mime:i}=e._zod.bag;void 0!==r&&(a.minLength=r),void 0!==s&&(a.maxLength=s),i?1===i.length?(a.contentMediaType=i[0],Object.assign(n,a)):n.anyOf=i.map((e=>({...a,contentMediaType:e}))):Object.assign(n,a);break}case"transform":if("throw"===this.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema");break;case"nullable":{const e=this.process(a.innerType,n);t.anyOf=[e,{type:"null"}];break}case"nonoptional":case"promise":case"optional":this.process(a.innerType,n),l.ref=a.innerType;break;case"default":this.process(a.innerType,n),l.ref=a.innerType,t.default=JSON.parse(JSON.stringify(a.defaultValue));break;case"prefault":this.process(a.innerType,n),l.ref=a.innerType,"input"===this.io&&(t._prefault=JSON.parse(JSON.stringify(a.defaultValue)));break;case"catch":{let e;this.process(a.innerType,n),l.ref=a.innerType;try{e=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=e;break}case"nan":if("throw"===this.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema");break;case"template_literal":{const n=t,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=a.source;break}case"pipe":{const e="input"===this.io?"transform"===a.in._zod.def.type?a.out:a.in:a.out;this.process(e,n),l.ref=e;break}case"readonly":this.process(a.innerType,n),l.ref=a.innerType,t.readOnly=!0;break;case"lazy":{const t=e._zod.innerType;this.process(t,n),l.ref=t;break}case"custom":if("throw"===this.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")}}}const c=this.metadataRegistry.get(e);return c&&Object.assign(l.schema,c),"input"===this.io&&o(e)&&(delete l.schema.examples,delete l.schema.default),"input"===this.io&&l.schema._prefault&&((n=l.schema).default??(n.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,t){const n={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},a=this.seen.get(e);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=e=>{const t="draft-2020-12"===this.target?"$defs":"definitions";if(n.external){const a=n.external.registry.get(e[0])?.id,r=n.external.uri??(e=>e);if(a)return{ref:r(a)};const s=e[1].defId??e[1].schema.id??"schema"+this.counter++;return e[1].defId=s,{defId:s,ref:`${r("__shared")}#/${t}/${s}`}}if(e[1]===a)return{ref:"#"};const r=`#/${t}/`,s=e[1].schema.id??"__schema"+this.counter++;return{defId:s,ref:r+s}},s=e=>{if(e[1].schema.$ref)return;const t=e[1],{ref:n,defId:a}=r(e);t.def={...t.schema},a&&(t.defId=a);const s=t.schema;for(const e in s)delete s[e];s.$ref=n};if("throw"===n.cycles)for(const e of this.seen.entries()){const t=e[1];if(t.cycle)throw new Error(`Cycle detected: #/${t.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const t of this.seen.entries()){const a=t[1];if(e===t[0]){s(t);continue}if(n.external){const a=n.external.registry.get(t[0])?.id;if(e!==t[0]&&a){s(t);continue}}const r=this.metadataRegistry.get(t[0])?.id;(r||a.cycle||a.count>1&&"ref"===n.reused)&&s(t)}const i=(e,t)=>{const n=this.seen.get(e),a=n.def??n.schema,r={...a};if(null===n.ref)return;const s=n.ref;if(n.ref=null,s){i(s,t);const e=this.seen.get(s).schema;e.$ref&&"draft-7"===t.target?(a.allOf=a.allOf??[],a.allOf.push(e)):(Object.assign(a,e),Object.assign(a,r))}n.isParent||this.override({zodSchema:e,jsonSchema:a,path:n.path??[]})};for(const e of[...this.seen.entries()].reverse())i(e[0],{target:this.target});const o={};if("draft-2020-12"===this.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?o.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){const t=n.external.registry.get(e)?.id;if(!t)throw new Error("Schema is missing an `id` property");o.$id=n.external.uri(t)}Object.assign(o,a.def);const l=n.external?.defs??{};for(const e of this.seen.entries()){const t=e[1];t.def&&t.defId&&(l[t.defId]=t.def)}n.external||Object.keys(l).length>0&&("draft-2020-12"===this.target?o.$defs=l:o.definitions=l);try{return JSON.parse(JSON.stringify(o))}catch(e){throw new Error("Error converting schema to JSON.")}}}function o(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;switch(a.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":case"custom":case"success":case"catch":return!1;case"array":return o(a.element,n);case"object":for(const e in a.shape)if(o(a.shape[e],n))return!0;return!1;case"union":for(const e of a.options)if(o(e,n))return!0;return!1;case"intersection":return o(a.left,n)||o(a.right,n);case"tuple":for(const e of a.items)if(o(e,n))return!0;return!(!a.rest||!o(a.rest,n));case"record":case"map":return o(a.keyType,n)||o(a.valueType,n);case"set":return o(a.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return o(a.innerType,n);case"lazy":return o(a.getter(),n);case"transform":return!0;case"pipe":return o(a.in,n)||o(a.out,n)}throw new Error(`Unknown schema type: ${a.type}`)}var l,u,c=n(2420);!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),a={};for(const e of n)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(l||(l={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(u||(u={}));const p=l.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),d=e=>{switch(typeof e){case"undefined":return p.undefined;case"string":return p.string;case"number":return Number.isNaN(e)?p.nan:p.number;case"boolean":return p.boolean;case"function":return p.function;case"bigint":return p.bigint;case"symbol":return p.symbol;case"object":return Array.isArray(e)?p.array:null===e?p.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?p.promise:"undefined"!=typeof Map&&e instanceof Map?p.map:"undefined"!=typeof Set&&e instanceof Set?p.set:"undefined"!=typeof Date&&e instanceof Date?p.date:p.object;default:return p.unknown}},m=l.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class h extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},a=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(a);else if("invalid_return_type"===r.code)a(r.returnTypeError);else if("invalid_arguments"===r.code)a(r.argumentsError);else if(0===r.path.length)n._errors.push(t(r));else{let e=n,a=0;for(;a<r.path.length;){const n=r.path[a];a===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],a++}}};return a(this),n}static assert(e){if(!(e instanceof h))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,l.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}h.create=e=>new h(e);const f=(e,t)=>{let n;switch(e.code){case m.invalid_type:n=e.received===p.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case m.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,l.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:n=`Unrecognized key(s) in object: ${l.joinValues(e.keys,", ")}`;break;case m.invalid_union:n="Invalid input";break;case m.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${l.joinValues(e.options)}`;break;case m.invalid_enum_value:n=`Invalid enum value. Expected ${l.joinValues(e.options)}, received '${e.received}'`;break;case m.invalid_arguments:n="Invalid function arguments";break;case m.invalid_return_type:n="Invalid function return type";break;case m.invalid_date:n="Invalid date";break;case m.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:l.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case m.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case m.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case m.custom:n="Invalid input";break;case m.invalid_intersection_types:n="Intersection results could not be merged";break;case m.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case m.not_finite:n="Number must be finite";break;default:n=t.defaultError,l.assertNever(e)}return{message:n}};let v=f;var g;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(g||(g={}));function y(e,t){const n=v,a=(e=>{const{data:t,path:n,errorMaps:a,issueData:r}=e,s=[...n,...r.path||[]],i={...r,path:s};if(void 0!==r.message)return{...r,path:s,message:r.message};let o="";const l=a.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(i,{data:t,defaultError:o}).message;return{...r,path:s,message:o}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===f?void 0:f].filter((e=>!!e))});e.common.issues.push(a)}class ${constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if("aborted"===a.status)return b;"dirty"===a.status&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,a=await e.value;n.push({key:t,value:a})}return $.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:t,value:r}=a;if("aborted"===t.status)return b;if("aborted"===r.status)return b;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!a.alwaysSet||(n[t.value]=r.value)}return{status:e.value,value:n}}}const b=Object.freeze({status:"aborted"}),_=e=>({status:"dirty",value:e}),E=e=>({status:"valid",value:e}),x=e=>"aborted"===e.status,S=e=>"dirty"===e.status,A=e=>"valid"===e.status,I=e=>"undefined"!=typeof Promise&&e instanceof Promise;var w=n(9606).URL;class T{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const N=(e,t)=>{if(A(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new h(e.common.issues);return this._error=t,this._error}}};function O(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:a,description:r}=e;if(t&&(n||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:r}:{errorMap:(t,r)=>{const{message:s}=e;return"invalid_enum_value"===t.code?{message:s??r.defaultError}:void 0===r.data?{message:s??a??r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:s??n??r.defaultError}},description:r}}class k{get description(){return this._def.description}_getType(e){return d(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:d(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new $,ctx:{common:e.parent.common,data:e.data,parsedType:d(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(I(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d(e)},a=this._parseSync({data:e,path:n.path,parent:n});return N(n,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return A(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>A(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d(e)},a=this._parse({data:e,path:n.path,parent:n}),r=await(I(a)?a:Promise.resolve(a));return N(n,r)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,a)=>{const r=e(t),s=()=>a.addIssue({code:m.custom,...n(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then((e=>!!e||(s(),!1))):!!r||(s(),!1)}))}refinement(e,t){return this._refinement(((n,a)=>!!e(n)||(a.addIssue("function"==typeof t?t(n,a):t),!1)))}_refinement(e){return new we({schema:this,typeName:je.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Te.create(this,this._def)}nullable(){return Ne.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return de.create(this)}promise(){return Ie.create(this,this._def)}or(e){return fe.create([this,e],this._def)}and(e){return ge.create(this,e,this._def)}transform(e){return new we({...O(this._def),schema:this,typeName:je.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Oe({...O(this._def),innerType:this,defaultValue:t,typeName:je.ZodDefault})}brand(){return new Ce({typeName:je.ZodBranded,type:this,...O(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ke({...O(this._def),innerType:this,catchValue:t,typeName:je.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Pe.create(this,e)}readonly(){return Le.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const R=/^c[^\s-]{8,}$/i,C=/^[0-9a-z]+$/,P=/^[0-9A-HJKMNP-TV-Z]{26}$/i,L=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,j=/^[a-z0-9_-]{21}$/i,M=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,D=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Y=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let F;const q=/^(?:(?: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])$/,U=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,V=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,z=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Z=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,B=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,G="((\\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])))",W=new RegExp(`^${G}$`);function K(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function H(e){let t=`${G}T${K(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function J(e,t){if(!M.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(a));return!("object"!=typeof r||null===r||"typ"in r&&"JWT"!==r?.typ||!r.alg||t&&r.alg!==t)}catch{return!1}}function X(e,t){return!("v4"!==t&&t||!U.test(e))||!("v6"!==t&&t||!z.test(e))}class Q extends k{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==p.string){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:p.string,received:t.parsedType}),b}const t=new $;let n;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:m.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("max"===s.kind)e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:m.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("length"===s.kind){const a=e.data.length>s.value,r=e.data.length<s.value;(a||r)&&(n=this._getOrReturnCtx(e,n),a?y(n,{code:m.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):r&&y(n,{code:m.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if("email"===s.kind)Y.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"email",code:m.invalid_string,message:s.message}),t.dirty());else if("emoji"===s.kind)F||(F=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),F.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"emoji",code:m.invalid_string,message:s.message}),t.dirty());else if("uuid"===s.kind)L.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"uuid",code:m.invalid_string,message:s.message}),t.dirty());else if("nanoid"===s.kind)j.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"nanoid",code:m.invalid_string,message:s.message}),t.dirty());else if("cuid"===s.kind)R.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"cuid",code:m.invalid_string,message:s.message}),t.dirty());else if("cuid2"===s.kind)C.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"cuid2",code:m.invalid_string,message:s.message}),t.dirty());else if("ulid"===s.kind)P.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"ulid",code:m.invalid_string,message:s.message}),t.dirty());else if("url"===s.kind)try{new w(e.data)}catch{n=this._getOrReturnCtx(e,n),y(n,{validation:"url",code:m.invalid_string,message:s.message}),t.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"regex",code:m.invalid_string,message:s.message}),t.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):"datetime"===s.kind?H(s).test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:"datetime",message:s.message}),t.dirty()):"date"===s.kind?W.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:"date",message:s.message}),t.dirty()):"time"===s.kind?new RegExp(`^${K(s)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:m.invalid_string,validation:"time",message:s.message}),t.dirty()):"duration"===s.kind?D.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"duration",code:m.invalid_string,message:s.message}),t.dirty()):"ip"===s.kind?(a=e.data,("v4"!==(r=s.version)&&r||!q.test(a))&&("v6"!==r&&r||!V.test(a))&&(n=this._getOrReturnCtx(e,n),y(n,{validation:"ip",code:m.invalid_string,message:s.message}),t.dirty())):"jwt"===s.kind?J(e.data,s.alg)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"jwt",code:m.invalid_string,message:s.message}),t.dirty()):"cidr"===s.kind?X(e.data,s.version)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"cidr",code:m.invalid_string,message:s.message}),t.dirty()):"base64"===s.kind?Z.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"base64",code:m.invalid_string,message:s.message}),t.dirty()):"base64url"===s.kind?B.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"base64url",code:m.invalid_string,message:s.message}),t.dirty()):l.assertNever(s);var a,r;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:m.invalid_string,...g.errToObj(n)})}_addCheck(e){return new Q({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...g.errToObj(e)})}url(e){return this._addCheck({kind:"url",...g.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...g.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...g.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...g.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...g.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...g.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...g.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...g.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...g.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...g.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...g.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...g.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...g.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...g.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...g.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...g.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...g.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...g.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...g.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...g.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...g.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...g.errToObj(t)})}nonempty(e){return this.min(1,g.errToObj(e))}trim(){return new Q({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function ee(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,r=n>a?n:a;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}Q.create=e=>new Q({checks:[],typeName:je.ZodString,coerce:e?.coerce??!1,...O(e)});class te extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==p.number){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:p.number,received:t.parsedType}),b}let t;const n=new $;for(const a of this._def.checks)"int"===a.kind?l.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:m.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):"multipleOf"===a.kind?0!==ee(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:m.not_finite,message:a.message}),n.dirty()):l.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,g.toString(t))}gt(e,t){return this.setLimit("min",e,!1,g.toString(t))}lte(e,t){return this.setLimit("max",e,!0,g.toString(t))}lt(e,t){return this.setLimit("max",e,!1,g.toString(t))}setLimit(e,t,n,a){return new te({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:g.toString(a)}]})}_addCheck(e){return new te({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:g.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:g.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:g.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:g.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&l.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}te.create=e=>new te({checks:[],typeName:je.ZodNumber,coerce:e?.coerce||!1,...O(e)});class ne extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==p.bigint)return this._getInvalidInput(e);let t;const n=new $;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),y(t,{code:m.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):l.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:p.bigint,received:t.parsedType}),b}gte(e,t){return this.setLimit("min",e,!0,g.toString(t))}gt(e,t){return this.setLimit("min",e,!1,g.toString(t))}lte(e,t){return this.setLimit("max",e,!0,g.toString(t))}lt(e,t){return this.setLimit("max",e,!1,g.toString(t))}setLimit(e,t,n,a){return new ne({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:g.toString(a)}]})}_addCheck(e){return new ne({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:g.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ne.create=e=>new ne({checks:[],typeName:je.ZodBigInt,coerce:e?.coerce??!1,...O(e)});class ae extends k{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==p.boolean){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:p.boolean,received:t.parsedType}),b}return E(e.data)}}ae.create=e=>new ae({typeName:je.ZodBoolean,coerce:e?.coerce||!1,...O(e)});class re extends k{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==p.date){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:p.date,received:t.parsedType}),b}if(Number.isNaN(e.data.getTime()))return y(this._getOrReturnCtx(e),{code:m.invalid_date}),b;const t=new $;let n;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:m.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:m.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):l.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new re({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:g.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:g.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}re.create=e=>new re({checks:[],coerce:e?.coerce||!1,typeName:je.ZodDate,...O(e)});class se extends k{_parse(e){if(this._getType(e)!==p.symbol){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:p.symbol,received:t.parsedType}),b}return E(e.data)}}se.create=e=>new se({typeName:je.ZodSymbol,...O(e)});class ie extends k{_parse(e){if(this._getType(e)!==p.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:p.undefined,received:t.parsedType}),b}return E(e.data)}}ie.create=e=>new ie({typeName:je.ZodUndefined,...O(e)});class oe extends k{_parse(e){if(this._getType(e)!==p.null){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:p.null,received:t.parsedType}),b}return E(e.data)}}oe.create=e=>new oe({typeName:je.ZodNull,...O(e)});class le extends k{constructor(){super(...arguments),this._any=!0}_parse(e){return E(e.data)}}le.create=e=>new le({typeName:je.ZodAny,...O(e)});class ue extends k{constructor(){super(...arguments),this._unknown=!0}_parse(e){return E(e.data)}}ue.create=e=>new ue({typeName:je.ZodUnknown,...O(e)});class ce extends k{_parse(e){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:p.never,received:t.parsedType}),b}}ce.create=e=>new ce({typeName:je.ZodNever,...O(e)});class pe extends k{_parse(e){if(this._getType(e)!==p.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:p.void,received:t.parsedType}),b}return E(e.data)}}pe.create=e=>new pe({typeName:je.ZodVoid,...O(e)});class de extends k{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==p.array)return y(t,{code:m.invalid_type,expected:p.array,received:t.parsedType}),b;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,r=t.data.length<a.exactLength.value;(e||r)&&(y(t,{code:e?m.too_big:m.too_small,minimum:r?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(y(t,{code:m.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(y(t,{code:m.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>a.type._parseAsync(new T(t,e,t.path,n))))).then((e=>$.mergeArray(n,e)));const r=[...t.data].map(((e,n)=>a.type._parseSync(new T(t,e,t.path,n))));return $.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new de({...this._def,minLength:{value:e,message:g.toString(t)}})}max(e,t){return new de({...this._def,maxLength:{value:e,message:g.toString(t)}})}length(e,t){return new de({...this._def,exactLength:{value:e,message:g.toString(t)}})}nonempty(e){return this.min(1,e)}}function me(e){if(e instanceof he){const t={};for(const n in e.shape){const a=e.shape[n];t[n]=Te.create(me(a))}return new he({...e._def,shape:()=>t})}return e instanceof de?new de({...e._def,type:me(e.element)}):e instanceof Te?Te.create(me(e.unwrap())):e instanceof Ne?Ne.create(me(e.unwrap())):e instanceof ye?ye.create(e.items.map((e=>me(e)))):e}de.create=(e,t)=>new de({type:e,minLength:null,maxLength:null,exactLength:null,typeName:je.ZodArray,...O(t)});class he extends k{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=l.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==p.object){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:p.object,received:t.parsedType}),b}const{status:t,ctx:n}=this._processInputParams(e),{shape:a,keys:r}=this._getCached(),s=[];if(!(this._def.catchall instanceof ce&&"strip"===this._def.unknownKeys))for(const e in n.data)r.includes(e)||s.push(e);const i=[];for(const e of r){const t=a[e],r=n.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new T(n,r,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ce){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)i.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)s.length>0&&(y(n,{code:m.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const a=n.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new T(n,a,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of i){const n=await t.key,a=await t.value;e.push({key:n,value:a,alwaysSet:t.alwaysSet})}return e})).then((e=>$.mergeObjectSync(t,e))):$.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return g.errToObj,new he({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{const a=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:g.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new he({...this._def,unknownKeys:"strip"})}passthrough(){return new he({...this._def,unknownKeys:"passthrough"})}extend(e){return new he({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new he({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:je.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new he({...this._def,catchall:e})}pick(e){const t={};for(const n of l.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new he({...this._def,shape:()=>t})}omit(e){const t={};for(const n of l.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new he({...this._def,shape:()=>t})}deepPartial(){return me(this)}partial(e){const t={};for(const n of l.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new he({...this._def,shape:()=>t})}required(e){const t={};for(const n of l.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Te;)e=e._def.innerType;t[n]=e}return new he({...this._def,shape:()=>t})}keyof(){return xe(l.objectKeys(this.shape))}}he.create=(e,t)=>new he({shape:()=>e,unknownKeys:"strip",catchall:ce.create(),typeName:je.ZodObject,...O(t)}),he.strictCreate=(e,t)=>new he({shape:()=>e,unknownKeys:"strict",catchall:ce.create(),typeName:je.ZodObject,...O(t)}),he.lazycreate=(e,t)=>new he({shape:e,unknownKeys:"strip",catchall:ce.create(),typeName:je.ZodObject,...O(t)});class fe extends k{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new h(e.ctx.common.issues)));return y(t,{code:m.invalid_union,unionErrors:n}),b}));{let e;const a=[];for(const r of n){const n={...t,common:{...t.common,issues:[]},parent:null},s=r._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&a.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=a.map((e=>new h(e)));return y(t,{code:m.invalid_union,unionErrors:r}),b}}get options(){return this._def.options}}function ve(e,t){const n=d(e),a=d(t);if(e===t)return{valid:!0,data:e};if(n===p.object&&a===p.object){const n=l.objectKeys(t),a=l.objectKeys(e).filter((e=>-1!==n.indexOf(e))),r={...e,...t};for(const n of a){const a=ve(e[n],t[n]);if(!a.valid)return{valid:!1};r[n]=a.data}return{valid:!0,data:r}}if(n===p.array&&a===p.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let a=0;a<e.length;a++){const r=ve(e[a],t[a]);if(!r.valid)return{valid:!1};n.push(r.data)}return{valid:!0,data:n}}return n===p.date&&a===p.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}fe.create=(e,t)=>new fe({options:e,typeName:je.ZodUnion,...O(t)});class ge extends k{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(e,a)=>{if(x(e)||x(a))return b;const r=ve(e.value,a.value);return r.valid?((S(e)||S(a))&&t.dirty(),{status:t.value,value:r.data}):(y(n,{code:m.invalid_intersection_types}),b)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>a(e,t))):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ge.create=(e,t,n)=>new ge({left:e,right:t,typeName:je.ZodIntersection,...O(n)});class ye extends k{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==p.array)return y(n,{code:m.invalid_type,expected:p.array,received:n.parsedType}),b;if(n.data.length<this._def.items.length)return y(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map(((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new T(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(a).then((e=>$.mergeArray(t,e))):$.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new ye({...this._def,rest:e})}}ye.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ye({items:e,typeName:je.ZodTuple,rest:null,...O(t)})};class $e extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==p.map)return y(n,{code:m.invalid_type,expected:p.map,received:n.parsedType}),b;const a=this._def.keyType,r=this._def.valueType,s=[...n.data.entries()].map((([e,t],s)=>({key:a._parse(new T(n,e,n.path,[s,"key"])),value:r._parse(new T(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of s){const a=await n.key,r=await n.value;if("aborted"===a.status||"aborted"===r.status)return b;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of s){const a=n.key,r=n.value;if("aborted"===a.status||"aborted"===r.status)return b;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}}}}$e.create=(e,t,n)=>new $e({valueType:t,keyType:e,typeName:je.ZodMap,...O(n)});class be extends k{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==p.set)return y(n,{code:m.invalid_type,expected:p.set,received:n.parsedType}),b;const a=this._def;null!==a.minSize&&n.data.size<a.minSize.value&&(y(n,{code:m.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&n.data.size>a.maxSize.value&&(y(n,{code:m.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const r=this._def.valueType;function s(e){const n=new Set;for(const a of e){if("aborted"===a.status)return b;"dirty"===a.status&&t.dirty(),n.add(a.value)}return{status:t.value,value:n}}const i=[...n.data.values()].map(((e,t)=>r._parse(new T(n,e,n.path,t))));return n.common.async?Promise.all(i).then((e=>s(e))):s(i)}min(e,t){return new be({...this._def,minSize:{value:e,message:g.toString(t)}})}max(e,t){return new be({...this._def,maxSize:{value:e,message:g.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}be.create=(e,t)=>new be({valueType:e,minSize:null,maxSize:null,typeName:je.ZodSet,...O(t)});class _e extends k{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}_e.create=(e,t)=>new _e({getter:e,typeName:je.ZodLazy,...O(t)});class Ee extends k{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),b}return{status:"valid",value:e.data}}get value(){return this._def.value}}function xe(e,t){return new Se({values:e,typeName:je.ZodEnum,...O(t)})}Ee.create=(e,t)=>new Ee({value:e,typeName:je.ZodLiteral,...O(t)});class Se extends k{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{expected:l.joinValues(n),received:t.parsedType,code:m.invalid_type}),b}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{received:t.data,code:m.invalid_enum_value,options:n}),b}return E(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Se.create(e,{...this._def,...t})}exclude(e,t=this._def){return Se.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}Se.create=xe;class Ae extends k{_parse(e){const t=l.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==p.string&&n.parsedType!==p.number){const e=l.objectValues(t);return y(n,{expected:l.joinValues(e),received:n.parsedType,code:m.invalid_type}),b}if(this._cache||(this._cache=new Set(l.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=l.objectValues(t);return y(n,{received:n.data,code:m.invalid_enum_value,options:e}),b}return E(e.data)}get enum(){return this._def.values}}Ae.create=(e,t)=>new Ae({values:e,typeName:je.ZodNativeEnum,...O(t)});class Ie extends k{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==p.promise&&!1===t.common.async)return y(t,{code:m.invalid_type,expected:p.promise,received:t.parsedType}),b;const n=t.parsedType===p.promise?t.data:Promise.resolve(t.data);return E(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ie.create=(e,t)=>new Ie({type:e,typeName:je.ZodPromise,...O(t)});class we extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===je.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,r={addIssue:e=>{y(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===a.type){const e=a.transform(n.data,r);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return b;const a=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===a.status?b:"dirty"===a.status||"dirty"===t.value?_(a.value):a}));{if("aborted"===t.value)return b;const a=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===a.status?b:"dirty"===a.status||"dirty"===t.value?_(a.value):a}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,r);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===a.status?b:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?b:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===a.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!A(e))return b;const s=a.transform(e.value,r);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>A(e)?Promise.resolve(a.transform(e.value,r)).then((e=>({status:t.value,value:e}))):b))}l.assertNever(a)}}we.create=(e,t,n)=>new we({schema:e,typeName:je.ZodEffects,effect:t,...O(n)}),we.createWithPreprocess=(e,t,n)=>new we({schema:t,effect:{type:"preprocess",transform:e},typeName:je.ZodEffects,...O(n)});class Te extends k{_parse(e){return this._getType(e)===p.undefined?E(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Te.create=(e,t)=>new Te({innerType:e,typeName:je.ZodOptional,...O(t)});class Ne extends k{_parse(e){return this._getType(e)===p.null?E(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ne.create=(e,t)=>new Ne({innerType:e,typeName:je.ZodNullable,...O(t)});class Oe extends k{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===p.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Oe.create=(e,t)=>new Oe({innerType:e,typeName:je.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...O(t)});class ke extends k{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return I(a)?a.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new h(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new h(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ke.create=(e,t)=>new ke({innerType:e,typeName:je.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...O(t)});class Re extends k{_parse(e){if(this._getType(e)!==p.nan){const t=this._getOrReturnCtx(e);return y(t,{code:m.invalid_type,expected:p.nan,received:t.parsedType}),b}return{status:"valid",value:e.data}}}Re.create=e=>new Re({typeName:je.ZodNaN,...O(e)}),Symbol("zod_brand");class Ce extends k{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Pe extends k{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?b:"dirty"===e.status?(t.dirty(),_(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?b:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Pe({in:e,out:t,typeName:je.ZodPipeline})}}class Le extends k{_parse(e){const t=this._def.innerType._parse(e),n=e=>(A(e)&&(e.value=Object.freeze(e.value)),e);return I(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}var je;Le.create=(e,t)=>new Le({innerType:e,typeName:je.ZodReadonly,...O(t)}),he.lazycreate,function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(je||(je={})),Q.create,te.create,Re.create,ne.create,ae.create,re.create,se.create,ie.create,oe.create,le.create,ue.create,ce.create,pe.create,de.create,he.create,he.strictCreate,fe.create,ge.create,ye.create,$e.create,be.create,_e.create,Ee.create,Se.create,Ae.create,Ie.create,we.create,Te.create,Ne.create,we.createWithPreprocess,Pe.create;var Me=n(29744),De=n(65994).e;function Ye(...e){return e.reduce(((e,t)=>({...e,...null!=t?t:{}})),{})}function Fe({tools:e=[],providerToolNames:t}){const n={},a={};for(const r of e)if("provider"===r.type&&r.id in t){const e=t[r.id];n[r.name]=e,a[e]=r.name}return{toProviderToolName:e=>{var t;return null!=(t=n[e])?t:e},toCustomToolName:e=>{var t;return null!=(t=a[e])?t:e}}}async function qe(e,t){if(null==e)return Promise.resolve();const n=null==t?void 0:t.abortSignal;return new Promise(((t,a)=>{if(null==n?void 0:n.aborted)return void a(Ue());const r=setTimeout((()=>{s(),t()}),e),s=()=>{clearTimeout(r),null==n||n.removeEventListener("abort",i)},i=()=>{s(),a(Ue())};null==n||n.addEventListener("abort",i)}))}function Ue(){return new DOMException("Delay was aborted","AbortError")}var Ve=class{constructor(){this.status={type:"pending"},this._resolve=void 0,this._reject=void 0}get promise(){return this._promise||(this._promise=new Promise(((e,t)=>{"resolved"===this.status.type?e(this.status.value):"rejected"===this.status.type&&t(this.status.error),this._resolve=e,this._reject=t}))),this._promise}resolve(e){var t;this.status={type:"resolved",value:e},this._promise&&(null==(t=this._resolve)||t.call(this,e))}reject(e){var t;this.status={type:"rejected",error:e},this._promise&&(null==(t=this._reject)||t.call(this,e))}isResolved(){return"resolved"===this.status.type}isRejected(){return"rejected"===this.status.type}isPending(){return"pending"===this.status.type}};function ze(e){return Object.fromEntries([...e.headers])}var Ze=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const e=n.length,a=new Array(t);for(let r=0;r<t;r++)a[r]=n[Math.random()*e|0];return a.join("")};if(null==e)return s;if(n.includes(r))throw new a.Di({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${s()}`},Be=Ze();function Ge(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}function We(e){return(e instanceof Error||e instanceof DOMException)&&("AbortError"===e.name||"ResponseAborted"===e.name||"TimeoutError"===e.name)}var Ke=["fetch failed","failed to fetch"];function He({error:e,url:t,requestBodyValues:n}){if(We(e))return e;if(e instanceof TypeError&&Ke.includes(e.message.toLowerCase())){const r=e.cause;if(null!=r)return new a.hL({message:`Cannot connect to API: ${r.message}`,cause:r,url:t,requestBodyValues:n,isRetryable:!0})}return e}function Je(e=globalThis){var t,n,a;return e.window?"runtime/browser":(null==(t=e.navigator)?void 0:t.userAgent)?`runtime/${e.navigator.userAgent.toLowerCase()}`:(null==(a=null==(n=e.process)?void 0:n.versions)?void 0:a.node)?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Xe(e){if(null==e)return{};const t={};if(e instanceof Headers)e.forEach(((e,n)=>{t[n.toLowerCase()]=e}));else{Array.isArray(e)||(e=Object.entries(e));for(const[n,a]of e)null!=a&&(t[n.toLowerCase()]=a)}return t}function Qe(e,...t){const n=new Headers(Xe(e)),a=n.get("user-agent")||"";return n.set("user-agent",[a,...t].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var et="4.0.0-beta.47",tt=()=>globalThis.fetch,nt=async({url:e,headers:t={},successfulResponseHandler:n,failedResponseHandler:r,abortSignal:s,fetch:i=tt()})=>{try{const o=await i(e,{method:"GET",headers:Qe(t,`ai-sdk/provider-utils/${et}`,Je()),signal:s}),l=ze(o);if(!o.ok){let t;try{t=await r({response:o,url:e,requestBodyValues:{}})}catch(t){if(We(t)||a.hL.isInstance(t))throw t;throw new a.hL({message:"Failed to process error response",cause:t,statusCode:o.status,url:e,responseHeaders:l,requestBodyValues:{}})}throw t.value}try{return await n({response:o,url:e,requestBodyValues:{}})}catch(t){if(t instanceof Error&&(We(t)||a.hL.isInstance(t)))throw t;throw new a.hL({message:"Failed to process successful response",cause:t,statusCode:o.status,url:e,responseHeaders:l,requestBodyValues:{}})}}catch(t){throw He({error:t,url:e,requestBodyValues:{}})}};function at(e){return null!=e}function rt({mediaType:e,url:t,supportedUrls:n}){return t=t.toLowerCase(),e=e.toLowerCase(),Object.entries(n).map((([e,t])=>{const n=e.toLowerCase();return"*"===n||"*/*"===n?{mediaTypePrefix:"",regexes:t}:{mediaTypePrefix:n.replace(/\*/,""),regexes:t}})).filter((({mediaTypePrefix:t})=>e.startsWith(t))).flatMap((({regexes:e})=>e)).some((e=>e.test(t)))}function st({apiKey:e,environmentVariableName:t,apiKeyParameterName:n="apiKey",description:r}){if("string"==typeof e)return e;if(null!=e)throw new a.Kq({message:`${r} API key must be a string.`});if(void 0===De)throw new a.Kq({message:`${r} API key is missing. Pass it using the '${n}' parameter. Environment variables is not supported in this environment.`});if(null==(e=De.env[t]))throw new a.Kq({message:`${r} API key is missing. Pass it using the '${n}' parameter or the ${t} environment variable.`});if("string"!=typeof e)throw new a.Kq({message:`${r} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}function it({settingValue:e,environmentVariableName:t}){return"string"==typeof e||null==e&&void 0!==De&&null!=(e=De.env[t])&&"string"==typeof e?e:void 0}function ot(e){var t;const[n,a=""]=e.toLowerCase().split("/");return null!=(t={mpeg:"mp3","x-wav":"wav",opus:"ogg",mp4:"m4a","x-m4a":"m4a"}[a])?t:a}var lt=/"__proto__"\s*:/,ut=/"constructor"\s*:/;function ct(e){const t=JSON.parse(e);return null===t||"object"!=typeof t||!1===lt.test(e)&&!1===ut.test(e)?t:function(e){let t=[e];for(;t.length;){const e=t;t=[];for(const n of e){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const e in n){const a=n[e];a&&"object"==typeof a&&t.push(a)}}}return e}(t)}function pt(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return ct(e)}try{return ct(e)}finally{Error.stackTraceLimit=t}}function dt(e){if("object"===e.type){e.additionalProperties=!1;const t=e.properties;if(null!=t)for(const e in t)t[e]=dt(t[e])}return"array"===e.type&&null!=e.items&&(Array.isArray(e.items)?e.items=e.items.map((e=>dt(e))):e.items=dt(e.items)),e}var mt=e=>()=>e.toJsonSchema(),ht=e=>async()=>{try{const{JSONSchema:t}=await Promise.resolve().then((function(){var e=new Error("Cannot find module 'effect'");throw e.code="MODULE_NOT_FOUND",e}));return t.make(e)}catch(e){throw new Error("Failed to import module 'effect'")}},ft=e=>async()=>{try{const{toJsonSchema:t}=await Promise.resolve().then((function(){var e=new Error("Cannot find module '@valibot/to-json-schema'");throw e.code="MODULE_NOT_FOUND",e}));return t(e)}catch(e){throw new Error("Failed to import module '@valibot/to-json-schema'")}},vt=Symbol("Let zodToJsonSchema decide on which parser to use"),gt={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function yt(e,t){return Pt(e.type._def,t)}function $t(e,t,n){const a=null!=n?n:t.dateStrategy;if(Array.isArray(a))return{anyOf:a.map(((n,a)=>$t(e,t,n)))};switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return bt(e)}}var bt=e=>{const t={type:"integer",format:"unix-time"};for(const n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value}return t},_t=void 0,Et={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(void 0===_t&&(_t=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),_t),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function xt(e,t){const n={type:"string"};if(e.checks)for(const a of e.checks)switch(a.kind){case"min":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,a.value):a.value;break;case"max":n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,a.value):a.value;break;case"email":switch(t.emailStrategy){case"format:email":It(n,"email",a.message,t);break;case"format:idn-email":It(n,"idn-email",a.message,t);break;case"pattern:zod":wt(n,Et.email,a.message,t)}break;case"url":It(n,"uri",a.message,t);break;case"uuid":It(n,"uuid",a.message,t);break;case"regex":wt(n,a.regex,a.message,t);break;case"cuid":wt(n,Et.cuid,a.message,t);break;case"cuid2":wt(n,Et.cuid2,a.message,t);break;case"startsWith":wt(n,RegExp(`^${St(a.value,t)}`),a.message,t);break;case"endsWith":wt(n,RegExp(`${St(a.value,t)}$`),a.message,t);break;case"datetime":It(n,"date-time",a.message,t);break;case"date":It(n,"date",a.message,t);break;case"time":It(n,"time",a.message,t);break;case"duration":It(n,"duration",a.message,t);break;case"length":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,a.value):a.value,n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,a.value):a.value;break;case"includes":wt(n,RegExp(St(a.value,t)),a.message,t);break;case"ip":"v6"!==a.version&&It(n,"ipv4",a.message,t),"v4"!==a.version&&It(n,"ipv6",a.message,t);break;case"base64url":wt(n,Et.base64url,a.message,t);break;case"jwt":wt(n,Et.jwt,a.message,t);break;case"cidr":"v6"!==a.version&&wt(n,Et.ipv4Cidr,a.message,t),"v4"!==a.version&&wt(n,Et.ipv6Cidr,a.message,t);break;case"emoji":wt(n,Et.emoji(),a.message,t);break;case"ulid":wt(n,Et.ulid,a.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":It(n,"binary",a.message,t);break;case"contentEncoding:base64":n.contentEncoding="base64";break;case"pattern:zod":wt(n,Et.base64,a.message,t)}break;case"nanoid":wt(n,Et.nanoid,a.message,t)}return n}function St(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let n=0;n<e.length;n++)At.has(e[n])||(t+="\\"),t+=e[n];return t}(e):e}var At=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function It(e,t,n,a){var r;e.format||(null==(r=e.anyOf)?void 0:r.some((e=>e.format)))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&a.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function wt(e,t,n,a){var r;e.pattern||(null==(r=e.allOf)?void 0:r.some((e=>e.pattern)))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:Tt(t,a),...n&&a.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=Tt(t,a)}function Tt(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;const a=e.flags.includes("i"),r=e.flags.includes("m"),s=e.flags.includes("s"),i=a?e.source.toLowerCase():e.source;let o="",l=!1,u=!1,c=!1;for(let e=0;e<i.length;e++)if(l)o+=i[e],l=!1;else{if(a)if(u){if(i[e].match(/[a-z]/)){c?(o+=i[e],o+=`${i[e-2]}-${i[e]}`.toUpperCase(),c=!1):"-"===i[e+1]&&(null==(n=i[e+2])?void 0:n.match(/[a-z]/))?(o+=i[e],c=!0):o+=`${i[e]}${i[e].toUpperCase()}`;continue}}else if(i[e].match(/[a-z]/)){o+=`[${i[e]}${i[e].toUpperCase()}]`;continue}if(r){if("^"===i[e]){o+="(^|(?<=[\r\n]))";continue}if("$"===i[e]){o+="($|(?=[\r\n]))";continue}}s&&"."===i[e]?o+=u?`${i[e]}\r\n`:`[${i[e]}\r\n]`:(o+=i[e],"\\"===i[e]?l=!0:u&&"]"===i[e]?u=!1:u||"["!==i[e]||(u=!0))}try{new RegExp(o)}catch(n){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function Nt(e,t){var n,a,r,s,i,o;const l={type:"object",additionalProperties:null!=(n=Pt(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?n:t.allowedAdditionalProperties};if((null==(a=e.keyType)?void 0:a._def.typeName)===je.ZodString&&(null==(r=e.keyType._def.checks)?void 0:r.length)){const{type:n,...a}=xt(e.keyType._def,t);return{...l,propertyNames:a}}if((null==(s=e.keyType)?void 0:s._def.typeName)===je.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if((null==(i=e.keyType)?void 0:i._def.typeName)===je.ZodBranded&&e.keyType._def.type._def.typeName===je.ZodString&&(null==(o=e.keyType._def.type._def.checks)?void 0:o.length)){const{type:n,...a}=yt(e.keyType._def,t);return{...l,propertyNames:a}}return l}var Ot={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function kt(e){try{return e.isOptional()}catch(e){return!0}}var Rt=(e,t,n)=>{switch(t){case je.ZodString:return xt(e,n);case je.ZodNumber:return function(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case je.ZodObject:return function(e,t){const n={type:"object",properties:{}},a=[],r=e.shape();for(const e in r){let s=r[e];if(void 0===s||void 0===s._def)continue;const i=kt(s),o=Pt(s._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==o&&(n.properties[e]=o,i||a.push(e))}a.length&&(n.required=a);const s=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return Pt(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==s&&(n.additionalProperties=s),n}(e,n);case je.ZodBigInt:return function(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case je.ZodBoolean:return{type:"boolean"};case je.ZodDate:return $t(e,n);case je.ZodUndefined:return{not:{}};case je.ZodNull:return{type:"null"};case je.ZodArray:return function(e,t){var n,a,r;const s={type:"array"};return(null==(n=e.type)?void 0:n._def)&&(null==(r=null==(a=e.type)?void 0:a._def)?void 0:r.typeName)!==je.ZodAny&&(s.items=Pt(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(s.minItems=e.minLength.value),e.maxLength&&(s.maxItems=e.maxLength.value),e.exactLength&&(s.minItems=e.exactLength.value,s.maxItems=e.exactLength.value),s}(e,n);case je.ZodUnion:case je.ZodDiscriminatedUnion:return function(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every((e=>e._def.typeName in Ot&&(!e._def.checks||!e._def.checks.length)))){const e=n.reduce(((e,t)=>{const n=Ot[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e}),[]);return{type:e.length>1?e:e[0]}}if(n.every((e=>"ZodLiteral"===e._def.typeName&&!e.description))){const e=n.reduce(((e,t)=>{const n=typeof t._def.value;switch(n){case"string":case"number":case"boolean":return[...e,n];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}}),[]);if(e.length===n.length){const t=e.filter(((e,t,n)=>n.indexOf(e)===t));return{type:t.length>1?t:t[0],enum:n.reduce(((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value]),[])}}}else if(n.every((e=>"ZodEnum"===e._def.typeName)))return{type:"string",enum:n.reduce(((e,t)=>[...e,...t._def.values.filter((t=>!e.includes(t)))]),[])};return((e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map(((e,n)=>Pt(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]}))).filter((e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0)));return n.length?{anyOf:n}:void 0})(e,t)}(e,n);case je.ZodIntersection:return function(e,t){const n=[Pt(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Pt(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter((e=>!!e)),a=[];return n.forEach((e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:n,...a}=e;t=a}a.push(t)}else a.push(...e.allOf);var t})),a.length?{allOf:a}:void 0}(e,n);case je.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map(((e,n)=>Pt(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[]),additionalItems:Pt(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map(((e,n)=>Pt(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[])}}(e,n);case je.ZodRecord:return Nt(e,n);case je.ZodLiteral:return function(e){const t=typeof e.value;return"bigint"!==t&&"number"!==t&&"boolean"!==t&&"string"!==t?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===t?"integer":t,const:e.value}}(e);case je.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case je.ZodNativeEnum:return function(e){const t=e.values,n=Object.keys(e.values).filter((e=>"number"!=typeof t[t[e]])).map((e=>t[e])),a=Array.from(new Set(n.map((e=>typeof e))));return{type:1===a.length?"string"===a[0]?"string":"number":["string","number"],enum:n}}(e);case je.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Ot[e.innerType._def.typeName],"null"]};const n=Pt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}(e,n);case je.ZodOptional:return((e,t)=>{var n;if(t.currentPath.toString()===(null==(n=t.propertyPath)?void 0:n.toString()))return Pt(e.innerType._def,t);const a=Pt(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return a?{anyOf:[{not:{}},a]}:{}})(e,n);case je.ZodMap:return function(e,t){return"record"===t.mapStrategy?Nt(e,t):{type:"array",maxItems:125,items:{type:"array",items:[Pt(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},Pt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}}}(e,n);case je.ZodSet:return function(e,t){const n={type:"array",uniqueItems:!0,items:Pt(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}(e,n);case je.ZodLazy:return()=>e.getter()._def;case je.ZodPromise:return function(e,t){return Pt(e.type._def,t)}(e,n);case je.ZodNaN:case je.ZodNever:return{not:{}};case je.ZodEffects:return function(e,t){return"input"===t.effectStrategy?Pt(e.schema._def,t):{}}(e,n);case je.ZodAny:case je.ZodUnknown:return{};case je.ZodDefault:return function(e,t){return{...Pt(e.innerType._def,t),default:e.defaultValue()}}(e,n);case je.ZodBranded:return yt(e,n);case je.ZodReadonly:case je.ZodCatch:return((e,t)=>Pt(e.innerType._def,t))(e,n);case je.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return Pt(e.in._def,t);if("output"===t.pipeStrategy)return Pt(e.out._def,t);const n=Pt(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[n,Pt(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]})].filter((e=>void 0!==e))}})(e,n);case je.ZodFunction:case je.ZodVoid:case je.ZodSymbol:default:return}},Ct=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function Pt(e,t,n=!1){var a;const r=t.seen.get(e);if(t.override){const s=null==(a=t.override)?void 0:a.call(t,e,t,r,n);if(s!==vt)return s}if(r&&!n){const e=Lt(r,t);if(void 0!==e)return e}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const i=Rt(e,e.typeName,t),o="function"==typeof i?Pt(i(),t):i;if(o&&jt(e,t,o),t.postProcess){const n=t.postProcess(o,e,t);return s.jsonSchema=o,n}return s.jsonSchema=o,o}var Lt=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Ct(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every(((e,n)=>t.currentPath[n]===e))?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):"seen"===t.$refStrategy?{}:void 0}},jt=(e,t,n)=>(e.description&&(n.description=e.description),n),Mt=(e,t)=>{var n;const a=(e=>{const t=(e=>"string"==typeof e?{...gt,name:e}:{...gt,...e})(e),n=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map((([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}])))}})(t);let r="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce(((e,[t,n])=>{var r;return{...e,[t]:null!=(r=Pt(n._def,{...a,currentPath:[...a.basePath,a.definitionPath,t]},!0))?r:{}}}),{}):void 0;const s="string"==typeof t?t:"title"===(null==t?void 0:t.nameStrategy)||null==t?void 0:t.name,i=null!=(n=Pt(e._def,void 0===s?a:{...a,currentPath:[...a.basePath,a.definitionPath,s]},!1))?n:{},o="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==o&&(i.title=o);const l=void 0===s?r?{...i,[a.definitionPath]:r}:i:{$ref:[..."relative"===a.$refStrategy?[]:a.basePath,a.definitionPath,s].join("/"),[a.definitionPath]:{...r,[s]:i}};return l.$schema="http://json-schema.org/draft-07/schema#",l},Dt=Symbol.for("vercel.ai.schema");function Yt(e){let t;return()=>(null==t&&(t=e()),t)}function Ft(e,{validate:t}={}){return{[Dt]:!0,_type:void 0,get jsonSchema(){return"function"==typeof e&&(e=e()),e},validate:t}}function qt(e){return null==e?Ft({properties:{},additionalProperties:!1}):"object"==typeof(t=e)&&null!==t&&Dt in t&&!0===t[Dt]&&"jsonSchema"in t&&"validate"in t?e:"~standard"in e?function(e){const t=e["~standard"].vendor;switch(t){case"zod":return zt(e);case"arktype":return Ut(e,mt);case"effect":return Ut(e,ht);case"valibot":return Ut(e,ft);default:return Ut(e,(()=>()=>{throw new Error(`Unsupported standard schema vendor: ${t}`)}))}}(e):e();var t}function Ut(e,t){return Ft(t(e),{validate:async t=>{const n=await e["~standard"].validate(t);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new a.iM({value:t,cause:n.issues})}}})}function Vt(e,t){var n;const a=null!=(n=null==t?void 0:t.useReferences)&&n;return Ft((()=>dt(function(e,t){if(e instanceof r.rs){const n=new i(t),a={};for(const t of e._idmap.entries()){const[e,a]=t;n.process(a)}const r={},s={registry:e,uri:t?.uri,defs:a};for(const a of e._idmap.entries()){const[e,i]=a;r[e]=n.emit(i,{...t,external:s})}if(Object.keys(a).length>0){const e="draft-2020-12"===n.target?"$defs":"definitions";r.__shared={[e]:a}}return{schemas:r}}const n=new i(t);return n.process(e),n.emit(e,t)}(e,{target:"draft-7",io:"input",reused:a?"ref":"inline"}))),{validate:async t=>{const n=await c.bp(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function zt(e,t){return function(e){return"_zod"in e}(e)?Vt(e,t):function(e,t){var n;const a=null!=(n=null==t?void 0:t.useReferences)&&n;return Ft((()=>Mt(e,{$refStrategy:a?"root":"none"})),{validate:async t=>{const n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}(e,t)}async function Zt({value:e,schema:t}){const n=await Bt({value:e,schema:t});if(!n.success)throw a.iM.wrap({value:e,cause:n.error});return n.value}async function Bt({value:e,schema:t}){const n=qt(t);try{if(null==n.validate)return{success:!0,value:e,rawValue:e};const t=await n.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:a.iM.wrap({value:e,cause:t.error}),rawValue:e}}catch(t){return{success:!1,error:a.iM.wrap({value:e,cause:t}),rawValue:e}}}async function Gt({text:e,schema:t}){try{const n=pt(e);return null==t?{success:!0,value:n,rawValue:n}:await Bt({value:n,schema:t})}catch(t){return{success:!1,error:a.u6.isInstance(t)?t:new a.u6({text:e,cause:t}),rawValue:void 0}}}function Wt(e){try{return pt(e),!0}catch(e){return!1}}function Kt({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Me.Z).pipeThrough(new TransformStream({async transform({data:e},n){"[DONE]"!==e&&n.enqueue(await Gt({text:e,schema:t}))}}))}async function Ht({provider:e,providerOptions:t,schema:n}){if(null==(null==t?void 0:t[e]))return;const r=await Bt({value:t[e],schema:n});if(!r.success)throw new a.Di({argument:"providerOptions",message:`invalid ${e} provider options`,cause:r.error});return r.value}var Jt=()=>globalThis.fetch,Xt=async({url:e,headers:t,body:n,failedResponseHandler:a,successfulResponseHandler:r,abortSignal:s,fetch:i})=>en({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(n),values:n},failedResponseHandler:a,successfulResponseHandler:r,abortSignal:s,fetch:i}),Qt=async({url:e,headers:t,formData:n,failedResponseHandler:a,successfulResponseHandler:r,abortSignal:s,fetch:i})=>en({url:e,headers:t,body:{content:n,values:Object.fromEntries(n.entries())},failedResponseHandler:a,successfulResponseHandler:r,abortSignal:s,fetch:i}),en=async({url:e,headers:t={},body:n,successfulResponseHandler:r,failedResponseHandler:s,abortSignal:i,fetch:o=Jt()})=>{try{const l=await o(e,{method:"POST",headers:Qe(t,`ai-sdk/provider-utils/${et}`,Je()),body:n.content,signal:i}),u=ze(l);if(!l.ok){let t;try{t=await s({response:l,url:e,requestBodyValues:n.values})}catch(t){if(We(t)||a.hL.isInstance(t))throw t;throw new a.hL({message:"Failed to process error response",cause:t,statusCode:l.status,url:e,responseHeaders:u,requestBodyValues:n.values})}throw t.value}try{return await r({response:l,url:e,requestBodyValues:n.values})}catch(t){if(t instanceof Error&&(We(t)||a.hL.isInstance(t)))throw t;throw new a.hL({message:"Failed to process successful response",cause:t,statusCode:l.status,url:e,responseHeaders:u,requestBodyValues:n.values})}}catch(t){throw He({error:t,url:e,requestBodyValues:n.values})}};function tn({id:e,inputSchema:t,outputSchema:n}){return({execute:a,needsApproval:r,toModelOutput:s,onInputStart:i,onInputDelta:o,onInputAvailable:l,...u})=>({type:"provider",id:e,args:u,inputSchema:t,outputSchema:n,execute:a,needsApproval:r,toModelOutput:s,onInputStart:i,onInputDelta:o,onInputAvailable:l})}async function nn(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}var an=({errorSchema:e,errorToMessage:t,isRetryable:n})=>async({response:r,url:s,requestBodyValues:i})=>{const o=await r.text(),l=ze(r);if(""===o.trim())return{responseHeaders:l,value:new a.hL({message:r.statusText,url:s,requestBodyValues:i,statusCode:r.status,responseHeaders:l,responseBody:o,isRetryable:null==n?void 0:n(r)})};try{const u=await async function({text:e,schema:t}){try{const n=pt(e);return null==t?n:Zt({value:n,schema:t})}catch(t){if(a.u6.isInstance(t)||a.iM.isInstance(t))throw t;throw new a.u6({text:e,cause:t})}}({text:o,schema:e});return{responseHeaders:l,value:new a.hL({message:t(u),url:s,requestBodyValues:i,statusCode:r.status,responseHeaders:l,responseBody:o,data:u,isRetryable:null==n?void 0:n(r,u)})}}catch(e){return{responseHeaders:l,value:new a.hL({message:r.statusText,url:s,requestBodyValues:i,statusCode:r.status,responseHeaders:l,responseBody:o,isRetryable:null==n?void 0:n(r)})}}},rn=e=>async({response:t})=>{const n=ze(t);if(null==t.body)throw new a.Tt({});return{responseHeaders:n,value:Kt({stream:t.body,schema:e})}},sn=e=>async({response:t,url:n,requestBodyValues:r})=>{const s=await t.text(),i=await Gt({text:s,schema:e}),o=ze(t);if(!i.success)throw new a.hL({message:"Invalid JSON response",cause:i.error,statusCode:t.status,responseHeaders:o,responseBody:s,url:n,requestBodyValues:r});return{responseHeaders:o,value:i.value,rawValue:i.rawValue}},on=()=>async({response:e,url:t,requestBodyValues:n})=>{const r=ze(e);if(!e.body)throw new a.hL({message:"Response body is empty",url:t,requestBodyValues:n,statusCode:e.status,responseHeaders:r,responseBody:void 0});try{const t=await e.arrayBuffer();return{responseHeaders:r,value:new Uint8Array(t)}}catch(s){throw new a.hL({message:"Failed to read response as array buffer",url:t,requestBodyValues:n,statusCode:e.status,responseHeaders:r,responseBody:void 0,cause:s})}},{btoa:ln,atob:un}=globalThis;function cn(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=un(t);return Uint8Array.from(n,(e=>e.codePointAt(0)))}function pn(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return ln(t)}function dn(e){return e instanceof Uint8Array?pn(e):e}function mn(e){return null==e?void 0:e.replace(/\/$/,"")}async function*hn({execute:e,input:t,options:n}){const a=e(t,n);if(null!=(r=a)&&"function"==typeof r[Symbol.asyncIterator]){let e;for await(const t of a)e=t,yield{type:"preliminary",output:t};yield{type:"final",output:e}}else yield{type:"final",output:await a};var r}},8117:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_CONSTANTS=void 0,t.createConstantFilter=f,t.wrapField=function(e,t=!1){return t||!function(e){if(/[.\s"'()[\];={}:]/.test(e))return!1;try{return new Function(`"use strict";let _ = { ${e}: 0 };`),!0}catch{return!1}}(e)?`"${e.replace(/["\\]/g,"\\$&")}"`:e},t.getFilteredCompletions=function(e={},n=t.ALL_CONSTANTS){const{serverVersion:a=m,fields:r=[],meta:s,stage:i}=e,o=f({serverVersion:a,meta:s,stage:i});return n.concat(r.flatMap((e=>{const{value:t,description:n}=function(e){return"string"==typeof e?{value:e}:{value:e.name,description:e.description}}(e);return[{value:t,meta:"field:identifier",version:"0.0.0",description:n},{value:`$${t}`,meta:"field:reference",version:"0.0.0",description:n}]}))).filter((e=>o(e)))};const a=n(51699),r=n(3012),s=n(91871),i=n(77973),o=n(80003),l=n(30797),u=n(17497),c=n(60679),p=n(99625),d=n(71174);t.ALL_CONSTANTS=[...r.ACCUMULATORS,...i.BSON_TYPES,...s.BSON_TYPE_ALIASES,...o.CONVERSION_OPERATORS,...l.EXPRESSION_OPERATORS,...u.JSON_SCHEMA,...c.QUERY_OPERATORS,...p.STAGE_OPERATORS,...d.SYSTEM_VARIABLES];const m="999.999.999";function h(e,t){return void 0===e||void 0===t||(e=Array.isArray(e)?e:[e]).some((e=>t.includes(e)))}function f({meta:e,serverVersion:t=m,stage:n={}}={}){const r=/^(?<version>\d+\.\d+\.\d+)/.exec(t)?.groups?.version??m;return({version:t,meta:s,env:i,namespaces:o,apiVersions:l})=>function(e,t){const n=/^\d+\.\d+\.\d+$/.test(t);return(0,a.satisfies)(e,n?`>=${t}`:t)}(r,t)&&h(n.env,i)&&h(n.namespace,o)&&h(n.apiVersion,l)&&(!e||function(e,t){const n=t.split(":");return e.some((e=>{const t=e.split(":");return t.length===n.length&&t.every(((e,t)=>"*"===e||e===n[t]))}))}(e,s))}},8573:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},8999:(e,t,n)=>{const a=n(48381),r=n(20332);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},9331:(e,t,n)=>{const a=n(50066);e.exports=(e,t,n)=>{const r=new a(e,n),s=new a(t,n);return r.compare(s)||r.compareBuild(s)}},9350:(e,t,n)=>{const a=n(52378),{MAX_LENGTH:r,MAX_SAFE_INTEGER:s}=n(28892),{safeRe:i,t:o}=n(68752),l=n(34773),{compareIdentifiers:u}=n(80661);class c{constructor(e,t){if(t=l(t),e instanceof c){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[o.LOOSE]:i[o.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(a("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof c||(e=new c(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(a("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(a("build compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===n&&(a=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},9357:(e,t,n)=>{const a=n(88825);e.exports=(e,t)=>new a(e,t).minor},9418:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>a(e,t,n)<=0},9480:(e,t,n)=>{const a=n(71333);e.exports=(e,t,n)=>{try{t=new a(t,n)}catch(e){return!1}return t.test(e)}},9703:(e,t,n)=>{const a=n(59441);e.exports=(e,t)=>{const n=a(e,null,!0),r=a(t,null,!0),s=n.compare(r);if(0===s)return null;const i=s>0,o=i?n:r,l=i?r:n,u=!!o.prerelease.length;if(l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(o))return l.minor&&!l.patch?"minor":"patch"}const c=u?"pre":"";return n.major!==r.major?c+"major":n.minor!==r.minor?c+"minor":n.patch!==r.patch?c+"patch":"prerelease"}},9895:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapField=t.getFilteredCompletions=void 0,r(n(62280),t),r(n(63547),t),r(n(85665),t),r(n(48543),t),r(n(97008),t),r(n(58313),t),r(n(13821),t),r(n(59588),t),r(n(46699),t),r(n(71925),t),r(n(3794),t),r(n(95831),t);var s=n(44601);Object.defineProperty(t,"getFilteredCompletions",{enumerable:!0,get:function(){return s.getFilteredCompletions}}),Object.defineProperty(t,"wrapField",{enumerable:!0,get:function(){return s.wrapField}}),r(n(10111),t),r(n(64757),t)},9982:(e,t,n)=>{const a=n(56206);e.exports=(e,t)=>e.sort(((e,n)=>a(e,n,t)))},10017:(e,t,n)=>{const a=n(34219);e.exports=(e,t)=>{const n=a(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},10036:function(e,t,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_PIPELINE_UTILS=void 0;const r=a(n(41738)),s="8.0.0",i="8.1.0";t.VIEW_PIPELINE_UTILS={MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_DE:s,MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_COMPASS:i,isPipelineSearchQueryable:e=>{for(const t of e){const e=Object.keys(t)[0];if("$addFields"!==e&&"$set"!==e&&"$match"!==e)return!1;if("$match"===e){const e=t.$match,n=Object.keys(e||{});if(1!==n.length||!n.includes("$expr"))return!1}}return!0},isVersionSearchCompatibleForViewsDataExplorer:e=>{try{return r.default.gte(e,s)}catch{return!1}},isVersionSearchCompatibleForViewsCompass:e=>{try{return r.default.gte(e,i)}catch{return!1}}}},10094:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QUERY_OPERATORS=void 0,t.QUERY_OPERATORS=[{name:"$all",value:"$all",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$and",value:"$and",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$bitsAllClear",value:"$bitsAllClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAllSet",value:"$bitsAllSet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnyClear",value:"$bitsAnyClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnySet",value:"$bitsAnySet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$comment",value:"$comment",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$elemMatch",value:"$elemMatch",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$eq",value:"$eq",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$exists",value:"$exists",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$expr",value:"$expr",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$geoIntersects",value:"$geoIntersects",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$geoWithin",value:"$geoWithin",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$gt",value:"$gt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$gte",value:"$gte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$in",value:"$in",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$jsonSchema",value:"$jsonSchema",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$lt",value:"$lt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$lte",value:"$lte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$mod",value:"$mod",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$ne",value:"$ne",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$near",value:"$near",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nearSphere",value:"$nearSphere",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nin",value:"$nin",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$not",value:"$not",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$nor",value:"$nor",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$or",value:"$or",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$regex",value:"$regex",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$size",value:"$size",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$slice",value:"$slice",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$text",value:"$text",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$type",value:"$type",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$where",value:"$where",score:1,meta:"query",version:"2.2.0",geospatial:!1}]},10111:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ATLAS_VECTOR_SEARCH_TEMPLATE=t.ATLAS_SEARCH_TEMPLATES=void 0,t.ATLAS_SEARCH_TEMPLATES=[{name:"Dynamic field mappings",snippet:'{\n "mappings": {\n "dynamic": true\n }\n}',version:"4.4.0"},{name:"Static field mappings",snippet:'{\n "mappings": {\n "dynamic": false,\n "fields": {\n ${1:<string field name>}: {\n "type": "string"\n },\n ${2:<number field name>}: {\n "type": "number"\n },\n ${3:<date field name>}: {\n "type": "date"\n },\n ${4:<geo field name>}: {\n "type": "geo"\n },\n } \n }\n}',version:"4.4.0"},{name:"Text field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<string field name>}: [\n {\n // Enables text queries\n "type": "string"\n },\n {\n // Enables autocomplete queries\n "type": "autocomplete"\n \n },\n {\n // Enables sorting\n "type": "token"\n }\n ] \n } \n }\n}',version:"4.4.0"},{name:"Facet field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<number field name for faceting>}: [\n {\n "type": "numberFacet"\n },\n {\n "type": "number"\n },\n ],\n ${2:<date field name for faceting>}: [\n {\n "type": "dateFacet"\n }\n {\n "type": "date"\n }\n ],\n ${3:<string field name for faceting>}: [\n {\n "type": "stringFacet"\n },\n {\n "type": "string",\n "analyzer": "lucene.keyword"\n },\n ],\n } \n }\n}',version:"4.4.0"},{name:"KNN Vector field mapping",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<vector embedding field name>}: [\n {\n "type": "knnVector",\n "dimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n } \n ] \n } \n }\n}',version:"4.4.0"}],t.ATLAS_VECTOR_SEARCH_TEMPLATE={name:"Vector Search default template",snippet:'{\n "fields": [{\n "type": "vector",\n "path": "${1:<field name to index>}",\n "numDimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n }]\n}',version:"4.4.0"}},10215:(e,t,n)=>{n.d(t,{J0:()=>r});var a=n(28830);a.default,a.CommaAndColonSeparatedRecord,a.ConnectionString;const r=a.redactConnectionString},10282:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_VARIABLES=void 0,t.SYSTEM_VARIABLES=[{name:"$$NOW",value:"$$NOW",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current datetime value. NOW returns the same value for all members of the deployment and remains the same throughout all stages of the aggregation pipeline."},{name:"$$CLUSTER_TIME",value:"$$CLUSTER_TIME",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current timestamp value. CLUSTER_TIME is only available on replica sets and sharded clusters. CLUSTER_TIME returns the same value for all members of the deployment and remains the same throughout all stages of the pipeline."},{name:"$$ROOT",value:"$$ROOT",score:1,meta:"variable:system",version:"2.4.0",description:"References the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage."},{name:"$$CURRENT",value:"$$CURRENT",score:1,meta:"variable:system",version:"2.4.0",description:"References the start of the field path being processed in the aggregation pipeline stage. Unless documented otherwise, all stages start with CURRENT the same as ROOT. CURRENT is modifiable. However, since `$<field>` is equivalent to `$$CURRENT.<field>`, rebinding CURRENT changes the meaning of `$` accesses."},{name:"$$REMOVE",value:"$$REMOVE",score:1,meta:"variable:system",version:"3.6.0",description:"A variable which evaluates to the missing value. Allows for the conditional exclusion of fields. In a `$project`, a field set to the variable REMOVE is excluded from the output."},{name:"$$DESCEND",value:"$$DESCEND",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$PRUNE",value:"$$PRUNE",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$KEEP",value:"$$KEEP",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$SEARCH_META",value:"$$SEARCH_META",score:1,meta:"variable:system",version:"5.0.0",description:"A variable that stores the metadata results of an Atlas Search query. In all supported aggregation pipeline stages, a field set to the variable SEARCH_META returns the metadata results for the query. For an example of its usage, see Atlas Search facet and count."},{name:"$$USER_ROLES",value:"$$USER_ROLES",score:1,meta:"variable:system",version:"7.0.0",description:"A variable that stores the role names of the authenticated user running the command."}]},10560:(e,t,n)=>{var a;try{a=n(20745)}catch(e){"undefined"!=typeof window&&(a=window.esprima)}var r=n(40811);e.exports=new r("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",n=a.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(e){return!1}},construct:function(e){var t,n="("+e+")",r=a.parse(n,{range:!0}),s=[];if("Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"ArrowFunctionExpression"!==r.body[0].expression.type&&"FunctionExpression"!==r.body[0].expression.type)throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach((function(e){s.push(e.name)})),t=r.body[0].expression.body.range,"BlockStatement"===r.body[0].expression.body.type?new Function(s,n.slice(t[0]+1,t[1]-1)):new Function(s,"return "+n.slice(t[0],t[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}})},10760:(e,t,n)=>{const a=n(85216);e.exports=(e,t)=>e.sort(((e,n)=>a(n,e,t)))},10933:(e,t,n)=>{const a=n(48381),r=n(20332);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},11233:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QUERY_OPERATORS=void 0,t.QUERY_OPERATORS=[{name:"$all",value:"$all",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$and",value:"$and",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$bitsAllClear",value:"$bitsAllClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAllSet",value:"$bitsAllSet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnyClear",value:"$bitsAnyClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnySet",value:"$bitsAnySet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$comment",value:"$comment",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$elemMatch",value:"$elemMatch",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$eq",value:"$eq",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$exists",value:"$exists",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$expr",value:"$expr",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$geoIntersects",value:"$geoIntersects",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$geoWithin",value:"$geoWithin",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$gt",value:"$gt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$gte",value:"$gte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$in",value:"$in",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$jsonSchema",value:"$jsonSchema",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$lt",value:"$lt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$lte",value:"$lte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$mod",value:"$mod",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$ne",value:"$ne",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$near",value:"$near",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nearSphere",value:"$nearSphere",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nin",value:"$nin",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$not",value:"$not",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$nor",value:"$nor",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$or",value:"$or",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$regex",value:"$regex",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$size",value:"$size",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$slice",value:"$slice",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$text",value:"$text",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$type",value:"$type",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$where",value:"$where",score:1,meta:"query",version:"2.2.0",geospatial:!1}]},11249:(e,t,n)=>{const a=n(75265);e.exports=(e,t)=>e.sort(((e,n)=>a(n,e,t)))},11420:(e,t,n)=>{const a=n(48381);e.exports=(e,t,n,r,s)=>{"string"==typeof n&&(s=r,r=n,n=void 0);try{return new a(e instanceof a?e.version:e,n).inc(t,r,s).version}catch(e){return null}}},11451:(e,t,n)=>{const a=n(75265);e.exports=(e,t)=>e.sort(((e,n)=>a(e,n,t)))},11710:(e,t,n)=>{var a=n(99174);function r(e,t,n,a,r){this.name=e,this.buffer=t,this.position=n,this.line=a,this.column=r}r.prototype.getSnippet=function(e,t){var n,r,s,i,o;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",r=this.position;r>0&&-1==="\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(r-=1,this.position-r>t/2-1){n=" ... ",r+=5;break}for(s="",i=this.position;i<this.buffer.length&&-1==="\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(i));)if((i+=1)-this.position>t/2-1){s=" ... ",i-=5;break}return o=this.buffer.slice(r,i),a.repeat(" ",e)+n+o+s+"\n"+a.repeat(" ",e+this.position-r+n.length)+"^"},r.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},e.exports=r},11742:(e,t,n)=>{const a=n(72857);e.exports=(e,t,n)=>(e=new a(e,n),t=new a(t,n),e.intersects(t,n))},12169:(e,t,n)=>{const a=n(88825);e.exports=(e,t)=>new a(e,t).major},12196:(e,t,n)=>{const a=n(57544);e.exports=(e,t,n=!1)=>{if(e instanceof a)return e;try{return new a(e,t)}catch(e){if(!n)return null;throw e}}},12815:(e,t,n)=>{const a=n(50066);e.exports=(e,t)=>new a(e,t).major},12876:(e,t,n)=>{const a=n(72857);e.exports=(e,t,n)=>{try{t=new a(t,n)}catch(e){return!1}return t.test(e)}},13008:(e,t,n)=>{n.d(t,{DG:()=>v,E6:()=>_,J:()=>b,J_:()=>u,Jk:()=>c,KH:()=>p,Kk:()=>m,NI:()=>g,QP:()=>i,RM:()=>h,Tt:()=>$,Yk:()=>d,kH:()=>y,ql:()=>f,sm:()=>l,v$:()=>E});var a=n(36710),r=n(53266),s=n(87257);const i=a.xI("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),o={number:"number",bigint:"bigint",object:"date"},l=a.xI("$ZodCheckLessThan",((e,t)=>{i.init(e,t);const n=o[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,a=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),u=a.xI("$ZodCheckGreaterThan",((e,t)=>{i.init(e,t);const n=o[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,a=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),c=a.xI("$ZodCheckMultipleOf",((e,t)=>{i.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===s.LG(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),p=a.xI("$ZodCheckNumberFormat",((e,t)=>{i.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[o,l]=s.zH[t.format];e._zod.onattach.push((e=>{const a=e._zod.bag;a.format=t.format,a.minimum=o,a.maximum=l,n&&(a.pattern=r.nd)})),e._zod.check=r=>{const s=r.value;if(n){if(!Number.isInteger(s))return void r.issues.push({expected:a,format:t.format,code:"invalid_type",input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?r.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,continue:!t.abort}):r.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,continue:!t.abort}))}s<o&&r.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>l&&r.issues.push({origin:"number",input:s,code:"too_big",maximum:l,inst:e})}})),d=a.xI("$ZodCheckMaxLength",((e,t)=>{var n;i.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!s.cl(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const a=n.value;if(a.length<=t.maximum)return;const r=s.Rc(a);n.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}})),m=a.xI("$ZodCheckMinLength",((e,t)=>{var n;i.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!s.cl(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const a=n.value;if(a.length>=t.minimum)return;const r=s.Rc(a);n.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}})),h=a.xI("$ZodCheckLengthEquals",((e,t)=>{var n;i.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!s.cl(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const a=n.value,r=a.length;if(r===t.length)return;const i=s.Rc(a),o=r>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),f=a.xI("$ZodCheckStringFormat",((e,t)=>{var n,a;i.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})})),v=a.xI("$ZodCheckRegex",((e,t)=>{f.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),g=a.xI("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=r.AC),f.init(e,t)})),y=a.xI("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=r.Zv),f.init(e,t)})),$=a.xI("$ZodCheckIncludes",((e,t)=>{i.init(e,t);const n=s.$f(t.includes),a=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(a)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),b=a.xI("$ZodCheckStartsWith",((e,t)=>{i.init(e,t);const n=new RegExp(`^${s.$f(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),_=a.xI("$ZodCheckEndsWith",((e,t)=>{i.init(e,t);const n=new RegExp(`.*${s.$f(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),E=a.xI("$ZodCheckOverwrite",((e,t)=>{i.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}))},13012:(e,t,n)=>{const a=n(99597);e.exports=(e,t,n)=>a(e,t,"<",n)},13016:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},13349:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},13445:(e,t,n)=>{var a=n(40811),r=Object.prototype.toString;e.exports=new a("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,a,s,i,o=e;for(i=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(a=o[t],"[object Object]"!==r.call(a))return!1;if(1!==(s=Object.keys(a)).length)return!1;i[t]=[s[0],a[s[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,a,r,s,i=e;for(s=new Array(i.length),t=0,n=i.length;t<n;t+=1)a=i[t],r=Object.keys(a),s[t]=[r[0],a[r[0]]];return s}})},13559:(e,t,n)=>{const a=n(48381),r=n(34219),{safeRe:s,t:i}=n(92625);e.exports=(e,t)=>{if(e instanceof a)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const a=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let r;for(;(r=a.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===n)return null;const o=n[2],l=n[3]||"0",u=n[4]||"0",c=t.includePrerelease&&n[5]?`-${n[5]}`:"",p=t.includePrerelease&&n[6]?`+${n[6]}`:"";return r(`${o}.${l}.${u}${c}${p}`,t)}},13821:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JSON_SCHEMA=void 0,t.JSON_SCHEMA=[{name:"bsonType",value:"bsonType",label:"bsonType",score:1,meta:"json-schema",version:"3.6.0",description:"Accepts same string aliases used for the $type operator"},{name:"enum",value:"enum",label:"enum",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates all possible values of the field"},{name:"type",value:"type",label:"type",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates the possible JSON types of the field"},{name:"allOf",value:"allOf",label:"allOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match all specified schemas"},{name:"anyOf",value:"anyOf",label:"anyOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match at least one of the specified schemas"},{name:"oneOf",value:"oneOf",label:"oneOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match exactly one of the specified schemas"},{name:"not",value:"not",label:"not",score:1,meta:"json-schema",version:"3.6.0",description:"Field must not match the schema"},{name:"multipleOf",value:"multipleOf",label:"multipleOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must be a multiple of this value"},{name:"maximum",value:"maximum",label:"maximum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum value of the field"},{name:"exclusiveMaximum",value:"exclusiveMaximum",label:"exclusiveMaximum",score:1,meta:"json-schema",version:"3.6.0",description:"If true and field is a number, maximum is an exclusive maximum"},{name:"minimum",value:"minimum",label:"minimum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum value of the field"},{name:"exclusiveMinimum",value:"exclusiveMinimum",label:"exclusiveMinimum",score:1,meta:"json-schema",version:"3.6.0",description:"If true, minimum is an exclusive minimum"},{name:"maxLength",value:"maxLength",label:"maxLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of the field"},{name:"minLength",value:"minLength",label:"minLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of the field"},{name:"pattern",value:"pattern",label:"pattern",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match the regular expression"},{name:"maxProperties",value:"maxProperties",label:"maxProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s maximum number of properties"},{name:"minProperties",value:"minProperties",label:"minProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s minimum number of properties"},{name:"required",value:"required",label:"required",score:1,meta:"json-schema",version:"3.6.0",description:"Object’s property set must contain all the specified elements in the array"},{name:"additionalProperties",value:"additionalProperties",label:"additionalProperties",score:1,meta:"json-schema",version:"3.6.0",description:"If true, additional fields are allowed"},{name:"properties",value:"properties",label:"properties",score:1,meta:"json-schema",version:"3.6.0",description:"A valid JSON Schema where each value is also a valid JSON Schema object"},{name:"patternProperties",value:"patternProperties",label:"patternProperties",score:1,meta:"json-schema",version:"3.6.0",description:"In addition to properties requirements, each property name of this object must be a valid regular expression"},{name:"dependencies",value:"dependencies",label:"dependencies",score:1,meta:"json-schema",version:"3.6.0",description:"Describes field or schema dependencies"},{name:"additionalItems",value:"additionalItems",label:"additionalItems",score:1,meta:"json-schema",version:"3.6.0",description:"If an object, must be a valid JSON Schema"},{name:"items",value:"items",label:"items",score:1,meta:"json-schema",version:"3.6.0",description:"Must be either a valid JSON Schema, or an array of valid JSON Schemas"},{name:"maxItems",value:"maxItems",label:"maxItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of array"},{name:"minItems",value:"minItems",label:"minItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of array"},{name:"uniqueItems",value:"uniqueItems",label:"uniqueItems",score:1,meta:"json-schema",version:"3.6.0",description:"If true, each item in the array must be unique"},{name:"title",value:"title",label:"title",score:1,meta:"json-schema",version:"3.6.0",description:"A descriptive title string with no effect"},{name:"description",value:"description",label:"description",score:1,meta:"json-schema",version:"3.6.0",description:"A string that describes the schema and has no effect."}]},14e3:(e,t,n)=>{const a=n(57544),r=n(95323);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},14487:(e,t,n)=>{n.d(t,{G:()=>i,WI:()=>s,eq:()=>r});var a=n(21392);const r=a.ZS.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),s=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class i extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},a=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(a);else if("invalid_return_type"===r.code)a(r.returnTypeError);else if("invalid_arguments"===r.code)a(r.argumentsError);else if(0===r.path.length)n._errors.push(t(r));else{let e=n,a=0;for(;a<r.path.length;){const n=r.path[a];a===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],a++}}};return a(this),n}static assert(e){if(!(e instanceof i))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.ZS.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}i.create=e=>new i(e)},14753:(e,t,n)=>{var a=n(40811);e.exports=new a("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),a="";if("/"===t[0]){if(n&&(a=n[1]),a.length>3)return!1;if("/"!==t[t.length-a.length-1])return!1}return!0},construct:function(e){var t=e,n=/\/([gim]*)$/.exec(e),a="";return"/"===t[0]&&(n&&(a=n[1]),t=t.slice(1,t.length-a.length-1)),new RegExp(t,a)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}})},14982:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapField=t.getFilteredCompletions=void 0,r(n(63131),t),r(n(93766),t),r(n(51626),t),r(n(64900),t),r(n(92133),t),r(n(85070),t),r(n(48080),t),r(n(79223),t),r(n(51098),t),r(n(79984),t),r(n(35593),t),r(n(40214),t);var s=n(21410);Object.defineProperty(t,"getFilteredCompletions",{enumerable:!0,get:function(){return s.getFilteredCompletions}}),Object.defineProperty(t,"wrapField",{enumerable:!0,get:function(){return s.wrapField}}),r(n(57136),t),r(n(37504),t)},15011:(e,t,n)=>{const a=n(20332);e.exports=(e,t)=>{try{return new a(e,t).range||"*"}catch(e){return null}}},15037:(e,t,n)=>{var a=n(54420);e.exports=new a({include:[n(91714)],implicit:[n(89295),n(81602),n(48013),n(44490)]})},15144:(e,t,n)=>{const a=n(83586);e.exports=(e,t)=>{const n=a(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},15160:(e,t,n)=>{const a=n(9350),r=n(33629);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},15580:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ATLAS_VECTOR_SEARCH_TEMPLATE=t.ATLAS_SEARCH_TEMPLATES=void 0,t.ATLAS_SEARCH_TEMPLATES=[{name:"Dynamic field mappings",snippet:'{\n "mappings": {\n "dynamic": true\n }\n}',version:"4.4.0"},{name:"Static field mappings",snippet:'{\n "mappings": {\n "dynamic": false,\n "fields": {\n ${1:<string field name>}: {\n "type": "string"\n },\n ${2:<number field name>}: {\n "type": "number"\n },\n ${3:<date field name>}: {\n "type": "date"\n },\n ${4:<geo field name>}: {\n "type": "geo"\n },\n } \n }\n}',version:"4.4.0"},{name:"Text field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<string field name>}: [\n {\n // Enables text queries\n "type": "string"\n },\n {\n // Enables autocomplete queries\n "type": "autocomplete"\n \n },\n {\n // Enables sorting\n "type": "token"\n }\n ] \n } \n }\n}',version:"4.4.0"},{name:"Facet field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<number field name for faceting>}: [\n {\n "type": "numberFacet"\n },\n {\n "type": "number"\n },\n ],\n ${2:<date field name for faceting>}: [\n {\n "type": "dateFacet"\n }\n {\n "type": "date"\n }\n ],\n ${3:<string field name for faceting>}: [\n {\n "type": "stringFacet"\n },\n {\n "type": "string",\n "analyzer": "lucene.keyword"\n },\n ],\n } \n }\n}',version:"4.4.0"},{name:"KNN Vector field mapping",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<vector embedding field name>}: [\n {\n "type": "knnVector",\n "dimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n } \n ] \n } \n }\n}',version:"4.4.0"}],t.ATLAS_VECTOR_SEARCH_TEMPLATE={name:"Vector Search default template",snippet:'{\n "fields": [{\n "type": "vector",\n "path": "${1:<field name to index>}",\n "numDimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n }]\n}',version:"4.4.0"}},15625:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(14487),r=n(21392);const s=(e,t)=>{let n;switch(e.code){case a.eq.invalid_type:n=e.received===r.Zp.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case a.eq.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,r.ZS.jsonStringifyReplacer)}`;break;case a.eq.unrecognized_keys:n=`Unrecognized key(s) in object: ${r.ZS.joinValues(e.keys,", ")}`;break;case a.eq.invalid_union:n="Invalid input";break;case a.eq.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${r.ZS.joinValues(e.options)}`;break;case a.eq.invalid_enum_value:n=`Invalid enum value. Expected ${r.ZS.joinValues(e.options)}, received '${e.received}'`;break;case a.eq.invalid_arguments:n="Invalid function arguments";break;case a.eq.invalid_return_type:n="Invalid function return type";break;case a.eq.invalid_date:n="Invalid date";break;case a.eq.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:r.ZS.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case a.eq.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case a.eq.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case a.eq.custom:n="Invalid input";break;case a.eq.invalid_intersection_types:n="Intersection results could not be merged";break;case a.eq.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case a.eq.not_finite:n="Number must be finite";break;default:n=t.defaultError,r.ZS.assertNever(e)}return{message:n}}},15844:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>a(e,t,n)>=0},17497:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JSON_SCHEMA=void 0,t.JSON_SCHEMA=[{name:"bsonType",value:"bsonType",label:"bsonType",score:1,meta:"json-schema",version:"3.6.0",description:"Accepts same string aliases used for the $type operator"},{name:"enum",value:"enum",label:"enum",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates all possible values of the field"},{name:"type",value:"type",label:"type",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates the possible JSON types of the field"},{name:"allOf",value:"allOf",label:"allOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match all specified schemas"},{name:"anyOf",value:"anyOf",label:"anyOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match at least one of the specified schemas"},{name:"oneOf",value:"oneOf",label:"oneOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match exactly one of the specified schemas"},{name:"not",value:"not",label:"not",score:1,meta:"json-schema",version:"3.6.0",description:"Field must not match the schema"},{name:"multipleOf",value:"multipleOf",label:"multipleOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must be a multiple of this value"},{name:"maximum",value:"maximum",label:"maximum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum value of the field"},{name:"exclusiveMaximum",value:"exclusiveMaximum",label:"exclusiveMaximum",score:1,meta:"json-schema",version:"3.6.0",description:"If true and field is a number, maximum is an exclusive maximum"},{name:"minimum",value:"minimum",label:"minimum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum value of the field"},{name:"exclusiveMinimum",value:"exclusiveMinimum",label:"exclusiveMinimum",score:1,meta:"json-schema",version:"3.6.0",description:"If true, minimum is an exclusive minimum"},{name:"maxLength",value:"maxLength",label:"maxLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of the field"},{name:"minLength",value:"minLength",label:"minLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of the field"},{name:"pattern",value:"pattern",label:"pattern",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match the regular expression"},{name:"maxProperties",value:"maxProperties",label:"maxProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s maximum number of properties"},{name:"minProperties",value:"minProperties",label:"minProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s minimum number of properties"},{name:"required",value:"required",label:"required",score:1,meta:"json-schema",version:"3.6.0",description:"Object’s property set must contain all the specified elements in the array"},{name:"additionalProperties",value:"additionalProperties",label:"additionalProperties",score:1,meta:"json-schema",version:"3.6.0",description:"If true, additional fields are allowed"},{name:"properties",value:"properties",label:"properties",score:1,meta:"json-schema",version:"3.6.0",description:"A valid JSON Schema where each value is also a valid JSON Schema object"},{name:"patternProperties",value:"patternProperties",label:"patternProperties",score:1,meta:"json-schema",version:"3.6.0",description:"In addition to properties requirements, each property name of this object must be a valid regular expression"},{name:"dependencies",value:"dependencies",label:"dependencies",score:1,meta:"json-schema",version:"3.6.0",description:"Describes field or schema dependencies"},{name:"additionalItems",value:"additionalItems",label:"additionalItems",score:1,meta:"json-schema",version:"3.6.0",description:"If an object, must be a valid JSON Schema"},{name:"items",value:"items",label:"items",score:1,meta:"json-schema",version:"3.6.0",description:"Must be either a valid JSON Schema, or an array of valid JSON Schemas"},{name:"maxItems",value:"maxItems",label:"maxItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of array"},{name:"minItems",value:"minItems",label:"minItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of array"},{name:"uniqueItems",value:"uniqueItems",label:"uniqueItems",score:1,meta:"json-schema",version:"3.6.0",description:"If true, each item in the array must be unique"},{name:"title",value:"title",label:"title",score:1,meta:"json-schema",version:"3.6.0",description:"A descriptive title string with no effect"},{name:"description",value:"description",label:"description",score:1,meta:"json-schema",version:"3.6.0",description:"A string that describes the schema and has no effect."}]},17555:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VALIDATION_TEMPLATE=void 0,t.VALIDATION_TEMPLATE='/**\n * This is a starter template for a schema validation rule for a collection.\n * More information on schema validation rules can be found at:\n * https://www.mongodb.com/docs/manual/core/schema-validation/\n */\n{\n $jsonSchema: {\n title: "Library.books",\n bsonType: "object",\n required: ["fieldname1", "fieldname2"],\n properties: {\n fieldname1: {\n bsonType: "string",\n description: "Fieldname1 must be a string",\n },\n fieldname2: {\n bsonType: "int",\n description: "Fieldname2 must be an integer",\n },\n arrayFieldName: {\n bsonType: "array",\n items: {\n bsonType: "string"\n },\n description: "arrayFieldName must be an array of strings"\n },\n }\n }\n}'},17620:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>a(t,e,n)},17624:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VALIDATION_TEMPLATE=void 0,t.VALIDATION_TEMPLATE='/**\n * This is a starter template for a schema validation rule for a collection.\n * More information on schema validation rules can be found at:\n * https://www.mongodb.com/docs/manual/core/schema-validation/\n */\n{\n $jsonSchema: {\n title: "Library.books",\n bsonType: "object",\n required: ["fieldname1", "fieldname2"],\n properties: {\n fieldname1: {\n bsonType: "string",\n description: "Fieldname1 must be a string",\n },\n fieldname2: {\n bsonType: "int",\n description: "Fieldname2 must be an integer",\n },\n arrayFieldName: {\n bsonType: "array",\n items: {\n bsonType: "string"\n },\n description: "arrayFieldName must be an array of strings"\n },\n }\n }\n}'},17769:(e,t,n)=>{n.d(t,{$W:()=>i,pJ:()=>s,su:()=>a.A});var a=n(15625);let r=a.A;function s(e){r=e}function i(){return r}},17807:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ACCUMULATORS=void 0,t.ACCUMULATORS=[{name:"$accumulator",value:"$accumulator",score:1,meta:"accumulator",version:"4.4.0"},{name:"$addToSet",value:"$addToSet",score:1,meta:"accumulator",version:"2.2.0"},{name:"$avg",value:"$avg",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$bottom",value:"$bottom",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$bottomN",value:"$bottomN",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$covariancePop",value:"$covariancePop",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$covarianceSamp",value:"$covarianceSamp",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$count",value:"$count",score:1,meta:"accumulator",version:"5.0.0"},{name:"$derivative",value:"$derivative",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$denseRank",value:"$denseRank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$documentNumber",value:"$documentNumber",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$expMovingAvg",value:"$expMovingAvg",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$first",value:"$first",score:1,meta:"accumulator",version:"2.2.0"},{name:"$firstN",value:"$firstN",score:1,meta:"accumulator",version:"5.1.0"},{name:"$integral",value:"$integral",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$last",value:"$last",score:1,meta:"accumulator",version:"2.2.0"},{name:"$lastN",value:"$lastN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$max",value:"$max",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$maxN",value:"$maxN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$median",value:"$median",score:1,meta:"accumulator",version:"7.0.0"},{name:"$min",value:"$min",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$minN",value:"$minN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$percentile",value:"$percentile",score:1,meta:"accumulator",version:"7.0.0"},{name:"$push",value:"$push",score:1,meta:"accumulator",version:"2.2.0"},{name:"$rank",value:"$rank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$stdDevPop",value:"$stdDevPop",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$stdDevSamp",value:"$stdDevSamp",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$shift",value:"$shift",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$sum",value:"$sum",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$top",value:"$top",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$topN",value:"$topN",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$locf",value:"$locf",score:1,meta:"accumulator:window",version:"5.3.0"},{name:"$linearFill",value:"$linearFill",score:1,meta:"accumulator:window",version:"5.3.0"}]},17914:(e,t,n)=>{const a=n(9350);e.exports=(e,t,n=!1)=>{if(e instanceof a)return e;try{return new a(e,t)}catch(e){if(!n)return null;throw e}}},17941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JSON_SCHEMA=void 0,t.JSON_SCHEMA=[{name:"bsonType",value:"bsonType",label:"bsonType",score:1,meta:"json-schema",version:"3.6.0",description:"Accepts same string aliases used for the $type operator"},{name:"enum",value:"enum",label:"enum",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates all possible values of the field"},{name:"type",value:"type",label:"type",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates the possible JSON types of the field"},{name:"allOf",value:"allOf",label:"allOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match all specified schemas"},{name:"anyOf",value:"anyOf",label:"anyOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match at least one of the specified schemas"},{name:"oneOf",value:"oneOf",label:"oneOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match exactly one of the specified schemas"},{name:"not",value:"not",label:"not",score:1,meta:"json-schema",version:"3.6.0",description:"Field must not match the schema"},{name:"multipleOf",value:"multipleOf",label:"multipleOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must be a multiple of this value"},{name:"maximum",value:"maximum",label:"maximum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum value of the field"},{name:"exclusiveMaximum",value:"exclusiveMaximum",label:"exclusiveMaximum",score:1,meta:"json-schema",version:"3.6.0",description:"If true and field is a number, maximum is an exclusive maximum"},{name:"minimum",value:"minimum",label:"minimum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum value of the field"},{name:"exclusiveMinimum",value:"exclusiveMinimum",label:"exclusiveMinimum",score:1,meta:"json-schema",version:"3.6.0",description:"If true, minimum is an exclusive minimum"},{name:"maxLength",value:"maxLength",label:"maxLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of the field"},{name:"minLength",value:"minLength",label:"minLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of the field"},{name:"pattern",value:"pattern",label:"pattern",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match the regular expression"},{name:"maxProperties",value:"maxProperties",label:"maxProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s maximum number of properties"},{name:"minProperties",value:"minProperties",label:"minProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s minimum number of properties"},{name:"required",value:"required",label:"required",score:1,meta:"json-schema",version:"3.6.0",description:"Object’s property set must contain all the specified elements in the array"},{name:"additionalProperties",value:"additionalProperties",label:"additionalProperties",score:1,meta:"json-schema",version:"3.6.0",description:"If true, additional fields are allowed"},{name:"properties",value:"properties",label:"properties",score:1,meta:"json-schema",version:"3.6.0",description:"A valid JSON Schema where each value is also a valid JSON Schema object"},{name:"patternProperties",value:"patternProperties",label:"patternProperties",score:1,meta:"json-schema",version:"3.6.0",description:"In addition to properties requirements, each property name of this object must be a valid regular expression"},{name:"dependencies",value:"dependencies",label:"dependencies",score:1,meta:"json-schema",version:"3.6.0",description:"Describes field or schema dependencies"},{name:"additionalItems",value:"additionalItems",label:"additionalItems",score:1,meta:"json-schema",version:"3.6.0",description:"If an object, must be a valid JSON Schema"},{name:"items",value:"items",label:"items",score:1,meta:"json-schema",version:"3.6.0",description:"Must be either a valid JSON Schema, or an array of valid JSON Schemas"},{name:"maxItems",value:"maxItems",label:"maxItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of array"},{name:"minItems",value:"minItems",label:"minItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of array"},{name:"uniqueItems",value:"uniqueItems",label:"uniqueItems",score:1,meta:"json-schema",version:"3.6.0",description:"If true, each item in the array must be unique"},{name:"title",value:"title",label:"title",score:1,meta:"json-schema",version:"3.6.0",description:"A descriptive title string with no effect"},{name:"description",value:"description",label:"description",score:1,meta:"json-schema",version:"3.6.0",description:"A string that describes the schema and has no effect."}]},18082:(e,t,n)=>{const a=n(25583);e.exports=(e,t,n)=>a(e,t,n)<0},18104:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:s}=n(4292),i=n(72082),o=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],p=t.t={};let d=0;const m="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[m,r]],f=(e,t,n)=>{const a=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=d++;i(e,r,t),p[e]=r,u[r]=t,c[r]=a,o[r]=new RegExp(t,n?"g":void 0),l[r]=new RegExp(a,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),f("MAINVERSION",`(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${u[p.PRERELEASEIDENTIFIER]}(?:\\.${u[p.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${u[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[p.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${m}+`),f("BUILD",`(?:\\+(${u[p.BUILDIDENTIFIER]}(?:\\.${u[p.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${u[p.MAINVERSION]}${u[p.PRERELEASE]}?${u[p.BUILD]}?`),f("FULL",`^${u[p.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${u[p.MAINVERSIONLOOSE]}${u[p.PRERELEASELOOSE]}?${u[p.BUILD]}?`),f("LOOSE",`^${u[p.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${u[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${u[p.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:${u[p.PRERELEASE]})?${u[p.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:${u[p.PRERELEASELOOSE]})?${u[p.BUILD]}?)?)?`),f("XRANGE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),f("COERCE",`${u[p.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",u[p.COERCEPLAIN]+`(?:${u[p.PRERELEASE]})?`+`(?:${u[p.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",u[p.COERCE],!0),f("COERCERTLFULL",u[p.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${u[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${u[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${u[p.LONECARET]}${u[p.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${u[p.LONECARET]}${u[p.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${u[p.GTLT]}\\s*(${u[p.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]}|${u[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${u[p.XRANGEPLAIN]})\\s+-\\s+(${u[p.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${u[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[p.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},18106:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>a(e,t,n)>0},18157:(e,t,n)=>{const a=n(50066);e.exports=(e,t,n,r,s)=>{"string"==typeof n&&(s=r,r=n,n=void 0);try{return new a(e instanceof a?e.version:e,n).inc(t,r,s).version}catch(e){return null}}},18184:(e,t,n)=>{var a=n(54420);e.exports=new a({include:[n(6340)],implicit:[n(78316),n(45848)],explicit:[n(52711),n(27195),n(13445),n(51228)]})},18894:(e,t,n)=>{const a=n(43301),r=n(77203);e.exports=(e,t,n)=>{const s=[];let i=null,o=null;const l=e.sort(((e,t)=>r(e,t,n)));for(const e of l)a(e,t,n)?(o=e,i||(i=e)):(o&&s.push([i,o]),o=null,i=null);i&&s.push([i,null]);const u=[];for(const[e,t]of s)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const c=u.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return c.length<p.length?c:t}},19133:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.REQUIRED_AS_FIRST_STAGE=t.FULL_SCAN_STAGES=t.OUT_STAGES=t.STAGE_OPERATOR_NAMES=t.STAGE_OPERATORS=void 0;const a=n(99352),r=n(37724),s=[{name:"$addFields",value:"$addFields",label:"$addFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value.",comment:"/**\n * newField: The new field name.\n * expression: The new field expression.\n */\n",snippet:"{\n ${1:newField}: ${2:expression}, ${3:...}\n}"},{name:"$bucket",value:"$bucket",label:"$bucket",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Categorizes incoming documents into groups, called buckets, based on specified boundaries.",comment:"/**\n * groupBy: The expression to group by.\n * boundaries: An array of the lower boundaries for each bucket.\n * default: The bucket name for documents that do not fall within the specified boundaries\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n */\n",snippet:"{\n groupBy: ${1:expression},\n boundaries: [ ${2:lowerbound}, ${3:...} ],\n default: ${4:literal},\n output: {\n ${5:outputN}: { ${6:accumulator} }, ${7:...}\n }\n}"},{name:"$bucketAuto",value:"$bucketAuto",label:"$bucketAuto",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.",comment:"/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n",snippet:"{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}"},{name:"$changeStream",value:"$changeStream",label:"$changeStream",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a Change Stream cursor for the collection.",comment:"/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n",snippet:"{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}"},{name:"$collStats",value:"$collStats",label:"$collStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Returns statistics regarding a collection or view.",comment:"/**\n * histograms: Optional latency histograms.\n * storageStats: Optional storage stats.\n */\n",snippet:"{\n latencyStats: {\n histograms: ${1:boolean}\n },\n storageStats: {${2:}},\n}"},{name:"$count",value:"$count",label:"$count",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns a count of the number of documents at this stage of the aggregation pipeline.",comment:"/**\n * Provide the field name for the count.\n */\n",snippet:"'${1:string}'"},{name:"$currentOp",value:"$currentOp",label:"$currentOp",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.",comment:"/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n",snippet:"{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}"},{name:"$densify",value:"$densify",label:"$densify",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.1.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level.",comment:"/**\n * field: The required field to densify.\n * partitionByFields: The set of fields that acts as a compound key to define each partition.\n * range: {\n * step: The amount to increment the field value in each document.\n * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.\n * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.\n * }\n */\n",snippet:"{\n field: ${1:string},\n partitionByFields: [${2:string}, ${3:string}, ...],\n range: {\n step: ${4:number},\n unit: ${5:string},\n bounds: [${6:lowerbound}, ${7:upperbound}, ...]\n }\n}"},{name:"$documents",value:"$documents",label:"$documents",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.9",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns literal documents from input values.",comment:"/**\n * expression: Any valid expression.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$facet",value:"$facet",label:"$facet",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Allows for multiple parellel aggregations to be specified.",comment:"/**\n * outputFieldN: The first output field.\n * stageN: The first aggregation stage.\n */\n",snippet:"{\n ${1:outputFieldN}: [ ${2:stageN}, ${3:...} ]\n}"},{name:"$fill",value:"$fill",label:"$fill",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.3.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Populates null and missing field values within documents.",comment:'/**\n * sortBy: Syntax is the same as $sort, required if "method" is used in at least one output spec otherwise optional\n * partitionBy: Optional, default is a single partition. Specification is the same as _id in $group (same as partitionBy in window functions).\n * partitionByFields: Optional, set of fields that acts as a compound key to define each partition.\n * output - Required, object for each field to fill in. For a single field, can be a single object.\n * output.<field> - A field to be filled with value, if missing or null in the current document.\n */\n',snippet:"{\n sortBy: ${1:sortSpec},\n partitionBy: ${2:expression},\n partitionByFields: [${3:string}, ${4:string}, ...],\n output: {\n field1: {value: ${5:expression}},\n field2: {method: ${6:string}},\n ...\n }\n}"},{name:"$geoNear",value:"$geoNear",label:"$geoNear",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns documents based on proximity to a geospatial point.",comment:"/**\n * near: The point to search near.\n * distanceField: The calculated distance.\n * maxDistance: The maximum distance, in meters, documents can be before being excluded from results.\n * query: Limits results that match the query\n * includeLocs: Optional. Labels and includes the point used to match the document.\n * num: Optional. The maximum number of documents to return.\n * spherical: Defaults to false. Specifies whether to use spherical geometry.\n */\n",snippet:"{\n near: { type: 'Point', coordinates: [ ${1:number}, ${2:number} ] },\n distanceField: '${3:string}',\n maxDistance: ${4:number},\n query: {${5}},\n includeLocs: '${6}',\n num: ${7:number},\n spherical: ${8:boolean}\n}"},{name:"$graphLookup",value:"$graphLookup",label:"$graphLookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a recursive search on a collection.",comment:"/**\n * from: The target collection.\n * startWith: Expression to start.\n * connectFromField: Field to connect.\n * connectToField: Field to connect to.\n * as: Name of the array field.\n * maxDepth: Optional max recursion depth.\n * depthField: Optional Name of the depth field.\n * restrictSearchWithMatch: Optional query.\n */\n",snippet:"{\n from: '${1:string}',\n startWith: ${2:expression},\n connectFromField: '${3:string}',\n connectToField: '${4:string}',\n as: '${5:string}',\n maxDepth: ${6:number},\n depthField: '${7:string}',\n restrictSearchWithMatch: {${8}}\n}"},{name:"$group",value:"$group",label:"$group",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups documents by a specified expression.",comment:"/**\n * _id: The id of the group.\n * fieldN: The first field name.\n */\n",snippet:"{\n _id: ${1:expression},\n ${2:fieldN}: {\n ${3:accumulatorN}: ${4:expressionN}\n }\n}"},{name:"$indexStats",value:"$indexStats",label:"$indexStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[],namespaces:[...r.ANY_NAMESPACE],description:"Returns statistics regarding the use of each index for the collection.",comment:"/**\n * No parameters.\n */\n",snippet:"{}"},{name:"$limit",value:"$limit",label:"$limit",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Limits the number of documents that flow into subsequent stages.",comment:"/**\n * Provide the number of documents to limit.\n */\n",snippet:"${1:number}"},{name:"$listLocalSessions",value:"$listLocalSessions",label:"$listLocalSessions",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Lists the sessions cached in memory by the mongod or mongos instance.",comment:"/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n",snippet:"{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}"},{name:"$lookup",value:"$lookup",label:"$lookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a join between two collections.",comment:"/**\n * from: The target collection.\n * localField: The local join field.\n * foreignField: The target join field.\n * as: The name for the results.\n * pipeline: Optional pipeline to run on the foreign collection.\n * let: Optional variables to use in the pipeline field stages.\n */\n",snippet:"{\n from: ${1:collection},\n localField: ${2:field},\n foreignField: ${3:field},\n as: ${4:result}\n}"},{name:"$match",value:"$match",label:"$match",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Filters the document stream to allow only matching documents to pass through to subsequent stages.",comment:"/**\n * query: The query in MQL.\n */\n",snippet:"{\n ${1:query}\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.1.11",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * into: The target collection.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: '${1:string}',\n on: '${2:string}',\n let: '${3:specification(s)}',\n whenMatched: '${4:string}',\n whenNotMatched: '${5:string}'\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * atlas: Location to write the documents from the aggregation pipeline.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: {\n atlas: {\n clusterName: '${1:atlasClusterName}',\n db: '${2:database}',\n coll: '${3:collection}',\n projectId: '${4:optionalAtlasProjectId}'\n }\n },\n on: '${5:identifier}',\n let: { ${6:specification(s)} },\n whenMatched: '${7:string}',\n whenNotMatched: '${8:string}'\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to a new or existing collection.",comment:"/**\n * Provide the name of the output database and collection.\n */\n",snippet:"{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to an Atlas cluster, S3 bucket, or Azure Blob Storage.",comment:"/**\n * Use any one of the following:\n * s3: Parameters to save the data to S3.\n * atlas: Parameters to save the data to Atlas. Example:\n * {\n * atlas: {\n * db: 'string',\n * coll: 'string',\n * projectId: 'string',\n * clusterName: 'string'\n * }\n * },\n * azure: Parameters to save the data to Azure. Example:\n * {\n * azure: {\n * serviceURL: 'string',\n * containerName: 'string',\n * region: 'string,\n * filename: 'string',\n * format: {\n * name: 'string',\n * maxFileSize: 'string',\n * maxRowGroupSize: 'string',\n * columnCompression: 'string'\n * },\n * errorMode: 'string'\n * }\n * }\n */\n",snippet:"{\n s3: {\n bucket: '${1:string}',\n region: '${2:string}',\n filename: '${3:string}',\n format: {\n name: '${4:string}',\n maxFileSize: '${5:bytes}',\n maxRowGroupSize: '${6:string}',\n columnCompression: '${7:string}'\n },\n errorMode: '${8:string}'\n }\n}"},{name:"$project",value:"$project",label:"$project",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value. Unlike $addFields, $project can also remove fields.",comment:"/**\n * specifications: The fields to\n * include or exclude.\n */\n",snippet:"{\n ${1:specification(s)}\n}"},{name:"$rankFusion",value:"$rankFusion",label:"$rankFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.0.14",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using reciprocal rank fusion to create hybrid search results.",comment:'/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be a Ranked Selection Pipeline operating on the same collection. Minimum of one pipeline.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information in {$meta: "scoreDetails"} for debugging and tuning.\n */\n',snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n }\n },\n combination: {\n weights: {\n ${6:searchPipeline}: ${7:number},\n ${8:vectorPipeline}: ${9:number}\n }\n },\n scoreDetails: ${10:false}\n}"},{name:"$redact",value:"$redact",label:"$redact",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.6.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Restricts the content for each document based on information stored in the documents themselves",comment:"/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$replaceRoot",value:"$replaceRoot",label:"$replaceRoot",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newRoot: ${1:replacementDocument}\n}"},{name:"$replaceWith",value:"$replaceWith",label:"$replaceWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newWith: ${1:replacementDocument}\n}"},{name:"$sample",value:"$sample",label:"$sample",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Randomly selects the specified number of documents from its input.",comment:"/**\n * size: The number of documents to sample.\n */\n",snippet:"{\n size: ${1:number}\n}"},{name:"$scoreFusion",value:"$scoreFusion",label:"$scoreFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.2.0",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using relative score fusion to create hybrid search results.",comment:"/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be operating on the same collection. Minimum of one pipeline.\n * input.normalization: Required. Normalizes the score to the range 0 to 1 before combining the results. Value can be none, sigmoid or minMaxScaler.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * combination.method: Optional. Specifies method for combining scores. Value can be avg or expression. Default is avg.\n * combination.expression: Optional. This is the custom expression that is used when combination.method is set to expression.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information.\n */\n",snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n },\n normalization: '${6:none|sigmoid|minMaxScaler}'\n },\n combination: {\n weights: {\n ${7:searchPipeline}: ${8:number},\n ${9:vectorPipeline}: ${10:number}\n },\n method: '${11:avg|expression}',\n expression: '${12:expression}'\n },\n scoreDetails: ${13:false}\n}"},{name:"$search",value:"$search",label:"$search",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.1.11",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s).",comment:"/**\n * index: The name of the Search index.\n * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. Use matchCriteria to match 'any' or 'all' query terms.\n * compound: Combines ops.\n * span: Find in text field regions.\n * exists: Test for presence of a field.\n * near: Find near number or date.\n * range: Find in numeric or date range.\n */\n",snippet:"{\n index: '${1:string}',\n text: {\n query: '${2:string}',\n path: '${3:string}',\n matchCriteria: '${4:any}',\n }\n}"},{name:"$searchMeta",value:"$searchMeta",label:"$searchMeta",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.4.9",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.",comment:"/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n",snippet:"{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}"},{name:"$set",value:"$set",label:"$set",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.",comment:"/**\n * field: The field name\n * expression: The expression.\n */\n",snippet:"{\n ${1:field}: ${2:expression}\n}"},{name:"$setWindowFields",value:"$setWindowFields",label:"$setWindowFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Capable of partitioning incoming data, and can apply one or more functions to defined windows within each partition.",comment:"/**\n * partitionBy: partitioning of data.\n * sortBy: fields to sort by.\n * output: {\n * path: {\n * function: The window function to compute over the given window.\n * window: {\n * documents: A number of documents before and after the current document.\n * range: A range of possible values around the value in the current document's sortBy field.\n * unit: Specifies the units for the window bounds.\n * }\n * }\n * }\n */\n",snippet:"{\n partitionBy: ${1:expression},\n sortBy: ${2:sortSpec},\n output: {\n ${3:path}: {\n ${4:function}: ${5:functionArgs},\n window: {\n documents: [${6:lowerbound}, ${7:upperbound}],\n range: [${8:lowerbound}, ${9:upperbound}],\n unit: ${10:string}\n }\n },\n ${11:path2}: ...\n }\n}"},{name:"$skip",value:"$skip",label:"$skip",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Skips a specified number of documents before advancing to the next stage.",comment:"/**\n * Provide the number of documents to skip.\n */\n",snippet:"${1:number}"},{name:"$sort",value:"$sort",label:"$sort",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Reorders the document stream by a specified sort key and direction.",comment:"/**\n * Provide any number of field/order pairs.\n */\n",snippet:"{\n ${1:field1}: ${2:sortOrder}\n}"},{name:"$sortByCount",value:"$sortByCount",label:"$sortByCount",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.",comment:"/**\n * expression: Grouping expression or string.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$unionWith",value:"$unionWith",label:"$unionWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Perform a union with a pipeline on another collection.",comment:"/**\n * coll: The collection name.\n * pipeline: The pipeline on the other collection.\n */\n",snippet:"{\n coll: '${1:coll}',\n pipeline: [${2:pipeline}]\n}"},{name:"$unset",value:"$unset",label:"$unset",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Excludes fields from the result document.",comment:"/**\n * Provide the field name to exclude.\n * To exclude multiple fields, pass the field names in an array.\n */\n",snippet:"'${1:string}'"},{name:"$unwind",value:"$unwind",label:"$unwind",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Outputs a new document for each element in a specified array. ",comment:"/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n",snippet:"{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}"},{name:"$vectorSearch",value:"$vectorSearch",label:"$vectorSearch",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS],meta:"stage",version:">=6.0.10 <7.0.0 || >=7.0.2",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a kNN search on embeddings in the specified field(s)",comment:"/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n * exact: Choose between false for ANN (Approximate Nearest Neighbor) and true for ENN (Exact Nearest Neighbor). Defaults to false. (Optional)\n */\n",snippet:"{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}},\n exact: ${8:boolean}\n}"}];t.STAGE_OPERATORS=s;const i=s.map((e=>e.name));t.STAGE_OPERATOR_NAMES=i;const o=s.filter((e=>e.outputStage));t.OUT_STAGES=o;const l=s.filter((e=>e.fullScan));t.FULL_SCAN_STAGES=l;const u=s.filter((e=>e.firstStage));t.REQUIRED_AS_FIRST_STAGE=u},19789:(e,t,n)=>{const a=n(99597);e.exports=(e,t,n)=>a(e,t,">",n)},19896:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>a(t,e,n)},20038:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>a(e,t,n)<0},20242:(e,t,n)=>{const a=n(59441);e.exports=(e,t)=>{const n=a(e,t);return n&&n.prerelease.length?n.prerelease:null}},20332:(e,t,n)=>{const a=/\s+/g;class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(a," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&v))+":"+e,n=s.get(t);if(n)return n;const a=this.options.loose,r=a?c[p.HYPHENRANGELOOSE]:c[p.HYPHENRANGE];e=e.replace(r,O(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(c[p.COMPARATORTRIM],d),l("comparator trim",e),e=e.replace(c[p.TILDETRIM],m),l("tilde trim",e),e=e.replace(c[p.CARETTRIM],h),l("caret trim",e);let i=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>N(e,this.options)));a&&(i=i.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(c[p.COMPARATORLOOSE]))))),l("range list",i);const u=new Map,y=i.map((e=>new o(e,this.options)));for(const e of y){if(g(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");const $=[...u.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>$(n,t)&&e.set.some((e=>$(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const s=new(n(92721)),i=n(83214),o=n(55141),l=n(29385),u=n(48381),{safeRe:c,t:p,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:h}=n(92625),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:v}=n(24159),g=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,$=(e,t)=>{let n=!0;const a=e.slice();let r=a.pop();for(;n&&a.length;)n=a.every((e=>r.intersects(e,t))),r=a.pop();return n},b=(e,t)=>(l("comp",e,t),e=S(e,t),l("caret",e),e=E(e,t),l("tildes",e),e=I(e,t),l("xrange",e),e=T(e,t),l("stars",e),e),_=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{const n=t.loose?c[p.TILDELOOSE]:c[p.TILDE];return e.replace(n,((t,n,a,r,s)=>{let i;return l("tilde",e,t,n,a,r,s),_(n)?i="":_(a)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:_(r)?i=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:s?(l("replaceTilde pr",s),i=`>=${n}.${a}.${r}-${s} <${n}.${+a+1}.0-0`):i=`>=${n}.${a}.${r} <${n}.${+a+1}.0-0`,l("tilde return",i),i}))},S=(e,t)=>e.trim().split(/\s+/).map((e=>A(e,t))).join(" "),A=(e,t)=>{l("caret",e,t);const n=t.loose?c[p.CARETLOOSE]:c[p.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,((t,n,r,s,i)=>{let o;return l("caret",e,t,n,r,s,i),_(n)?o="":_(r)?o=`>=${n}.0.0${a} <${+n+1}.0.0-0`:_(s)?o="0"===n?`>=${n}.${r}.0${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${a} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),o="0"===n?"0"===r?`>=${n}.${r}.${s}-${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${i} <${+n+1}.0.0-0`):(l("no pr"),o="0"===n?"0"===r?`>=${n}.${r}.${s}${a} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),l("caret return",o),o}))},I=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();const n=t.loose?c[p.XRANGELOOSE]:c[p.XRANGE];return e.replace(n,((n,a,r,s,i,o)=>{l("xRange",e,n,a,r,s,i,o);const u=_(r),c=u||_(s),p=c||_(i),d=p;return"="===a&&d&&(a=""),o=t.includePrerelease?"-0":"",u?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&d?(c&&(s=0),i=0,">"===a?(a=">=",c?(r=+r+1,s=0,i=0):(s=+s+1,i=0)):"<="===a&&(a="<",c?r=+r+1:s=+s+1),"<"===a&&(o="-0"),n=`${a+r}.${s}.${i}${o}`):c?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:p&&(n=`>=${r}.${s}.0${o} <${r}.${+s+1}.0-0`),l("xRange return",n),n}))},T=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[p.STAR],"")),N=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),O=e=>(t,n,a,r,s,i,o,l,u,c,p,d)=>`${n=_(a)?"":_(r)?`>=${a}.0.0${e?"-0":""}`:_(s)?`>=${a}.${r}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=_(u)?"":_(c)?`<${+u+1}.0.0-0`:_(p)?`<${u}.${+c+1}.0-0`:d?`<=${u}.${c}.${p}-${d}`:e?`<${u}.${c}.${+p+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const a=e[n].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},20360:(e,t,n)=>{const a=/\s+/g;class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(a," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&v))+":"+e,n=s.get(t);if(n)return n;const a=this.options.loose,r=a?c[p.HYPHENRANGELOOSE]:c[p.HYPHENRANGE];e=e.replace(r,O(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(c[p.COMPARATORTRIM],d),l("comparator trim",e),e=e.replace(c[p.TILDETRIM],m),l("tilde trim",e),e=e.replace(c[p.CARETTRIM],h),l("caret trim",e);let i=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>N(e,this.options)));a&&(i=i.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(c[p.COMPARATORLOOSE]))))),l("range list",i);const u=new Map,y=i.map((e=>new o(e,this.options)));for(const e of y){if(g(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");const $=[...u.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>$(n,t)&&e.set.some((e=>$(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const s=new(n(13349)),i=n(40594),o=n(67105),l=n(95869),u=n(88825),{safeRe:c,t:p,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:h}=n(36165),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:v}=n(64136),g=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,$=(e,t)=>{let n=!0;const a=e.slice();let r=a.pop();for(;n&&a.length;)n=a.every((e=>r.intersects(e,t))),r=a.pop();return n},b=(e,t)=>(l("comp",e,t),e=S(e,t),l("caret",e),e=E(e,t),l("tildes",e),e=I(e,t),l("xrange",e),e=T(e,t),l("stars",e),e),_=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{const n=t.loose?c[p.TILDELOOSE]:c[p.TILDE];return e.replace(n,((t,n,a,r,s)=>{let i;return l("tilde",e,t,n,a,r,s),_(n)?i="":_(a)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:_(r)?i=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:s?(l("replaceTilde pr",s),i=`>=${n}.${a}.${r}-${s} <${n}.${+a+1}.0-0`):i=`>=${n}.${a}.${r} <${n}.${+a+1}.0-0`,l("tilde return",i),i}))},S=(e,t)=>e.trim().split(/\s+/).map((e=>A(e,t))).join(" "),A=(e,t)=>{l("caret",e,t);const n=t.loose?c[p.CARETLOOSE]:c[p.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,((t,n,r,s,i)=>{let o;return l("caret",e,t,n,r,s,i),_(n)?o="":_(r)?o=`>=${n}.0.0${a} <${+n+1}.0.0-0`:_(s)?o="0"===n?`>=${n}.${r}.0${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${a} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),o="0"===n?"0"===r?`>=${n}.${r}.${s}-${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${i} <${+n+1}.0.0-0`):(l("no pr"),o="0"===n?"0"===r?`>=${n}.${r}.${s}${a} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),l("caret return",o),o}))},I=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();const n=t.loose?c[p.XRANGELOOSE]:c[p.XRANGE];return e.replace(n,((n,a,r,s,i,o)=>{l("xRange",e,n,a,r,s,i,o);const u=_(r),c=u||_(s),p=c||_(i),d=p;return"="===a&&d&&(a=""),o=t.includePrerelease?"-0":"",u?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&d?(c&&(s=0),i=0,">"===a?(a=">=",c?(r=+r+1,s=0,i=0):(s=+s+1,i=0)):"<="===a&&(a="<",c?r=+r+1:s=+s+1),"<"===a&&(o="-0"),n=`${a+r}.${s}.${i}${o}`):c?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:p&&(n=`>=${r}.${s}.0${o} <${r}.${+s+1}.0-0`),l("xRange return",n),n}))},T=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[p.STAR],"")),N=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),O=e=>(t,n,a,r,s,i,o,l,u,c,p,d)=>`${n=_(a)?"":_(r)?`>=${a}.0.0${e?"-0":""}`:_(s)?`>=${a}.${r}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=_(u)?"":_(c)?`<${+u+1}.0.0-0`:_(p)?`<${u}.${+c+1}.0-0`:d?`<=${u}.${c}.${p}-${d}`:e?`<${u}.${c}.${+p+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const a=e[n].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},20474:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EXPRESSION_OPERATORS=void 0,t.EXPRESSION_OPERATORS=[{name:"$abs",value:"$abs",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$accumulator",value:"$accumulator",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$add",value:"$add",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$allElementsTrue",value:"$allElementsTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$and",value:"$and",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$anyElementTrue",value:"$anyElementTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$arrayElemAt",value:"$arrayElemAt",score:1,meta:"expr:array",version:"3.2.0"},{name:"$arrayToObject",value:"$arrayToObject",score:1,meta:"expr:array",version:"3.4.4"},{name:"$binarySize",value:"$binarySize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$bsonSize",value:"$bsonSize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$ceil",value:"$ceil",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$cmp",value:"$cmp",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$concat",value:"$concat",score:1,meta:"expr:string",version:"2.4.0"},{name:"$concatArrays",value:"$concatArrays",score:1,meta:"expr:array",version:"3.2.0"},{name:"$cond",value:"$cond",score:1,meta:"expr:cond",version:"2.6.0"},{name:"$dateAdd",value:"$dateAdd",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateDiff",value:"$dateDiff",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateFromParts",value:"$dateFromParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateFromString",value:"$dateFromString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateSubtract",value:"$dateSubtract",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateToParts",value:"$dateToParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateTrunc",value:"$dateTrunc",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dayOfMonth",value:"$dayOfMonth",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfWeek",value:"$dayOfWeek",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfYear",value:"$dayOfYear",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.0.0"},{name:"$divide",value:"$divide",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$eq",value:"$eq",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$exp",value:"$exp",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$filter",value:"$filter",score:1,meta:"expr:array",version:"3.2.0"},{name:"$first",value:"$first",score:1,meta:"expr:array",version:"4.4.0"},{name:"$floor",value:"$floor",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$function",value:"$function",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$getField",value:"$getField",score:1,meta:"expr:get",version:"5.0.0"},{name:"$gt",value:"$gt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$gte",value:"$gte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$hour",value:"$hour",score:1,meta:"expr:date",version:"2.2.0"},{name:"$ifNull",value:"$ifNull",score:1,meta:"expr:cond",version:"2.2.0"},{name:"$in",value:"$in",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfArray",value:"$indexOfArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfBytes",value:"$indexOfBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$indexOfCP",value:"$indexOfCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$isArray",value:"$isArray",score:1,meta:"expr:array",version:"3.2.0"},{name:"$isNumber",value:"$isNumber",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$isoDayOfWeek",value:"$isoDayOfWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeek",value:"$isoWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeekYear",value:"$isoWeekYear",score:1,meta:"expr:date",version:"3.4.0"},{name:"$last",value:"$last",score:1,meta:"expr:array",version:"4.4.0"},{name:"$let",value:"$let",score:1,meta:"expr:var",version:"2.6.0"},{name:"$literal",value:"$literal",score:1,meta:"expr:literal",version:"2.6.0"},{name:"$lt",value:"$lt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$lt",value:"$lte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$ln",value:"$ln",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log",value:"$log",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log10",value:"$log10",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$map",value:"$map",score:1,meta:"expr:array",version:"2.6.0"},{name:"$mergeObjects",value:"$mergeObjects",score:1,meta:"expr:obj",version:"3.6.0"},{name:"$meta",value:"$meta",score:1,meta:"expr:text",version:"2.6.0"},{name:"$millisecond",value:"$millisecond",score:1,meta:"expr:date",version:"2.4.0"},{name:"$minute",value:"$minute",score:1,meta:"expr:date",version:"2.2.0"},{name:"$mod",value:"$mod",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$month",value:"$month",score:1,meta:"expr:date",version:"2.2.0"},{name:"$multiply",value:"$multiply",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$new",value:"$new",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$not",value:"$not",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$objectToArray",value:"$objectToArray",score:1,meta:"expr:array",version:"3.4.4"},{name:"$or",value:"$or",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$pow",value:"$pow",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$range",value:"$range",score:1,meta:"expr:array",version:"3.4.0"},{name:"$reduce",value:"$reduce",score:1,meta:"expr:array",version:"3.4.0"},{name:"$regexFind",value:"$regexFind",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexFindAll",value:"$regexFindAll",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexMatch",value:"$regexMatch",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$replaceAll",value:"$replaceAll",score:1,meta:"expr:string",version:"4.4.0"},{name:"$replaceOne",value:"$replaceOne",score:1,meta:"expr:string",version:"4.4.0"},{name:"$reverseArray",value:"$reverseArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$second",value:"$second",score:1,meta:"expr:date",version:"2.2.0"},{name:"$setDifference",value:"$setDifference",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setEquals",value:"$setEquals",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIntersection",value:"$setIntersection",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIsSubset",value:"$setIsSubset",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setUnion",value:"$setUnion",score:1,meta:"expr:set",version:"2.6.0"},{name:"$similarityCosine",value:"$similarityCosine",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityDotProduct",value:"$similarityDotProduct",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityEuclidean",value:"$similarityEuclidean",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$size",value:"$size",score:1,meta:"expr:array",version:"2.6.0"},{name:"$slice",value:"$slice",score:1,meta:"expr:array",version:"3.2.0"},{name:"$sortArray",value:"$sortArray",score:1,meta:"expr:array",version:"5.2.0"},{name:"$split",value:"$split",score:1,meta:"expr:string",version:"3.4.0"},{name:"$sqrt",value:"$sqrt",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$strcasecmp",value:"$strcasecmp",score:1,meta:"expr:string",version:"2.2.0"},{name:"$strLenBytes",value:"$strLenBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$strLenCP",value:"$strLenCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substr",value:"$substr",score:1,meta:"expr:string",version:"2.2.0",deprecated:"3.4.0",replacement:"$substrBytes"},{name:"$substrBytes",value:"$substrBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substrCP",value:"$substrCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$subtract",value:"$subtract",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$switch",value:"$switch",score:1,meta:"expr:cond",version:"3.4.0"},{name:"$toHashedIndexKey",value:"$toHashedIndexKey",score:1,meta:"expr:arith",version:"4.2.24"},{name:"$toLower",value:"$toLower",score:1,meta:"expr:string",version:"2.2.0"},{name:"$toUpper",value:"$toUpper",score:1,meta:"expr:string",version:"2.2.0"},{name:"$tsSecond",value:"$tsSecond",score:1,meta:"expr:date",version:"5.1.0"},{name:"$tsIncrement",value:"$tsIncrement",score:1,meta:"expr:date",version:"5.1.0"},{name:"$trunc",value:"$trunc",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$type",value:"$type",score:1,meta:"expr:type",version:"3.4.0"},{name:"$week",value:"$week",score:1,meta:"expr:date",version:"2.2.0"},{name:"$year",value:"$year",score:1,meta:"expr:date",version:"2.2.0"},{name:"$zip",value:"$zip",score:1,meta:"expr:array",version:"3.4.0"},{name:"$bitAnd",value:"$bitAnd",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitOr",value:"$bitOr",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitXor",value:"$bitXor",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitNot",value:"$bitNot",score:1,meta:"expr:bit",version:"7.0.0"}]},20903:(e,t,n)=>{const a=n(83586);e.exports=(e,t)=>{const n=a(e,t);return n?n.version:null}},20930:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},21022:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ANY_NAMESPACE=t.ANY_COLLECTION_NAMESPACE=t.TIME_SERIES=t.VIEW=t.COLLECTION=t.DATABASE=void 0,t.DATABASE="db";const n="coll";t.COLLECTION=n;const a="view";t.VIEW=a;const r="timeseries";t.TIME_SERIES=r;const s=[n,a,r];t.ANY_COLLECTION_NAMESPACE=s;const i=["db",...s];t.ANY_NAMESPACE=i},21148:(e,t,n)=>{const a=n(50363),r=n(60501);e.exports=(e,t,n)=>{const s=[];let i=null,o=null;const l=e.sort(((e,t)=>r(e,t,n)));for(const e of l)a(e,t,n)?(o=e,i||(i=e)):(o&&s.push([i,o]),o=null,i=null);i&&s.push([i,null]);const u=[];for(const[e,t]of s)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const c=u.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return c.length<p.length?c:t}},21212:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},21392:(e,t,n)=>{var a,r;n.d(t,{CR:()=>i,ZS:()=>a,Zp:()=>s,o6:()=>r}),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),a={};for(const e of n)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(a||(a={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(r||(r={}));const s=a.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return Number.isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":return Array.isArray(e)?s.array:null===e?s.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?s.promise:"undefined"!=typeof Map&&e instanceof Map?s.map:"undefined"!=typeof Set&&e instanceof Set?s.set:"undefined"!=typeof Date&&e instanceof Date?s.date:s.object;default:return s.unknown}}},21410:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_CONSTANTS=void 0,t.createConstantFilter=f,t.wrapField=function(e,t=!1){return t||!function(e){if(/[.\s"'()[\];={}:]/.test(e))return!1;try{return new Function(`"use strict";let _ = { ${e}: 0 };`),!0}catch{return!1}}(e)?`"${e.replace(/["\\]/g,"\\$&")}"`:e},t.getFilteredCompletions=function(e={},n=t.ALL_CONSTANTS){const{serverVersion:a=m,fields:r=[],meta:s,stage:i}=e,o=f({serverVersion:a,meta:s,stage:i});return n.concat(r.flatMap((e=>{const{value:t,description:n}=function(e){return"string"==typeof e?{value:e}:{value:e.name,description:e.description}}(e);return[{value:t,meta:"field:identifier",version:"0.0.0",description:n},{value:`$${t}`,meta:"field:reference",version:"0.0.0",description:n}]}))).filter((e=>o(e)))};const a=n(75982),r=n(63131),s=n(93766),i=n(51626),o=n(64900),l=n(85070),u=n(48080),c=n(51098),p=n(79984),d=n(35593);t.ALL_CONSTANTS=[...r.ACCUMULATORS,...i.BSON_TYPES,...s.BSON_TYPE_ALIASES,...o.CONVERSION_OPERATORS,...l.EXPRESSION_OPERATORS,...u.JSON_SCHEMA,...c.QUERY_OPERATORS,...p.STAGE_OPERATORS,...d.SYSTEM_VARIABLES];const m="999.999.999";function h(e,t){return void 0===e||void 0===t||(e=Array.isArray(e)?e:[e]).some((e=>t.includes(e)))}function f({meta:e,serverVersion:t=m,stage:n={}}={}){const r=/^(?<version>\d+\.\d+\.\d+)/.exec(t)?.groups?.version??m;return({version:t,meta:s,env:i,namespaces:o,apiVersions:l})=>function(e,t){const n=/^\d+\.\d+\.\d+$/.test(t);return(0,a.satisfies)(e,n?`>=${t}`:t)}(r,t)&&h(n.env,i)&&h(n.namespace,o)&&h(n.apiVersion,l)&&(!e||function(e,t){const n=t.split(":");return e.some((e=>{const t=e.split(":");return t.length===n.length&&t.every(((e,t)=>"*"===e||e===n[t]))}))}(e,s))}},21482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VALIDATION_TEMPLATE=void 0,t.VALIDATION_TEMPLATE='/**\n * This is a starter template for a schema validation rule for a collection.\n * More information on schema validation rules can be found at:\n * https://www.mongodb.com/docs/manual/core/schema-validation/\n */\n{\n $jsonSchema: {\n title: "Library.books",\n bsonType: "object",\n required: ["fieldname1", "fieldname2"],\n properties: {\n fieldname1: {\n bsonType: "string",\n description: "Fieldname1 must be a string",\n },\n fieldname2: {\n bsonType: "int",\n description: "Fieldname2 must be an integer",\n },\n arrayFieldName: {\n bsonType: "array",\n items: {\n bsonType: "string"\n },\n description: "arrayFieldName must be an array of strings"\n },\n }\n }\n}'},21665:(e,t,n)=>{var a=n(29520);e.exports=a},22038:(e,t,n)=>{const a=n(87866);e.exports=(e,t,n)=>a(e,t,">",n)},22156:(e,t,n)=>{const a=n(59441);e.exports=(e,t)=>{const n=a(e,t);return n?n.version:null}},22849:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ACCUMULATORS=void 0,t.ACCUMULATORS=[{name:"$accumulator",value:"$accumulator",score:1,meta:"accumulator",version:"4.4.0"},{name:"$addToSet",value:"$addToSet",score:1,meta:"accumulator",version:"2.2.0"},{name:"$avg",value:"$avg",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$bottom",value:"$bottom",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$bottomN",value:"$bottomN",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$covariancePop",value:"$covariancePop",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$covarianceSamp",value:"$covarianceSamp",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$count",value:"$count",score:1,meta:"accumulator",version:"5.0.0"},{name:"$derivative",value:"$derivative",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$denseRank",value:"$denseRank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$documentNumber",value:"$documentNumber",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$expMovingAvg",value:"$expMovingAvg",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$first",value:"$first",score:1,meta:"accumulator",version:"2.2.0"},{name:"$firstN",value:"$firstN",score:1,meta:"accumulator",version:"5.1.0"},{name:"$integral",value:"$integral",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$last",value:"$last",score:1,meta:"accumulator",version:"2.2.0"},{name:"$lastN",value:"$lastN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$max",value:"$max",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$maxN",value:"$maxN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$median",value:"$median",score:1,meta:"accumulator",version:"7.0.0"},{name:"$min",value:"$min",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$minN",value:"$minN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$percentile",value:"$percentile",score:1,meta:"accumulator",version:"7.0.0"},{name:"$push",value:"$push",score:1,meta:"accumulator",version:"2.2.0"},{name:"$rank",value:"$rank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$stdDevPop",value:"$stdDevPop",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$stdDevSamp",value:"$stdDevSamp",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$shift",value:"$shift",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$sum",value:"$sum",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$top",value:"$top",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$topN",value:"$topN",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$locf",value:"$locf",score:1,meta:"accumulator:window",version:"5.3.0"},{name:"$linearFill",value:"$linearFill",score:1,meta:"accumulator:window",version:"5.3.0"}]},23252:(e,t,n)=>{const a=n(88825),r=n(20360),s=n(51269);e.exports=(e,t)=>{e=new r(e,t);let n=new a("0.0.0");if(e.test(n))return n;if(n=new a("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new a(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!s(n,i)||(n=i)}return n&&e.test(n)?n:null}},23253:(e,t,n)=>{n.d(t,{qg:()=>l,EJ:()=>u,xL:()=>c,bp:()=>p});var a=n(27750),r=n(77926),s=n(36710);const i=(e,t)=>{r.a$.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>r.Wk(e,t)},flatten:{value:t=>r.JM(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})},o=(s.xI("ZodError",i),s.xI("ZodError",i,{Parent:Error})),l=a.Tj(o),u=a.Rb(o),c=a.Od(o),p=a.wG(o)},24078:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>a(e,t,n)<=0},24087:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPES=void 0,t.BSON_TYPES=[{name:"Code",value:"Code",label:"Code",score:1,meta:"bson",version:"0.0.0",description:"BSON Code type",snippet:"Code('${1:code}')"},{name:"ObjectId",value:"ObjectId",label:"ObjectId",score:1,meta:"bson",version:"0.0.0",description:"BSON ObjectId type",snippet:"ObjectId('${1:id}')"},{name:"Binary",value:"Binary",label:"Binary",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary type",snippet:"Binary('${1:data}', '${2:subType}')"},{name:"DBRef",value:"DBRef",label:"DBRef",score:1,meta:"bson",version:"0.0.0",description:"BSON DBRef type",snippet:"DBRef('${1:ns}', '${2:oid}')"},{name:"Timestamp",value:"Timestamp",label:"Timestamp",score:1,meta:"bson",version:"0.0.0",description:"BSON Timestamp type",snippet:"Timestamp(${1:low}, ${2:high})"},{name:"NumberInt",value:"NumberInt",label:"NumberInt",score:1,meta:"bson",version:"0.0.0",description:"BSON 32 bit Integer type",snippet:"NumberInt(${1:value})"},{name:"NumberLong",value:"NumberLong",label:"NumberLong",score:1,meta:"bson",version:"0.0.0",description:"BSON 64 but Integer type",snippet:"NumberLong('${1:value}')"},{name:"NumberDecimal",value:"NumberDecimal",label:"NumberDecimal",score:1,meta:"bson",version:"3.4.0",description:"BSON Decimal128 type",snippet:"NumberDecimal('${1:value}')"},{name:"MaxKey",value:"MaxKey",label:"MaxKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MaxKey type",snippet:"MaxKey()"},{name:"MinKey",value:"MinKey",label:"MinKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MinKey type",snippet:"MinKey()"},{name:"ISODate",value:"ISODate",label:"ISODate",score:1,meta:"bson",version:"0.0.0",description:"BSON Date type",snippet:"ISODate('${1:date}')"},{name:"RegExp",value:"RegExp",label:"RegExp",score:1,meta:"bson",version:"0.0.0",description:"BSON Regex type",snippet:"RegExp('${1:source}', '${2:opts}')"},{name:"LegacyJavaUUID",value:"LegacyJavaUUID",label:"LegacyJavaUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Java legacy UUID)",snippet:"LegacyJavaUUID('${1:uuid}')"},{name:"LegacyCSharpUUID",value:"LegacyCSharpUUID",label:"LegacyCSharpUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (CSharp legacy UUID)",snippet:"LegacyCSharpUUID('${1:uuid}')"},{name:"LegacyPythonUUID",value:"LegacyPythonUUID",label:"LegacyPythonUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Python legacy UUID)",snippet:"LegacyPythonUUID('${1:uuid}')"},{name:"UUID",value:"UUID",label:"UUID",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary subtype 4",snippet:"UUID('${1:uuid}')"}]},24159:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},24320:(e,t,n)=>{const a=n(17914);e.exports=(e,t)=>{const n=a(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},24472:(e,t,n)=>{const a=n(66283),r=n(58387),{ANY:s}=r,i=n(38366),o=n(50363),l=n(61607),u=n(91152),c=n(80829),p=n(15844);e.exports=(e,t,n,d)=>{let m,h,f,v,g;switch(e=new a(e,d),t=new i(t,d),n){case">":m=l,h=c,f=u,v=">",g=">=";break;case"<":m=u,h=p,f=l,v="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){const a=t.set[n];let i=null,o=null;if(a.forEach((e=>{e.semver===s&&(e=new r(">=0.0.0")),i=i||e,o=o||e,m(e.semver,i.semver,d)?i=e:f(e.semver,o.semver,d)&&(o=e)})),i.operator===v||i.operator===g)return!1;if((!o.operator||o.operator===v)&&h(e,o.semver))return!1;if(o.operator===g&&f(e,o.semver))return!1}return!0}},24482:(e,t,n)=>{const a=n(34219);e.exports=(e,t)=>{const n=a(e,t);return n?n.version:null}},24625:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapField=t.getFilteredCompletions=void 0,r(n(98582),t),r(n(66529),t),r(n(24087),t),r(n(47501),t),r(n(91030),t),r(n(96651),t),r(n(54395),t),r(n(21022),t),r(n(11233),t),r(n(40727),t),r(n(82660),t),r(n(58505),t);var s=n(27699);Object.defineProperty(t,"getFilteredCompletions",{enumerable:!0,get:function(){return s.getFilteredCompletions}}),Object.defineProperty(t,"wrapField",{enumerable:!0,get:function(){return s.wrapField}}),r(n(91597),t),r(n(43959),t)},24975:(e,t,n)=>{const a=n(25583);e.exports=(e,t,n)=>a(t,e,n)},25157:(e,t,n)=>{var a,r=n(98437),s=n(17642);function i(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),-1===e.indexOf("-")&&-1===e.indexOf("_"))return e;{let t="",n=!1;const a=e.match(/^-+/);for(let r=a?a[0].length:0;r<e.length;r++){let a=e.charAt(r);n&&(n=!1,a=a.toUpperCase()),0===r||"-"!==a&&"_"!==a?"-"!==a&&"_"!==a&&(t+=a):n=!0}return t}}function o(e,t){const n=e.toLowerCase();t=t||"-";let a="";for(let r=0;r<e.length;r++){const s=n.charAt(r),i=e.charAt(r);a+=s!==i&&r>0?`${t}${n.charAt(r)}`:i}return a}function l(e){return null!=e&&("number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||!/^0[^.]/.test(e)&&/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e))}let u;function c(e){return void 0!==e?e+1:1}function p(e){return"__proto__"===e?"___proto___":e}!function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"}(a||(a={}));var d,m,h,f=n(36374),v=n(65994).e;const g=v&&v.env&&v.env.YARGS_MIN_NODE_VERSION?Number(v.env.YARGS_MIN_NODE_VERSION):12,y=null!==(m=null===(d=null==v?void 0:v.versions)||void 0===d?void 0:d.node)&&void 0!==m?m:null===(h=null==v?void 0:v.version)||void 0===h?void 0:h.slice(1);if(y&&Number(y.match(/^([^.]+)/)[1])<g)throw Error(`yargs parser supports a minimum Node.js version of ${g}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const $=v?v.env:{},b=new class{constructor(e){u=e}parse(e,t){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),r=function(e){if(Array.isArray(e))return e.map((e=>"string"!=typeof e?e+"":e));e=e.trim();let t=0,n=null,a=null,r=null;const s=[];for(let i=0;i<e.length;i++)n=a,a=e.charAt(i)," "!==a||r?(a===r?r=null:"'"!==a&&'"'!==a||r||(r=a),s[t]||(s[t]=""),s[t]+=a):" "!==n&&t++;return s}(e),s="string"==typeof e,d=function(e){const t=[],n=Object.create(null);let a=!0;for(Object.keys(e).forEach((function(n){t.push([].concat(e[n],n))}));a;){a=!1;for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++)if(t[e].filter((function(e){return-1!==t[n].indexOf(e)})).length){t[e]=t[e].concat(t[n]),t.splice(n,1),a=!0;break}}return t.forEach((function(e){const t=(e=e.filter((function(e,t,n){return n.indexOf(e)===t}))).pop();void 0!==t&&"string"==typeof t&&(n[t]=e)})),n}(Object.assign(Object.create(null),n.alias)),m=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),h=Object.assign(Object.create(null),n.default),f=n.configObjects||[],v=n.envPrefix,g=m["populate--"],y=g?"--":"_",$=Object.create(null),b=Object.create(null),_=n.__||u.format,E={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},x=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,S=new RegExp("^--"+m["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach((function(e){const t="object"==typeof e?e.key:e,n=Object.keys(e).map((function(e){return{boolean:"bools",string:"strings",number:"numbers"}[e]})).filter(Boolean).pop();n&&(E[n][t]=!0),E.arrays[t]=!0,E.keys.push(t)})),[].concat(n.boolean||[]).filter(Boolean).forEach((function(e){E.bools[e]=!0,E.keys.push(e)})),[].concat(n.string||[]).filter(Boolean).forEach((function(e){E.strings[e]=!0,E.keys.push(e)})),[].concat(n.number||[]).filter(Boolean).forEach((function(e){E.numbers[e]=!0,E.keys.push(e)})),[].concat(n.count||[]).filter(Boolean).forEach((function(e){E.counts[e]=!0,E.keys.push(e)})),[].concat(n.normalize||[]).filter(Boolean).forEach((function(e){E.normalize[e]=!0,E.keys.push(e)})),"object"==typeof n.narg&&Object.entries(n.narg).forEach((([e,t])=>{"number"==typeof t&&(E.nargs[e]=t,E.keys.push(e))})),"object"==typeof n.coerce&&Object.entries(n.coerce).forEach((([e,t])=>{"function"==typeof t&&(E.coercions[e]=t,E.keys.push(e))})),void 0!==n.config&&(Array.isArray(n.config)||"string"==typeof n.config?[].concat(n.config).filter(Boolean).forEach((function(e){E.configs[e]=!0})):"object"==typeof n.config&&Object.entries(n.config).forEach((([e,t])=>{"boolean"!=typeof t&&"function"!=typeof t||(E.configs[e]=t)}))),function(...e){e.forEach((function(e){Object.keys(e||{}).forEach((function(e){E.aliases[e]||(E.aliases[e]=[].concat(d[e]||[]),E.aliases[e].concat(e).forEach((function(t){if(/-/.test(t)&&m["camel-case-expansion"]){const n=i(t);n!==e&&-1===E.aliases[e].indexOf(n)&&(E.aliases[e].push(n),$[n]=!0)}})),E.aliases[e].concat(e).forEach((function(t){if(t.length>1&&/[A-Z]/.test(t)&&m["camel-case-expansion"]){const n=o(t,"-");n!==e&&-1===E.aliases[e].indexOf(n)&&(E.aliases[e].push(n),$[n]=!0)}})),E.aliases[e].forEach((function(t){E.aliases[t]=[e].concat(E.aliases[e].filter((function(e){return t!==e})))})))}))}))}(n.key,d,n.default,E.arrays),Object.keys(h).forEach((function(e){(E.aliases[e]||[]).forEach((function(t){h[t]=h[e]}))}));let A=null;Object.keys(E.counts).find((e=>q(e,E.arrays)?(A=Error(_("Invalid configuration: %s, opts.count excludes opts.array.",e)),!0):!!q(e,E.nargs)&&(A=Error(_("Invalid configuration: %s, opts.count excludes opts.narg.",e)),!0)));let I=[];const w=Object.assign(Object.create(null),{_:[]}),T={};for(let e=0;e<r.length;e++){const t=r[e],n=t.replace(/^-{3,}/,"---");let a,s,i,o,l,u;if("--"!==t&&/^-/.test(t)&&V(t))N(t);else{if(n.match(/^---+(=|$)/)){N(t);continue}if(t.match(/^--.+=/)||!m["short-option-groups"]&&t.match(/^-.+=/))o=t.match(/^--?([^=]+)=([\s\S]*)$/),null!==o&&Array.isArray(o)&&o.length>=3&&(q(o[1],E.arrays)?e=k(e,o[1],r,o[2]):!1!==q(o[1],E.nargs)?e=O(e,o[1],r,o[2]):R(o[1],o[2],!0));else if(t.match(S)&&m["boolean-negation"])o=t.match(S),null!==o&&Array.isArray(o)&&o.length>=2&&(s=o[1],R(s,!!q(s,E.arrays)&&[!1]));else if(t.match(/^--.+/)||!m["short-option-groups"]&&t.match(/^-[^-]+/))o=t.match(/^--?(.+)/),null!==o&&Array.isArray(o)&&o.length>=2&&(s=o[1],q(s,E.arrays)?e=k(e,s,r):!1!==q(s,E.nargs)?e=O(e,s,r):(l=r[e+1],void 0===l||l.match(/^-/)&&!l.match(x)||q(s,E.bools)||q(s,E.counts)?/^(true|false)$/.test(l)?(R(s,l),e++):R(s,z(s)):(R(s,l),e++)));else if(t.match(/^-.\..+=/))o=t.match(/^-([^=]+)=([\s\S]*)$/),null!==o&&Array.isArray(o)&&o.length>=3&&R(o[1],o[2]);else if(t.match(/^-.\..+/)&&!t.match(x))l=r[e+1],o=t.match(/^-(.\..+)/),null!==o&&Array.isArray(o)&&o.length>=2&&(s=o[1],void 0===l||l.match(/^-/)||q(s,E.bools)||q(s,E.counts)?R(s,z(s)):(R(s,l),e++));else if(t.match(/^-[^-]+/)&&!t.match(x)){i=t.slice(1,-1).split(""),a=!1;for(let n=0;n<i.length;n++){if(l=t.slice(n+2),i[n+1]&&"="===i[n+1]){u=t.slice(n+3),s=i[n],q(s,E.arrays)?e=k(e,s,r,u):!1!==q(s,E.nargs)?e=O(e,s,r,u):R(s,u),a=!0;break}if("-"!==l){if(/[A-Za-z]/.test(i[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&!1===q(l,E.bools)){R(i[n],l),a=!0;break}if(i[n+1]&&i[n+1].match(/\W/)){R(i[n],l),a=!0;break}R(i[n],z(i[n]))}else R(i[n],l)}s=t.slice(-1)[0],a||"-"===s||(q(s,E.arrays)?e=k(e,s,r):!1!==q(s,E.nargs)?e=O(e,s,r):(l=r[e+1],void 0===l||/^(-|--)[^-]/.test(l)&&!l.match(x)||q(s,E.bools)||q(s,E.counts)?/^(true|false)$/.test(l)?(R(s,l),e++):R(s,z(s)):(R(s,l),e++)))}else if(t.match(/^-[0-9]$/)&&t.match(x)&&q(t.slice(1),E.bools))s=t.slice(1),R(s,z(s));else{if("--"===t){I=r.slice(e+1);break}if(m["halt-at-non-option"]){I=r.slice(e);break}N(t)}}}function N(e){const t=L("_",e);"string"!=typeof t&&"number"!=typeof t||w._.push(t)}function O(e,t,n,a){let r,s=q(t,E.nargs);if(s="number"!=typeof s||isNaN(s)?1:s,0===s)return Z(a)||(A=Error(_("Argument unexpected for: %s",t))),R(t,z(t)),e;let i=Z(a)?0:1;if(m["nargs-eats-options"])n.length-(e+1)+i<s&&(A=Error(_("Not enough arguments following: %s",t))),i=s;else{for(r=e+1;r<n.length&&(!n[r].match(/^-[^0-9]/)||n[r].match(x)||V(n[r]));r++)i++;i<s&&(A=Error(_("Not enough arguments following: %s",t)))}let o=Math.min(i,s);for(!Z(a)&&o>0&&(R(t,a),o--),r=e+1;r<o+e+1;r++)R(t,n[r]);return e+o}function k(e,t,n,a){let r=[],i=a||n[e+1];const o=q(t,E.nargs);if(q(t,E.bools)&&!/^(true|false)$/.test(i))r.push(!0);else if(Z(i)||Z(a)&&/^-/.test(i)&&!x.test(i)&&!V(i)){if(void 0!==h[t]){const e=h[t];r=Array.isArray(e)?e:[e]}}else{Z(a)||r.push(P(t,a,!0));for(let a=e+1;a<n.length&&!(!m["greedy-arrays"]&&r.length>0||o&&"number"==typeof o&&r.length>=o)&&(i=n[a],!/^-/.test(i)||x.test(i)||V(i));a++)e=a,r.push(P(t,i,s))}return"number"==typeof o&&(o&&r.length<o||isNaN(o)&&0===r.length)&&(A=Error(_("Not enough arguments following: %s",t))),R(t,r),e}function R(e,t,n=s){if(/-/.test(e)&&m["camel-case-expansion"]){const t=e.split(".").map((function(e){return i(e)})).join(".");C(e,t)}const a=P(e,t,n),r=e.split(".");F(w,r,a),E.aliases[e]&&E.aliases[e].forEach((function(e){const t=e.split(".");F(w,t,a)})),r.length>1&&m["dot-notation"]&&(E.aliases[r[0]]||[]).forEach((function(t){let n=t.split(".");const s=[].concat(r);s.shift(),n=n.concat(s),(E.aliases[e]||[]).includes(n.join("."))||F(w,n,a)})),q(e,E.normalize)&&!q(e,E.arrays)&&[e].concat(E.aliases[e]||[]).forEach((function(e){Object.defineProperty(T,e,{enumerable:!0,get:()=>t,set(e){t="string"==typeof e?u.normalize(e):e}})}))}function C(e,t){E.aliases[e]&&E.aliases[e].length||(E.aliases[e]=[t],$[t]=!0),E.aliases[t]&&E.aliases[t].length||C(t,e)}function P(e,t,n){n&&(t=function(e){return"string"!=typeof e||"'"!==e[0]&&'"'!==e[0]||e[e.length-1]!==e[0]?e:e.substring(1,e.length-1)}(t)),(q(e,E.bools)||q(e,E.counts))&&"string"==typeof t&&(t="true"===t);let a=Array.isArray(t)?t.map((function(t){return L(e,t)})):L(e,t);return q(e,E.counts)&&(Z(a)||"boolean"==typeof a)&&(a=c()),q(e,E.normalize)&&q(e,E.arrays)&&(a=Array.isArray(t)?t.map((e=>u.normalize(e))):u.normalize(t)),a}function L(e,t){return m["parse-positional-numbers"]||"_"!==e?(q(e,E.strings)||q(e,E.bools)||Array.isArray(t)||(l(t)&&m["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))||!Z(t)&&q(e,E.numbers))&&(t=Number(t)),t):t}function j(e,t){Object.keys(e).forEach((function(n){const a=e[n],r=t?t+"."+n:n;"object"==typeof a&&null!==a&&!Array.isArray(a)&&m["dot-notation"]?j(a,r):(!Y(w,r.split("."))||q(r,E.arrays)&&m["combine-arrays"])&&R(r,a)}))}function M(e,t){if(void 0===v)return;const n="string"==typeof v?v:"",a=u.env();Object.keys(a).forEach((function(r){if(""===n||0===r.lastIndexOf(n,0)){const s=r.split("__").map((function(e,t){return 0===t&&(e=e.substring(n.length)),i(e)}));(t&&E.configs[s.join(".")]||!t)&&!Y(e,s)&&R(s.join("."),a[r])}}))}function D(e,t,n,a=!1){Object.keys(n).forEach((function(r){Y(e,r.split("."))||(F(e,r.split("."),n[r]),a&&(b[r]=!0),(t[r]||[]).forEach((function(t){Y(e,t.split("."))||F(e,t.split("."),n[r])})))}))}function Y(e,t){let n=e;m["dot-notation"]||(t=[t.join(".")]),t.slice(0,-1).forEach((function(e){n=n[e]||{}}));const a=t[t.length-1];return"object"==typeof n&&a in n}function F(e,t,n){let a=e;m["dot-notation"]||(t=[t.join(".")]),t.slice(0,-1).forEach((function(e){e=p(e),"object"==typeof a&&void 0===a[e]&&(a[e]={}),"object"!=typeof a[e]||Array.isArray(a[e])?(Array.isArray(a[e])?a[e].push({}):a[e]=[a[e],{}],a=a[e][a[e].length-1]):a=a[e]}));const r=p(t[t.length-1]),s=q(t.join("."),E.arrays),i=Array.isArray(n);let o=m["duplicate-arguments-array"];!o&&q(r,E.nargs)&&(o=!0,(!Z(a[r])&&1===E.nargs[r]||Array.isArray(a[r])&&a[r].length===E.nargs[r])&&(a[r]=void 0)),n===c()?a[r]=c(a[r]):Array.isArray(a[r])?o&&s&&i?a[r]=m["flatten-duplicate-arrays"]?a[r].concat(n):(Array.isArray(a[r][0])?a[r]:[a[r]]).concat([n]):o||Boolean(s)!==Boolean(i)?a[r]=a[r].concat([n]):a[r]=n:void 0===a[r]&&s?a[r]=i?n:[n]:!o||void 0===a[r]||q(r,E.counts)||q(r,E.bools)?a[r]=n:a[r]=[a[r],n]}function q(e,t){const n=[].concat(E.aliases[e]||[],e),a=Object.keys(t),r=n.find((e=>a.includes(e)));return!!r&&t[r]}function U(e){const t=Object.keys(E);return[].concat(t.map((e=>E[e]))).some((function(t){return Array.isArray(t)?t.includes(e):t[e]}))}function V(e){return m["unknown-options-as-args"]&&function(e){return!(e=e.replace(/^-{3,}/,"--")).match(x)&&(!function(e){if(e.match(x)||!e.match(/^-[^-]+/))return!1;let t,n=!0;const a=e.slice(1).split("");for(let r=0;r<a.length;r++){if(t=e.slice(r+2),!U(a[r])){n=!1;break}if(a[r+1]&&"="===a[r+1]||"-"===t||/[A-Za-z]/.test(a[r])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(t)||a[r+1]&&a[r+1].match(/\W/))break}return n}(e)&&!function(e,...t){return[].concat(...t).some((function(t){const n=e.match(t);return n&&U(n[1])}))}(e,/^-+([^=]+?)=[\s\S]*$/,S,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/))}(e)}function z(e){return q(e,E.bools)||q(e,E.counts)||!(`${e}`in h)?(t=function(e){let t=a.BOOLEAN;return q(e,E.strings)?t=a.STRING:q(e,E.numbers)?t=a.NUMBER:q(e,E.bools)?t=a.BOOLEAN:q(e,E.arrays)&&(t=a.ARRAY),t}(e),{[a.BOOLEAN]:!0,[a.STRING]:"",[a.NUMBER]:void 0,[a.ARRAY]:[]}[t]):h[e];var t}function Z(e){return void 0===e}return M(w,!0),M(w,!1),function(e){const t=Object.create(null);D(t,E.aliases,h),Object.keys(E.configs).forEach((function(n){const a=e[n]||t[n];if(a)try{let e=null;const t=u.resolve(u.cwd(),a),r=E.configs[n];if("function"==typeof r){try{e=r(t)}catch(t){e=t}if(e instanceof Error)return void(A=e)}else e=u.require(t);j(e)}catch(t){"PermissionDenied"===t.name?A=t:e[n]&&(A=Error(_("Invalid JSON config file: %s",a)))}}))}(w),void 0!==f&&f.forEach((function(e){j(e)})),D(w,E.aliases,h,!0),function(e){let t;const n=new Set;Object.keys(e).forEach((function(a){if(!n.has(a)&&(t=q(a,E.coercions),"function"==typeof t))try{const r=L(a,t(e[a]));[].concat(E.aliases[a]||[],a).forEach((t=>{n.add(t),e[t]=r}))}catch(e){A=e}}))}(w),m["set-placeholder-key"]&&function(e){E.keys.forEach((t=>{~t.indexOf(".")||void 0===e[t]&&(e[t]=void 0)}))}(w),Object.keys(E.counts).forEach((function(e){Y(w,e.split("."))||R(e,0)})),g&&I.length&&(w[y]=[]),I.forEach((function(e){w[y].push(e)})),m["camel-case-expansion"]&&m["strip-dashed"]&&Object.keys(w).filter((e=>"--"!==e&&e.includes("-"))).forEach((e=>{delete w[e]})),m["strip-aliased"]&&[].concat(...Object.keys(d).map((e=>d[e]))).forEach((e=>{m["camel-case-expansion"]&&e.includes("-")&&delete w[e.split(".").map((e=>i(e))).join(".")],delete w[e]})),{aliases:Object.assign({},E.aliases),argv:Object.assign(T,w),configuration:m,defaulted:Object.assign({},b),error:A,newAliases:Object.assign({},$)}}}({cwd:v.cwd,env:()=>$,format:r.format,normalize:s.normalize,resolve:s.resolve,require:e=>{if("undefined"!=typeof require)return require(e);if(e.match(/\.json$/))return JSON.parse((0,f.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),_=function(e,t){return b.parse(e.slice(),t).argv};_.detailed=function(e,t){return b.parse(e.slice(),t)},_.camelCase=i,_.decamelize=o,_.looksLikeNumber=l},25522:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:s}=n(66078),i=n(49764),o=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],p=t.t={};let d=0;const m="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[m,r]],f=(e,t,n)=>{const a=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=d++;i(e,r,t),p[e]=r,u[r]=t,c[r]=a,o[r]=new RegExp(t,n?"g":void 0),l[r]=new RegExp(a,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),f("MAINVERSION",`(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${u[p.PRERELEASEIDENTIFIER]}(?:\\.${u[p.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${u[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[p.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${m}+`),f("BUILD",`(?:\\+(${u[p.BUILDIDENTIFIER]}(?:\\.${u[p.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${u[p.MAINVERSION]}${u[p.PRERELEASE]}?${u[p.BUILD]}?`),f("FULL",`^${u[p.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${u[p.MAINVERSIONLOOSE]}${u[p.PRERELEASELOOSE]}?${u[p.BUILD]}?`),f("LOOSE",`^${u[p.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${u[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${u[p.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:${u[p.PRERELEASE]})?${u[p.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:${u[p.PRERELEASELOOSE]})?${u[p.BUILD]}?)?)?`),f("XRANGE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),f("COERCE",`${u[p.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",u[p.COERCEPLAIN]+`(?:${u[p.PRERELEASE]})?`+`(?:${u[p.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",u[p.COERCE],!0),f("COERCERTLFULL",u[p.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${u[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${u[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${u[p.LONECARET]}${u[p.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${u[p.LONECARET]}${u[p.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${u[p.GTLT]}\\s*(${u[p.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]}|${u[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${u[p.XRANGEPLAIN]})\\s+-\\s+(${u[p.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${u[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[p.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},25530:(e,t,n)=>{n.d(t,{MU:()=>s,Nw:()=>r,rd:()=>i});var a=n(84591);a.ACCUMULATORS,a.ADL,a.ANY_COLLECTION_NAMESPACE,a.ANY_NAMESPACE,a.ATLAS;const r=a.ATLAS_SEARCH_TEMPLATES,s=a.ATLAS_VECTOR_SEARCH_TEMPLATE,i=(a.BSON_TYPES,a.BSON_TYPE_ALIASES,a.COLLECTION,a.CONVERSION_OPERATORS,a.DATABASE,a.ENVS,a.EXPRESSION_OPERATORS,a.FULL_SCAN_STAGES,a.JSON_SCHEMA,a.ON_PREM,a.OUT_STAGES,a.QUERY_OPERATORS,a.REQUIRED_AS_FIRST_STAGE,a.STAGE_OPERATORS,a.STAGE_OPERATOR_NAMES,a.SYSTEM_VARIABLES,a.TIME_SERIES,a.VALIDATION_TEMPLATE,a.VIEW,a.VIEW_PIPELINE_UTILS);a.getFilteredCompletions,a.wrapField},25546:(e,t,n)=>{const a=n(66283),r=n(38366),s=n(61607);e.exports=(e,t)=>{e=new r(e,t);let n=new a("0.0.0");if(e.test(n))return n;if(n=new a("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new a(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!s(n,i)||(n=i)}return n&&e.test(n)?n:null}},25583:(e,t,n)=>{const a=n(88825);e.exports=(e,t,n)=>new a(e,n).compare(new a(t,n))},25812:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>0!==a(e,t,n)},26518:(e,t,n)=>{n.d(t,{fd:()=>s,rs:()=>a}),Symbol("ZodOutput"),Symbol("ZodInput");class a{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function r(){return new a}const s=r()},26620:(e,t,n)=>{const a=n(25583);e.exports=(e,t,n)=>0===a(e,t,n)},26633:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENVS=t.ON_PREM=t.ADL=t.ATLAS=void 0;const n="atlas";t.ATLAS=n,t.ADL="adl";const a="on-prem";t.ON_PREM=a;const r=[n,"adl",a];t.ENVS=r},27195:(e,t,n)=>{var a=n(40811),r=Object.prototype.hasOwnProperty,s=Object.prototype.toString;e.exports=new a("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,a,i,o,l=[],u=e;for(t=0,n=u.length;t<n;t+=1){if(a=u[t],o=!1,"[object Object]"!==s.call(a))return!1;for(i in a)if(r.call(a,i)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==l.indexOf(i))return!1;l.push(i)}return!0},construct:function(e){return null!==e?e:[]}})},27225:(e,t,n)=>{const a=n(44455);e.exports=(e,t)=>e.sort(((e,n)=>a(e,n,t)))},27699:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_CONSTANTS=void 0,t.createConstantFilter=f,t.wrapField=function(e,t=!1){return t||!function(e){if(/[.\s"'()[\];={}:]/.test(e))return!1;try{return new Function(`"use strict";let _ = { ${e}: 0 };`),!0}catch{return!1}}(e)?`"${e.replace(/["\\]/g,"\\$&")}"`:e},t.getFilteredCompletions=function(e={},n=t.ALL_CONSTANTS){const{serverVersion:a=m,fields:r=[],meta:s,stage:i}=e,o=f({serverVersion:a,meta:s,stage:i});return n.concat(r.flatMap((e=>{const{value:t,description:n}=function(e){return"string"==typeof e?{value:e}:{value:e.name,description:e.description}}(e);return[{value:t,meta:"field:identifier",version:"0.0.0",description:n},{value:`$${t}`,meta:"field:reference",version:"0.0.0",description:n}]}))).filter((e=>o(e)))};const a=n(88769),r=n(98582),s=n(66529),i=n(24087),o=n(47501),l=n(96651),u=n(54395),c=n(11233),p=n(40727),d=n(82660);t.ALL_CONSTANTS=[...r.ACCUMULATORS,...i.BSON_TYPES,...s.BSON_TYPE_ALIASES,...o.CONVERSION_OPERATORS,...l.EXPRESSION_OPERATORS,...u.JSON_SCHEMA,...c.QUERY_OPERATORS,...p.STAGE_OPERATORS,...d.SYSTEM_VARIABLES];const m="999.999.999";function h(e,t){return void 0===e||void 0===t||(e=Array.isArray(e)?e:[e]).some((e=>t.includes(e)))}function f({meta:e,serverVersion:t=m,stage:n={}}={}){const r=/^(?<version>\d+\.\d+\.\d+)/.exec(t)?.groups?.version??m;return({version:t,meta:s,env:i,namespaces:o,apiVersions:l})=>function(e,t){const n=/^\d+\.\d+\.\d+$/.test(t);return(0,a.satisfies)(e,n?`>=${t}`:t)}(r,t)&&h(n.env,i)&&h(n.namespace,o)&&h(n.apiVersion,l)&&(!e||function(e,t){const n=t.split(":");return e.some((e=>{const t=e.split(":");return t.length===n.length&&t.every(((e,t)=>"*"===e||e===n[t]))}))}(e,s))}},27750:(e,t,n)=>{n.d(t,{Od:()=>l,Rb:()=>o,Tj:()=>i,bp:()=>p,wG:()=>c,xL:()=>u});var a=n(36710),r=n(77926),s=n(87257);const i=e=>(t,n,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},o);if(l instanceof Promise)throw new a.GT;if(l.issues.length){const t=new(i?.Err??e)(l.issues.map((e=>s.iR(e,o,a.$W()))));throw s.gx(t,i?.callee),t}return l.value},o=(r.Kd,e=>async(t,n,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},o);if(l instanceof Promise&&(l=await l),l.issues.length){const t=new(i?.Err??e)(l.issues.map((e=>s.iR(e,o,a.$W()))));throw s.gx(t,i?.callee),t}return l.value}),l=(r.Kd,e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},l=t._zod.run({value:n,issues:[]},o);if(l instanceof Promise)throw new a.GT;return l.issues.length?{success:!1,error:new(e??r.a$)(l.issues.map((e=>s.iR(e,o,a.$W()))))}:{success:!0,data:l.value}}),u=l(r.Kd),c=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map((e=>s.iR(e,i,a.$W()))))}:{success:!0,data:o.value}},p=c(r.Kd)},27995:(e,t,n)=>{const a=n(20360);e.exports=(e,t,n)=>(e=new a(e,n),t=new a(t,n),e.intersects(t,n))},28131:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QUERY_OPERATORS=void 0,t.QUERY_OPERATORS=[{name:"$all",value:"$all",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$and",value:"$and",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$bitsAllClear",value:"$bitsAllClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAllSet",value:"$bitsAllSet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnyClear",value:"$bitsAnyClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnySet",value:"$bitsAnySet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$comment",value:"$comment",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$elemMatch",value:"$elemMatch",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$eq",value:"$eq",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$exists",value:"$exists",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$expr",value:"$expr",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$geoIntersects",value:"$geoIntersects",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$geoWithin",value:"$geoWithin",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$gt",value:"$gt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$gte",value:"$gte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$in",value:"$in",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$jsonSchema",value:"$jsonSchema",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$lt",value:"$lt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$lte",value:"$lte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$mod",value:"$mod",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$ne",value:"$ne",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$near",value:"$near",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nearSphere",value:"$nearSphere",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nin",value:"$nin",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$not",value:"$not",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$nor",value:"$nor",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$or",value:"$or",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$regex",value:"$regex",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$size",value:"$size",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$slice",value:"$slice",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$text",value:"$text",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$type",value:"$type",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$where",value:"$where",score:1,meta:"query",version:"2.2.0",geospatial:!1}]},28141:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>a(e,t,n)<0},28553:(e,t,n)=>{const a=n(67338),r=n(70692);e.exports=(e,t,n)=>{const s=[];let i=null,o=null;const l=e.sort(((e,t)=>r(e,t,n)));for(const e of l)a(e,t,n)?(o=e,i||(i=e)):(o&&s.push([i,o]),o=null,i=null);i&&s.push([i,null]);const u=[];for(const[e,t]of s)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const c=u.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return c.length<p.length?c:t}},28742:e=>{var t={};e.exports=function(e,n){var a=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(n)}},28830:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CommaAndColonSeparatedRecord=t.ConnectionString=t.redactConnectionString=void 0;const a=n(9606),r=n(32901);Object.defineProperty(t,"redactConnectionString",{enumerable:!0,get:function(){return r.redactConnectionString}});const s="__this_is_a_placeholder__",i=/^(?<protocol>[^/]+):\/\/(?:(?<username>[^:@]*)(?::(?<password>[^@]*))?@)?(?<hosts>(?!:)[^/?@]*)(?<rest>.*)/;class o extends Map{delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}_normalizeKey(e){e=`${e}`;for(const t of this.keys())if(t.toLowerCase()===e.toLowerCase()){e=t;break}return e}}class l extends a.URL{}class u extends Error{get name(){return"MongoParseError"}}class c extends l{constructor(e,t={}){var n;const{looseValidation:a}=t;if(!a&&!(r=e).startsWith("mongodb://")&&!r.startsWith("mongodb+srv://"))throw new u('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');var r;const l=e.match(i);if(!l)throw new u(`Invalid connection string "${e}"`);const{protocol:p,username:d,password:m,hosts:h,rest:f}=null!==(n=l.groups)&&void 0!==n?n:{};if(!a){if(!p||!h)throw new u(`Protocol and host list are required in "${e}"`);try{decodeURIComponent(null!=d?d:""),decodeURIComponent(null!=m?m:"")}catch(e){throw new u(e.message)}const t=/[:/?#[\]@]/gi;if(null==d?void 0:d.match(t))throw new u(`Username contains unescaped characters ${d}`);if(!d||!m){const t=e.replace(`${p}://`,"");if(t.startsWith("@")||t.startsWith(":"))throw new u("URI contained empty userinfo section")}if(null==m?void 0:m.match(t))throw new u("Password contains unescaped characters")}let v="";"string"==typeof d&&(v+=d),"string"==typeof m&&(v+=`:${m}`),v&&(v+="@");try{super(`${p.toLowerCase()}://${v}${s}${f}`)}catch(n){throw a&&new c(e,{...t,looseValidation:!1}),"string"==typeof n.message&&(n.message=n.message.replace(s,h)),n}if(this._hosts=h.split(","),!a){if(this.isSRV&&1!==this.hosts.length)throw new u("mongodb+srv URI cannot have multiple service names");if(this.isSRV&&this.hosts.some((e=>e.includes(":"))))throw new u("mongodb+srv URI cannot have port number")}var g;this.pathname||(this.pathname="/"),Object.setPrototypeOf(this.searchParams,(g=this.searchParams.constructor,class extends g{append(e,t){return super.append(this._normalizeKey(e),t)}delete(e){return super.delete(this._normalizeKey(e))}get(e){return super.get(this._normalizeKey(e))}getAll(e){return super.getAll(this._normalizeKey(e))}has(e){return super.has(this._normalizeKey(e))}set(e,t){return super.set(this._normalizeKey(e),t)}keys(){return super.keys()}values(){return super.values()}entries(){return super.entries()}[Symbol.iterator](){return super[Symbol.iterator]()}_normalizeKey(e){return o.prototype._normalizeKey.call(this,e)}}).prototype)}get host(){return s}set host(e){throw new Error("No single host for connection string")}get hostname(){return s}set hostname(e){throw new Error("No single host for connection string")}get port(){return""}set port(e){throw new Error("No single host for connection string")}get href(){return this.toString()}set href(e){throw new Error("Cannot set href for connection strings")}get isSRV(){return this.protocol.includes("srv")}get hosts(){return this._hosts}set hosts(e){this._hosts=e}toString(){return super.toString().replace(s,this.hosts.join(","))}clone(){return new c(this.toString(),{looseValidation:!0})}redact(e){return(0,r.redactValidConnectionString)(this,e)}typedSearchParams(){return this.searchParams}[Symbol.for("nodejs.util.inspect.custom")](){const{href:e,origin:t,protocol:n,username:a,password:r,hosts:s,pathname:i,search:o,searchParams:l,hash:u}=this;return{href:e,origin:t,protocol:n,username:a,password:r,hosts:s,pathname:i,search:o,searchParams:l,hash:u}}}t.ConnectionString=c,t.CommaAndColonSeparatedRecord=class extends o{constructor(e){super();for(const t of(null!=e?e:"").split(",")){if(!t)continue;const e=t.indexOf(":");-1===e?this.set(t,""):this.set(t.slice(0,e),t.slice(e+1))}}toString(){return[...this].map((e=>e.join(":"))).join(",")}},t.default=c},28892:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},28968:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QUERY_OPERATORS=void 0,t.QUERY_OPERATORS=[{name:"$all",value:"$all",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$and",value:"$and",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$bitsAllClear",value:"$bitsAllClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAllSet",value:"$bitsAllSet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnyClear",value:"$bitsAnyClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnySet",value:"$bitsAnySet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$comment",value:"$comment",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$elemMatch",value:"$elemMatch",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$eq",value:"$eq",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$exists",value:"$exists",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$expr",value:"$expr",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$geoIntersects",value:"$geoIntersects",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$geoWithin",value:"$geoWithin",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$gt",value:"$gt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$gte",value:"$gte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$in",value:"$in",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$jsonSchema",value:"$jsonSchema",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$lt",value:"$lt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$lte",value:"$lte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$mod",value:"$mod",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$ne",value:"$ne",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$near",value:"$near",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nearSphere",value:"$nearSphere",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nin",value:"$nin",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$not",value:"$not",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$nor",value:"$nor",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$or",value:"$or",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$regex",value:"$regex",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$size",value:"$size",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$slice",value:"$slice",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$text",value:"$text",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$type",value:"$type",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$where",value:"$where",score:1,meta:"query",version:"2.2.0",geospatial:!1}]},29014:(e,t,n)=>{n.d(t,{Zt:()=>r});var a=n(24625);a.ACCUMULATORS,a.ADL,a.ANY_COLLECTION_NAMESPACE,a.ANY_NAMESPACE,a.ATLAS,a.ATLAS_SEARCH_TEMPLATES,a.ATLAS_VECTOR_SEARCH_TEMPLATE,a.BSON_TYPES,a.BSON_TYPE_ALIASES,a.COLLECTION,a.CONVERSION_OPERATORS,a.DATABASE,a.ENVS,a.EXPRESSION_OPERATORS,a.FULL_SCAN_STAGES,a.JSON_SCHEMA,a.ON_PREM,a.OUT_STAGES,a.QUERY_OPERATORS,a.REQUIRED_AS_FIRST_STAGE,a.STAGE_OPERATORS,a.STAGE_OPERATOR_NAMES,a.SYSTEM_VARIABLES,a.TIME_SERIES,a.VALIDATION_TEMPLATE,a.VIEW,a.VIEW_PIPELINE_UTILS,a.getFilteredCompletions;const r=a.wrapField},29087:(e,t,n)=>{const a=n(50066),r=n(72857),s=n(18106);e.exports=(e,t)=>{e=new r(e,t);let n=new a("0.0.0");if(e.test(n))return n;if(n=new a("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new a(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!s(n,i)||(n=i)}return n&&e.test(n)?n:null}},29299:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapField=t.getFilteredCompletions=void 0,r(n(3012),t),r(n(91871),t),r(n(77973),t),r(n(80003),t),r(n(1276),t),r(n(30797),t),r(n(17497),t),r(n(39560),t),r(n(60679),t),r(n(99625),t),r(n(71174),t),r(n(17555),t);var s=n(8117);Object.defineProperty(t,"getFilteredCompletions",{enumerable:!0,get:function(){return s.getFilteredCompletions}}),Object.defineProperty(t,"wrapField",{enumerable:!0,get:function(){return s.wrapField}}),r(n(33907),t),r(n(95153),t)},29385:(e,t,n)=>{var a=n(65994).e;const r="object"==typeof a&&a.env&&a.env.NODE_DEBUG&&/\bsemver\b/i.test(a.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},29478:(e,t,n)=>{const a=n(88825);e.exports=(e,t)=>new a(e,t).patch},29520:(e,t,n)=>{var a=n(69316),r=n(76462);function s(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}e.exports.Type=n(40811),e.exports.Schema=n(54420),e.exports.FAILSAFE_SCHEMA=n(91714),e.exports.JSON_SCHEMA=n(15037),e.exports.CORE_SCHEMA=n(6340),e.exports.DEFAULT_SAFE_SCHEMA=n(18184),e.exports.DEFAULT_FULL_SCHEMA=n(57116),e.exports.load=a.load,e.exports.loadAll=a.loadAll,e.exports.safeLoad=a.safeLoad,e.exports.safeLoadAll=a.safeLoadAll,e.exports.dump=r.dump,e.exports.safeDump=r.safeDump,e.exports.YAMLException=n(4414),e.exports.MINIMAL_SCHEMA=n(91714),e.exports.SAFE_SCHEMA=n(18184),e.exports.DEFAULT_SCHEMA=n(57116),e.exports.scan=s("scan"),e.exports.parse=s("parse"),e.exports.compose=s("compose"),e.exports.addConstructor=s("addConstructor")},30044:(e,t,n)=>{const a=n(34219);e.exports=(e,t)=>{const n=a(e,t);return n&&n.prerelease.length?n.prerelease:null}},30403:(e,t,n)=>{const a=n(83586);e.exports=(e,t)=>{const n=a(e,t);return n&&n.prerelease.length?n.prerelease:null}},30452:(e,t,n)=>{const a=n(9350);e.exports=(e,t)=>new a(e,t).minor},30629:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_VARIABLES=void 0,t.SYSTEM_VARIABLES=[{name:"$$NOW",value:"$$NOW",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current datetime value. NOW returns the same value for all members of the deployment and remains the same throughout all stages of the aggregation pipeline."},{name:"$$CLUSTER_TIME",value:"$$CLUSTER_TIME",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current timestamp value. CLUSTER_TIME is only available on replica sets and sharded clusters. CLUSTER_TIME returns the same value for all members of the deployment and remains the same throughout all stages of the pipeline."},{name:"$$ROOT",value:"$$ROOT",score:1,meta:"variable:system",version:"2.4.0",description:"References the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage."},{name:"$$CURRENT",value:"$$CURRENT",score:1,meta:"variable:system",version:"2.4.0",description:"References the start of the field path being processed in the aggregation pipeline stage. Unless documented otherwise, all stages start with CURRENT the same as ROOT. CURRENT is modifiable. However, since `$<field>` is equivalent to `$$CURRENT.<field>`, rebinding CURRENT changes the meaning of `$` accesses."},{name:"$$REMOVE",value:"$$REMOVE",score:1,meta:"variable:system",version:"3.6.0",description:"A variable which evaluates to the missing value. Allows for the conditional exclusion of fields. In a `$project`, a field set to the variable REMOVE is excluded from the output."},{name:"$$DESCEND",value:"$$DESCEND",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$PRUNE",value:"$$PRUNE",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$KEEP",value:"$$KEEP",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$SEARCH_META",value:"$$SEARCH_META",score:1,meta:"variable:system",version:"5.0.0",description:"A variable that stores the metadata results of an Atlas Search query. In all supported aggregation pipeline stages, a field set to the variable SEARCH_META returns the metadata results for the query. For an example of its usage, see Atlas Search facet and count."},{name:"$$USER_ROLES",value:"$$USER_ROLES",score:1,meta:"variable:system",version:"7.0.0",description:"A variable that stores the role names of the authenticated user running the command."}]},30797:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EXPRESSION_OPERATORS=void 0,t.EXPRESSION_OPERATORS=[{name:"$abs",value:"$abs",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$accumulator",value:"$accumulator",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$add",value:"$add",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$allElementsTrue",value:"$allElementsTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$and",value:"$and",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$anyElementTrue",value:"$anyElementTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$arrayElemAt",value:"$arrayElemAt",score:1,meta:"expr:array",version:"3.2.0"},{name:"$arrayToObject",value:"$arrayToObject",score:1,meta:"expr:array",version:"3.4.4"},{name:"$binarySize",value:"$binarySize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$bsonSize",value:"$bsonSize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$ceil",value:"$ceil",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$cmp",value:"$cmp",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$concat",value:"$concat",score:1,meta:"expr:string",version:"2.4.0"},{name:"$concatArrays",value:"$concatArrays",score:1,meta:"expr:array",version:"3.2.0"},{name:"$cond",value:"$cond",score:1,meta:"expr:cond",version:"2.6.0"},{name:"$dateAdd",value:"$dateAdd",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateDiff",value:"$dateDiff",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateFromParts",value:"$dateFromParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateFromString",value:"$dateFromString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateSubtract",value:"$dateSubtract",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateToParts",value:"$dateToParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateTrunc",value:"$dateTrunc",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dayOfMonth",value:"$dayOfMonth",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfWeek",value:"$dayOfWeek",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfYear",value:"$dayOfYear",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.0.0"},{name:"$divide",value:"$divide",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$eq",value:"$eq",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$exp",value:"$exp",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$filter",value:"$filter",score:1,meta:"expr:array",version:"3.2.0"},{name:"$first",value:"$first",score:1,meta:"expr:array",version:"4.4.0"},{name:"$floor",value:"$floor",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$function",value:"$function",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$getField",value:"$getField",score:1,meta:"expr:get",version:"5.0.0"},{name:"$gt",value:"$gt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$gte",value:"$gte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$hour",value:"$hour",score:1,meta:"expr:date",version:"2.2.0"},{name:"$ifNull",value:"$ifNull",score:1,meta:"expr:cond",version:"2.2.0"},{name:"$in",value:"$in",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfArray",value:"$indexOfArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfBytes",value:"$indexOfBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$indexOfCP",value:"$indexOfCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$isArray",value:"$isArray",score:1,meta:"expr:array",version:"3.2.0"},{name:"$isNumber",value:"$isNumber",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$isoDayOfWeek",value:"$isoDayOfWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeek",value:"$isoWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeekYear",value:"$isoWeekYear",score:1,meta:"expr:date",version:"3.4.0"},{name:"$last",value:"$last",score:1,meta:"expr:array",version:"4.4.0"},{name:"$let",value:"$let",score:1,meta:"expr:var",version:"2.6.0"},{name:"$literal",value:"$literal",score:1,meta:"expr:literal",version:"2.6.0"},{name:"$lt",value:"$lt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$lt",value:"$lte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$ln",value:"$ln",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log",value:"$log",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log10",value:"$log10",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$map",value:"$map",score:1,meta:"expr:array",version:"2.6.0"},{name:"$mergeObjects",value:"$mergeObjects",score:1,meta:"expr:obj",version:"3.6.0"},{name:"$meta",value:"$meta",score:1,meta:"expr:text",version:"2.6.0"},{name:"$millisecond",value:"$millisecond",score:1,meta:"expr:date",version:"2.4.0"},{name:"$minute",value:"$minute",score:1,meta:"expr:date",version:"2.2.0"},{name:"$mod",value:"$mod",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$month",value:"$month",score:1,meta:"expr:date",version:"2.2.0"},{name:"$multiply",value:"$multiply",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$new",value:"$new",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$not",value:"$not",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$objectToArray",value:"$objectToArray",score:1,meta:"expr:array",version:"3.4.4"},{name:"$or",value:"$or",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$pow",value:"$pow",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$range",value:"$range",score:1,meta:"expr:array",version:"3.4.0"},{name:"$reduce",value:"$reduce",score:1,meta:"expr:array",version:"3.4.0"},{name:"$regexFind",value:"$regexFind",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexFindAll",value:"$regexFindAll",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexMatch",value:"$regexMatch",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$replaceAll",value:"$replaceAll",score:1,meta:"expr:string",version:"4.4.0"},{name:"$replaceOne",value:"$replaceOne",score:1,meta:"expr:string",version:"4.4.0"},{name:"$reverseArray",value:"$reverseArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$second",value:"$second",score:1,meta:"expr:date",version:"2.2.0"},{name:"$setDifference",value:"$setDifference",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setEquals",value:"$setEquals",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIntersection",value:"$setIntersection",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIsSubset",value:"$setIsSubset",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setUnion",value:"$setUnion",score:1,meta:"expr:set",version:"2.6.0"},{name:"$similarityCosine",value:"$similarityCosine",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityDotProduct",value:"$similarityDotProduct",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityEuclidean",value:"$similarityEuclidean",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$size",value:"$size",score:1,meta:"expr:array",version:"2.6.0"},{name:"$slice",value:"$slice",score:1,meta:"expr:array",version:"3.2.0"},{name:"$sortArray",value:"$sortArray",score:1,meta:"expr:array",version:"5.2.0"},{name:"$split",value:"$split",score:1,meta:"expr:string",version:"3.4.0"},{name:"$sqrt",value:"$sqrt",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$strcasecmp",value:"$strcasecmp",score:1,meta:"expr:string",version:"2.2.0"},{name:"$strLenBytes",value:"$strLenBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$strLenCP",value:"$strLenCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substr",value:"$substr",score:1,meta:"expr:string",version:"2.2.0",deprecated:"3.4.0",replacement:"$substrBytes"},{name:"$substrBytes",value:"$substrBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substrCP",value:"$substrCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$subtract",value:"$subtract",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$switch",value:"$switch",score:1,meta:"expr:cond",version:"3.4.0"},{name:"$toHashedIndexKey",value:"$toHashedIndexKey",score:1,meta:"expr:arith",version:"4.2.24"},{name:"$toLower",value:"$toLower",score:1,meta:"expr:string",version:"2.2.0"},{name:"$toUpper",value:"$toUpper",score:1,meta:"expr:string",version:"2.2.0"},{name:"$tsSecond",value:"$tsSecond",score:1,meta:"expr:date",version:"5.1.0"},{name:"$tsIncrement",value:"$tsIncrement",score:1,meta:"expr:date",version:"5.1.0"},{name:"$trunc",value:"$trunc",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$type",value:"$type",score:1,meta:"expr:type",version:"3.4.0"},{name:"$week",value:"$week",score:1,meta:"expr:date",version:"2.2.0"},{name:"$year",value:"$year",score:1,meta:"expr:date",version:"2.2.0"},{name:"$zip",value:"$zip",score:1,meta:"expr:array",version:"3.4.0"},{name:"$bitAnd",value:"$bitAnd",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitOr",value:"$bitOr",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitXor",value:"$bitXor",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitNot",value:"$bitNot",score:1,meta:"expr:bit",version:"7.0.0"}]},31145:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},32056:(e,t,n)=>{const a=n(25583);e.exports=(e,t,n)=>0!==a(e,t,n)},32654:(e,t,n)=>{const a=n(38366);e.exports=(e,t)=>new a(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},32674:(e,t,n)=>{const a=n(50066);e.exports=(e,t,n)=>new a(e,n).compare(new a(t,n))},32901:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.redactConnectionString=t.redactValidConnectionString=void 0;const i=s(n(28830));t.redactValidConnectionString=function(e,t){var n,a;const r=e.clone(),s=null!==(n=null==t?void 0:t.replacementString)&&void 0!==n?n:"_credentials_",o=null===(a=null==t?void 0:t.redactUsernames)||void 0===a||a;if((r.username||r.password)&&o?(r.username=s,r.password=""):r.password&&(r.password=s),r.searchParams.has("authMechanismProperties")){const e=new i.CommaAndColonSeparatedRecord(r.searchParams.get("authMechanismProperties"));e.get("AWS_SESSION_TOKEN")&&(e.set("AWS_SESSION_TOKEN",s),r.searchParams.set("authMechanismProperties",e.toString()))}return r.searchParams.has("tlsCertificateKeyFilePassword")&&r.searchParams.set("tlsCertificateKeyFilePassword",s),r.searchParams.has("proxyUsername")&&o&&r.searchParams.set("proxyUsername",s),r.searchParams.has("proxyPassword")&&r.searchParams.set("proxyPassword",s),r},t.redactConnectionString=function(e,t){var n,a;const r=null!==(n=null==t?void 0:t.replacementString)&&void 0!==n?n:"<credentials>",s=null===(a=null==t?void 0:t.redactUsernames)||void 0===a||a;let o;try{o=new i.default(e)}catch(e){}if(o)return t={...t,replacementString:"___credentials___"},o.redact(t).toString().replace(/___credentials___/g,r);const l=r,u=[e=>e.replace(s?/(\/\/)(.*)(@)/g:/(\/\/[^@]*:)(.*)(@)/g,`$1${l}$3`),e=>e.replace(/(AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi,`$1${l}`),e=>e.replace(/(tlsCertificateKeyFilePassword=)([^&]+)/gi,`$1${l}`),e=>s?e.replace(/(proxyUsername=)([^&]+)/gi,`$1${l}`):e,e=>e.replace(/(proxyPassword=)([^&]+)/gi,`$1${l}`)];for(const t of u)e=t(e);return e}},32910:(e,t,n)=>{const a=n(48381),r=n(55141),{ANY:s}=r,i=n(20332),o=n(43301),l=n(58809),u=n(20038),c=n(66239),p=n(54506);e.exports=(e,t,n,d)=>{let m,h,f,v,g;switch(e=new a(e,d),t=new i(t,d),n){case">":m=l,h=c,f=u,v=">",g=">=";break;case"<":m=u,h=p,f=l,v="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){const a=t.set[n];let i=null,o=null;if(a.forEach((e=>{e.semver===s&&(e=new r(">=0.0.0")),i=i||e,o=o||e,m(e.semver,i.semver,d)?i=e:f(e.semver,o.semver,d)&&(o=e)})),i.operator===v||i.operator===g)return!1;if((!o.operator||o.operator===v)&&h(e,o.semver))return!1;if(o.operator===g&&f(e,o.semver))return!1}return!0}},32924:(e,t,n)=>{const a=n(41694);e.exports=(e,t)=>new a(e,t).minor},32939:(e,t,n)=>{const a=n(66283);e.exports=(e,t)=>new a(e,t).minor},33629:(e,t,n)=>{const a=/\s+/g;class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(a," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&v))+":"+e,n=s.get(t);if(n)return n;const a=this.options.loose,r=a?c[p.HYPHENRANGELOOSE]:c[p.HYPHENRANGE];e=e.replace(r,O(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(c[p.COMPARATORTRIM],d),l("comparator trim",e),e=e.replace(c[p.TILDETRIM],m),l("tilde trim",e),e=e.replace(c[p.CARETTRIM],h),l("caret trim",e);let i=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>N(e,this.options)));a&&(i=i.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(c[p.COMPARATORLOOSE]))))),l("range list",i);const u=new Map,y=i.map((e=>new o(e,this.options)));for(const e of y){if(g(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");const $=[...u.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>$(n,t)&&e.set.some((e=>$(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const s=new(n(92660)),i=n(34773),o=n(96506),l=n(52378),u=n(9350),{safeRe:c,t:p,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:h}=n(68752),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:v}=n(28892),g=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,$=(e,t)=>{let n=!0;const a=e.slice();let r=a.pop();for(;n&&a.length;)n=a.every((e=>r.intersects(e,t))),r=a.pop();return n},b=(e,t)=>(l("comp",e,t),e=S(e,t),l("caret",e),e=E(e,t),l("tildes",e),e=I(e,t),l("xrange",e),e=T(e,t),l("stars",e),e),_=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{const n=t.loose?c[p.TILDELOOSE]:c[p.TILDE];return e.replace(n,((t,n,a,r,s)=>{let i;return l("tilde",e,t,n,a,r,s),_(n)?i="":_(a)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:_(r)?i=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:s?(l("replaceTilde pr",s),i=`>=${n}.${a}.${r}-${s} <${n}.${+a+1}.0-0`):i=`>=${n}.${a}.${r} <${n}.${+a+1}.0-0`,l("tilde return",i),i}))},S=(e,t)=>e.trim().split(/\s+/).map((e=>A(e,t))).join(" "),A=(e,t)=>{l("caret",e,t);const n=t.loose?c[p.CARETLOOSE]:c[p.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,((t,n,r,s,i)=>{let o;return l("caret",e,t,n,r,s,i),_(n)?o="":_(r)?o=`>=${n}.0.0${a} <${+n+1}.0.0-0`:_(s)?o="0"===n?`>=${n}.${r}.0${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${a} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),o="0"===n?"0"===r?`>=${n}.${r}.${s}-${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${i} <${+n+1}.0.0-0`):(l("no pr"),o="0"===n?"0"===r?`>=${n}.${r}.${s}${a} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),l("caret return",o),o}))},I=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();const n=t.loose?c[p.XRANGELOOSE]:c[p.XRANGE];return e.replace(n,((n,a,r,s,i,o)=>{l("xRange",e,n,a,r,s,i,o);const u=_(r),c=u||_(s),p=c||_(i),d=p;return"="===a&&d&&(a=""),o=t.includePrerelease?"-0":"",u?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&d?(c&&(s=0),i=0,">"===a?(a=">=",c?(r=+r+1,s=0,i=0):(s=+s+1,i=0)):"<="===a&&(a="<",c?r=+r+1:s=+s+1),"<"===a&&(o="-0"),n=`${a+r}.${s}.${i}${o}`):c?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:p&&(n=`>=${r}.${s}.0${o} <${r}.${+s+1}.0-0`),l("xRange return",n),n}))},T=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[p.STAR],"")),N=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),O=e=>(t,n,a,r,s,i,o,l,u,c,p,d)=>`${n=_(a)?"":_(r)?`>=${a}.0.0${e?"-0":""}`:_(s)?`>=${a}.${r}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=_(u)?"":_(c)?`<${+u+1}.0.0-0`:_(p)?`<${u}.${+c+1}.0-0`:d?`<=${u}.${c}.${p}-${d}`:e?`<${u}.${c}.${+p+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const a=e[n].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},33907:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ATLAS_VECTOR_SEARCH_TEMPLATE=t.ATLAS_SEARCH_TEMPLATES=void 0,t.ATLAS_SEARCH_TEMPLATES=[{name:"Dynamic field mappings",snippet:'{\n "mappings": {\n "dynamic": true\n }\n}',version:"4.4.0"},{name:"Static field mappings",snippet:'{\n "mappings": {\n "dynamic": false,\n "fields": {\n ${1:<string field name>}: {\n "type": "string"\n },\n ${2:<number field name>}: {\n "type": "number"\n },\n ${3:<date field name>}: {\n "type": "date"\n },\n ${4:<geo field name>}: {\n "type": "geo"\n },\n } \n }\n}',version:"4.4.0"},{name:"Text field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<string field name>}: [\n {\n // Enables text queries\n "type": "string"\n },\n {\n // Enables autocomplete queries\n "type": "autocomplete"\n \n },\n {\n // Enables sorting\n "type": "token"\n }\n ] \n } \n }\n}',version:"4.4.0"},{name:"Facet field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<number field name for faceting>}: [\n {\n "type": "numberFacet"\n },\n {\n "type": "number"\n },\n ],\n ${2:<date field name for faceting>}: [\n {\n "type": "dateFacet"\n }\n {\n "type": "date"\n }\n ],\n ${3:<string field name for faceting>}: [\n {\n "type": "stringFacet"\n },\n {\n "type": "string",\n "analyzer": "lucene.keyword"\n },\n ],\n } \n }\n}',version:"4.4.0"},{name:"KNN Vector field mapping",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<vector embedding field name>}: [\n {\n "type": "knnVector",\n "dimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n } \n ] \n } \n }\n}',version:"4.4.0"}],t.ATLAS_VECTOR_SEARCH_TEMPLATE={name:"Vector Search default template",snippet:'{\n "fields": [{\n "type": "vector",\n "path": "${1:<field name to index>}",\n "numDimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n }]\n}',version:"4.4.0"}},34218:(e,t,n)=>{const a=n(41694),r=n(71333);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},34219:(e,t,n)=>{const a=n(48381);e.exports=(e,t,n=!1)=>{if(e instanceof a)return e;try{return new a(e,t)}catch(e){if(!n)return null;throw e}}},34335:(e,t,n)=>{const a=n(20332),r=n(55141),{ANY:s}=r,i=n(43301),o=n(77203),l=[new r(">=0.0.0-0")],u=[new r(">=0.0.0")],c=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=n.includePrerelease?l:u}if(1===t.length&&t[0].semver===s){if(n.includePrerelease)return!0;t=u}const a=new Set;let r,c,m,h,f,v,g;for(const t of e)">"===t.operator||">="===t.operator?r=p(r,t,n):"<"===t.operator||"<="===t.operator?c=d(c,t,n):a.add(t.semver);if(a.size>1)return null;if(r&&c){if(m=o(r.semver,c.semver,n),m>0)return null;if(0===m&&(">="!==r.operator||"<="!==c.operator))return null}for(const e of a){if(r&&!i(e,String(r),n))return null;if(c&&!i(e,String(c),n))return null;for(const a of t)if(!i(e,String(a),n))return!1;return!0}let y=!(!c||n.includePrerelease||!c.semver.prerelease.length)&&c.semver,$=!(!r||n.includePrerelease||!r.semver.prerelease.length)&&r.semver;y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,v=v||"<"===e.operator||"<="===e.operator,r)if($&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===$.major&&e.semver.minor===$.minor&&e.semver.patch===$.patch&&($=!1),">"===e.operator||">="===e.operator){if(h=p(r,e,n),h===e&&h!==r)return!1}else if(">="===r.operator&&!i(r.semver,String(e),n))return!1;if(c)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(f=d(c,e,n),f===e&&f!==c)return!1}else if("<="===c.operator&&!i(c.semver,String(e),n))return!1;if(!e.operator&&(c||r)&&0!==m)return!1}return!(r&&v&&!c&&0!==m||c&&g&&!r&&0!==m||$||y)},p=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a>0?e:a<0||">"===t.operator&&">="===e.operator?t:e},d=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a<0?e:a>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new a(e,n),t=new a(t,n);let r=!1;e:for(const a of e.set){for(const e of t.set){const t=c(a,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},34773:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},34889:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPES=void 0,t.BSON_TYPES=[{name:"Code",value:"Code",label:"Code",score:1,meta:"bson",version:"0.0.0",description:"BSON Code type",snippet:"Code('${1:code}')"},{name:"ObjectId",value:"ObjectId",label:"ObjectId",score:1,meta:"bson",version:"0.0.0",description:"BSON ObjectId type",snippet:"ObjectId('${1:id}')"},{name:"Binary",value:"Binary",label:"Binary",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary type",snippet:"Binary('${1:data}', '${2:subType}')"},{name:"DBRef",value:"DBRef",label:"DBRef",score:1,meta:"bson",version:"0.0.0",description:"BSON DBRef type",snippet:"DBRef('${1:ns}', '${2:oid}')"},{name:"Timestamp",value:"Timestamp",label:"Timestamp",score:1,meta:"bson",version:"0.0.0",description:"BSON Timestamp type",snippet:"Timestamp(${1:low}, ${2:high})"},{name:"NumberInt",value:"NumberInt",label:"NumberInt",score:1,meta:"bson",version:"0.0.0",description:"BSON 32 bit Integer type",snippet:"NumberInt(${1:value})"},{name:"NumberLong",value:"NumberLong",label:"NumberLong",score:1,meta:"bson",version:"0.0.0",description:"BSON 64 but Integer type",snippet:"NumberLong('${1:value}')"},{name:"NumberDecimal",value:"NumberDecimal",label:"NumberDecimal",score:1,meta:"bson",version:"3.4.0",description:"BSON Decimal128 type",snippet:"NumberDecimal('${1:value}')"},{name:"MaxKey",value:"MaxKey",label:"MaxKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MaxKey type",snippet:"MaxKey()"},{name:"MinKey",value:"MinKey",label:"MinKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MinKey type",snippet:"MinKey()"},{name:"ISODate",value:"ISODate",label:"ISODate",score:1,meta:"bson",version:"0.0.0",description:"BSON Date type",snippet:"ISODate('${1:date}')"},{name:"RegExp",value:"RegExp",label:"RegExp",score:1,meta:"bson",version:"0.0.0",description:"BSON Regex type",snippet:"RegExp('${1:source}', '${2:opts}')"},{name:"LegacyJavaUUID",value:"LegacyJavaUUID",label:"LegacyJavaUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Java legacy UUID)",snippet:"LegacyJavaUUID('${1:uuid}')"},{name:"LegacyCSharpUUID",value:"LegacyCSharpUUID",label:"LegacyCSharpUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (CSharp legacy UUID)",snippet:"LegacyCSharpUUID('${1:uuid}')"},{name:"LegacyPythonUUID",value:"LegacyPythonUUID",label:"LegacyPythonUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Python legacy UUID)",snippet:"LegacyPythonUUID('${1:uuid}')"},{name:"UUID",value:"UUID",label:"UUID",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary subtype 4",snippet:"UUID('${1:uuid}')"}]},35229:(e,t,n)=>{const a=n(70692);e.exports=(e,t,n)=>0===a(e,t,n)},35593:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_VARIABLES=void 0,t.SYSTEM_VARIABLES=[{name:"$$NOW",value:"$$NOW",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current datetime value. NOW returns the same value for all members of the deployment and remains the same throughout all stages of the aggregation pipeline."},{name:"$$CLUSTER_TIME",value:"$$CLUSTER_TIME",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current timestamp value. CLUSTER_TIME is only available on replica sets and sharded clusters. CLUSTER_TIME returns the same value for all members of the deployment and remains the same throughout all stages of the pipeline."},{name:"$$ROOT",value:"$$ROOT",score:1,meta:"variable:system",version:"2.4.0",description:"References the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage."},{name:"$$CURRENT",value:"$$CURRENT",score:1,meta:"variable:system",version:"2.4.0",description:"References the start of the field path being processed in the aggregation pipeline stage. Unless documented otherwise, all stages start with CURRENT the same as ROOT. CURRENT is modifiable. However, since `$<field>` is equivalent to `$$CURRENT.<field>`, rebinding CURRENT changes the meaning of `$` accesses."},{name:"$$REMOVE",value:"$$REMOVE",score:1,meta:"variable:system",version:"3.6.0",description:"A variable which evaluates to the missing value. Allows for the conditional exclusion of fields. In a `$project`, a field set to the variable REMOVE is excluded from the output."},{name:"$$DESCEND",value:"$$DESCEND",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$PRUNE",value:"$$PRUNE",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$KEEP",value:"$$KEEP",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$SEARCH_META",value:"$$SEARCH_META",score:1,meta:"variable:system",version:"5.0.0",description:"A variable that stores the metadata results of an Atlas Search query. In all supported aggregation pipeline stages, a field set to the variable SEARCH_META returns the metadata results for the query. For an example of its usage, see Atlas Search facet and count."},{name:"$$USER_ROLES",value:"$$USER_ROLES",score:1,meta:"variable:system",version:"7.0.0",description:"A variable that stores the role names of the authenticated user running the command."}]},35647:(e,t,n)=>{const a=n(68752),r=n(28892),s=n(9350),i=n(80661),o=n(17914),l=n(40447),u=n(24320),c=n(1025),p=n(82214),d=n(90216),m=n(30452),h=n(58395),f=n(94715),v=n(99430),g=n(51456),y=n(62525),$=n(44455),b=n(27225),_=n(85623),E=n(42734),x=n(63825),S=n(53831),A=n(42997),I=n(66135),w=n(90898),T=n(39149),N=n(84112),O=n(96506),k=n(33629),R=n(52992),C=n(52189),P=n(60098),L=n(15160),j=n(88099),M=n(44948),D=n(57681),Y=n(62921),F=n(69904),q=n(89834),U=n(59263),V=n(45006);e.exports={parse:o,valid:l,clean:u,inc:c,diff:p,major:d,minor:m,patch:h,prerelease:f,compare:v,rcompare:g,compareLoose:y,compareBuild:$,sort:b,rsort:_,gt:E,lt:x,eq:S,neq:A,gte:I,lte:w,cmp:T,coerce:N,Comparator:O,Range:k,satisfies:R,toComparators:C,maxSatisfying:P,minSatisfying:L,minVersion:j,validRange:M,outside:D,gtr:Y,ltr:F,intersects:q,simplifyRange:U,subset:V,SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},35735:(e,t,n)=>{const a=n(59441);e.exports=(e,t)=>{const n=a(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},36059:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>a(t,e,n)},36165:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:s}=n(64136),i=n(95869),o=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],p=t.t={};let d=0;const m="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[m,r]],f=(e,t,n)=>{const a=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=d++;i(e,r,t),p[e]=r,u[r]=t,c[r]=a,o[r]=new RegExp(t,n?"g":void 0),l[r]=new RegExp(a,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),f("MAINVERSION",`(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${u[p.PRERELEASEIDENTIFIER]}(?:\\.${u[p.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${u[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[p.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${m}+`),f("BUILD",`(?:\\+(${u[p.BUILDIDENTIFIER]}(?:\\.${u[p.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${u[p.MAINVERSION]}${u[p.PRERELEASE]}?${u[p.BUILD]}?`),f("FULL",`^${u[p.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${u[p.MAINVERSIONLOOSE]}${u[p.PRERELEASELOOSE]}?${u[p.BUILD]}?`),f("LOOSE",`^${u[p.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${u[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${u[p.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:${u[p.PRERELEASE]})?${u[p.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:${u[p.PRERELEASELOOSE]})?${u[p.BUILD]}?)?)?`),f("XRANGE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),f("COERCE",`${u[p.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",u[p.COERCEPLAIN]+`(?:${u[p.PRERELEASE]})?`+`(?:${u[p.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",u[p.COERCE],!0),f("COERCERTLFULL",u[p.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${u[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${u[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${u[p.LONECARET]}${u[p.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${u[p.LONECARET]}${u[p.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${u[p.GTLT]}\\s*(${u[p.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]}|${u[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${u[p.XRANGEPLAIN]})\\s+-\\s+(${u[p.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${u[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[p.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},36326:(e,t,n)=>{const a=n(57544),r=n(12196),{safeRe:s,t:i}=n(25522);e.exports=(e,t)=>{if(e instanceof a)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const a=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let r;for(;(r=a.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===n)return null;const o=n[2],l=n[3]||"0",u=n[4]||"0",c=t.includePrerelease&&n[5]?`-${n[5]}`:"",p=t.includePrerelease&&n[6]?`+${n[6]}`:"";return r(`${o}.${l}.${u}${c}${p}`,t)}},36582:(e,t,n)=>{const a=n(71333),r=n(96082),{ANY:s}=r,i=n(9480),o=n(40289),l=[new r(">=0.0.0-0")],u=[new r(">=0.0.0")],c=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=n.includePrerelease?l:u}if(1===t.length&&t[0].semver===s){if(n.includePrerelease)return!0;t=u}const a=new Set;let r,c,m,h,f,v,g;for(const t of e)">"===t.operator||">="===t.operator?r=p(r,t,n):"<"===t.operator||"<="===t.operator?c=d(c,t,n):a.add(t.semver);if(a.size>1)return null;if(r&&c){if(m=o(r.semver,c.semver,n),m>0)return null;if(0===m&&(">="!==r.operator||"<="!==c.operator))return null}for(const e of a){if(r&&!i(e,String(r),n))return null;if(c&&!i(e,String(c),n))return null;for(const a of t)if(!i(e,String(a),n))return!1;return!0}let y=!(!c||n.includePrerelease||!c.semver.prerelease.length)&&c.semver,$=!(!r||n.includePrerelease||!r.semver.prerelease.length)&&r.semver;y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,v=v||"<"===e.operator||"<="===e.operator,r)if($&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===$.major&&e.semver.minor===$.minor&&e.semver.patch===$.patch&&($=!1),">"===e.operator||">="===e.operator){if(h=p(r,e,n),h===e&&h!==r)return!1}else if(">="===r.operator&&!i(r.semver,String(e),n))return!1;if(c)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(f=d(c,e,n),f===e&&f!==c)return!1}else if("<="===c.operator&&!i(c.semver,String(e),n))return!1;if(!e.operator&&(c||r)&&0!==m)return!1}return!(r&&v&&!c&&0!==m||c&&g&&!r&&0!==m||$||y)},p=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a>0?e:a<0||">"===t.operator&&">="===e.operator?t:e},d=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a<0?e:a>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new a(e,n),t=new a(t,n);let r=!1;e:for(const a of e.set){for(const e of t.set){const t=c(a,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},36710:(e,t,n)=>{function a(e,t,n){function a(n,a){var r;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(r=n._zod).traits??(r.traits=new Set),n._zod.traits.add(e),t(n,a);for(const e in i.prototype)e in n||Object.defineProperty(n,e,{value:i.prototype[e].bind(n)});n._zod.constr=i,n._zod.def=a}const r=n?.Parent??Object;class s extends r{}function i(e){var t;const r=n?.Parent?new s:this;a(r,e),(t=r._zod).deferred??(t.deferred=[]);for(const e of r._zod.deferred)e();return r}return Object.defineProperty(s,"name",{value:e}),Object.defineProperty(i,"init",{value:a}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}n.d(t,{$W:()=>i,GT:()=>r,cr:()=>s,xI:()=>a}),Object.freeze({status:"aborted"}),Symbol("zod_brand");class r extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const s={};function i(e){return e&&Object.assign(s,e),s}},36719:(e,t,n)=>{const a=n(66283);e.exports=(e,t)=>new a(e,t).major},36744:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EXPRESSION_OPERATORS=void 0,t.EXPRESSION_OPERATORS=[{name:"$abs",value:"$abs",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$accumulator",value:"$accumulator",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$add",value:"$add",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$allElementsTrue",value:"$allElementsTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$and",value:"$and",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$anyElementTrue",value:"$anyElementTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$arrayElemAt",value:"$arrayElemAt",score:1,meta:"expr:array",version:"3.2.0"},{name:"$arrayToObject",value:"$arrayToObject",score:1,meta:"expr:array",version:"3.4.4"},{name:"$binarySize",value:"$binarySize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$bsonSize",value:"$bsonSize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$ceil",value:"$ceil",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$cmp",value:"$cmp",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$concat",value:"$concat",score:1,meta:"expr:string",version:"2.4.0"},{name:"$concatArrays",value:"$concatArrays",score:1,meta:"expr:array",version:"3.2.0"},{name:"$cond",value:"$cond",score:1,meta:"expr:cond",version:"2.6.0"},{name:"$dateAdd",value:"$dateAdd",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateDiff",value:"$dateDiff",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateFromParts",value:"$dateFromParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateFromString",value:"$dateFromString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateSubtract",value:"$dateSubtract",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateToParts",value:"$dateToParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateTrunc",value:"$dateTrunc",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dayOfMonth",value:"$dayOfMonth",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfWeek",value:"$dayOfWeek",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfYear",value:"$dayOfYear",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.0.0"},{name:"$divide",value:"$divide",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$eq",value:"$eq",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$exp",value:"$exp",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$filter",value:"$filter",score:1,meta:"expr:array",version:"3.2.0"},{name:"$first",value:"$first",score:1,meta:"expr:array",version:"4.4.0"},{name:"$floor",value:"$floor",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$function",value:"$function",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$getField",value:"$getField",score:1,meta:"expr:get",version:"5.0.0"},{name:"$gt",value:"$gt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$gte",value:"$gte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$hour",value:"$hour",score:1,meta:"expr:date",version:"2.2.0"},{name:"$ifNull",value:"$ifNull",score:1,meta:"expr:cond",version:"2.2.0"},{name:"$in",value:"$in",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfArray",value:"$indexOfArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfBytes",value:"$indexOfBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$indexOfCP",value:"$indexOfCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$isArray",value:"$isArray",score:1,meta:"expr:array",version:"3.2.0"},{name:"$isNumber",value:"$isNumber",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$isoDayOfWeek",value:"$isoDayOfWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeek",value:"$isoWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeekYear",value:"$isoWeekYear",score:1,meta:"expr:date",version:"3.4.0"},{name:"$last",value:"$last",score:1,meta:"expr:array",version:"4.4.0"},{name:"$let",value:"$let",score:1,meta:"expr:var",version:"2.6.0"},{name:"$literal",value:"$literal",score:1,meta:"expr:literal",version:"2.6.0"},{name:"$lt",value:"$lt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$lt",value:"$lte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$ln",value:"$ln",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log",value:"$log",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log10",value:"$log10",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$map",value:"$map",score:1,meta:"expr:array",version:"2.6.0"},{name:"$mergeObjects",value:"$mergeObjects",score:1,meta:"expr:obj",version:"3.6.0"},{name:"$meta",value:"$meta",score:1,meta:"expr:text",version:"2.6.0"},{name:"$millisecond",value:"$millisecond",score:1,meta:"expr:date",version:"2.4.0"},{name:"$minute",value:"$minute",score:1,meta:"expr:date",version:"2.2.0"},{name:"$mod",value:"$mod",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$month",value:"$month",score:1,meta:"expr:date",version:"2.2.0"},{name:"$multiply",value:"$multiply",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$new",value:"$new",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$not",value:"$not",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$objectToArray",value:"$objectToArray",score:1,meta:"expr:array",version:"3.4.4"},{name:"$or",value:"$or",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$pow",value:"$pow",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$range",value:"$range",score:1,meta:"expr:array",version:"3.4.0"},{name:"$reduce",value:"$reduce",score:1,meta:"expr:array",version:"3.4.0"},{name:"$regexFind",value:"$regexFind",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexFindAll",value:"$regexFindAll",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexMatch",value:"$regexMatch",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$replaceAll",value:"$replaceAll",score:1,meta:"expr:string",version:"4.4.0"},{name:"$replaceOne",value:"$replaceOne",score:1,meta:"expr:string",version:"4.4.0"},{name:"$reverseArray",value:"$reverseArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$second",value:"$second",score:1,meta:"expr:date",version:"2.2.0"},{name:"$setDifference",value:"$setDifference",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setEquals",value:"$setEquals",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIntersection",value:"$setIntersection",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIsSubset",value:"$setIsSubset",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setUnion",value:"$setUnion",score:1,meta:"expr:set",version:"2.6.0"},{name:"$similarityCosine",value:"$similarityCosine",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityDotProduct",value:"$similarityDotProduct",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityEuclidean",value:"$similarityEuclidean",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$size",value:"$size",score:1,meta:"expr:array",version:"2.6.0"},{name:"$slice",value:"$slice",score:1,meta:"expr:array",version:"3.2.0"},{name:"$sortArray",value:"$sortArray",score:1,meta:"expr:array",version:"5.2.0"},{name:"$split",value:"$split",score:1,meta:"expr:string",version:"3.4.0"},{name:"$sqrt",value:"$sqrt",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$strcasecmp",value:"$strcasecmp",score:1,meta:"expr:string",version:"2.2.0"},{name:"$strLenBytes",value:"$strLenBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$strLenCP",value:"$strLenCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substr",value:"$substr",score:1,meta:"expr:string",version:"2.2.0",deprecated:"3.4.0",replacement:"$substrBytes"},{name:"$substrBytes",value:"$substrBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substrCP",value:"$substrCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$subtract",value:"$subtract",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$switch",value:"$switch",score:1,meta:"expr:cond",version:"3.4.0"},{name:"$toHashedIndexKey",value:"$toHashedIndexKey",score:1,meta:"expr:arith",version:"4.2.24"},{name:"$toLower",value:"$toLower",score:1,meta:"expr:string",version:"2.2.0"},{name:"$toUpper",value:"$toUpper",score:1,meta:"expr:string",version:"2.2.0"},{name:"$tsSecond",value:"$tsSecond",score:1,meta:"expr:date",version:"5.1.0"},{name:"$tsIncrement",value:"$tsIncrement",score:1,meta:"expr:date",version:"5.1.0"},{name:"$trunc",value:"$trunc",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$type",value:"$type",score:1,meta:"expr:type",version:"3.4.0"},{name:"$week",value:"$week",score:1,meta:"expr:date",version:"2.2.0"},{name:"$year",value:"$year",score:1,meta:"expr:date",version:"2.2.0"},{name:"$zip",value:"$zip",score:1,meta:"expr:array",version:"3.4.0"},{name:"$bitAnd",value:"$bitAnd",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitOr",value:"$bitOr",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitXor",value:"$bitXor",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitNot",value:"$bitNot",score:1,meta:"expr:bit",version:"7.0.0"}]},36749:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>0!==a(e,t,n)},37276:(e,t,n)=>{const a=n(71333);e.exports=(e,t)=>{try{return new a(e,t).range||"*"}catch(e){return null}}},37354:(e,t,n)=>{const a=n(57544),r=n(95323);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},37359:(e,t,n)=>{const a=n(87391);e.exports=(e,t)=>e.sort(((e,n)=>a(n,e,t)))},37385:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},37391:(e,t,n)=>{const a=n(43143);e.exports=(e,t,n)=>a(e,t,">",n)},37504:function(e,t,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_PIPELINE_UTILS=void 0;const r=a(n(75982)),s="8.0.0",i="8.1.0";t.VIEW_PIPELINE_UTILS={MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_DE:s,MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_COMPASS:i,isPipelineSearchQueryable:e=>{for(const t of e){const e=Object.keys(t)[0];if("$addFields"!==e&&"$set"!==e&&"$match"!==e)return!1;if("$match"===e){const e=t.$match,n=Object.keys(e||{});if(1!==n.length||!n.includes("$expr"))return!1}}return!0},isVersionSearchCompatibleForViewsDataExplorer:e=>{try{return r.default.gte(e,s)}catch{return!1}},isVersionSearchCompatibleForViewsCompass:e=>{try{return r.default.gte(e,i)}catch{return!1}}}},37724:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ANY_NAMESPACE=t.ANY_COLLECTION_NAMESPACE=t.TIME_SERIES=t.VIEW=t.COLLECTION=t.DATABASE=void 0,t.DATABASE="db";const n="coll";t.COLLECTION=n;const a="view";t.VIEW=a;const r="timeseries";t.TIME_SERIES=r;const s=[n,a,r];t.ANY_COLLECTION_NAMESPACE=s;const i=["db",...s];t.ANY_NAMESPACE=i},38185:(e,t,n)=>{const a=n(88825),r=n(20360);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},38358:(e,t,n)=>{const a=n(50066);e.exports=(e,t,n=!1)=>{if(e instanceof a)return e;try{return new a(e,t)}catch(e){if(!n)return null;throw e}}},38366:(e,t,n)=>{const a=/\s+/g;class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(a," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&v))+":"+e,n=s.get(t);if(n)return n;const a=this.options.loose,r=a?c[p.HYPHENRANGELOOSE]:c[p.HYPHENRANGE];e=e.replace(r,O(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(c[p.COMPARATORTRIM],d),l("comparator trim",e),e=e.replace(c[p.TILDETRIM],m),l("tilde trim",e),e=e.replace(c[p.CARETTRIM],h),l("caret trim",e);let i=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>N(e,this.options)));a&&(i=i.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(c[p.COMPARATORLOOSE]))))),l("range list",i);const u=new Map,y=i.map((e=>new o(e,this.options)));for(const e of y){if(g(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");const $=[...u.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>$(n,t)&&e.set.some((e=>$(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const s=new(n(43287)),i=n(69348),o=n(58387),l=n(67767),u=n(66283),{safeRe:c,t:p,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:h}=n(415),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:v}=n(77693),g=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,$=(e,t)=>{let n=!0;const a=e.slice();let r=a.pop();for(;n&&a.length;)n=a.every((e=>r.intersects(e,t))),r=a.pop();return n},b=(e,t)=>(l("comp",e,t),e=S(e,t),l("caret",e),e=E(e,t),l("tildes",e),e=I(e,t),l("xrange",e),e=T(e,t),l("stars",e),e),_=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{const n=t.loose?c[p.TILDELOOSE]:c[p.TILDE];return e.replace(n,((t,n,a,r,s)=>{let i;return l("tilde",e,t,n,a,r,s),_(n)?i="":_(a)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:_(r)?i=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:s?(l("replaceTilde pr",s),i=`>=${n}.${a}.${r}-${s} <${n}.${+a+1}.0-0`):i=`>=${n}.${a}.${r} <${n}.${+a+1}.0-0`,l("tilde return",i),i}))},S=(e,t)=>e.trim().split(/\s+/).map((e=>A(e,t))).join(" "),A=(e,t)=>{l("caret",e,t);const n=t.loose?c[p.CARETLOOSE]:c[p.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,((t,n,r,s,i)=>{let o;return l("caret",e,t,n,r,s,i),_(n)?o="":_(r)?o=`>=${n}.0.0${a} <${+n+1}.0.0-0`:_(s)?o="0"===n?`>=${n}.${r}.0${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${a} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),o="0"===n?"0"===r?`>=${n}.${r}.${s}-${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${i} <${+n+1}.0.0-0`):(l("no pr"),o="0"===n?"0"===r?`>=${n}.${r}.${s}${a} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),l("caret return",o),o}))},I=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();const n=t.loose?c[p.XRANGELOOSE]:c[p.XRANGE];return e.replace(n,((n,a,r,s,i,o)=>{l("xRange",e,n,a,r,s,i,o);const u=_(r),c=u||_(s),p=c||_(i),d=p;return"="===a&&d&&(a=""),o=t.includePrerelease?"-0":"",u?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&d?(c&&(s=0),i=0,">"===a?(a=">=",c?(r=+r+1,s=0,i=0):(s=+s+1,i=0)):"<="===a&&(a="<",c?r=+r+1:s=+s+1),"<"===a&&(o="-0"),n=`${a+r}.${s}.${i}${o}`):c?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:p&&(n=`>=${r}.${s}.0${o} <${r}.${+s+1}.0-0`),l("xRange return",n),n}))},T=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[p.STAR],"")),N=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),O=e=>(t,n,a,r,s,i,o,l,u,c,p,d)=>`${n=_(a)?"":_(r)?`>=${a}.0.0${e?"-0":""}`:_(s)?`>=${a}.${r}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=_(u)?"":_(c)?`<${+u+1}.0.0-0`:_(p)?`<${u}.${+c+1}.0-0`:d?`<=${u}.${c}.${p}-${d}`:e?`<${u}.${c}.${+p+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const a=e[n].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},38506:(e,t,n)=>{const a=n(47538);e.exports=(e,t)=>e.sort(((e,n)=>a(n,e,t)))},39044:(e,t,n)=>{const a=n(20332);e.exports=(e,t)=>new a(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},39149:(e,t,n)=>{const a=n(53831),r=n(42997),s=n(42734),i=n(66135),o=n(63825),l=n(90898);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a(e,n,u);case"!=":return r(e,n,u);case">":return s(e,n,u);case">=":return i(e,n,u);case"<":return o(e,n,u);case"<=":return l(e,n,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},39560:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ANY_NAMESPACE=t.ANY_COLLECTION_NAMESPACE=t.TIME_SERIES=t.VIEW=t.COLLECTION=t.DATABASE=void 0,t.DATABASE="db";const n="coll";t.COLLECTION=n;const a="view";t.VIEW=a;const r="timeseries";t.TIME_SERIES=r;const s=[n,a,r];t.ANY_COLLECTION_NAMESPACE=s;const i=["db",...s];t.ANY_NAMESPACE=i},39581:(e,t,n)=>{n.d(t,{fd:()=>s,rs:()=>a}),Symbol("ZodOutput"),Symbol("ZodInput");class a{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function r(){return new a}const s=r()},40030:(e,t,n)=>{var a=n(65994).e;Object.defineProperty(t,"__esModule",{value:!0}),t.signals=void 0,t.signals=[],t.signals.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==a.platform&&t.signals.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===a.platform&&t.signals.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")},40194:(e,t,n)=>{const a=n(72857),r=n(67094),{ANY:s}=r,i=n(12876),o=n(32674),l=[new r(">=0.0.0-0")],u=[new r(">=0.0.0")],c=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=n.includePrerelease?l:u}if(1===t.length&&t[0].semver===s){if(n.includePrerelease)return!0;t=u}const a=new Set;let r,c,m,h,f,v,g;for(const t of e)">"===t.operator||">="===t.operator?r=p(r,t,n):"<"===t.operator||"<="===t.operator?c=d(c,t,n):a.add(t.semver);if(a.size>1)return null;if(r&&c){if(m=o(r.semver,c.semver,n),m>0)return null;if(0===m&&(">="!==r.operator||"<="!==c.operator))return null}for(const e of a){if(r&&!i(e,String(r),n))return null;if(c&&!i(e,String(c),n))return null;for(const a of t)if(!i(e,String(a),n))return!1;return!0}let y=!(!c||n.includePrerelease||!c.semver.prerelease.length)&&c.semver,$=!(!r||n.includePrerelease||!r.semver.prerelease.length)&&r.semver;y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,v=v||"<"===e.operator||"<="===e.operator,r)if($&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===$.major&&e.semver.minor===$.minor&&e.semver.patch===$.patch&&($=!1),">"===e.operator||">="===e.operator){if(h=p(r,e,n),h===e&&h!==r)return!1}else if(">="===r.operator&&!i(r.semver,String(e),n))return!1;if(c)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(f=d(c,e,n),f===e&&f!==c)return!1}else if("<="===c.operator&&!i(c.semver,String(e),n))return!1;if(!e.operator&&(c||r)&&0!==m)return!1}return!(r&&v&&!c&&0!==m||c&&g&&!r&&0!==m||$||y)},p=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a>0?e:a<0||">"===t.operator&&">="===e.operator?t:e},d=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a<0?e:a>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new a(e,n),t=new a(t,n);let r=!1;e:for(const a of e.set){for(const e of t.set){const t=c(a,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},40214:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VALIDATION_TEMPLATE=void 0,t.VALIDATION_TEMPLATE='/**\n * This is a starter template for a schema validation rule for a collection.\n * More information on schema validation rules can be found at:\n * https://www.mongodb.com/docs/manual/core/schema-validation/\n */\n{\n $jsonSchema: {\n title: "Library.books",\n bsonType: "object",\n required: ["fieldname1", "fieldname2"],\n properties: {\n fieldname1: {\n bsonType: "string",\n description: "Fieldname1 must be a string",\n },\n fieldname2: {\n bsonType: "int",\n description: "Fieldname2 must be an integer",\n },\n arrayFieldName: {\n bsonType: "array",\n items: {\n bsonType: "string"\n },\n description: "arrayFieldName must be an array of strings"\n },\n }\n }\n}'},40289:(e,t,n)=>{const a=n(41694);e.exports=(e,t,n)=>new a(e,n).compare(new a(t,n))},40383:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const a=t.test(e),r=t.test(n);return a&&r&&(e=+e,n=+n),e===n?0:a&&!r?-1:r&&!a?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},40447:(e,t,n)=>{const a=n(17914);e.exports=(e,t)=>{const n=a(e,t);return n?n.version:null}},40594:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},40727:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.REQUIRED_AS_FIRST_STAGE=t.FULL_SCAN_STAGES=t.OUT_STAGES=t.STAGE_OPERATOR_NAMES=t.STAGE_OPERATORS=void 0;const a=n(91030),r=n(21022),s=[{name:"$addFields",value:"$addFields",label:"$addFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value.",comment:"/**\n * newField: The new field name.\n * expression: The new field expression.\n */\n",snippet:"{\n ${1:newField}: ${2:expression}, ${3:...}\n}"},{name:"$bucket",value:"$bucket",label:"$bucket",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Categorizes incoming documents into groups, called buckets, based on specified boundaries.",comment:"/**\n * groupBy: The expression to group by.\n * boundaries: An array of the lower boundaries for each bucket.\n * default: The bucket name for documents that do not fall within the specified boundaries\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n */\n",snippet:"{\n groupBy: ${1:expression},\n boundaries: [ ${2:lowerbound}, ${3:...} ],\n default: ${4:literal},\n output: {\n ${5:outputN}: { ${6:accumulator} }, ${7:...}\n }\n}"},{name:"$bucketAuto",value:"$bucketAuto",label:"$bucketAuto",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.",comment:"/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n",snippet:"{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}"},{name:"$changeStream",value:"$changeStream",label:"$changeStream",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a Change Stream cursor for the collection.",comment:"/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n",snippet:"{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}"},{name:"$collStats",value:"$collStats",label:"$collStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Returns statistics regarding a collection or view.",comment:"/**\n * histograms: Optional latency histograms.\n * storageStats: Optional storage stats.\n */\n",snippet:"{\n latencyStats: {\n histograms: ${1:boolean}\n },\n storageStats: {${2:}},\n}"},{name:"$count",value:"$count",label:"$count",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns a count of the number of documents at this stage of the aggregation pipeline.",comment:"/**\n * Provide the field name for the count.\n */\n",snippet:"'${1:string}'"},{name:"$currentOp",value:"$currentOp",label:"$currentOp",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.",comment:"/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n",snippet:"{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}"},{name:"$densify",value:"$densify",label:"$densify",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.1.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level.",comment:"/**\n * field: The required field to densify.\n * partitionByFields: The set of fields that acts as a compound key to define each partition.\n * range: {\n * step: The amount to increment the field value in each document.\n * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.\n * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.\n * }\n */\n",snippet:"{\n field: ${1:string},\n partitionByFields: [${2:string}, ${3:string}, ...],\n range: {\n step: ${4:number},\n unit: ${5:string},\n bounds: [${6:lowerbound}, ${7:upperbound}, ...]\n }\n}"},{name:"$documents",value:"$documents",label:"$documents",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.9",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns literal documents from input values.",comment:"/**\n * expression: Any valid expression.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$facet",value:"$facet",label:"$facet",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Allows for multiple parellel aggregations to be specified.",comment:"/**\n * outputFieldN: The first output field.\n * stageN: The first aggregation stage.\n */\n",snippet:"{\n ${1:outputFieldN}: [ ${2:stageN}, ${3:...} ]\n}"},{name:"$fill",value:"$fill",label:"$fill",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.3.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Populates null and missing field values within documents.",comment:'/**\n * sortBy: Syntax is the same as $sort, required if "method" is used in at least one output spec otherwise optional\n * partitionBy: Optional, default is a single partition. Specification is the same as _id in $group (same as partitionBy in window functions).\n * partitionByFields: Optional, set of fields that acts as a compound key to define each partition.\n * output - Required, object for each field to fill in. For a single field, can be a single object.\n * output.<field> - A field to be filled with value, if missing or null in the current document.\n */\n',snippet:"{\n sortBy: ${1:sortSpec},\n partitionBy: ${2:expression},\n partitionByFields: [${3:string}, ${4:string}, ...],\n output: {\n field1: {value: ${5:expression}},\n field2: {method: ${6:string}},\n ...\n }\n}"},{name:"$geoNear",value:"$geoNear",label:"$geoNear",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns documents based on proximity to a geospatial point.",comment:"/**\n * near: The point to search near.\n * distanceField: The calculated distance.\n * maxDistance: The maximum distance, in meters, documents can be before being excluded from results.\n * query: Limits results that match the query\n * includeLocs: Optional. Labels and includes the point used to match the document.\n * num: Optional. The maximum number of documents to return.\n * spherical: Defaults to false. Specifies whether to use spherical geometry.\n */\n",snippet:"{\n near: { type: 'Point', coordinates: [ ${1:number}, ${2:number} ] },\n distanceField: '${3:string}',\n maxDistance: ${4:number},\n query: {${5}},\n includeLocs: '${6}',\n num: ${7:number},\n spherical: ${8:boolean}\n}"},{name:"$graphLookup",value:"$graphLookup",label:"$graphLookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a recursive search on a collection.",comment:"/**\n * from: The target collection.\n * startWith: Expression to start.\n * connectFromField: Field to connect.\n * connectToField: Field to connect to.\n * as: Name of the array field.\n * maxDepth: Optional max recursion depth.\n * depthField: Optional Name of the depth field.\n * restrictSearchWithMatch: Optional query.\n */\n",snippet:"{\n from: '${1:string}',\n startWith: ${2:expression},\n connectFromField: '${3:string}',\n connectToField: '${4:string}',\n as: '${5:string}',\n maxDepth: ${6:number},\n depthField: '${7:string}',\n restrictSearchWithMatch: {${8}}\n}"},{name:"$group",value:"$group",label:"$group",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups documents by a specified expression.",comment:"/**\n * _id: The id of the group.\n * fieldN: The first field name.\n */\n",snippet:"{\n _id: ${1:expression},\n ${2:fieldN}: {\n ${3:accumulatorN}: ${4:expressionN}\n }\n}"},{name:"$indexStats",value:"$indexStats",label:"$indexStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[],namespaces:[...r.ANY_NAMESPACE],description:"Returns statistics regarding the use of each index for the collection.",comment:"/**\n * No parameters.\n */\n",snippet:"{}"},{name:"$limit",value:"$limit",label:"$limit",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Limits the number of documents that flow into subsequent stages.",comment:"/**\n * Provide the number of documents to limit.\n */\n",snippet:"${1:number}"},{name:"$listLocalSessions",value:"$listLocalSessions",label:"$listLocalSessions",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Lists the sessions cached in memory by the mongod or mongos instance.",comment:"/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n",snippet:"{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}"},{name:"$lookup",value:"$lookup",label:"$lookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a join between two collections.",comment:"/**\n * from: The target collection.\n * localField: The local join field.\n * foreignField: The target join field.\n * as: The name for the results.\n * pipeline: Optional pipeline to run on the foreign collection.\n * let: Optional variables to use in the pipeline field stages.\n */\n",snippet:"{\n from: ${1:collection},\n localField: ${2:field},\n foreignField: ${3:field},\n as: ${4:result}\n}"},{name:"$match",value:"$match",label:"$match",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Filters the document stream to allow only matching documents to pass through to subsequent stages.",comment:"/**\n * query: The query in MQL.\n */\n",snippet:"{\n ${1:query}\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.1.11",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * into: The target collection.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: '${1:string}',\n on: '${2:string}',\n let: '${3:specification(s)}',\n whenMatched: '${4:string}',\n whenNotMatched: '${5:string}'\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * atlas: Location to write the documents from the aggregation pipeline.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: {\n atlas: {\n clusterName: '${1:atlasClusterName}',\n db: '${2:database}',\n coll: '${3:collection}',\n projectId: '${4:optionalAtlasProjectId}'\n }\n },\n on: '${5:identifier}',\n let: { ${6:specification(s)} },\n whenMatched: '${7:string}',\n whenNotMatched: '${8:string}'\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to a new or existing collection.",comment:"/**\n * Provide the name of the output database and collection.\n */\n",snippet:"{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to an Atlas cluster, S3 bucket, or Azure Blob Storage.",comment:"/**\n * Use any one of the following:\n * s3: Parameters to save the data to S3.\n * atlas: Parameters to save the data to Atlas. Example:\n * {\n * atlas: {\n * db: 'string',\n * coll: 'string',\n * projectId: 'string',\n * clusterName: 'string'\n * }\n * },\n * azure: Parameters to save the data to Azure. Example:\n * {\n * azure: {\n * serviceURL: 'string',\n * containerName: 'string',\n * region: 'string,\n * filename: 'string',\n * format: {\n * name: 'string',\n * maxFileSize: 'string',\n * maxRowGroupSize: 'string',\n * columnCompression: 'string'\n * },\n * errorMode: 'string'\n * }\n * }\n */\n",snippet:"{\n s3: {\n bucket: '${1:string}',\n region: '${2:string}',\n filename: '${3:string}',\n format: {\n name: '${4:string}',\n maxFileSize: '${5:bytes}',\n maxRowGroupSize: '${6:string}',\n columnCompression: '${7:string}'\n },\n errorMode: '${8:string}'\n }\n}"},{name:"$project",value:"$project",label:"$project",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value. Unlike $addFields, $project can also remove fields.",comment:"/**\n * specifications: The fields to\n * include or exclude.\n */\n",snippet:"{\n ${1:specification(s)}\n}"},{name:"$rankFusion",value:"$rankFusion",label:"$rankFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.0.14",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using reciprocal rank fusion to create hybrid search results.",comment:'/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be a Ranked Selection Pipeline operating on the same collection. Minimum of one pipeline.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information in {$meta: "scoreDetails"} for debugging and tuning.\n */\n',snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n }\n },\n combination: {\n weights: {\n ${6:searchPipeline}: ${7:number},\n ${8:vectorPipeline}: ${9:number}\n }\n },\n scoreDetails: ${10:false}\n}"},{name:"$redact",value:"$redact",label:"$redact",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.6.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Restricts the content for each document based on information stored in the documents themselves",comment:"/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$replaceRoot",value:"$replaceRoot",label:"$replaceRoot",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newRoot: ${1:replacementDocument}\n}"},{name:"$replaceWith",value:"$replaceWith",label:"$replaceWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newWith: ${1:replacementDocument}\n}"},{name:"$sample",value:"$sample",label:"$sample",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Randomly selects the specified number of documents from its input.",comment:"/**\n * size: The number of documents to sample.\n */\n",snippet:"{\n size: ${1:number}\n}"},{name:"$scoreFusion",value:"$scoreFusion",label:"$scoreFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.2.0",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using relative score fusion to create hybrid search results.",comment:"/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be operating on the same collection. Minimum of one pipeline.\n * input.normalization: Required. Normalizes the score to the range 0 to 1 before combining the results. Value can be none, sigmoid or minMaxScaler.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * combination.method: Optional. Specifies method for combining scores. Value can be avg or expression. Default is avg.\n * combination.expression: Optional. This is the custom expression that is used when combination.method is set to expression.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information.\n */\n",snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n },\n normalization: '${6:none|sigmoid|minMaxScaler}'\n },\n combination: {\n weights: {\n ${7:searchPipeline}: ${8:number},\n ${9:vectorPipeline}: ${10:number}\n },\n method: '${11:avg|expression}',\n expression: '${12:expression}'\n },\n scoreDetails: ${13:false}\n}"},{name:"$search",value:"$search",label:"$search",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.1.11",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s).",comment:"/**\n * index: The name of the Search index.\n * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. Use matchCriteria to match 'any' or 'all' query terms.\n * compound: Combines ops.\n * span: Find in text field regions.\n * exists: Test for presence of a field.\n * near: Find near number or date.\n * range: Find in numeric or date range.\n */\n",snippet:"{\n index: '${1:string}',\n text: {\n query: '${2:string}',\n path: '${3:string}',\n matchCriteria: '${4:any}',\n }\n}"},{name:"$searchMeta",value:"$searchMeta",label:"$searchMeta",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.4.9",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.",comment:"/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n",snippet:"{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}"},{name:"$set",value:"$set",label:"$set",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.",comment:"/**\n * field: The field name\n * expression: The expression.\n */\n",snippet:"{\n ${1:field}: ${2:expression}\n}"},{name:"$setWindowFields",value:"$setWindowFields",label:"$setWindowFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Capable of partitioning incoming data, and can apply one or more functions to defined windows within each partition.",comment:"/**\n * partitionBy: partitioning of data.\n * sortBy: fields to sort by.\n * output: {\n * path: {\n * function: The window function to compute over the given window.\n * window: {\n * documents: A number of documents before and after the current document.\n * range: A range of possible values around the value in the current document's sortBy field.\n * unit: Specifies the units for the window bounds.\n * }\n * }\n * }\n */\n",snippet:"{\n partitionBy: ${1:expression},\n sortBy: ${2:sortSpec},\n output: {\n ${3:path}: {\n ${4:function}: ${5:functionArgs},\n window: {\n documents: [${6:lowerbound}, ${7:upperbound}],\n range: [${8:lowerbound}, ${9:upperbound}],\n unit: ${10:string}\n }\n },\n ${11:path2}: ...\n }\n}"},{name:"$skip",value:"$skip",label:"$skip",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Skips a specified number of documents before advancing to the next stage.",comment:"/**\n * Provide the number of documents to skip.\n */\n",snippet:"${1:number}"},{name:"$sort",value:"$sort",label:"$sort",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Reorders the document stream by a specified sort key and direction.",comment:"/**\n * Provide any number of field/order pairs.\n */\n",snippet:"{\n ${1:field1}: ${2:sortOrder}\n}"},{name:"$sortByCount",value:"$sortByCount",label:"$sortByCount",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.",comment:"/**\n * expression: Grouping expression or string.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$unionWith",value:"$unionWith",label:"$unionWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Perform a union with a pipeline on another collection.",comment:"/**\n * coll: The collection name.\n * pipeline: The pipeline on the other collection.\n */\n",snippet:"{\n coll: '${1:coll}',\n pipeline: [${2:pipeline}]\n}"},{name:"$unset",value:"$unset",label:"$unset",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Excludes fields from the result document.",comment:"/**\n * Provide the field name to exclude.\n * To exclude multiple fields, pass the field names in an array.\n */\n",snippet:"'${1:string}'"},{name:"$unwind",value:"$unwind",label:"$unwind",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Outputs a new document for each element in a specified array. ",comment:"/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n",snippet:"{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}"},{name:"$vectorSearch",value:"$vectorSearch",label:"$vectorSearch",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS],meta:"stage",version:">=6.0.10 <7.0.0 || >=7.0.2",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a kNN search on embeddings in the specified field(s)",comment:"/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n * exact: Choose between false for ANN (Approximate Nearest Neighbor) and true for ENN (Exact Nearest Neighbor). Defaults to false. (Optional)\n */\n",snippet:"{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}},\n exact: ${8:boolean}\n}"}];t.STAGE_OPERATORS=s;const i=s.map((e=>e.name));t.STAGE_OPERATOR_NAMES=i;const o=s.filter((e=>e.outputStage));t.OUT_STAGES=o;const l=s.filter((e=>e.fullScan));t.FULL_SCAN_STAGES=l;const u=s.filter((e=>e.firstStage));t.REQUIRED_AS_FIRST_STAGE=u},40811:(e,t,n)=>{var a=n(4414),r=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];e.exports=function(e,t){var n,i;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===r.indexOf(t))throw new a('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,i={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){i[String(t)]=e}))})),i),-1===s.indexOf(this.kind))throw new a('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},40957:function(e,t,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_PIPELINE_UTILS=void 0;const r=a(n(59591)),s="8.0.0",i="8.1.0";t.VIEW_PIPELINE_UTILS={MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_DE:s,MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_COMPASS:i,isPipelineSearchQueryable:e=>{for(const t of e){const e=Object.keys(t)[0];if("$addFields"!==e&&"$set"!==e&&"$match"!==e)return!1;if("$match"===e){const e=t.$match,n=Object.keys(e||{});if(1!==n.length||!n.includes("$expr"))return!1}}return!0},isVersionSearchCompatibleForViewsDataExplorer:e=>{try{return r.default.gte(e,s)}catch{return!1}},isVersionSearchCompatibleForViewsCompass:e=>{try{return r.default.gte(e,i)}catch{return!1}}}},41163:(e,t,n)=>{var a;Object.defineProperty(t,"__esModule",{value:!0}),t.unload=t.load=t.onExit=t.signals=void 0;const r=n(40030);Object.defineProperty(t,"signals",{enumerable:!0,get:function(){return r.signals}});const s=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,i=Symbol.for("signal-exit emitter"),o=globalThis,l=Object.defineProperty.bind(Object);class u{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(o[i])return o[i];l(o,i,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const n=this.listeners[e],a=n.indexOf(t);-1!==a&&(0===a&&1===n.length?n.length=0:n.splice(a,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let a=!1;for(const r of this.listeners[e])a=!0===r(t,n)||a;return"exit"===e&&(a=this.emit("afterExit",t,n)||a),a}}class c{}const p=globalThis.process;var d;d=s(p)?new class extends c{#e="win32"===p.platform?"SIGINT":"SIGHUP";#t=new u;#n;#a;#r;#s={};#i=!1;constructor(e){super(),this.#n=e,this.#s={};for(const t of r.signals)this.#s[t]=()=>{const n=this.#n.listeners(t);let{count:a}=this.#t;const r=e;if("object"==typeof r.__signal_exit_emitter__&&"number"==typeof r.__signal_exit_emitter__.count&&(a+=r.__signal_exit_emitter__.count),n.length===a){this.unload();const n=this.#t.emit("exit",null,t),a="SIGHUP"===t?this.#e:t;n||e.kill(e.pid,a)}};this.#r=e.reallyExit,this.#a=e.emit}onExit(e,t){if(!s(this.#n))return()=>{};!1===this.#i&&this.load();const n=t?.alwaysLast?"afterExit":"exit";return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),0===this.#t.listeners.exit.length&&0===this.#t.listeners.afterExit.length&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#t.count+=1;for(const e of r.signals)try{const t=this.#s[e];t&&this.#n.on(e,t)}catch(e){}this.#n.emit=(e,...t)=>this.#o(e,...t),this.#n.reallyExit=e=>this.#l(e)}}unload(){this.#i&&(this.#i=!1,r.signals.forEach((e=>{const t=this.#s[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#n.removeListener(e,t)}catch(e){}})),this.#n.emit=this.#a,this.#n.reallyExit=this.#r,this.#t.count-=1)}#l(e){return s(this.#n)?(this.#n.exitCode=e||0,this.#t.emit("exit",this.#n.exitCode,null),this.#r.call(this.#n,this.#n.exitCode)):0}#o(e,...t){const n=this.#a;if("exit"===e&&s(this.#n)){"number"==typeof t[0]&&(this.#n.exitCode=t[0]);const a=n.call(this.#n,e,...t);return this.#t.emit("exit",this.#n.exitCode,null),a}return n.call(this.#n,e,...t)}}(p):new class extends c{onExit(){return()=>{}}load(){}unload(){}},a={onExit:(e,t)=>d.onExit(e,t),load:()=>d.load(),unload:()=>d.unload()},t.onExit=a.onExit,t.load=a.load,t.unload=a.unload},41573:(e,t,n)=>{n.d(t,{Ay:()=>r});var a=n(87494);const r=a;a.MAX_DATABASE_NAME_LENGTH,a.sort},41694:(e,t,n)=>{const a=n(72082),{MAX_LENGTH:r,MAX_SAFE_INTEGER:s}=n(4292),{safeRe:i,t:o}=n(18104),l=n(8573),{compareIdentifiers:u}=n(90733);class c{constructor(e,t){if(t=l(t),e instanceof c){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[o.LOOSE]:i[o.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(a("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof c||(e=new c(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(a("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(a("build compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===n&&(a=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},41738:(e,t,n)=>{const a=n(92625),r=n(24159),s=n(48381),i=n(5286),o=n(34219),l=n(24482),u=n(10017),c=n(11420),p=n(77277),d=n(78853),m=n(74145),h=n(86506),f=n(30044),v=n(77203),g=n(36059),y=n(68716),$=n(47538),b=n(88770),_=n(38506),E=n(58809),x=n(20038),S=n(45160),A=n(25812),I=n(54506),w=n(66239),T=n(88108),N=n(13559),O=n(55141),k=n(20332),R=n(43301),C=n(39044),P=n(8999),L=n(10933),j=n(98696),M=n(15011),D=n(32910),Y=n(76130),F=n(89975),q=n(78519),U=n(18894),V=n(34335);e.exports={parse:o,valid:l,clean:u,inc:c,diff:p,major:d,minor:m,patch:h,prerelease:f,compare:v,rcompare:g,compareLoose:y,compareBuild:$,sort:b,rsort:_,gt:E,lt:x,eq:S,neq:A,gte:I,lte:w,cmp:T,coerce:N,Comparator:O,Range:k,satisfies:R,toComparators:C,maxSatisfying:P,minSatisfying:L,minVersion:j,validRange:M,outside:D,gtr:Y,ltr:F,intersects:q,simplifyRange:U,subset:V,SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},41755:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>0===a(e,t,n)},42734:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>a(e,t,n)>0},42937:(e,t,n)=>{n.d(t,{$O:()=>_,$S:()=>X,Au:()=>F,Be:()=>l,Bj:()=>v,Ct:()=>g,Dl:()=>h,ER:()=>Q,Eb:()=>Z,F7:()=>R,FO:()=>ie,Fk:()=>W,Fn:()=>d,G1:()=>T,G8:()=>Y,Hi:()=>z,Il:()=>ae,KA:()=>M,KB:()=>I,Kn:()=>O,LK:()=>P,Mu:()=>i,Ny:()=>b,Pw:()=>y,Rl:()=>s,Tx:()=>U,Uy:()=>E,WN:()=>ne,YA:()=>G,Zm:()=>q,_L:()=>L,_z:()=>$,aC:()=>m,bS:()=>ee,cU:()=>A,dR:()=>J,dZ:()=>se,db:()=>N,em:()=>D,f2:()=>k,fU:()=>oe,fs:()=>f,gP:()=>x,hH:()=>K,jw:()=>j,lo:()=>te,m9:()=>B,nA:()=>u,pY:()=>c,qF:()=>H,qG:()=>C,qm:()=>V,rk:()=>w,rt:()=>S,tB:()=>o,wA:()=>p,xY:()=>re});var a=n(13008),r=n(87257);function s(e,t){return new e({type:"string",...r.A2(t)})}function i(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...r.A2(t)})}function o(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...r.A2(t)})}function l(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...r.A2(t)})}function u(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...r.A2(t)})}function c(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...r.A2(t)})}function p(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...r.A2(t)})}function d(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...r.A2(t)})}function m(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...r.A2(t)})}function h(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...r.A2(t)})}function f(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...r.A2(t)})}function v(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...r.A2(t)})}function g(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...r.A2(t)})}function y(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...r.A2(t)})}function $(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...r.A2(t)})}function b(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...r.A2(t)})}function _(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...r.A2(t)})}function E(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...r.A2(t)})}function x(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...r.A2(t)})}function S(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...r.A2(t)})}function A(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...r.A2(t)})}function I(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...r.A2(t)})}function w(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...r.A2(t)})}function T(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...r.A2(t)})}function N(e,t){return new e({type:"string",format:"date",check:"string_format",...r.A2(t)})}function O(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...r.A2(t)})}function k(e,t){return new e({type:"string",format:"duration",check:"string_format",...r.A2(t)})}function R(e,t){return new e({type:"number",checks:[],...r.A2(t)})}function C(e,t){return new e({type:"number",coerce:!0,checks:[],...r.A2(t)})}function P(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...r.A2(t)})}function L(e,t){return new e({type:"boolean",...r.A2(t)})}function j(e,t){return new e({type:"null",...r.A2(t)})}function M(e){return new e({type:"any"})}function D(e){return new e({type:"unknown"})}function Y(e,t){return new e({type:"never",...r.A2(t)})}function F(e,t){return new a.sm({check:"less_than",...r.A2(t),value:e,inclusive:!1})}function q(e,t){return new a.sm({check:"less_than",...r.A2(t),value:e,inclusive:!0})}function U(e,t){return new a.J_({check:"greater_than",...r.A2(t),value:e,inclusive:!1})}function V(e,t){return new a.J_({check:"greater_than",...r.A2(t),value:e,inclusive:!0})}function z(e,t){return new a.Jk({check:"multiple_of",...r.A2(t),value:e})}function Z(e,t){return new a.Yk({check:"max_length",...r.A2(t),maximum:e})}function B(e,t){return new a.Kk({check:"min_length",...r.A2(t),minimum:e})}function G(e,t){return new a.RM({check:"length_equals",...r.A2(t),length:e})}function W(e,t){return new a.DG({check:"string_format",format:"regex",...r.A2(t),pattern:e})}function K(e){return new a.NI({check:"string_format",format:"lowercase",...r.A2(e)})}function H(e){return new a.kH({check:"string_format",format:"uppercase",...r.A2(e)})}function J(e,t){return new a.Tt({check:"string_format",format:"includes",...r.A2(t),includes:e})}function X(e,t){return new a.J({check:"string_format",format:"starts_with",...r.A2(t),prefix:e})}function Q(e,t){return new a.E6({check:"string_format",format:"ends_with",...r.A2(t),suffix:e})}function ee(e){return new a.v$({check:"overwrite",tx:e})}function te(e){return ee((t=>t.normalize(e)))}function ne(){return ee((e=>e.trim()))}function ae(){return ee((e=>e.toLowerCase()))}function re(){return ee((e=>e.toUpperCase()))}function se(e,t,n){return new e({type:"array",element:t,...r.A2(n)})}function ie(e,t,n){const a=r.A2(n);return a.abort??(a.abort=!0),new e({type:"custom",check:"custom",fn:t,...a})}function oe(e,t,n){return new e({type:"custom",check:"custom",fn:t,...r.A2(n)})}},42945:(e,t,n)=>{const a=n(87391);e.exports=(e,t)=>e.sort(((e,n)=>a(e,n,t)))},42997:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>0!==a(e,t,n)},43143:(e,t,n)=>{const a=n(57544),r=n(75732),{ANY:s}=r,i=n(95323),o=n(67338),l=n(72608),u=n(86391),c=n(75092),p=n(70509);e.exports=(e,t,n,d)=>{let m,h,f,v,g;switch(e=new a(e,d),t=new i(t,d),n){case">":m=l,h=c,f=u,v=">",g=">=";break;case"<":m=u,h=p,f=l,v="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){const a=t.set[n];let i=null,o=null;if(a.forEach((e=>{e.semver===s&&(e=new r(">=0.0.0")),i=i||e,o=o||e,m(e.semver,i.semver,d)?i=e:f(e.semver,o.semver,d)&&(o=e)})),i.operator===v||i.operator===g)return!1;if((!o.operator||o.operator===v)&&h(e,o.semver))return!1;if(o.operator===g&&f(e,o.semver))return!1}return!0}},43287:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},43301:(e,t,n)=>{const a=n(20332);e.exports=(e,t,n)=>{try{t=new a(t,n)}catch(e){return!1}return t.test(e)}},43334:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>a(e,t,n)>0},43639:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},43959:function(e,t,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_PIPELINE_UTILS=void 0;const r=a(n(88769)),s="8.0.0",i="8.1.0";t.VIEW_PIPELINE_UTILS={MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_DE:s,MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_COMPASS:i,isPipelineSearchQueryable:e=>{for(const t of e){const e=Object.keys(t)[0];if("$addFields"!==e&&"$set"!==e&&"$match"!==e)return!1;if("$match"===e){const e=t.$match,n=Object.keys(e||{});if(1!==n.length||!n.includes("$expr"))return!1}}return!0},isVersionSearchCompatibleForViewsDataExplorer:e=>{try{return r.default.gte(e,s)}catch{return!1}},isVersionSearchCompatibleForViewsCompass:e=>{try{return r.default.gte(e,i)}catch{return!1}}}},44016:(e,t,n)=>{const a=n(41694),r=n(71333);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},44455:(e,t,n)=>{const a=n(9350);e.exports=(e,t,n)=>{const r=new a(e,n),s=new a(t,n);return r.compare(s)||r.compareBuild(s)}},44490:(e,t,n)=>{var a=n(99174),r=n(40811),s=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),i=/^[-+]?[0-9]+e/;e.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!s.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,a,r;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,r=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach((function(e){r.unshift(parseFloat(e,10))})),t=0,a=1,r.forEach((function(e){t+=e*a,a*=60})),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||a.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(a.isNegativeZero(e))return"-0.0";return n=e.toString(10),i.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},44601:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_CONSTANTS=void 0,t.createConstantFilter=f,t.wrapField=function(e,t=!1){return t||!function(e){if(/[.\s"'()[\];={}:]/.test(e))return!1;try{return new Function(`"use strict";let _ = { ${e}: 0 };`),!0}catch{return!1}}(e)?`"${e.replace(/["\\]/g,"\\$&")}"`:e},t.getFilteredCompletions=function(e={},n=t.ALL_CONSTANTS){const{serverVersion:a=m,fields:r=[],meta:s,stage:i}=e,o=f({serverVersion:a,meta:s,stage:i});return n.concat(r.flatMap((e=>{const{value:t,description:n}=function(e){return"string"==typeof e?{value:e}:{value:e.name,description:e.description}}(e);return[{value:t,meta:"field:identifier",version:"0.0.0",description:n},{value:`$${t}`,meta:"field:reference",version:"0.0.0",description:n}]}))).filter((e=>o(e)))};const a=n(35647),r=n(62280),s=n(63547),i=n(85665),o=n(48543),l=n(58313),u=n(13821),c=n(46699),p=n(71925),d=n(3794);t.ALL_CONSTANTS=[...r.ACCUMULATORS,...i.BSON_TYPES,...s.BSON_TYPE_ALIASES,...o.CONVERSION_OPERATORS,...l.EXPRESSION_OPERATORS,...u.JSON_SCHEMA,...c.QUERY_OPERATORS,...p.STAGE_OPERATORS,...d.SYSTEM_VARIABLES];const m="999.999.999";function h(e,t){return void 0===e||void 0===t||(e=Array.isArray(e)?e:[e]).some((e=>t.includes(e)))}function f({meta:e,serverVersion:t=m,stage:n={}}={}){const r=/^(?<version>\d+\.\d+\.\d+)/.exec(t)?.groups?.version??m;return({version:t,meta:s,env:i,namespaces:o,apiVersions:l})=>function(e,t){const n=/^\d+\.\d+\.\d+$/.test(t);return(0,a.satisfies)(e,n?`>=${t}`:t)}(r,t)&&h(n.env,i)&&h(n.namespace,o)&&h(n.apiVersion,l)&&(!e||function(e,t){const n=t.split(":");return e.some((e=>{const t=e.split(":");return t.length===n.length&&t.every(((e,t)=>"*"===e||e===n[t]))}))}(e,s))}},44719:(e,t,n)=>{n.d(t,{Tf:()=>r,Zt:()=>i,zM:()=>s});var a=n(49976);a.ACCUMULATORS,a.ADL,a.ANY_COLLECTION_NAMESPACE,a.ANY_NAMESPACE,a.ATLAS,a.ATLAS_SEARCH_TEMPLATES,a.ATLAS_VECTOR_SEARCH_TEMPLATE,a.BSON_TYPES,a.BSON_TYPE_ALIASES,a.COLLECTION,a.CONVERSION_OPERATORS,a.DATABASE,a.ENVS,a.EXPRESSION_OPERATORS,a.FULL_SCAN_STAGES,a.JSON_SCHEMA,a.ON_PREM,a.OUT_STAGES,a.QUERY_OPERATORS,a.REQUIRED_AS_FIRST_STAGE,a.STAGE_OPERATORS;const r=a.STAGE_OPERATOR_NAMES,s=(a.SYSTEM_VARIABLES,a.TIME_SERIES,a.VALIDATION_TEMPLATE,a.VIEW,a.VIEW_PIPELINE_UTILS,a.getFilteredCompletions),i=a.wrapField},44948:(e,t,n)=>{const a=n(33629);e.exports=(e,t)=>{try{return new a(e,t).range||"*"}catch(e){return null}}},45006:(e,t,n)=>{const a=n(33629),r=n(96506),{ANY:s}=r,i=n(52992),o=n(99430),l=[new r(">=0.0.0-0")],u=[new r(">=0.0.0")],c=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=n.includePrerelease?l:u}if(1===t.length&&t[0].semver===s){if(n.includePrerelease)return!0;t=u}const a=new Set;let r,c,m,h,f,v,g;for(const t of e)">"===t.operator||">="===t.operator?r=p(r,t,n):"<"===t.operator||"<="===t.operator?c=d(c,t,n):a.add(t.semver);if(a.size>1)return null;if(r&&c){if(m=o(r.semver,c.semver,n),m>0)return null;if(0===m&&(">="!==r.operator||"<="!==c.operator))return null}for(const e of a){if(r&&!i(e,String(r),n))return null;if(c&&!i(e,String(c),n))return null;for(const a of t)if(!i(e,String(a),n))return!1;return!0}let y=!(!c||n.includePrerelease||!c.semver.prerelease.length)&&c.semver,$=!(!r||n.includePrerelease||!r.semver.prerelease.length)&&r.semver;y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,v=v||"<"===e.operator||"<="===e.operator,r)if($&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===$.major&&e.semver.minor===$.minor&&e.semver.patch===$.patch&&($=!1),">"===e.operator||">="===e.operator){if(h=p(r,e,n),h===e&&h!==r)return!1}else if(">="===r.operator&&!i(r.semver,String(e),n))return!1;if(c)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(f=d(c,e,n),f===e&&f!==c)return!1}else if("<="===c.operator&&!i(c.semver,String(e),n))return!1;if(!e.operator&&(c||r)&&0!==m)return!1}return!(r&&v&&!c&&0!==m||c&&g&&!r&&0!==m||$||y)},p=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a>0?e:a<0||">"===t.operator&&">="===e.operator?t:e},d=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a<0?e:a>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new a(e,n),t=new a(t,n);let r=!1;e:for(const a of e.set){for(const e of t.set){const t=c(a,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},45160:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>0===a(e,t,n)},45848:(e,t,n)=>{var a=n(40811);e.exports=new a("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},45890:(e,t,n)=>{n.d(t,{e1:()=>v,mD:()=>he,m2:()=>d,Z9:()=>je,ej:()=>De,n_:()=>Me,HD:()=>Ce,Ds:()=>ke,hK:()=>y,sl:()=>Oe,cV:()=>Re,wA:()=>Te,CR:()=>m,cb:()=>h,o8:()=>Fe,$C:()=>$,u1:()=>b,$b:()=>N,G1:()=>S,zf:()=>_,R:()=>O,v0:()=>_e,qs:()=>k,ID:()=>de,WL:()=>R,x3:()=>C,HQ:()=>P,qx:()=>A,_Z:()=>Ee,xI:()=>xe,S:()=>Ie,GU:()=>Ae,hd:()=>Ne,N8:()=>be,ZZ:()=>$e,k5:()=>ye,WZ:()=>I,ae:()=>Ye,jN:()=>ge});var a=n(12240),r=n(26518),s=n(87257);class i{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??r.fd,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;const a=e._zod.def,r={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},i=this.seen.get(e);if(i)return i.count++,t.schemaPath.includes(e)&&(i.cycle=t.path),i.schema;const l={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,l);const u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{const n={...t,schemaPath:[...t.schemaPath,e],path:t.path},i=e._zod.parent;if(i)l.ref=i,this.process(i,n),this.seen.get(i).isParent=!0;else{const t=l.schema;switch(a.type){case"string":{const n=t;n.type="string";const{minimum:a,maximum:s,format:i,patterns:o,contentEncoding:u}=e._zod.bag;if("number"==typeof a&&(n.minLength=a),"number"==typeof s&&(n.maxLength=s),i&&(n.format=r[i]??i,""===n.format&&delete n.format),u&&(n.contentEncoding=u),o&&o.size>0){const e=[...o];1===e.length?n.pattern=e[0].source:e.length>1&&(l.schema.allOf=[...e.map((e=>({..."draft-7"===this.target?{type:"string"}:{},pattern:e.source})))])}break}case"number":{const n=t,{minimum:a,maximum:r,format:s,multipleOf:i,exclusiveMaximum:o,exclusiveMinimum:l}=e._zod.bag;"string"==typeof s&&s.includes("int")?n.type="integer":n.type="number","number"==typeof l&&(n.exclusiveMinimum=l),"number"==typeof a&&(n.minimum=a,"number"==typeof l&&(l>=a?delete n.minimum:delete n.exclusiveMinimum)),"number"==typeof o&&(n.exclusiveMaximum=o),"number"==typeof r&&(n.maximum=r,"number"==typeof o&&(o<=r?delete n.maximum:delete n.exclusiveMaximum)),"number"==typeof i&&(n.multipleOf=i);break}case"boolean":case"success":t.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema");break;case"null":t.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw new Error("Void cannot be represented in JSON Schema");break;case"never":t.not={};break;case"date":if("throw"===this.unrepresentable)throw new Error("Date cannot be represented in JSON Schema");break;case"array":{const r=t,{minimum:s,maximum:i}=e._zod.bag;"number"==typeof s&&(r.minItems=s),"number"==typeof i&&(r.maxItems=i),r.type="array",r.items=this.process(a.element,{...n,path:[...n.path,"items"]});break}case"object":{const e=t;e.type="object",e.properties={};const r=a.shape;for(const t in r)e.properties[t]=this.process(r[t],{...n,path:[...n.path,"properties",t]});const s=new Set(Object.keys(r)),i=new Set([...s].filter((e=>{const t=a.shape[e]._zod;return"input"===this.io?void 0===t.optin:void 0===t.optout})));i.size>0&&(e.required=Array.from(i)),"never"===a.catchall?._zod.def.type?e.additionalProperties=!1:a.catchall?a.catchall&&(e.additionalProperties=this.process(a.catchall,{...n,path:[...n.path,"additionalProperties"]})):"output"===this.io&&(e.additionalProperties=!1);break}case"union":t.anyOf=a.options.map(((e,t)=>this.process(e,{...n,path:[...n.path,"anyOf",t]})));break;case"intersection":{const e=t,r=this.process(a.left,{...n,path:[...n.path,"allOf",0]}),s=this.process(a.right,{...n,path:[...n.path,"allOf",1]}),i=e=>"allOf"in e&&1===Object.keys(e).length,o=[...i(r)?r.allOf:[r],...i(s)?s.allOf:[s]];e.allOf=o;break}case"tuple":{const r=t;r.type="array";const s=a.items.map(((e,t)=>this.process(e,{...n,path:[...n.path,"prefixItems",t]})));if("draft-2020-12"===this.target?r.prefixItems=s:r.items=s,a.rest){const e=this.process(a.rest,{...n,path:[...n.path,"items"]});"draft-2020-12"===this.target?r.items=e:r.additionalItems=e}a.rest&&(r.items=this.process(a.rest,{...n,path:[...n.path,"items"]}));const{minimum:i,maximum:o}=e._zod.bag;"number"==typeof i&&(r.minItems=i),"number"==typeof o&&(r.maxItems=o);break}case"record":{const e=t;e.type="object",e.propertyNames=this.process(a.keyType,{...n,path:[...n.path,"propertyNames"]}),e.additionalProperties=this.process(a.valueType,{...n,path:[...n.path,"additionalProperties"]});break}case"map":if("throw"===this.unrepresentable)throw new Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw new Error("Set cannot be represented in JSON Schema");break;case"enum":{const e=t,n=(0,s.w5)(a.entries);n.every((e=>"number"==typeof e))&&(e.type="number"),n.every((e=>"string"==typeof e))&&(e.type="string"),e.enum=n;break}case"literal":{const e=t,n=[];for(const e of a.values)if(void 0===e){if("throw"===this.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===this.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");n.push(Number(e))}else n.push(e);if(0===n.length);else if(1===n.length){const t=n[0];e.type=null===t?"null":typeof t,e.const=t}else n.every((e=>"number"==typeof e))&&(e.type="number"),n.every((e=>"string"==typeof e))&&(e.type="string"),n.every((e=>"boolean"==typeof e))&&(e.type="string"),n.every((e=>null===e))&&(e.type="null"),e.enum=n;break}case"file":{const n=t,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:r,maximum:s,mime:i}=e._zod.bag;void 0!==r&&(a.minLength=r),void 0!==s&&(a.maxLength=s),i?1===i.length?(a.contentMediaType=i[0],Object.assign(n,a)):n.anyOf=i.map((e=>({...a,contentMediaType:e}))):Object.assign(n,a);break}case"transform":if("throw"===this.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema");break;case"nullable":{const e=this.process(a.innerType,n);t.anyOf=[e,{type:"null"}];break}case"nonoptional":case"promise":case"optional":this.process(a.innerType,n),l.ref=a.innerType;break;case"default":this.process(a.innerType,n),l.ref=a.innerType,t.default=JSON.parse(JSON.stringify(a.defaultValue));break;case"prefault":this.process(a.innerType,n),l.ref=a.innerType,"input"===this.io&&(t._prefault=JSON.parse(JSON.stringify(a.defaultValue)));break;case"catch":{let e;this.process(a.innerType,n),l.ref=a.innerType;try{e=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=e;break}case"nan":if("throw"===this.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema");break;case"template_literal":{const n=t,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=a.source;break}case"pipe":{const e="input"===this.io?"transform"===a.in._zod.def.type?a.out:a.in:a.out;this.process(e,n),l.ref=e;break}case"readonly":this.process(a.innerType,n),l.ref=a.innerType,t.readOnly=!0;break;case"lazy":{const t=e._zod.innerType;this.process(t,n),l.ref=t;break}case"custom":if("throw"===this.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")}}}const c=this.metadataRegistry.get(e);return c&&Object.assign(l.schema,c),"input"===this.io&&o(e)&&(delete l.schema.examples,delete l.schema.default),"input"===this.io&&l.schema._prefault&&((n=l.schema).default??(n.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,t){const n={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},a=this.seen.get(e);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=e=>{const t="draft-2020-12"===this.target?"$defs":"definitions";if(n.external){const a=n.external.registry.get(e[0])?.id,r=n.external.uri??(e=>e);if(a)return{ref:r(a)};const s=e[1].defId??e[1].schema.id??"schema"+this.counter++;return e[1].defId=s,{defId:s,ref:`${r("__shared")}#/${t}/${s}`}}if(e[1]===a)return{ref:"#"};const r=`#/${t}/`,s=e[1].schema.id??"__schema"+this.counter++;return{defId:s,ref:r+s}},s=e=>{if(e[1].schema.$ref)return;const t=e[1],{ref:n,defId:a}=r(e);t.def={...t.schema},a&&(t.defId=a);const s=t.schema;for(const e in s)delete s[e];s.$ref=n};if("throw"===n.cycles)for(const e of this.seen.entries()){const t=e[1];if(t.cycle)throw new Error(`Cycle detected: #/${t.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const t of this.seen.entries()){const a=t[1];if(e===t[0]){s(t);continue}if(n.external){const a=n.external.registry.get(t[0])?.id;if(e!==t[0]&&a){s(t);continue}}const r=this.metadataRegistry.get(t[0])?.id;(r||a.cycle||a.count>1&&"ref"===n.reused)&&s(t)}const i=(e,t)=>{const n=this.seen.get(e),a=n.def??n.schema,r={...a};if(null===n.ref)return;const s=n.ref;if(n.ref=null,s){i(s,t);const e=this.seen.get(s).schema;e.$ref&&"draft-7"===t.target?(a.allOf=a.allOf??[],a.allOf.push(e)):(Object.assign(a,e),Object.assign(a,r))}n.isParent||this.override({zodSchema:e,jsonSchema:a,path:n.path??[]})};for(const e of[...this.seen.entries()].reverse())i(e[0],{target:this.target});const o={};if("draft-2020-12"===this.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?o.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){const t=n.external.registry.get(e)?.id;if(!t)throw new Error("Schema is missing an `id` property");o.$id=n.external.uri(t)}Object.assign(o,a.def);const l=n.external?.defs??{};for(const e of this.seen.entries()){const t=e[1];t.def&&t.defId&&(l[t.defId]=t.def)}n.external||Object.keys(l).length>0&&("draft-2020-12"===this.target?o.$defs=l:o.definitions=l);try{return JSON.parse(JSON.stringify(o))}catch(e){throw new Error("Error converting schema to JSON.")}}}function o(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;switch(a.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":case"custom":case"success":case"catch":return!1;case"array":return o(a.element,n);case"object":for(const e in a.shape)if(o(a.shape[e],n))return!0;return!1;case"union":for(const e of a.options)if(o(e,n))return!0;return!1;case"intersection":return o(a.left,n)||o(a.right,n);case"tuple":for(const e of a.items)if(o(e,n))return!0;return!(!a.rest||!o(a.rest,n));case"record":case"map":return o(a.keyType,n)||o(a.valueType,n);case"set":return o(a.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return o(a.innerType,n);case"lazy":return o(a.getter(),n);case"transform":return!0;case"pipe":return o(a.in,n)||o(a.out,n)}throw new Error(`Unknown schema type: ${a.type}`)}var l=n(23253),u=n(3508),c=n(29744),p=n(65994).e;function d(...e){return e.reduce(((e,t)=>({...e,...null!=t?t:{}})),{})}function m({tools:e=[],providerToolNames:t}){const n={},a={};for(const r of e)if("provider"===r.type&&r.id in t){const e=t[r.id];n[r.name]=e,a[e]=r.name}return{toProviderToolName:e=>{var t;return null!=(t=n[e])?t:e},toCustomToolName:e=>{var t;return null!=(t=a[e])?t:e}}}async function h(e,t){if(null==e)return Promise.resolve();const n=null==t?void 0:t.abortSignal;return new Promise(((t,a)=>{if(null==n?void 0:n.aborted)return void a(f());const r=setTimeout((()=>{s(),t()}),e),s=()=>{clearTimeout(r),null==n||n.removeEventListener("abort",i)},i=()=>{s(),a(f())};null==n||n.addEventListener("abort",i)}))}function f(){return new DOMException("Delay was aborted","AbortError")}var v=class{constructor(){this.status={type:"pending"},this._resolve=void 0,this._reject=void 0}get promise(){return this._promise||(this._promise=new Promise(((e,t)=>{"resolved"===this.status.type?e(this.status.value):"rejected"===this.status.type&&t(this.status.error),this._resolve=e,this._reject=t}))),this._promise}resolve(e){var t;this.status={type:"resolved",value:e},this._promise&&(null==(t=this._resolve)||t.call(this,e))}reject(e){var t;this.status={type:"rejected",error:e},this._promise&&(null==(t=this._reject)||t.call(this,e))}isResolved(){return"resolved"===this.status.type}isRejected(){return"rejected"===this.status.type}isPending(){return"pending"===this.status.type}};function g(e){return Object.fromEntries([...e.headers])}var y=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const e=n.length,a=new Array(t);for(let r=0;r<t;r++)a[r]=n[Math.random()*e|0];return a.join("")};if(null==e)return s;if(n.includes(r))throw new a.Di({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${s()}`},$=y();function b(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}function _(e){return(e instanceof Error||e instanceof DOMException)&&("AbortError"===e.name||"ResponseAborted"===e.name||"TimeoutError"===e.name)}var E=["fetch failed","failed to fetch"];function x({error:e,url:t,requestBodyValues:n}){if(_(e))return e;if(e instanceof TypeError&&E.includes(e.message.toLowerCase())){const r=e.cause;if(null!=r)return new a.hL({message:`Cannot connect to API: ${r.message}`,cause:r,url:t,requestBodyValues:n,isRetryable:!0})}return e}function S(e=globalThis){var t,n,a;return e.window?"runtime/browser":(null==(t=e.navigator)?void 0:t.userAgent)?`runtime/${e.navigator.userAgent.toLowerCase()}`:(null==(a=null==(n=e.process)?void 0:n.versions)?void 0:a.node)?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function A(e){if(null==e)return{};const t={};if(e instanceof Headers)e.forEach(((e,n)=>{t[n.toLowerCase()]=e}));else{Array.isArray(e)||(e=Object.entries(e));for(const[n,a]of e)null!=a&&(t[n.toLowerCase()]=a)}return t}function I(e,...t){const n=new Headers(A(e)),a=n.get("user-agent")||"";return n.set("user-agent",[a,...t].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var w="4.0.0-beta.47",T=()=>globalThis.fetch,N=async({url:e,headers:t={},successfulResponseHandler:n,failedResponseHandler:r,abortSignal:s,fetch:i=T()})=>{try{const o=await i(e,{method:"GET",headers:I(t,`ai-sdk/provider-utils/${w}`,S()),signal:s}),l=g(o);if(!o.ok){let t;try{t=await r({response:o,url:e,requestBodyValues:{}})}catch(t){if(_(t)||a.hL.isInstance(t))throw t;throw new a.hL({message:"Failed to process error response",cause:t,statusCode:o.status,url:e,responseHeaders:l,requestBodyValues:{}})}throw t.value}try{return await n({response:o,url:e,requestBodyValues:{}})}catch(t){if(t instanceof Error&&(_(t)||a.hL.isInstance(t)))throw t;throw new a.hL({message:"Failed to process successful response",cause:t,statusCode:o.status,url:e,responseHeaders:l,requestBodyValues:{}})}}catch(t){throw x({error:t,url:e,requestBodyValues:{}})}};function O(e){return null!=e}function k({mediaType:e,url:t,supportedUrls:n}){return t=t.toLowerCase(),e=e.toLowerCase(),Object.entries(n).map((([e,t])=>{const n=e.toLowerCase();return"*"===n||"*/*"===n?{mediaTypePrefix:"",regexes:t}:{mediaTypePrefix:n.replace(/\*/,""),regexes:t}})).filter((({mediaTypePrefix:t})=>e.startsWith(t))).flatMap((({regexes:e})=>e)).some((e=>e.test(t)))}function R({apiKey:e,environmentVariableName:t,apiKeyParameterName:n="apiKey",description:r}){if("string"==typeof e)return e;if(null!=e)throw new a.Kq({message:`${r} API key must be a string.`});if(void 0===p)throw new a.Kq({message:`${r} API key is missing. Pass it using the '${n}' parameter. Environment variables is not supported in this environment.`});if(null==(e=p.env[t]))throw new a.Kq({message:`${r} API key is missing. Pass it using the '${n}' parameter or the ${t} environment variable.`});if("string"!=typeof e)throw new a.Kq({message:`${r} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}function C({settingValue:e,environmentVariableName:t}){return"string"==typeof e||null==e&&void 0!==p&&null!=(e=p.env[t])&&"string"==typeof e?e:void 0}function P(e){var t;const[n,a=""]=e.toLowerCase().split("/");return null!=(t={mpeg:"mp3","x-wav":"wav",opus:"ogg",mp4:"m4a","x-m4a":"m4a"}[a])?t:a}var L=/"__proto__"\s*:/,j=/"constructor"\s*:/;function M(e){const t=JSON.parse(e);return null===t||"object"!=typeof t||!1===L.test(e)&&!1===j.test(e)?t:function(e){let t=[e];for(;t.length;){const e=t;t=[];for(const n of e){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const e in n){const a=n[e];a&&"object"==typeof a&&t.push(a)}}}return e}(t)}function D(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return M(e)}try{return M(e)}finally{Error.stackTraceLimit=t}}function Y(e){if("object"===e.type){e.additionalProperties=!1;const t=e.properties;if(null!=t)for(const e in t)t[e]=Y(t[e])}return"array"===e.type&&null!=e.items&&(Array.isArray(e.items)?e.items=e.items.map((e=>Y(e))):e.items=Y(e.items)),e}var F=e=>()=>e.toJsonSchema(),q=e=>async()=>{try{const{JSONSchema:t}=await Promise.resolve().then((function(){var e=new Error("Cannot find module 'effect'");throw e.code="MODULE_NOT_FOUND",e}));return t.make(e)}catch(e){throw new Error("Failed to import module 'effect'")}},U=e=>async()=>{try{const{toJsonSchema:t}=await Promise.resolve().then((function(){var e=new Error("Cannot find module '@valibot/to-json-schema'");throw e.code="MODULE_NOT_FOUND",e}));return t(e)}catch(e){throw new Error("Failed to import module '@valibot/to-json-schema'")}},V=Symbol("Let zodToJsonSchema decide on which parser to use"),z={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function Z(e,t){return oe(e.type._def,t)}function B(e,t,n){const a=null!=n?n:t.dateStrategy;if(Array.isArray(a))return{anyOf:a.map(((n,a)=>B(e,t,n)))};switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return G(e)}}var G=e=>{const t={type:"integer",format:"unix-time"};for(const n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value}return t},W=void 0,K={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(void 0===W&&(W=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),W),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function H(e,t){const n={type:"string"};if(e.checks)for(const a of e.checks)switch(a.kind){case"min":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,a.value):a.value;break;case"max":n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,a.value):a.value;break;case"email":switch(t.emailStrategy){case"format:email":Q(n,"email",a.message,t);break;case"format:idn-email":Q(n,"idn-email",a.message,t);break;case"pattern:zod":ee(n,K.email,a.message,t)}break;case"url":Q(n,"uri",a.message,t);break;case"uuid":Q(n,"uuid",a.message,t);break;case"regex":ee(n,a.regex,a.message,t);break;case"cuid":ee(n,K.cuid,a.message,t);break;case"cuid2":ee(n,K.cuid2,a.message,t);break;case"startsWith":ee(n,RegExp(`^${J(a.value,t)}`),a.message,t);break;case"endsWith":ee(n,RegExp(`${J(a.value,t)}$`),a.message,t);break;case"datetime":Q(n,"date-time",a.message,t);break;case"date":Q(n,"date",a.message,t);break;case"time":Q(n,"time",a.message,t);break;case"duration":Q(n,"duration",a.message,t);break;case"length":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,a.value):a.value,n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,a.value):a.value;break;case"includes":ee(n,RegExp(J(a.value,t)),a.message,t);break;case"ip":"v6"!==a.version&&Q(n,"ipv4",a.message,t),"v4"!==a.version&&Q(n,"ipv6",a.message,t);break;case"base64url":ee(n,K.base64url,a.message,t);break;case"jwt":ee(n,K.jwt,a.message,t);break;case"cidr":"v6"!==a.version&&ee(n,K.ipv4Cidr,a.message,t),"v4"!==a.version&&ee(n,K.ipv6Cidr,a.message,t);break;case"emoji":ee(n,K.emoji(),a.message,t);break;case"ulid":ee(n,K.ulid,a.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":Q(n,"binary",a.message,t);break;case"contentEncoding:base64":n.contentEncoding="base64";break;case"pattern:zod":ee(n,K.base64,a.message,t)}break;case"nanoid":ee(n,K.nanoid,a.message,t)}return n}function J(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let n=0;n<e.length;n++)X.has(e[n])||(t+="\\"),t+=e[n];return t}(e):e}var X=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Q(e,t,n,a){var r;e.format||(null==(r=e.anyOf)?void 0:r.some((e=>e.format)))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&a.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function ee(e,t,n,a){var r;e.pattern||(null==(r=e.allOf)?void 0:r.some((e=>e.pattern)))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:te(t,a),...n&&a.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=te(t,a)}function te(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;const a=e.flags.includes("i"),r=e.flags.includes("m"),s=e.flags.includes("s"),i=a?e.source.toLowerCase():e.source;let o="",l=!1,u=!1,c=!1;for(let e=0;e<i.length;e++)if(l)o+=i[e],l=!1;else{if(a)if(u){if(i[e].match(/[a-z]/)){c?(o+=i[e],o+=`${i[e-2]}-${i[e]}`.toUpperCase(),c=!1):"-"===i[e+1]&&(null==(n=i[e+2])?void 0:n.match(/[a-z]/))?(o+=i[e],c=!0):o+=`${i[e]}${i[e].toUpperCase()}`;continue}}else if(i[e].match(/[a-z]/)){o+=`[${i[e]}${i[e].toUpperCase()}]`;continue}if(r){if("^"===i[e]){o+="(^|(?<=[\r\n]))";continue}if("$"===i[e]){o+="($|(?=[\r\n]))";continue}}s&&"."===i[e]?o+=u?`${i[e]}\r\n`:`[${i[e]}\r\n]`:(o+=i[e],"\\"===i[e]?l=!0:u&&"]"===i[e]?u=!1:u||"["!==i[e]||(u=!0))}try{new RegExp(o)}catch(n){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function ne(e,t){var n,a,r,s,i,o;const l={type:"object",additionalProperties:null!=(n=oe(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?n:t.allowedAdditionalProperties};if((null==(a=e.keyType)?void 0:a._def.typeName)===u.kY.ZodString&&(null==(r=e.keyType._def.checks)?void 0:r.length)){const{type:n,...a}=H(e.keyType._def,t);return{...l,propertyNames:a}}if((null==(s=e.keyType)?void 0:s._def.typeName)===u.kY.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if((null==(i=e.keyType)?void 0:i._def.typeName)===u.kY.ZodBranded&&e.keyType._def.type._def.typeName===u.kY.ZodString&&(null==(o=e.keyType._def.type._def.checks)?void 0:o.length)){const{type:n,...a}=Z(e.keyType._def,t);return{...l,propertyNames:a}}return l}var ae={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function re(e){try{return e.isOptional()}catch(e){return!0}}var se=(e,t,n)=>{switch(t){case u.kY.ZodString:return H(e,n);case u.kY.ZodNumber:return function(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case u.kY.ZodObject:return function(e,t){const n={type:"object",properties:{}},a=[],r=e.shape();for(const e in r){let s=r[e];if(void 0===s||void 0===s._def)continue;const i=re(s),o=oe(s._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==o&&(n.properties[e]=o,i||a.push(e))}a.length&&(n.required=a);const s=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return oe(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==s&&(n.additionalProperties=s),n}(e,n);case u.kY.ZodBigInt:return function(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value}return t}(e);case u.kY.ZodBoolean:return{type:"boolean"};case u.kY.ZodDate:return B(e,n);case u.kY.ZodUndefined:return{not:{}};case u.kY.ZodNull:return{type:"null"};case u.kY.ZodArray:return function(e,t){var n,a,r;const s={type:"array"};return(null==(n=e.type)?void 0:n._def)&&(null==(r=null==(a=e.type)?void 0:a._def)?void 0:r.typeName)!==u.kY.ZodAny&&(s.items=oe(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(s.minItems=e.minLength.value),e.maxLength&&(s.maxItems=e.maxLength.value),e.exactLength&&(s.minItems=e.exactLength.value,s.maxItems=e.exactLength.value),s}(e,n);case u.kY.ZodUnion:case u.kY.ZodDiscriminatedUnion:return function(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every((e=>e._def.typeName in ae&&(!e._def.checks||!e._def.checks.length)))){const e=n.reduce(((e,t)=>{const n=ae[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e}),[]);return{type:e.length>1?e:e[0]}}if(n.every((e=>"ZodLiteral"===e._def.typeName&&!e.description))){const e=n.reduce(((e,t)=>{const n=typeof t._def.value;switch(n){case"string":case"number":case"boolean":return[...e,n];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}}),[]);if(e.length===n.length){const t=e.filter(((e,t,n)=>n.indexOf(e)===t));return{type:t.length>1?t:t[0],enum:n.reduce(((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value]),[])}}}else if(n.every((e=>"ZodEnum"===e._def.typeName)))return{type:"string",enum:n.reduce(((e,t)=>[...e,...t._def.values.filter((t=>!e.includes(t)))]),[])};return((e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map(((e,n)=>oe(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]}))).filter((e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0)));return n.length?{anyOf:n}:void 0})(e,t)}(e,n);case u.kY.ZodIntersection:return function(e,t){const n=[oe(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),oe(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter((e=>!!e)),a=[];return n.forEach((e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:n,...a}=e;t=a}a.push(t)}else a.push(...e.allOf);var t})),a.length?{allOf:a}:void 0}(e,n);case u.kY.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map(((e,n)=>oe(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[]),additionalItems:oe(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map(((e,n)=>oe(e._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]}))).reduce(((e,t)=>void 0===t?e:[...e,t]),[])}}(e,n);case u.kY.ZodRecord:return ne(e,n);case u.kY.ZodLiteral:return function(e){const t=typeof e.value;return"bigint"!==t&&"number"!==t&&"boolean"!==t&&"string"!==t?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===t?"integer":t,const:e.value}}(e);case u.kY.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case u.kY.ZodNativeEnum:return function(e){const t=e.values,n=Object.keys(e.values).filter((e=>"number"!=typeof t[t[e]])).map((e=>t[e])),a=Array.from(new Set(n.map((e=>typeof e))));return{type:1===a.length?"string"===a[0]?"string":"number":["string","number"],enum:n}}(e);case u.kY.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[ae[e.innerType._def.typeName],"null"]};const n=oe(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}(e,n);case u.kY.ZodOptional:return((e,t)=>{var n;if(t.currentPath.toString()===(null==(n=t.propertyPath)?void 0:n.toString()))return oe(e.innerType._def,t);const a=oe(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return a?{anyOf:[{not:{}},a]}:{}})(e,n);case u.kY.ZodMap:return function(e,t){return"record"===t.mapStrategy?ne(e,t):{type:"array",maxItems:125,items:{type:"array",items:[oe(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},oe(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}}}(e,n);case u.kY.ZodSet:return function(e,t){const n={type:"array",uniqueItems:!0,items:oe(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}(e,n);case u.kY.ZodLazy:return()=>e.getter()._def;case u.kY.ZodPromise:return function(e,t){return oe(e.type._def,t)}(e,n);case u.kY.ZodNaN:case u.kY.ZodNever:return{not:{}};case u.kY.ZodEffects:return function(e,t){return"input"===t.effectStrategy?oe(e.schema._def,t):{}}(e,n);case u.kY.ZodAny:case u.kY.ZodUnknown:return{};case u.kY.ZodDefault:return function(e,t){return{...oe(e.innerType._def,t),default:e.defaultValue()}}(e,n);case u.kY.ZodBranded:return Z(e,n);case u.kY.ZodReadonly:case u.kY.ZodCatch:return((e,t)=>oe(e.innerType._def,t))(e,n);case u.kY.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return oe(e.in._def,t);if("output"===t.pipeStrategy)return oe(e.out._def,t);const n=oe(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[n,oe(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]})].filter((e=>void 0!==e))}})(e,n);case u.kY.ZodFunction:case u.kY.ZodVoid:case u.kY.ZodSymbol:default:return}},ie=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function oe(e,t,n=!1){var a;const r=t.seen.get(e);if(t.override){const s=null==(a=t.override)?void 0:a.call(t,e,t,r,n);if(s!==V)return s}if(r&&!n){const e=le(r,t);if(void 0!==e)return e}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const i=se(e,e.typeName,t),o="function"==typeof i?oe(i(),t):i;if(o&&ue(e,t,o),t.postProcess){const n=t.postProcess(o,e,t);return s.jsonSchema=o,n}return s.jsonSchema=o,o}var le=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:ie(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every(((e,n)=>t.currentPath[n]===e))?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):"seen"===t.$refStrategy?{}:void 0}},ue=(e,t,n)=>(e.description&&(n.description=e.description),n),ce=(e,t)=>{var n;const a=(e=>{const t=(e=>"string"==typeof e?{...z,name:e}:{...z,...e})(e),n=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map((([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}])))}})(t);let r="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce(((e,[t,n])=>{var r;return{...e,[t]:null!=(r=oe(n._def,{...a,currentPath:[...a.basePath,a.definitionPath,t]},!0))?r:{}}}),{}):void 0;const s="string"==typeof t?t:"title"===(null==t?void 0:t.nameStrategy)||null==t?void 0:t.name,i=null!=(n=oe(e._def,void 0===s?a:{...a,currentPath:[...a.basePath,a.definitionPath,s]},!1))?n:{},o="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==o&&(i.title=o);const l=void 0===s?r?{...i,[a.definitionPath]:r}:i:{$ref:[..."relative"===a.$refStrategy?[]:a.basePath,a.definitionPath,s].join("/"),[a.definitionPath]:{...r,[s]:i}};return l.$schema="http://json-schema.org/draft-07/schema#",l},pe=Symbol.for("vercel.ai.schema");function de(e){let t;return()=>(null==t&&(t=e()),t)}function me(e,{validate:t}={}){return{[pe]:!0,_type:void 0,get jsonSchema(){return"function"==typeof e&&(e=e()),e},validate:t}}function he(e){return null==e?me({properties:{},additionalProperties:!1}):"object"==typeof(t=e)&&null!==t&&pe in t&&!0===t[pe]&&"jsonSchema"in t&&"validate"in t?e:"~standard"in e?function(e){const t=e["~standard"].vendor;switch(t){case"zod":return ge(e);case"arktype":return fe(e,F);case"effect":return fe(e,q);case"valibot":return fe(e,U);default:return fe(e,(()=>()=>{throw new Error(`Unsupported standard schema vendor: ${t}`)}))}}(e):e();var t}function fe(e,t){return me(t(e),{validate:async t=>{const n=await e["~standard"].validate(t);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new a.iM({value:t,cause:n.issues})}}})}function ve(e,t){var n;const a=null!=(n=null==t?void 0:t.useReferences)&&n;return me((()=>Y(function(e,t){if(e instanceof r.rs){const n=new i(t),a={};for(const t of e._idmap.entries()){const[e,a]=t;n.process(a)}const r={},s={registry:e,uri:t?.uri,defs:a};for(const a of e._idmap.entries()){const[e,i]=a;r[e]=n.emit(i,{...t,external:s})}if(Object.keys(a).length>0){const e="draft-2020-12"===n.target?"$defs":"definitions";r.__shared={[e]:a}}return{schemas:r}}const n=new i(t);return n.process(e),n.emit(e,t)}(e,{target:"draft-7",io:"input",reused:a?"ref":"inline"}))),{validate:async t=>{const n=await l.bp(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function ge(e,t){return function(e){return"_zod"in e}(e)?ve(e,t):function(e,t){var n;const a=null!=(n=null==t?void 0:t.useReferences)&&n;return me((()=>ce(e,{$refStrategy:a?"root":"none"})),{validate:async t=>{const n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}(e,t)}async function ye({value:e,schema:t}){const n=await $e({value:e,schema:t});if(!n.success)throw a.iM.wrap({value:e,cause:n.error});return n.value}async function $e({value:e,schema:t}){const n=he(t);try{if(null==n.validate)return{success:!0,value:e,rawValue:e};const t=await n.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:a.iM.wrap({value:e,cause:t.error}),rawValue:e}}catch(t){return{success:!1,error:a.iM.wrap({value:e,cause:t}),rawValue:e}}}async function be({text:e,schema:t}){try{const n=D(e);return null==t?{success:!0,value:n,rawValue:n}:await $e({value:n,schema:t})}catch(t){return{success:!1,error:a.u6.isInstance(t)?t:new a.u6({text:e,cause:t}),rawValue:void 0}}}function _e(e){try{return D(e),!0}catch(e){return!1}}function Ee({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new c.Z).pipeThrough(new TransformStream({async transform({data:e},n){"[DONE]"!==e&&n.enqueue(await be({text:e,schema:t}))}}))}async function xe({provider:e,providerOptions:t,schema:n}){if(null==(null==t?void 0:t[e]))return;const r=await $e({value:t[e],schema:n});if(!r.success)throw new a.Di({argument:"providerOptions",message:`invalid ${e} provider options`,cause:r.error});return r.value}var Se=()=>globalThis.fetch,Ae=async({url:e,headers:t,body:n,failedResponseHandler:a,successfulResponseHandler:r,abortSignal:s,fetch:i})=>we({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(n),values:n},failedResponseHandler:a,successfulResponseHandler:r,abortSignal:s,fetch:i}),Ie=async({url:e,headers:t,formData:n,failedResponseHandler:a,successfulResponseHandler:r,abortSignal:s,fetch:i})=>we({url:e,headers:t,body:{content:n,values:Object.fromEntries(n.entries())},failedResponseHandler:a,successfulResponseHandler:r,abortSignal:s,fetch:i}),we=async({url:e,headers:t={},body:n,successfulResponseHandler:r,failedResponseHandler:s,abortSignal:i,fetch:o=Se()})=>{try{const l=await o(e,{method:"POST",headers:I(t,`ai-sdk/provider-utils/${w}`,S()),body:n.content,signal:i}),u=g(l);if(!l.ok){let t;try{t=await s({response:l,url:e,requestBodyValues:n.values})}catch(t){if(_(t)||a.hL.isInstance(t))throw t;throw new a.hL({message:"Failed to process error response",cause:t,statusCode:l.status,url:e,responseHeaders:u,requestBodyValues:n.values})}throw t.value}try{return await r({response:l,url:e,requestBodyValues:n.values})}catch(t){if(t instanceof Error&&(_(t)||a.hL.isInstance(t)))throw t;throw new a.hL({message:"Failed to process successful response",cause:t,statusCode:l.status,url:e,responseHeaders:u,requestBodyValues:n.values})}}catch(t){throw x({error:t,url:e,requestBodyValues:n.values})}};function Te({id:e,inputSchema:t,outputSchema:n}){return({execute:a,needsApproval:r,toModelOutput:s,onInputStart:i,onInputDelta:o,onInputAvailable:l,...u})=>({type:"provider",id:e,args:u,inputSchema:t,outputSchema:n,execute:a,needsApproval:r,toModelOutput:s,onInputStart:i,onInputDelta:o,onInputAvailable:l})}async function Ne(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}var Oe=({errorSchema:e,errorToMessage:t,isRetryable:n})=>async({response:r,url:s,requestBodyValues:i})=>{const o=await r.text(),l=g(r);if(""===o.trim())return{responseHeaders:l,value:new a.hL({message:r.statusText,url:s,requestBodyValues:i,statusCode:r.status,responseHeaders:l,responseBody:o,isRetryable:null==n?void 0:n(r)})};try{const u=await async function({text:e,schema:t}){try{const n=D(e);return null==t?n:ye({value:n,schema:t})}catch(t){if(a.u6.isInstance(t)||a.iM.isInstance(t))throw t;throw new a.u6({text:e,cause:t})}}({text:o,schema:e});return{responseHeaders:l,value:new a.hL({message:t(u),url:s,requestBodyValues:i,statusCode:r.status,responseHeaders:l,responseBody:o,data:u,isRetryable:null==n?void 0:n(r,u)})}}catch(e){return{responseHeaders:l,value:new a.hL({message:r.statusText,url:s,requestBodyValues:i,statusCode:r.status,responseHeaders:l,responseBody:o,isRetryable:null==n?void 0:n(r)})}}},ke=e=>async({response:t})=>{const n=g(t);if(null==t.body)throw new a.Tt({});return{responseHeaders:n,value:Ee({stream:t.body,schema:e})}},Re=e=>async({response:t,url:n,requestBodyValues:r})=>{const s=await t.text(),i=await be({text:s,schema:e}),o=g(t);if(!i.success)throw new a.hL({message:"Invalid JSON response",cause:i.error,statusCode:t.status,responseHeaders:o,responseBody:s,url:n,requestBodyValues:r});return{responseHeaders:o,value:i.value,rawValue:i.rawValue}},Ce=()=>async({response:e,url:t,requestBodyValues:n})=>{const r=g(e);if(!e.body)throw new a.hL({message:"Response body is empty",url:t,requestBodyValues:n,statusCode:e.status,responseHeaders:r,responseBody:void 0});try{const t=await e.arrayBuffer();return{responseHeaders:r,value:new Uint8Array(t)}}catch(s){throw new a.hL({message:"Failed to read response as array buffer",url:t,requestBodyValues:n,statusCode:e.status,responseHeaders:r,responseBody:void 0,cause:s})}},{btoa:Pe,atob:Le}=globalThis;function je(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=Le(t);return Uint8Array.from(n,(e=>e.codePointAt(0)))}function Me(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return Pe(t)}function De(e){return e instanceof Uint8Array?Me(e):e}function Ye(e){return null==e?void 0:e.replace(/\/$/,"")}async function*Fe({execute:e,input:t,options:n}){const a=e(t,n);if(null!=(r=a)&&"function"==typeof r[Symbol.asyncIterator]){let e;for await(const t of a)e=t,yield{type:"preliminary",output:t};yield{type:"final",output:e}}else yield{type:"final",output:await a};var r}},45962:(e,t,n)=>{var a,r;n.d(t,{BRAND:()=>je,DIRTY:()=>$,EMPTY_PATH:()=>f,INVALID:()=>y,NEVER:()=>Nt,OK:()=>b,ParseStatus:()=>g,Schema:()=>O,ZodAny:()=>oe,ZodArray:()=>pe,ZodBigInt:()=>te,ZodBoolean:()=>ne,ZodBranded:()=>Me,ZodCatch:()=>Pe,ZodDate:()=>ae,ZodDefault:()=>Ce,ZodDiscriminatedUnion:()=>ve,ZodEffects:()=>Oe,ZodEnum:()=>we,ZodError:()=>u,ZodFirstPartyTypeKind:()=>Ve,ZodFunction:()=>xe,ZodIntersection:()=>ye,ZodIssueCode:()=>o,ZodLazy:()=>Se,ZodLiteral:()=>Ae,ZodMap:()=>_e,ZodNaN:()=>Le,ZodNativeEnum:()=>Te,ZodNever:()=>ue,ZodNull:()=>ie,ZodNullable:()=>Re,ZodNumber:()=>ee,ZodObject:()=>me,ZodOptional:()=>ke,ZodParsedType:()=>s,ZodPipeline:()=>De,ZodPromise:()=>Ne,ZodReadonly:()=>Ye,ZodRecord:()=>be,ZodSchema:()=>O,ZodSet:()=>Ee,ZodString:()=>X,ZodSymbol:()=>re,ZodTransformer:()=>Oe,ZodTuple:()=>$e,ZodType:()=>O,ZodUndefined:()=>se,ZodUnion:()=>he,ZodUnknown:()=>le,ZodVoid:()=>ce,addIssueToContext:()=>v,any:()=>et,array:()=>rt,bigint:()=>We,boolean:()=>Ke,coerce:()=>Tt,custom:()=>qe,date:()=>He,datetimeRegex:()=>K,defaultErrorMap:()=>c,discriminatedUnion:()=>lt,effect:()=>bt,enum:()=>gt,function:()=>ht,getErrorMap:()=>m,getParsedType:()=>i,instanceof:()=>ze,intersection:()=>ut,isAborted:()=>_,isAsync:()=>S,isDirty:()=>E,isValid:()=>x,late:()=>Ue,lazy:()=>ft,literal:()=>vt,makeIssue:()=>h,map:()=>dt,nan:()=>Ge,nativeEnum:()=>yt,never:()=>nt,null:()=>Qe,nullable:()=>Et,number:()=>Be,object:()=>st,objectUtil:()=>r,oboolean:()=>wt,onumber:()=>It,optional:()=>_t,ostring:()=>At,pipeline:()=>St,preprocess:()=>xt,promise:()=>$t,quotelessJson:()=>l,record:()=>pt,set:()=>mt,setErrorMap:()=>d,strictObject:()=>it,string:()=>Ze,symbol:()=>Je,transformer:()=>bt,tuple:()=>ct,undefined:()=>Xe,union:()=>ot,unknown:()=>tt,util:()=>a,void:()=>at}),n.r(t),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),a={};for(const e of n)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(a||(a={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(r||(r={}));const s=a.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return Number.isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":return Array.isArray(e)?s.array:null===e?s.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?s.promise:"undefined"!=typeof Map&&e instanceof Map?s.map:"undefined"!=typeof Set&&e instanceof Set?s.set:"undefined"!=typeof Date&&e instanceof Date?s.date:s.object;default:return s.unknown}},o=a.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),l=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class u extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},a=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(a);else if("invalid_return_type"===r.code)a(r.returnTypeError);else if("invalid_arguments"===r.code)a(r.argumentsError);else if(0===r.path.length)n._errors.push(t(r));else{let e=n,a=0;for(;a<r.path.length;){const n=r.path[a];a===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],a++}}};return a(this),n}static assert(e){if(!(e instanceof u))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}u.create=e=>new u(e);const c=(e,t)=>{let n;switch(e.code){case o.invalid_type:n=e.received===s.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case o.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,a.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:n=`Unrecognized key(s) in object: ${a.joinValues(e.keys,", ")}`;break;case o.invalid_union:n="Invalid input";break;case o.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${a.joinValues(e.options)}`;break;case o.invalid_enum_value:n=`Invalid enum value. Expected ${a.joinValues(e.options)}, received '${e.received}'`;break;case o.invalid_arguments:n="Invalid function arguments";break;case o.invalid_return_type:n="Invalid function return type";break;case o.invalid_date:n="Invalid date";break;case o.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:a.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case o.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case o.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case o.custom:n="Invalid input";break;case o.invalid_intersection_types:n="Intersection results could not be merged";break;case o.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case o.not_finite:n="Number must be finite";break;default:n=t.defaultError,a.assertNever(e)}return{message:n}};let p=c;function d(e){p=e}function m(){return p}const h=e=>{const{data:t,path:n,errorMaps:a,issueData:r}=e,s=[...n,...r.path||[]],i={...r,path:s};if(void 0!==r.message)return{...r,path:s,message:r.message};let o="";const l=a.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(i,{data:t,defaultError:o}).message;return{...r,path:s,message:o}},f=[];function v(e,t){const n=m(),a=h({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===c?void 0:c].filter((e=>!!e))});e.common.issues.push(a)}class g{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if("aborted"===a.status)return y;"dirty"===a.status&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,a=await e.value;n.push({key:t,value:a})}return g.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:t,value:r}=a;if("aborted"===t.status)return y;if("aborted"===r.status)return y;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!a.alwaysSet||(n[t.value]=r.value)}return{status:e.value,value:n}}}const y=Object.freeze({status:"aborted"}),$=e=>({status:"dirty",value:e}),b=e=>({status:"valid",value:e}),_=e=>"aborted"===e.status,E=e=>"dirty"===e.status,x=e=>"valid"===e.status,S=e=>"undefined"!=typeof Promise&&e instanceof Promise;var A;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(A||(A={}));var I=n(9606).URL;class w{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const T=(e,t)=>{if(x(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new u(e.common.issues);return this._error=t,this._error}}};function N(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:a,description:r}=e;if(t&&(n||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:r}:{errorMap:(t,r)=>{const{message:s}=e;return"invalid_enum_value"===t.code?{message:s??r.defaultError}:void 0===r.data?{message:s??a??r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:s??n??r.defaultError}},description:r}}class O{get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new g,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(S(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},a=this._parseSync({data:e,path:n.path,parent:n});return T(n,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return x(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>x(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},a=this._parse({data:e,path:n.path,parent:n}),r=await(S(a)?a:Promise.resolve(a));return T(n,r)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,a)=>{const r=e(t),s=()=>a.addIssue({code:o.custom,...n(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then((e=>!!e||(s(),!1))):!!r||(s(),!1)}))}refinement(e,t){return this._refinement(((n,a)=>!!e(n)||(a.addIssue("function"==typeof t?t(n,a):t),!1)))}_refinement(e){return new Oe({schema:this,typeName:Ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ke.create(this,this._def)}nullable(){return Re.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return pe.create(this)}promise(){return Ne.create(this,this._def)}or(e){return he.create([this,e],this._def)}and(e){return ye.create(this,e,this._def)}transform(e){return new Oe({...N(this._def),schema:this,typeName:Ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ce({...N(this._def),innerType:this,defaultValue:t,typeName:Ve.ZodDefault})}brand(){return new Me({typeName:Ve.ZodBranded,type:this,...N(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Pe({...N(this._def),innerType:this,catchValue:t,typeName:Ve.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return De.create(this,e)}readonly(){return Ye.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const k=/^c[^\s-]{8,}$/i,R=/^[0-9a-z]+$/,C=/^[0-9A-HJKMNP-TV-Z]{26}$/i,P=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,L=/^[a-z0-9_-]{21}$/i,j=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,M=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,D=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Y;const F=/^(?:(?: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])$/,q=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,U=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,V=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,z=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Z=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,B="((\\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])))",G=new RegExp(`^${B}$`);function W(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function K(e){let t=`${B}T${W(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function H(e,t){if(!j.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(a));return!("object"!=typeof r||null===r||"typ"in r&&"JWT"!==r?.typ||!r.alg||t&&r.alg!==t)}catch{return!1}}function J(e,t){return!("v4"!==t&&t||!q.test(e))||!("v6"!==t&&t||!V.test(e))}class X extends O{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.string){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.string,received:t.parsedType}),y}const t=new g;let n;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),v(n,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("max"===s.kind)e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),v(n,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("length"===s.kind){const a=e.data.length>s.value,r=e.data.length<s.value;(a||r)&&(n=this._getOrReturnCtx(e,n),a?v(n,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):r&&v(n,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if("email"===s.kind)D.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"email",code:o.invalid_string,message:s.message}),t.dirty());else if("emoji"===s.kind)Y||(Y=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Y.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"emoji",code:o.invalid_string,message:s.message}),t.dirty());else if("uuid"===s.kind)P.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"uuid",code:o.invalid_string,message:s.message}),t.dirty());else if("nanoid"===s.kind)L.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"nanoid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid"===s.kind)k.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"cuid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid2"===s.kind)R.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"cuid2",code:o.invalid_string,message:s.message}),t.dirty());else if("ulid"===s.kind)C.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"ulid",code:o.invalid_string,message:s.message}),t.dirty());else if("url"===s.kind)try{new I(e.data)}catch{n=this._getOrReturnCtx(e,n),v(n,{validation:"url",code:o.invalid_string,message:s.message}),t.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"regex",code:o.invalid_string,message:s.message}),t.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),v(n,{code:o.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),v(n,{code:o.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),v(n,{code:o.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):"datetime"===s.kind?K(s).test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:o.invalid_string,validation:"datetime",message:s.message}),t.dirty()):"date"===s.kind?G.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:o.invalid_string,validation:"date",message:s.message}),t.dirty()):"time"===s.kind?new RegExp(`^${W(s)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:o.invalid_string,validation:"time",message:s.message}),t.dirty()):"duration"===s.kind?M.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"duration",code:o.invalid_string,message:s.message}),t.dirty()):"ip"===s.kind?(r=e.data,("v4"!==(i=s.version)&&i||!F.test(r))&&("v6"!==i&&i||!U.test(r))&&(n=this._getOrReturnCtx(e,n),v(n,{validation:"ip",code:o.invalid_string,message:s.message}),t.dirty())):"jwt"===s.kind?H(e.data,s.alg)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"jwt",code:o.invalid_string,message:s.message}),t.dirty()):"cidr"===s.kind?J(e.data,s.version)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"cidr",code:o.invalid_string,message:s.message}),t.dirty()):"base64"===s.kind?z.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"base64",code:o.invalid_string,message:s.message}),t.dirty()):"base64url"===s.kind?Z.test(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{validation:"base64url",code:o.invalid_string,message:s.message}),t.dirty()):a.assertNever(s);var r,i;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:o.invalid_string,...A.errToObj(n)})}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...A.errToObj(e)})}url(e){return this._addCheck({kind:"url",...A.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...A.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...A.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...A.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...A.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...A.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...A.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...A.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...A.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...A.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...A.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...A.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...A.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...A.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...A.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...A.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...A.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...A.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...A.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...A.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...A.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...A.errToObj(t)})}nonempty(e){return this.min(1,A.errToObj(e))}trim(){return new X({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new X({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new X({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Q(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,r=n>a?n:a;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}X.create=e=>new X({checks:[],typeName:Ve.ZodString,coerce:e?.coerce??!1,...N(e)});class ee extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==s.number){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.number,received:t.parsedType}),y}let t;const n=new g;for(const r of this._def.checks)"int"===r.kind?a.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),v(t,{code:o.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:o.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:o.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==Q(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:o.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),v(t,{code:o.not_finite,message:r.message}),n.dirty()):a.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,A.toString(t))}gt(e,t){return this.setLimit("min",e,!1,A.toString(t))}lte(e,t){return this.setLimit("max",e,!0,A.toString(t))}lt(e,t){return this.setLimit("max",e,!1,A.toString(t))}setLimit(e,t,n,a){return new ee({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:A.toString(a)}]})}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:A.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:A.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:A.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:A.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:A.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:A.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:A.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:A.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:A.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&a.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ee.create=e=>new ee({checks:[],typeName:Ve.ZodNumber,coerce:e?.coerce||!1,...N(e)});class te extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==s.bigint)return this._getInvalidInput(e);let t;const n=new g;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:o.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:o.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),v(t,{code:o.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):a.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.bigint,received:t.parsedType}),y}gte(e,t){return this.setLimit("min",e,!0,A.toString(t))}gt(e,t){return this.setLimit("min",e,!1,A.toString(t))}lte(e,t){return this.setLimit("max",e,!0,A.toString(t))}lt(e,t){return this.setLimit("max",e,!1,A.toString(t))}setLimit(e,t,n,a){return new te({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:A.toString(a)}]})}_addCheck(e){return new te({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:A.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:A.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:A.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:A.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:A.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}te.create=e=>new te({checks:[],typeName:Ve.ZodBigInt,coerce:e?.coerce??!1,...N(e)});class ne extends O{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==s.boolean){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.boolean,received:t.parsedType}),y}return b(e.data)}}ne.create=e=>new ne({typeName:Ve.ZodBoolean,coerce:e?.coerce||!1,...N(e)});class ae extends O{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.date){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.date,received:t.parsedType}),y}if(Number.isNaN(e.data.getTime()))return v(this._getOrReturnCtx(e),{code:o.invalid_date}),y;const t=new g;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),v(n,{code:o.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),v(n,{code:o.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):a.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ae({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:A.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:A.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ae.create=e=>new ae({checks:[],coerce:e?.coerce||!1,typeName:Ve.ZodDate,...N(e)});class re extends O{_parse(e){if(this._getType(e)!==s.symbol){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.symbol,received:t.parsedType}),y}return b(e.data)}}re.create=e=>new re({typeName:Ve.ZodSymbol,...N(e)});class se extends O{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.undefined,received:t.parsedType}),y}return b(e.data)}}se.create=e=>new se({typeName:Ve.ZodUndefined,...N(e)});class ie extends O{_parse(e){if(this._getType(e)!==s.null){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.null,received:t.parsedType}),y}return b(e.data)}}ie.create=e=>new ie({typeName:Ve.ZodNull,...N(e)});class oe extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return b(e.data)}}oe.create=e=>new oe({typeName:Ve.ZodAny,...N(e)});class le extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return b(e.data)}}le.create=e=>new le({typeName:Ve.ZodUnknown,...N(e)});class ue extends O{_parse(e){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.never,received:t.parsedType}),y}}ue.create=e=>new ue({typeName:Ve.ZodNever,...N(e)});class ce extends O{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.void,received:t.parsedType}),y}return b(e.data)}}ce.create=e=>new ce({typeName:Ve.ZodVoid,...N(e)});class pe extends O{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==s.array)return v(t,{code:o.invalid_type,expected:s.array,received:t.parsedType}),y;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,r=t.data.length<a.exactLength.value;(e||r)&&(v(t,{code:e?o.too_big:o.too_small,minimum:r?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(v(t,{code:o.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(v(t,{code:o.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>a.type._parseAsync(new w(t,e,t.path,n))))).then((e=>g.mergeArray(n,e)));const r=[...t.data].map(((e,n)=>a.type._parseSync(new w(t,e,t.path,n))));return g.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new pe({...this._def,minLength:{value:e,message:A.toString(t)}})}max(e,t){return new pe({...this._def,maxLength:{value:e,message:A.toString(t)}})}length(e,t){return new pe({...this._def,exactLength:{value:e,message:A.toString(t)}})}nonempty(e){return this.min(1,e)}}function de(e){if(e instanceof me){const t={};for(const n in e.shape){const a=e.shape[n];t[n]=ke.create(de(a))}return new me({...e._def,shape:()=>t})}return e instanceof pe?new pe({...e._def,type:de(e.element)}):e instanceof ke?ke.create(de(e.unwrap())):e instanceof Re?Re.create(de(e.unwrap())):e instanceof $e?$e.create(e.items.map((e=>de(e)))):e}pe.create=(e,t)=>new pe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ve.ZodArray,...N(t)});class me extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=a.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==s.object){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),y}const{status:t,ctx:n}=this._processInputParams(e),{shape:a,keys:r}=this._getCached(),i=[];if(!(this._def.catchall instanceof ue&&"strip"===this._def.unknownKeys))for(const e in n.data)r.includes(e)||i.push(e);const l=[];for(const e of r){const t=a[e],r=n.data[e];l.push({key:{status:"valid",value:e},value:t._parse(new w(n,r,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ue){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)l.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)i.length>0&&(v(n,{code:o.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const a=n.data[t];l.push({key:{status:"valid",value:t},value:e._parse(new w(n,a,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of l){const n=await t.key,a=await t.value;e.push({key:n,value:a,alwaysSet:t.alwaysSet})}return e})).then((e=>g.mergeObjectSync(t,e))):g.mergeObjectSync(t,l)}get shape(){return this._def.shape()}strict(e){return A.errToObj,new me({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{const a=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:A.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new me({...this._def,unknownKeys:"strip"})}passthrough(){return new me({...this._def,unknownKeys:"passthrough"})}extend(e){return new me({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new me({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ve.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new me({...this._def,catchall:e})}pick(e){const t={};for(const n of a.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new me({...this._def,shape:()=>t})}omit(e){const t={};for(const n of a.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new me({...this._def,shape:()=>t})}deepPartial(){return de(this)}partial(e){const t={};for(const n of a.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new me({...this._def,shape:()=>t})}required(e){const t={};for(const n of a.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof ke;)e=e._def.innerType;t[n]=e}return new me({...this._def,shape:()=>t})}keyof(){return Ie(a.objectKeys(this.shape))}}me.create=(e,t)=>new me({shape:()=>e,unknownKeys:"strip",catchall:ue.create(),typeName:Ve.ZodObject,...N(t)}),me.strictCreate=(e,t)=>new me({shape:()=>e,unknownKeys:"strict",catchall:ue.create(),typeName:Ve.ZodObject,...N(t)}),me.lazycreate=(e,t)=>new me({shape:e,unknownKeys:"strip",catchall:ue.create(),typeName:Ve.ZodObject,...N(t)});class he extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new u(e.ctx.common.issues)));return v(t,{code:o.invalid_union,unionErrors:n}),y}));{let e;const a=[];for(const r of n){const n={...t,common:{...t.common,issues:[]},parent:null},s=r._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&a.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=a.map((e=>new u(e)));return v(t,{code:o.invalid_union,unionErrors:r}),y}}get options(){return this._def.options}}he.create=(e,t)=>new he({options:e,typeName:Ve.ZodUnion,...N(t)});const fe=e=>e instanceof Se?fe(e.schema):e instanceof Oe?fe(e.innerType()):e instanceof Ae?[e.value]:e instanceof we?e.options:e instanceof Te?a.objectValues(e.enum):e instanceof Ce?fe(e._def.innerType):e instanceof se?[void 0]:e instanceof ie?[null]:e instanceof ke?[void 0,...fe(e.unwrap())]:e instanceof Re?[null,...fe(e.unwrap())]:e instanceof Me||e instanceof Ye?fe(e.unwrap()):e instanceof Pe?fe(e._def.innerType):[];class ve extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.object)return v(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),y;const n=this.discriminator,a=t.data[n],r=this.optionsMap.get(a);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(v(t,{code:o.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const a=new Map;for(const n of t){const t=fe(n.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const r of t){if(a.has(r))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);a.set(r,n)}}return new ve({typeName:Ve.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...N(n)})}}function ge(e,t){const n=i(e),r=i(t);if(e===t)return{valid:!0,data:e};if(n===s.object&&r===s.object){const n=a.objectKeys(t),r=a.objectKeys(e).filter((e=>-1!==n.indexOf(e))),s={...e,...t};for(const n of r){const a=ge(e[n],t[n]);if(!a.valid)return{valid:!1};s[n]=a.data}return{valid:!0,data:s}}if(n===s.array&&r===s.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let a=0;a<e.length;a++){const r=ge(e[a],t[a]);if(!r.valid)return{valid:!1};n.push(r.data)}return{valid:!0,data:n}}return n===s.date&&r===s.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ye extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(e,a)=>{if(_(e)||_(a))return y;const r=ge(e.value,a.value);return r.valid?((E(e)||E(a))&&t.dirty(),{status:t.value,value:r.data}):(v(n,{code:o.invalid_intersection_types}),y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>a(e,t))):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ye.create=(e,t,n)=>new ye({left:e,right:t,typeName:Ve.ZodIntersection,...N(n)});class $e extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.array)return v(n,{code:o.invalid_type,expected:s.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return v(n,{code:o.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&n.data.length>this._def.items.length&&(v(n,{code:o.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map(((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new w(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(a).then((e=>g.mergeArray(t,e))):g.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new $e({...this._def,rest:e})}}$e.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $e({items:e,typeName:Ve.ZodTuple,rest:null,...N(t)})};class be extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.object)return v(n,{code:o.invalid_type,expected:s.object,received:n.parsedType}),y;const a=[],r=this._def.keyType,i=this._def.valueType;for(const e in n.data)a.push({key:r._parse(new w(n,e,n.path,e)),value:i._parse(new w(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?g.mergeObjectAsync(t,a):g.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,n){return new be(t instanceof O?{keyType:e,valueType:t,typeName:Ve.ZodRecord,...N(n)}:{keyType:X.create(),valueType:e,typeName:Ve.ZodRecord,...N(t)})}}class _e extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.map)return v(n,{code:o.invalid_type,expected:s.map,received:n.parsedType}),y;const a=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map((([e,t],s)=>({key:a._parse(new w(n,e,n.path,[s,"key"])),value:r._parse(new w(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of i){const a=await n.key,r=await n.value;if("aborted"===a.status||"aborted"===r.status)return y;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of i){const a=n.key,r=n.value;if("aborted"===a.status||"aborted"===r.status)return y;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}}}}_e.create=(e,t,n)=>new _e({valueType:t,keyType:e,typeName:Ve.ZodMap,...N(n)});class Ee extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==s.set)return v(n,{code:o.invalid_type,expected:s.set,received:n.parsedType}),y;const a=this._def;null!==a.minSize&&n.data.size<a.minSize.value&&(v(n,{code:o.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&n.data.size>a.maxSize.value&&(v(n,{code:o.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const r=this._def.valueType;function i(e){const n=new Set;for(const a of e){if("aborted"===a.status)return y;"dirty"===a.status&&t.dirty(),n.add(a.value)}return{status:t.value,value:n}}const l=[...n.data.values()].map(((e,t)=>r._parse(new w(n,e,n.path,t))));return n.common.async?Promise.all(l).then((e=>i(e))):i(l)}min(e,t){return new Ee({...this._def,minSize:{value:e,message:A.toString(t)}})}max(e,t){return new Ee({...this._def,maxSize:{value:e,message:A.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ee.create=(e,t)=>new Ee({valueType:e,minSize:null,maxSize:null,typeName:Ve.ZodSet,...N(t)});class xe extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.function)return v(t,{code:o.invalid_type,expected:s.function,received:t.parsedType}),y;function n(e,n){return h({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m(),c].filter((e=>!!e)),issueData:{code:o.invalid_arguments,argumentsError:n}})}function a(e,n){return h({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,m(),c].filter((e=>!!e)),issueData:{code:o.invalid_return_type,returnTypeError:n}})}const r={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Ne){const e=this;return b((async function(...t){const s=new u([]),o=await e._def.args.parseAsync(t,r).catch((e=>{throw s.addIssue(n(t,e)),s})),l=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(l,r).catch((e=>{throw s.addIssue(a(l,e)),s}))}))}{const e=this;return b((function(...t){const s=e._def.args.safeParse(t,r);if(!s.success)throw new u([n(t,s.error)]);const o=Reflect.apply(i,this,s.data),l=e._def.returns.safeParse(o,r);if(!l.success)throw new u([a(o,l.error)]);return l.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new xe({...this._def,args:$e.create(e).rest(le.create())})}returns(e){return new xe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new xe({args:e||$e.create([]).rest(le.create()),returns:t||le.create(),typeName:Ve.ZodFunction,...N(n)})}}class Se extends O{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Se.create=(e,t)=>new Se({getter:e,typeName:Ve.ZodLazy,...N(t)});class Ae extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return v(t,{received:t.data,code:o.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ie(e,t){return new we({values:e,typeName:Ve.ZodEnum,...N(t)})}Ae.create=(e,t)=>new Ae({value:e,typeName:Ve.ZodLiteral,...N(t)});class we extends O{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return v(t,{expected:a.joinValues(n),received:t.parsedType,code:o.invalid_type}),y}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return v(t,{received:t.data,code:o.invalid_enum_value,options:n}),y}return b(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return we.create(e,{...this._def,...t})}exclude(e,t=this._def){return we.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}we.create=Ie;class Te extends O{_parse(e){const t=a.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==s.string&&n.parsedType!==s.number){const e=a.objectValues(t);return v(n,{expected:a.joinValues(e),received:n.parsedType,code:o.invalid_type}),y}if(this._cache||(this._cache=new Set(a.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=a.objectValues(t);return v(n,{received:n.data,code:o.invalid_enum_value,options:e}),y}return b(e.data)}get enum(){return this._def.values}}Te.create=(e,t)=>new Te({values:e,typeName:Ve.ZodNativeEnum,...N(t)});class Ne extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.promise&&!1===t.common.async)return v(t,{code:o.invalid_type,expected:s.promise,received:t.parsedType}),y;const n=t.parsedType===s.promise?t.data:Promise.resolve(t.data);return b(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ne.create=(e,t)=>new Ne({type:e,typeName:Ve.ZodPromise,...N(t)});class Oe extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:e=>{v(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===r.type){const e=r.transform(n.data,s);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return y;const a=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===a.status?y:"dirty"===a.status||"dirty"===t.value?$(a.value):a}));{if("aborted"===t.value)return y;const a=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===a.status?y:"dirty"===a.status||"dirty"===t.value?$(a.value):a}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,s);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===a.status?y:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?y:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!x(e))return y;const a=r.transform(e.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>x(e)?Promise.resolve(r.transform(e.value,s)).then((e=>({status:t.value,value:e}))):y))}a.assertNever(r)}}Oe.create=(e,t,n)=>new Oe({schema:e,typeName:Ve.ZodEffects,effect:t,...N(n)}),Oe.createWithPreprocess=(e,t,n)=>new Oe({schema:t,effect:{type:"preprocess",transform:e},typeName:Ve.ZodEffects,...N(n)});class ke extends O{_parse(e){return this._getType(e)===s.undefined?b(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ke.create=(e,t)=>new ke({innerType:e,typeName:Ve.ZodOptional,...N(t)});class Re extends O{_parse(e){return this._getType(e)===s.null?b(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Re.create=(e,t)=>new Re({innerType:e,typeName:Ve.ZodNullable,...N(t)});class Ce extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===s.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ce.create=(e,t)=>new Ce({innerType:e,typeName:Ve.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...N(t)});class Pe extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return S(a)?a.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new u(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new u(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Pe.create=(e,t)=>new Pe({innerType:e,typeName:Ve.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...N(t)});class Le extends O{_parse(e){if(this._getType(e)!==s.nan){const t=this._getOrReturnCtx(e);return v(t,{code:o.invalid_type,expected:s.nan,received:t.parsedType}),y}return{status:"valid",value:e.data}}}Le.create=e=>new Le({typeName:Ve.ZodNaN,...N(e)});const je=Symbol("zod_brand");class Me extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class De extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?y:"dirty"===e.status?(t.dirty(),$(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?y:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new De({in:e,out:t,typeName:Ve.ZodPipeline})}}class Ye extends O{_parse(e){const t=this._def.innerType._parse(e),n=e=>(x(e)&&(e.value=Object.freeze(e.value)),e);return S(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function Fe(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function qe(e,t={},n){return e?oe.create().superRefine(((a,r)=>{const s=e(a);if(s instanceof Promise)return s.then((e=>{if(!e){const e=Fe(t,a),s=e.fatal??n??!0;r.addIssue({code:"custom",...e,fatal:s})}}));if(!s){const e=Fe(t,a),s=e.fatal??n??!0;r.addIssue({code:"custom",...e,fatal:s})}})):oe.create()}Ye.create=(e,t)=>new Ye({innerType:e,typeName:Ve.ZodReadonly,...N(t)});const Ue={object:me.lazycreate};var Ve;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ve||(Ve={}));const ze=(e,t={message:`Input not instance of ${e.name}`})=>qe((t=>t instanceof e),t),Ze=X.create,Be=ee.create,Ge=Le.create,We=te.create,Ke=ne.create,He=ae.create,Je=re.create,Xe=se.create,Qe=ie.create,et=oe.create,tt=le.create,nt=ue.create,at=ce.create,rt=pe.create,st=me.create,it=me.strictCreate,ot=he.create,lt=ve.create,ut=ye.create,ct=$e.create,pt=be.create,dt=_e.create,mt=Ee.create,ht=xe.create,ft=Se.create,vt=Ae.create,gt=we.create,yt=Te.create,$t=Ne.create,bt=Oe.create,_t=ke.create,Et=Re.create,xt=Oe.createWithPreprocess,St=De.create,At=()=>Ze().optional(),It=()=>Be().optional(),wt=()=>Ke().optional(),Tt={string:e=>X.create({...e,coerce:!0}),number:e=>ee.create({...e,coerce:!0}),boolean:e=>ne.create({...e,coerce:!0}),bigint:e=>te.create({...e,coerce:!0}),date:e=>ae.create({...e,coerce:!0})},Nt=y},46432:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ACCUMULATORS=void 0,t.ACCUMULATORS=[{name:"$accumulator",value:"$accumulator",score:1,meta:"accumulator",version:"4.4.0"},{name:"$addToSet",value:"$addToSet",score:1,meta:"accumulator",version:"2.2.0"},{name:"$avg",value:"$avg",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$bottom",value:"$bottom",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$bottomN",value:"$bottomN",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$covariancePop",value:"$covariancePop",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$covarianceSamp",value:"$covarianceSamp",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$count",value:"$count",score:1,meta:"accumulator",version:"5.0.0"},{name:"$derivative",value:"$derivative",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$denseRank",value:"$denseRank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$documentNumber",value:"$documentNumber",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$expMovingAvg",value:"$expMovingAvg",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$first",value:"$first",score:1,meta:"accumulator",version:"2.2.0"},{name:"$firstN",value:"$firstN",score:1,meta:"accumulator",version:"5.1.0"},{name:"$integral",value:"$integral",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$last",value:"$last",score:1,meta:"accumulator",version:"2.2.0"},{name:"$lastN",value:"$lastN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$max",value:"$max",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$maxN",value:"$maxN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$median",value:"$median",score:1,meta:"accumulator",version:"7.0.0"},{name:"$min",value:"$min",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$minN",value:"$minN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$percentile",value:"$percentile",score:1,meta:"accumulator",version:"7.0.0"},{name:"$push",value:"$push",score:1,meta:"accumulator",version:"2.2.0"},{name:"$rank",value:"$rank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$stdDevPop",value:"$stdDevPop",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$stdDevSamp",value:"$stdDevSamp",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$shift",value:"$shift",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$sum",value:"$sum",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$top",value:"$top",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$topN",value:"$topN",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$locf",value:"$locf",score:1,meta:"accumulator:window",version:"5.3.0"},{name:"$linearFill",value:"$linearFill",score:1,meta:"accumulator:window",version:"5.3.0"}]},46526:(e,t,n)=>{const a=n(98855);e.exports=(e,t)=>{const n=a(e,t);return n?n.version:null}},46699:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QUERY_OPERATORS=void 0,t.QUERY_OPERATORS=[{name:"$all",value:"$all",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$and",value:"$and",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$bitsAllClear",value:"$bitsAllClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAllSet",value:"$bitsAllSet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnyClear",value:"$bitsAnyClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnySet",value:"$bitsAnySet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$comment",value:"$comment",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$elemMatch",value:"$elemMatch",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$eq",value:"$eq",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$exists",value:"$exists",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$expr",value:"$expr",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$geoIntersects",value:"$geoIntersects",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$geoWithin",value:"$geoWithin",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$gt",value:"$gt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$gte",value:"$gte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$in",value:"$in",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$jsonSchema",value:"$jsonSchema",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$lt",value:"$lt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$lte",value:"$lte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$mod",value:"$mod",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$ne",value:"$ne",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$near",value:"$near",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nearSphere",value:"$nearSphere",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nin",value:"$nin",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$not",value:"$not",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$nor",value:"$nor",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$or",value:"$or",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$regex",value:"$regex",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$size",value:"$size",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$slice",value:"$slice",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$text",value:"$text",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$type",value:"$type",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$where",value:"$where",score:1,meta:"query",version:"2.2.0",geospatial:!1}]},46970:(e,t,n)=>{const a=n(12196);e.exports=(e,t)=>{const n=a(e,t);return n?n.version:null}},47384:(e,t,n)=>{const a=n(88825);e.exports=(e,t,n,r,s)=>{"string"==typeof n&&(s=r,r=n,n=void 0);try{return new a(e instanceof a?e.version:e,n).inc(t,r,s).version}catch(e){return null}}},47501:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CONVERSION_OPERATORS=void 0,t.CONVERSION_OPERATORS=[{name:"$convert",value:"$convert",score:1,meta:"conv",version:"3.7.2"},{name:"$ltrim",value:"$ltrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$rtrim",value:"$rtrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$toBool",value:"$toBool",score:1,meta:"conv",version:"3.7.2"},{name:"$toDate",value:"$toDate",score:1,meta:"conv",version:"3.7.2"},{name:"$toDecimal",value:"$toDecimal",score:1,meta:"conv",version:"3.7.2"},{name:"$toDouble",value:"$toDouble",score:1,meta:"conv",version:"3.7.2"},{name:"$toInt",value:"$toInt",score:1,meta:"conv",version:"3.7.2"},{name:"$toLong",value:"$toLong",score:1,meta:"conv",version:"3.7.2"},{name:"$toObjectId",value:"$toObjectId",score:1,meta:"conv",version:"3.7.2"},{name:"$toString",value:"$toString",score:1,meta:"conv",version:"3.7.2"},{name:"$trim",value:"$trim",score:1,meta:"accumulator",version:"3.7.2"}]},47530:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CONVERSION_OPERATORS=void 0,t.CONVERSION_OPERATORS=[{name:"$convert",value:"$convert",score:1,meta:"conv",version:"3.7.2"},{name:"$ltrim",value:"$ltrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$rtrim",value:"$rtrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$toBool",value:"$toBool",score:1,meta:"conv",version:"3.7.2"},{name:"$toDate",value:"$toDate",score:1,meta:"conv",version:"3.7.2"},{name:"$toDecimal",value:"$toDecimal",score:1,meta:"conv",version:"3.7.2"},{name:"$toDouble",value:"$toDouble",score:1,meta:"conv",version:"3.7.2"},{name:"$toInt",value:"$toInt",score:1,meta:"conv",version:"3.7.2"},{name:"$toLong",value:"$toLong",score:1,meta:"conv",version:"3.7.2"},{name:"$toObjectId",value:"$toObjectId",score:1,meta:"conv",version:"3.7.2"},{name:"$toString",value:"$toString",score:1,meta:"conv",version:"3.7.2"},{name:"$trim",value:"$trim",score:1,meta:"accumulator",version:"3.7.2"}]},47538:(e,t,n)=>{const a=n(48381);e.exports=(e,t,n)=>{const r=new a(e,n),s=new a(t,n);return r.compare(s)||r.compareBuild(s)}},47544:(e,t,n)=>{const a=n(20360);e.exports=(e,t)=>new a(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},47755:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},47775:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>a(e,t,n)>=0},47969:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EXPRESSION_OPERATORS=void 0,t.EXPRESSION_OPERATORS=[{name:"$abs",value:"$abs",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$accumulator",value:"$accumulator",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$add",value:"$add",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$allElementsTrue",value:"$allElementsTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$and",value:"$and",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$anyElementTrue",value:"$anyElementTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$arrayElemAt",value:"$arrayElemAt",score:1,meta:"expr:array",version:"3.2.0"},{name:"$arrayToObject",value:"$arrayToObject",score:1,meta:"expr:array",version:"3.4.4"},{name:"$binarySize",value:"$binarySize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$bsonSize",value:"$bsonSize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$ceil",value:"$ceil",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$cmp",value:"$cmp",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$concat",value:"$concat",score:1,meta:"expr:string",version:"2.4.0"},{name:"$concatArrays",value:"$concatArrays",score:1,meta:"expr:array",version:"3.2.0"},{name:"$cond",value:"$cond",score:1,meta:"expr:cond",version:"2.6.0"},{name:"$dateAdd",value:"$dateAdd",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateDiff",value:"$dateDiff",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateFromParts",value:"$dateFromParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateFromString",value:"$dateFromString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateSubtract",value:"$dateSubtract",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateToParts",value:"$dateToParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateTrunc",value:"$dateTrunc",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dayOfMonth",value:"$dayOfMonth",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfWeek",value:"$dayOfWeek",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfYear",value:"$dayOfYear",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.0.0"},{name:"$divide",value:"$divide",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$eq",value:"$eq",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$exp",value:"$exp",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$filter",value:"$filter",score:1,meta:"expr:array",version:"3.2.0"},{name:"$first",value:"$first",score:1,meta:"expr:array",version:"4.4.0"},{name:"$floor",value:"$floor",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$function",value:"$function",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$getField",value:"$getField",score:1,meta:"expr:get",version:"5.0.0"},{name:"$gt",value:"$gt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$gte",value:"$gte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$hour",value:"$hour",score:1,meta:"expr:date",version:"2.2.0"},{name:"$ifNull",value:"$ifNull",score:1,meta:"expr:cond",version:"2.2.0"},{name:"$in",value:"$in",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfArray",value:"$indexOfArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfBytes",value:"$indexOfBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$indexOfCP",value:"$indexOfCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$isArray",value:"$isArray",score:1,meta:"expr:array",version:"3.2.0"},{name:"$isNumber",value:"$isNumber",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$isoDayOfWeek",value:"$isoDayOfWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeek",value:"$isoWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeekYear",value:"$isoWeekYear",score:1,meta:"expr:date",version:"3.4.0"},{name:"$last",value:"$last",score:1,meta:"expr:array",version:"4.4.0"},{name:"$let",value:"$let",score:1,meta:"expr:var",version:"2.6.0"},{name:"$literal",value:"$literal",score:1,meta:"expr:literal",version:"2.6.0"},{name:"$lt",value:"$lt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$lt",value:"$lte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$ln",value:"$ln",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log",value:"$log",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log10",value:"$log10",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$map",value:"$map",score:1,meta:"expr:array",version:"2.6.0"},{name:"$mergeObjects",value:"$mergeObjects",score:1,meta:"expr:obj",version:"3.6.0"},{name:"$meta",value:"$meta",score:1,meta:"expr:text",version:"2.6.0"},{name:"$millisecond",value:"$millisecond",score:1,meta:"expr:date",version:"2.4.0"},{name:"$minute",value:"$minute",score:1,meta:"expr:date",version:"2.2.0"},{name:"$mod",value:"$mod",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$month",value:"$month",score:1,meta:"expr:date",version:"2.2.0"},{name:"$multiply",value:"$multiply",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$new",value:"$new",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$not",value:"$not",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$objectToArray",value:"$objectToArray",score:1,meta:"expr:array",version:"3.4.4"},{name:"$or",value:"$or",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$pow",value:"$pow",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$range",value:"$range",score:1,meta:"expr:array",version:"3.4.0"},{name:"$reduce",value:"$reduce",score:1,meta:"expr:array",version:"3.4.0"},{name:"$regexFind",value:"$regexFind",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexFindAll",value:"$regexFindAll",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexMatch",value:"$regexMatch",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$replaceAll",value:"$replaceAll",score:1,meta:"expr:string",version:"4.4.0"},{name:"$replaceOne",value:"$replaceOne",score:1,meta:"expr:string",version:"4.4.0"},{name:"$reverseArray",value:"$reverseArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$second",value:"$second",score:1,meta:"expr:date",version:"2.2.0"},{name:"$setDifference",value:"$setDifference",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setEquals",value:"$setEquals",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIntersection",value:"$setIntersection",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIsSubset",value:"$setIsSubset",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setUnion",value:"$setUnion",score:1,meta:"expr:set",version:"2.6.0"},{name:"$similarityCosine",value:"$similarityCosine",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityDotProduct",value:"$similarityDotProduct",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityEuclidean",value:"$similarityEuclidean",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$size",value:"$size",score:1,meta:"expr:array",version:"2.6.0"},{name:"$slice",value:"$slice",score:1,meta:"expr:array",version:"3.2.0"},{name:"$sortArray",value:"$sortArray",score:1,meta:"expr:array",version:"5.2.0"},{name:"$split",value:"$split",score:1,meta:"expr:string",version:"3.4.0"},{name:"$sqrt",value:"$sqrt",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$strcasecmp",value:"$strcasecmp",score:1,meta:"expr:string",version:"2.2.0"},{name:"$strLenBytes",value:"$strLenBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$strLenCP",value:"$strLenCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substr",value:"$substr",score:1,meta:"expr:string",version:"2.2.0",deprecated:"3.4.0",replacement:"$substrBytes"},{name:"$substrBytes",value:"$substrBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substrCP",value:"$substrCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$subtract",value:"$subtract",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$switch",value:"$switch",score:1,meta:"expr:cond",version:"3.4.0"},{name:"$toHashedIndexKey",value:"$toHashedIndexKey",score:1,meta:"expr:arith",version:"4.2.24"},{name:"$toLower",value:"$toLower",score:1,meta:"expr:string",version:"2.2.0"},{name:"$toUpper",value:"$toUpper",score:1,meta:"expr:string",version:"2.2.0"},{name:"$tsSecond",value:"$tsSecond",score:1,meta:"expr:date",version:"5.1.0"},{name:"$tsIncrement",value:"$tsIncrement",score:1,meta:"expr:date",version:"5.1.0"},{name:"$trunc",value:"$trunc",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$type",value:"$type",score:1,meta:"expr:type",version:"3.4.0"},{name:"$week",value:"$week",score:1,meta:"expr:date",version:"2.2.0"},{name:"$year",value:"$year",score:1,meta:"expr:date",version:"2.2.0"},{name:"$zip",value:"$zip",score:1,meta:"expr:array",version:"3.4.0"},{name:"$bitAnd",value:"$bitAnd",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitOr",value:"$bitOr",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitXor",value:"$bitXor",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitNot",value:"$bitNot",score:1,meta:"expr:bit",version:"7.0.0"}]},48013:(e,t,n)=>{var a=n(99174),r=n(40811);function s(e){return 48<=e&&e<=55}function i(e){return 48<=e&&e<=57}e.exports=new r("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,a=e.length,r=0,o=!1;if(!a)return!1;if("-"!==(t=e[r])&&"+"!==t||(t=e[++r]),"0"===t){if(r+1===a)return!0;if("b"===(t=e[++r])){for(r++;r<a;r++)if("_"!==(t=e[r])){if("0"!==t&&"1"!==t)return!1;o=!0}return o&&"_"!==t}if("x"===t){for(r++;r<a;r++)if("_"!==(t=e[r])){if(!(48<=(n=e.charCodeAt(r))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;o=!0}return o&&"_"!==t}for(;r<a;r++)if("_"!==(t=e[r])){if(!s(e.charCodeAt(r)))return!1;o=!0}return o&&"_"!==t}if("_"===t)return!1;for(;r<a;r++)if("_"!==(t=e[r])){if(":"===t)break;if(!i(e.charCodeAt(r)))return!1;o=!0}return!(!o||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(r)))},construct:function(e){var t,n,a=e,r=1,s=[];return-1!==a.indexOf("_")&&(a=a.replace(/_/g,"")),"-"!==(t=a[0])&&"+"!==t||("-"===t&&(r=-1),t=(a=a.slice(1))[0]),"0"===a?0:"0"===t?"b"===a[1]?r*parseInt(a.slice(2),2):"x"===a[1]?r*parseInt(a,16):r*parseInt(a,8):-1!==a.indexOf(":")?(a.split(":").forEach((function(e){s.unshift(parseInt(e,10))})),a=0,n=1,s.forEach((function(e){a+=e*n,n*=60})),r*a):r*parseInt(a,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!a.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},48080:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JSON_SCHEMA=void 0,t.JSON_SCHEMA=[{name:"bsonType",value:"bsonType",label:"bsonType",score:1,meta:"json-schema",version:"3.6.0",description:"Accepts same string aliases used for the $type operator"},{name:"enum",value:"enum",label:"enum",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates all possible values of the field"},{name:"type",value:"type",label:"type",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates the possible JSON types of the field"},{name:"allOf",value:"allOf",label:"allOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match all specified schemas"},{name:"anyOf",value:"anyOf",label:"anyOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match at least one of the specified schemas"},{name:"oneOf",value:"oneOf",label:"oneOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match exactly one of the specified schemas"},{name:"not",value:"not",label:"not",score:1,meta:"json-schema",version:"3.6.0",description:"Field must not match the schema"},{name:"multipleOf",value:"multipleOf",label:"multipleOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must be a multiple of this value"},{name:"maximum",value:"maximum",label:"maximum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum value of the field"},{name:"exclusiveMaximum",value:"exclusiveMaximum",label:"exclusiveMaximum",score:1,meta:"json-schema",version:"3.6.0",description:"If true and field is a number, maximum is an exclusive maximum"},{name:"minimum",value:"minimum",label:"minimum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum value of the field"},{name:"exclusiveMinimum",value:"exclusiveMinimum",label:"exclusiveMinimum",score:1,meta:"json-schema",version:"3.6.0",description:"If true, minimum is an exclusive minimum"},{name:"maxLength",value:"maxLength",label:"maxLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of the field"},{name:"minLength",value:"minLength",label:"minLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of the field"},{name:"pattern",value:"pattern",label:"pattern",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match the regular expression"},{name:"maxProperties",value:"maxProperties",label:"maxProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s maximum number of properties"},{name:"minProperties",value:"minProperties",label:"minProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s minimum number of properties"},{name:"required",value:"required",label:"required",score:1,meta:"json-schema",version:"3.6.0",description:"Object’s property set must contain all the specified elements in the array"},{name:"additionalProperties",value:"additionalProperties",label:"additionalProperties",score:1,meta:"json-schema",version:"3.6.0",description:"If true, additional fields are allowed"},{name:"properties",value:"properties",label:"properties",score:1,meta:"json-schema",version:"3.6.0",description:"A valid JSON Schema where each value is also a valid JSON Schema object"},{name:"patternProperties",value:"patternProperties",label:"patternProperties",score:1,meta:"json-schema",version:"3.6.0",description:"In addition to properties requirements, each property name of this object must be a valid regular expression"},{name:"dependencies",value:"dependencies",label:"dependencies",score:1,meta:"json-schema",version:"3.6.0",description:"Describes field or schema dependencies"},{name:"additionalItems",value:"additionalItems",label:"additionalItems",score:1,meta:"json-schema",version:"3.6.0",description:"If an object, must be a valid JSON Schema"},{name:"items",value:"items",label:"items",score:1,meta:"json-schema",version:"3.6.0",description:"Must be either a valid JSON Schema, or an array of valid JSON Schemas"},{name:"maxItems",value:"maxItems",label:"maxItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of array"},{name:"minItems",value:"minItems",label:"minItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of array"},{name:"uniqueItems",value:"uniqueItems",label:"uniqueItems",score:1,meta:"json-schema",version:"3.6.0",description:"If true, each item in the array must be unique"},{name:"title",value:"title",label:"title",score:1,meta:"json-schema",version:"3.6.0",description:"A descriptive title string with no effect"},{name:"description",value:"description",label:"description",score:1,meta:"json-schema",version:"3.6.0",description:"A string that describes the schema and has no effect."}]},48195:(e,t,n)=>{const a=n(12876),r=n(32674);e.exports=(e,t,n)=>{const s=[];let i=null,o=null;const l=e.sort(((e,t)=>r(e,t,n)));for(const e of l)a(e,t,n)?(o=e,i||(i=e)):(o&&s.push([i,o]),o=null,i=null);i&&s.push([i,null]);const u=[];for(const[e,t]of s)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const c=u.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return c.length<p.length?c:t}},48381:(e,t,n)=>{const a=n(29385),{MAX_LENGTH:r,MAX_SAFE_INTEGER:s}=n(24159),{safeRe:i,t:o}=n(92625),l=n(83214),{compareIdentifiers:u}=n(5286);class c{constructor(e,t){if(t=l(t),e instanceof c){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[o.LOOSE]:i[o.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(a("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof c||(e=new c(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(a("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(a("build compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===n&&(a=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},48543:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CONVERSION_OPERATORS=void 0,t.CONVERSION_OPERATORS=[{name:"$convert",value:"$convert",score:1,meta:"conv",version:"3.7.2"},{name:"$ltrim",value:"$ltrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$rtrim",value:"$rtrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$toBool",value:"$toBool",score:1,meta:"conv",version:"3.7.2"},{name:"$toDate",value:"$toDate",score:1,meta:"conv",version:"3.7.2"},{name:"$toDecimal",value:"$toDecimal",score:1,meta:"conv",version:"3.7.2"},{name:"$toDouble",value:"$toDouble",score:1,meta:"conv",version:"3.7.2"},{name:"$toInt",value:"$toInt",score:1,meta:"conv",version:"3.7.2"},{name:"$toLong",value:"$toLong",score:1,meta:"conv",version:"3.7.2"},{name:"$toObjectId",value:"$toObjectId",score:1,meta:"conv",version:"3.7.2"},{name:"$toString",value:"$toString",score:1,meta:"conv",version:"3.7.2"},{name:"$trim",value:"$trim",score:1,meta:"accumulator",version:"3.7.2"}]},49189:(e,t,n)=>{function a(e,t,n){function a(n,a){var r;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(r=n._zod).traits??(r.traits=new Set),n._zod.traits.add(e),t(n,a);for(const e in i.prototype)e in n||Object.defineProperty(n,e,{value:i.prototype[e].bind(n)});n._zod.constr=i,n._zod.def=a}const r=n?.Parent??Object;class s extends r{}function i(e){var t;const r=n?.Parent?new s:this;a(r,e),(t=r._zod).deferred??(t.deferred=[]);for(const e of r._zod.deferred)e();return r}return Object.defineProperty(s,"name",{value:e}),Object.defineProperty(i,"init",{value:a}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}n.d(t,{$W:()=>i,GT:()=>r,cr:()=>s,xI:()=>a}),Object.freeze({status:"aborted"}),Symbol("zod_brand");class r extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const s={};function i(e){return e&&Object.assign(s,e),s}},49764:(e,t,n)=>{var a=n(65994).e;const r="object"==typeof a&&a.env&&a.env.NODE_DEBUG&&/\bsemver\b/i.test(a.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},49976:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapField=t.getFilteredCompletions=void 0,r(n(22849),t),r(n(58516),t),r(n(77192),t),r(n(47530),t),r(n(63875),t),r(n(36744),t),r(n(91934),t),r(n(80417),t),r(n(28968),t),r(n(85426),t),r(n(86987),t),r(n(17624),t);var s=n(54316);Object.defineProperty(t,"getFilteredCompletions",{enumerable:!0,get:function(){return s.getFilteredCompletions}}),Object.defineProperty(t,"wrapField",{enumerable:!0,get:function(){return s.wrapField}}),r(n(69750),t),r(n(51778),t)},50066:(e,t,n)=>{const a=n(71598),{MAX_LENGTH:r,MAX_SAFE_INTEGER:s}=n(47755),{safeRe:i,t:o}=n(65684),l=n(31145),{compareIdentifiers:u}=n(76393);class c{constructor(e,t){if(t=l(t),e instanceof c){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[o.LOOSE]:i[o.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(a("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof c||(e=new c(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(a("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(a("build compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===n&&(a=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},50363:(e,t,n)=>{const a=n(38366);e.exports=(e,t,n)=>{try{t=new a(t,n)}catch(e){return!1}return t.test(e)}},50418:(e,t,n)=>{const a=n(57544);e.exports=(e,t)=>new a(e,t).minor},50678:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPES=void 0,t.BSON_TYPES=[{name:"Code",value:"Code",label:"Code",score:1,meta:"bson",version:"0.0.0",description:"BSON Code type",snippet:"Code('${1:code}')"},{name:"ObjectId",value:"ObjectId",label:"ObjectId",score:1,meta:"bson",version:"0.0.0",description:"BSON ObjectId type",snippet:"ObjectId('${1:id}')"},{name:"Binary",value:"Binary",label:"Binary",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary type",snippet:"Binary('${1:data}', '${2:subType}')"},{name:"DBRef",value:"DBRef",label:"DBRef",score:1,meta:"bson",version:"0.0.0",description:"BSON DBRef type",snippet:"DBRef('${1:ns}', '${2:oid}')"},{name:"Timestamp",value:"Timestamp",label:"Timestamp",score:1,meta:"bson",version:"0.0.0",description:"BSON Timestamp type",snippet:"Timestamp(${1:low}, ${2:high})"},{name:"NumberInt",value:"NumberInt",label:"NumberInt",score:1,meta:"bson",version:"0.0.0",description:"BSON 32 bit Integer type",snippet:"NumberInt(${1:value})"},{name:"NumberLong",value:"NumberLong",label:"NumberLong",score:1,meta:"bson",version:"0.0.0",description:"BSON 64 but Integer type",snippet:"NumberLong('${1:value}')"},{name:"NumberDecimal",value:"NumberDecimal",label:"NumberDecimal",score:1,meta:"bson",version:"3.4.0",description:"BSON Decimal128 type",snippet:"NumberDecimal('${1:value}')"},{name:"MaxKey",value:"MaxKey",label:"MaxKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MaxKey type",snippet:"MaxKey()"},{name:"MinKey",value:"MinKey",label:"MinKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MinKey type",snippet:"MinKey()"},{name:"ISODate",value:"ISODate",label:"ISODate",score:1,meta:"bson",version:"0.0.0",description:"BSON Date type",snippet:"ISODate('${1:date}')"},{name:"RegExp",value:"RegExp",label:"RegExp",score:1,meta:"bson",version:"0.0.0",description:"BSON Regex type",snippet:"RegExp('${1:source}', '${2:opts}')"},{name:"LegacyJavaUUID",value:"LegacyJavaUUID",label:"LegacyJavaUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Java legacy UUID)",snippet:"LegacyJavaUUID('${1:uuid}')"},{name:"LegacyCSharpUUID",value:"LegacyCSharpUUID",label:"LegacyCSharpUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (CSharp legacy UUID)",snippet:"LegacyCSharpUUID('${1:uuid}')"},{name:"LegacyPythonUUID",value:"LegacyPythonUUID",label:"LegacyPythonUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Python legacy UUID)",snippet:"LegacyPythonUUID('${1:uuid}')"},{name:"UUID",value:"UUID",label:"UUID",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary subtype 4",snippet:"UUID('${1:uuid}')"}]},51098:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QUERY_OPERATORS=void 0,t.QUERY_OPERATORS=[{name:"$all",value:"$all",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$and",value:"$and",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$bitsAllClear",value:"$bitsAllClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAllSet",value:"$bitsAllSet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnyClear",value:"$bitsAnyClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnySet",value:"$bitsAnySet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$comment",value:"$comment",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$elemMatch",value:"$elemMatch",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$eq",value:"$eq",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$exists",value:"$exists",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$expr",value:"$expr",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$geoIntersects",value:"$geoIntersects",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$geoWithin",value:"$geoWithin",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$gt",value:"$gt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$gte",value:"$gte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$in",value:"$in",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$jsonSchema",value:"$jsonSchema",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$lt",value:"$lt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$lte",value:"$lte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$mod",value:"$mod",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$ne",value:"$ne",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$near",value:"$near",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nearSphere",value:"$nearSphere",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nin",value:"$nin",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$not",value:"$not",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$nor",value:"$nor",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$or",value:"$or",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$regex",value:"$regex",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$size",value:"$size",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$slice",value:"$slice",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$text",value:"$text",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$type",value:"$type",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$where",value:"$where",score:1,meta:"query",version:"2.2.0",geospatial:!1}]},51138:(e,t,n)=>{var a=n(40811);e.exports=new a("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}})},51228:(e,t,n)=>{var a=n(40811),r=Object.prototype.hasOwnProperty;e.exports=new a("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(r.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},51269:(e,t,n)=>{const a=n(25583);e.exports=(e,t,n)=>a(e,t,n)>0},51456:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>a(t,e,n)},51626:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPES=void 0,t.BSON_TYPES=[{name:"Code",value:"Code",label:"Code",score:1,meta:"bson",version:"0.0.0",description:"BSON Code type",snippet:"Code('${1:code}')"},{name:"ObjectId",value:"ObjectId",label:"ObjectId",score:1,meta:"bson",version:"0.0.0",description:"BSON ObjectId type",snippet:"ObjectId('${1:id}')"},{name:"Binary",value:"Binary",label:"Binary",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary type",snippet:"Binary('${1:data}', '${2:subType}')"},{name:"DBRef",value:"DBRef",label:"DBRef",score:1,meta:"bson",version:"0.0.0",description:"BSON DBRef type",snippet:"DBRef('${1:ns}', '${2:oid}')"},{name:"Timestamp",value:"Timestamp",label:"Timestamp",score:1,meta:"bson",version:"0.0.0",description:"BSON Timestamp type",snippet:"Timestamp(${1:low}, ${2:high})"},{name:"NumberInt",value:"NumberInt",label:"NumberInt",score:1,meta:"bson",version:"0.0.0",description:"BSON 32 bit Integer type",snippet:"NumberInt(${1:value})"},{name:"NumberLong",value:"NumberLong",label:"NumberLong",score:1,meta:"bson",version:"0.0.0",description:"BSON 64 but Integer type",snippet:"NumberLong('${1:value}')"},{name:"NumberDecimal",value:"NumberDecimal",label:"NumberDecimal",score:1,meta:"bson",version:"3.4.0",description:"BSON Decimal128 type",snippet:"NumberDecimal('${1:value}')"},{name:"MaxKey",value:"MaxKey",label:"MaxKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MaxKey type",snippet:"MaxKey()"},{name:"MinKey",value:"MinKey",label:"MinKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MinKey type",snippet:"MinKey()"},{name:"ISODate",value:"ISODate",label:"ISODate",score:1,meta:"bson",version:"0.0.0",description:"BSON Date type",snippet:"ISODate('${1:date}')"},{name:"RegExp",value:"RegExp",label:"RegExp",score:1,meta:"bson",version:"0.0.0",description:"BSON Regex type",snippet:"RegExp('${1:source}', '${2:opts}')"},{name:"LegacyJavaUUID",value:"LegacyJavaUUID",label:"LegacyJavaUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Java legacy UUID)",snippet:"LegacyJavaUUID('${1:uuid}')"},{name:"LegacyCSharpUUID",value:"LegacyCSharpUUID",label:"LegacyCSharpUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (CSharp legacy UUID)",snippet:"LegacyCSharpUUID('${1:uuid}')"},{name:"LegacyPythonUUID",value:"LegacyPythonUUID",label:"LegacyPythonUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Python legacy UUID)",snippet:"LegacyPythonUUID('${1:uuid}')"},{name:"UUID",value:"UUID",label:"UUID",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary subtype 4",snippet:"UUID('${1:uuid}')"}]},51699:(e,t,n)=>{const a=n(65684),r=n(47755),s=n(50066),i=n(76393),o=n(38358),l=n(99451),u=n(97660),c=n(18157),p=n(59818),d=n(12815),m=n(4496),h=n(67223),f=n(86543),v=n(32674),g=n(17620),y=n(80321),$=n(9331),b=n(68821),_=n(71595),E=n(18106),x=n(28141),S=n(41755),A=n(97369),I=n(74227),w=n(24078),T=n(98249),N=n(67812),O=n(67094),k=n(72857),R=n(12876),C=n(70449),P=n(92222),L=n(540),j=n(29087),M=n(59984),D=n(99597),Y=n(19789),F=n(13012),q=n(11742),U=n(48195),V=n(40194);e.exports={parse:o,valid:l,clean:u,inc:c,diff:p,major:d,minor:m,patch:h,prerelease:f,compare:v,rcompare:g,compareLoose:y,compareBuild:$,sort:b,rsort:_,gt:E,lt:x,eq:S,neq:A,gte:I,lte:w,cmp:T,coerce:N,Comparator:O,Range:k,satisfies:R,toComparators:C,maxSatisfying:P,minSatisfying:L,minVersion:j,validRange:M,outside:D,gtr:Y,ltr:F,intersects:q,simplifyRange:U,subset:V,SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},51778:function(e,t,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_PIPELINE_UTILS=void 0;const r=a(n(80184)),s="8.0.0",i="8.1.0";t.VIEW_PIPELINE_UTILS={MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_DE:s,MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_COMPASS:i,isPipelineSearchQueryable:e=>{for(const t of e){const e=Object.keys(t)[0];if("$addFields"!==e&&"$set"!==e&&"$match"!==e)return!1;if("$match"===e){const e=t.$match,n=Object.keys(e||{});if(1!==n.length||!n.includes("$expr"))return!1}}return!0},isVersionSearchCompatibleForViewsDataExplorer:e=>{try{return r.default.gte(e,s)}catch{return!1}},isVersionSearchCompatibleForViewsCompass:e=>{try{return r.default.gte(e,i)}catch{return!1}}}},52189:(e,t,n)=>{const a=n(33629);e.exports=(e,t)=>new a(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},52378:(e,t,n)=>{var a=n(65994).e;const r="object"==typeof a&&a.env&&a.env.NODE_DEBUG&&/\bsemver\b/i.test(a.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},52539:(e,t,n)=>{const a=n(88825),r=n(98855),{safeRe:s,t:i}=n(36165);e.exports=(e,t)=>{if(e instanceof a)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const a=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let r;for(;(r=a.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===n)return null;const o=n[2],l=n[3]||"0",u=n[4]||"0",c=t.includePrerelease&&n[5]?`-${n[5]}`:"",p=t.includePrerelease&&n[6]?`+${n[6]}`:"";return r(`${o}.${l}.${u}${c}${p}`,t)}},52711:(e,t,n)=>{var a;try{a=n(67787).Buffer}catch(e){}var r=n(40811),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,a=0,r=e.length,i=s;for(n=0;n<r;n++)if(!((t=i.indexOf(e.charAt(n)))>64)){if(t<0)return!1;a+=6}return a%8==0},construct:function(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=s,l=0,u=[];for(t=0;t<i;t++)t%4==0&&t&&(u.push(l>>16&255),u.push(l>>8&255),u.push(255&l)),l=l<<6|o.indexOf(r.charAt(t));return 0==(n=i%4*6)?(u.push(l>>16&255),u.push(l>>8&255),u.push(255&l)):18===n?(u.push(l>>10&255),u.push(l>>2&255)):12===n&&u.push(l>>4&255),a?a.from?a.from(u):new a(u):u},predicate:function(e){return a&&a.isBuffer(e)},represent:function(e){var t,n,a="",r=0,i=e.length,o=s;for(t=0;t<i;t++)t%3==0&&t&&(a+=o[r>>18&63],a+=o[r>>12&63],a+=o[r>>6&63],a+=o[63&r]),r=(r<<8)+e[t];return 0==(n=i%3)?(a+=o[r>>18&63],a+=o[r>>12&63],a+=o[r>>6&63],a+=o[63&r]):2===n?(a+=o[r>>10&63],a+=o[r>>4&63],a+=o[r<<2&63],a+=o[64]):1===n&&(a+=o[r>>2&63],a+=o[r<<4&63],a+=o[64],a+=o[64]),a}})},52992:(e,t,n)=>{const a=n(33629);e.exports=(e,t,n)=>{try{t=new a(t,n)}catch(e){return!1}return t.test(e)}},53266:(e,t,n)=>{n.d(t,{AC:()=>C,Ak:()=>l,Gl:()=>r,K3:()=>$,OI:()=>_,Os:()=>c,Rp:()=>d,Yj:()=>T,Z0:()=>s,Zg:()=>h,Zv:()=>P,ai:()=>O,ch:()=>R,fO:()=>o,gF:()=>a,hQ:()=>E,kB:()=>I,kM:()=>i,l7:()=>y,nd:()=>N,p0:()=>u,p6:()=>S,r0:()=>b,uR:()=>p,uX:()=>f,ug:()=>v,w$:()=>w,zM:()=>k,zr:()=>g});const a=/^[cC][^\s-]{8,}$/,r=/^[0-9a-z]+$/,s=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,i=/^[0-9a-vA-V]{20}$/,o=/^[A-Za-z0-9]{27}$/,l=/^[a-zA-Z0-9_-]{21}$/,u=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,c=/^([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})$/,p=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,d=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,m="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function h(){return new RegExp(m,"u")}const f=/^(?:(?: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])$/,v=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,g=/^((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])$/,y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,b=/^[A-Za-z0-9_-]*$/,_=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,E=/^\+(?:[0-9]){6,14}[0-9]$/,x="(?:(?:\\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])))",S=new RegExp(`^${x}$`);function A(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function I(e){return new RegExp(`^${A(e)}$`)}function w(e){const t=A({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${x}T(?:${a})$`)}const T=e=>new RegExp(`^${e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*"}$`),N=/^\d+$/,O=/^-?\d+(?:\.\d+)?/i,k=/true|false/i,R=/null/i,C=/^[^A-Z]*$/,P=/^[^a-z]*$/},53354:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapField=t.getFilteredCompletions=void 0,r(n(17807),t),r(n(5698),t),r(n(50678),t),r(n(66272),t),r(n(26633),t),r(n(20474),t),r(n(79188),t),r(n(93555),t),r(n(10094),t),r(n(86812),t),r(n(30629),t),r(n(21482),t);var s=n(69334);Object.defineProperty(t,"getFilteredCompletions",{enumerable:!0,get:function(){return s.getFilteredCompletions}}),Object.defineProperty(t,"wrapField",{enumerable:!0,get:function(){return s.wrapField}}),r(n(15580),t),r(n(10036),t)},53831:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>0===a(e,t,n)},54316:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_CONSTANTS=void 0,t.createConstantFilter=f,t.wrapField=function(e,t=!1){return t||!function(e){if(/[.\s"'()[\];={}:]/.test(e))return!1;try{return new Function(`"use strict";let _ = { ${e}: 0 };`),!0}catch{return!1}}(e)?`"${e.replace(/["\\]/g,"\\$&")}"`:e},t.getFilteredCompletions=function(e={},n=t.ALL_CONSTANTS){const{serverVersion:a=m,fields:r=[],meta:s,stage:i}=e,o=f({serverVersion:a,meta:s,stage:i});return n.concat(r.flatMap((e=>{const{value:t,description:n}=function(e){return"string"==typeof e?{value:e}:{value:e.name,description:e.description}}(e);return[{value:t,meta:"field:identifier",version:"0.0.0",description:n},{value:`$${t}`,meta:"field:reference",version:"0.0.0",description:n}]}))).filter((e=>o(e)))};const a=n(80184),r=n(22849),s=n(58516),i=n(77192),o=n(47530),l=n(36744),u=n(91934),c=n(28968),p=n(85426),d=n(86987);t.ALL_CONSTANTS=[...r.ACCUMULATORS,...i.BSON_TYPES,...s.BSON_TYPE_ALIASES,...o.CONVERSION_OPERATORS,...l.EXPRESSION_OPERATORS,...u.JSON_SCHEMA,...c.QUERY_OPERATORS,...p.STAGE_OPERATORS,...d.SYSTEM_VARIABLES];const m="999.999.999";function h(e,t){return void 0===e||void 0===t||(e=Array.isArray(e)?e:[e]).some((e=>t.includes(e)))}function f({meta:e,serverVersion:t=m,stage:n={}}={}){const r=/^(?<version>\d+\.\d+\.\d+)/.exec(t)?.groups?.version??m;return({version:t,meta:s,env:i,namespaces:o,apiVersions:l})=>function(e,t){const n=/^\d+\.\d+\.\d+$/.test(t);return(0,a.satisfies)(e,n?`>=${t}`:t)}(r,t)&&h(n.env,i)&&h(n.namespace,o)&&h(n.apiVersion,l)&&(!e||function(e,t){const n=t.split(":");return e.some((e=>{const t=e.split(":");return t.length===n.length&&t.every(((e,t)=>"*"===e||e===n[t]))}))}(e,s))}},54395:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JSON_SCHEMA=void 0,t.JSON_SCHEMA=[{name:"bsonType",value:"bsonType",label:"bsonType",score:1,meta:"json-schema",version:"3.6.0",description:"Accepts same string aliases used for the $type operator"},{name:"enum",value:"enum",label:"enum",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates all possible values of the field"},{name:"type",value:"type",label:"type",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates the possible JSON types of the field"},{name:"allOf",value:"allOf",label:"allOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match all specified schemas"},{name:"anyOf",value:"anyOf",label:"anyOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match at least one of the specified schemas"},{name:"oneOf",value:"oneOf",label:"oneOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match exactly one of the specified schemas"},{name:"not",value:"not",label:"not",score:1,meta:"json-schema",version:"3.6.0",description:"Field must not match the schema"},{name:"multipleOf",value:"multipleOf",label:"multipleOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must be a multiple of this value"},{name:"maximum",value:"maximum",label:"maximum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum value of the field"},{name:"exclusiveMaximum",value:"exclusiveMaximum",label:"exclusiveMaximum",score:1,meta:"json-schema",version:"3.6.0",description:"If true and field is a number, maximum is an exclusive maximum"},{name:"minimum",value:"minimum",label:"minimum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum value of the field"},{name:"exclusiveMinimum",value:"exclusiveMinimum",label:"exclusiveMinimum",score:1,meta:"json-schema",version:"3.6.0",description:"If true, minimum is an exclusive minimum"},{name:"maxLength",value:"maxLength",label:"maxLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of the field"},{name:"minLength",value:"minLength",label:"minLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of the field"},{name:"pattern",value:"pattern",label:"pattern",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match the regular expression"},{name:"maxProperties",value:"maxProperties",label:"maxProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s maximum number of properties"},{name:"minProperties",value:"minProperties",label:"minProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s minimum number of properties"},{name:"required",value:"required",label:"required",score:1,meta:"json-schema",version:"3.6.0",description:"Object’s property set must contain all the specified elements in the array"},{name:"additionalProperties",value:"additionalProperties",label:"additionalProperties",score:1,meta:"json-schema",version:"3.6.0",description:"If true, additional fields are allowed"},{name:"properties",value:"properties",label:"properties",score:1,meta:"json-schema",version:"3.6.0",description:"A valid JSON Schema where each value is also a valid JSON Schema object"},{name:"patternProperties",value:"patternProperties",label:"patternProperties",score:1,meta:"json-schema",version:"3.6.0",description:"In addition to properties requirements, each property name of this object must be a valid regular expression"},{name:"dependencies",value:"dependencies",label:"dependencies",score:1,meta:"json-schema",version:"3.6.0",description:"Describes field or schema dependencies"},{name:"additionalItems",value:"additionalItems",label:"additionalItems",score:1,meta:"json-schema",version:"3.6.0",description:"If an object, must be a valid JSON Schema"},{name:"items",value:"items",label:"items",score:1,meta:"json-schema",version:"3.6.0",description:"Must be either a valid JSON Schema, or an array of valid JSON Schemas"},{name:"maxItems",value:"maxItems",label:"maxItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of array"},{name:"minItems",value:"minItems",label:"minItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of array"},{name:"uniqueItems",value:"uniqueItems",label:"uniqueItems",score:1,meta:"json-schema",version:"3.6.0",description:"If true, each item in the array must be unique"},{name:"title",value:"title",label:"title",score:1,meta:"json-schema",version:"3.6.0",description:"A descriptive title string with no effect"},{name:"description",value:"description",label:"description",score:1,meta:"json-schema",version:"3.6.0",description:"A string that describes the schema and has no effect."}]},54420:(e,t,n)=>{var a=n(99174),r=n(4414),s=n(40811);function i(e,t,n){var a=[];return e.include.forEach((function(e){n=i(e,t,n)})),e[t].forEach((function(e){n.forEach((function(t,n){t.tag===e.tag&&t.kind===e.kind&&a.push(n)})),n.push(e)})),n.filter((function(e,t){return-1===a.indexOf(t)}))}function o(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach((function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new r("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")})),this.compiledImplicit=i(this,"implicit",[]),this.compiledExplicit=i(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function a(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(a);return n}(this.compiledImplicit,this.compiledExplicit)}o.DEFAULT=null,o.create=function(){var e,t;switch(arguments.length){case 1:e=o.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new r("Wrong number of arguments for Schema.create function")}if(e=a.toArray(e),t=a.toArray(t),!e.every((function(e){return e instanceof o})))throw new r("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every((function(e){return e instanceof s})))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new o({include:e,explicit:t})},e.exports=o},54506:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>a(e,t,n)>=0},54597:(e,t,n)=>{const a=n(40289);e.exports=(e,t)=>a(e,t,!0)},54737:(e,t,n)=>{const a=n(57544);e.exports=(e,t)=>new a(e,t).patch},54838:(e,t,n)=>{const a=n(25583);e.exports=(e,t,n)=>a(e,t,n)>=0},55069:(e,t,n)=>{n.d(t,{Zt:()=>r});var a=n(29299);a.ACCUMULATORS,a.ADL,a.ANY_COLLECTION_NAMESPACE,a.ANY_NAMESPACE,a.ATLAS,a.ATLAS_SEARCH_TEMPLATES,a.ATLAS_VECTOR_SEARCH_TEMPLATE,a.BSON_TYPES,a.BSON_TYPE_ALIASES,a.COLLECTION,a.CONVERSION_OPERATORS,a.DATABASE,a.ENVS,a.EXPRESSION_OPERATORS,a.FULL_SCAN_STAGES,a.JSON_SCHEMA,a.ON_PREM,a.OUT_STAGES,a.QUERY_OPERATORS,a.REQUIRED_AS_FIRST_STAGE,a.STAGE_OPERATORS,a.STAGE_OPERATOR_NAMES,a.SYSTEM_VARIABLES,a.TIME_SERIES,a.VALIDATION_TEMPLATE,a.VIEW,a.VIEW_PIPELINE_UTILS,a.getFilteredCompletions;const r=a.wrapField},55141:(e,t,n)=>{const a=Symbol("SemVer ANY");class r{static get ANY(){return a}constructor(e,t){if(t=s(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===a?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new c(n[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=s(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=r;const s=n(83214),{safeRe:i,t:o}=n(92625),l=n(88108),u=n(29385),c=n(48381),p=n(20332)},56206:(e,t,n)=>{const a=n(88825);e.exports=(e,t,n)=>{const r=new a(e,n),s=new a(t,n);return r.compare(s)||r.compareBuild(s)}},56565:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t),t}},56741:(e,t,n)=>{const a=n(71333);e.exports=(e,t)=>new a(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},56911:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VALIDATION_TEMPLATE=void 0,t.VALIDATION_TEMPLATE='/**\n * This is a starter template for a schema validation rule for a collection.\n * More information on schema validation rules can be found at:\n * https://www.mongodb.com/docs/manual/core/schema-validation/\n */\n{\n $jsonSchema: {\n title: "Library.books",\n bsonType: "object",\n required: ["fieldname1", "fieldname2"],\n properties: {\n fieldname1: {\n bsonType: "string",\n description: "Fieldname1 must be a string",\n },\n fieldname2: {\n bsonType: "int",\n description: "Fieldname2 must be an integer",\n },\n arrayFieldName: {\n bsonType: "array",\n items: {\n bsonType: "string"\n },\n description: "arrayFieldName must be an array of strings"\n },\n }\n }\n}'},57116:(e,t,n)=>{var a=n(54420);e.exports=a.DEFAULT=new a({include:[n(18184)],explicit:[n(51138),n(14753),n(10560)]})},57136:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ATLAS_VECTOR_SEARCH_TEMPLATE=t.ATLAS_SEARCH_TEMPLATES=void 0,t.ATLAS_SEARCH_TEMPLATES=[{name:"Dynamic field mappings",snippet:'{\n "mappings": {\n "dynamic": true\n }\n}',version:"4.4.0"},{name:"Static field mappings",snippet:'{\n "mappings": {\n "dynamic": false,\n "fields": {\n ${1:<string field name>}: {\n "type": "string"\n },\n ${2:<number field name>}: {\n "type": "number"\n },\n ${3:<date field name>}: {\n "type": "date"\n },\n ${4:<geo field name>}: {\n "type": "geo"\n },\n } \n }\n}',version:"4.4.0"},{name:"Text field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<string field name>}: [\n {\n // Enables text queries\n "type": "string"\n },\n {\n // Enables autocomplete queries\n "type": "autocomplete"\n \n },\n {\n // Enables sorting\n "type": "token"\n }\n ] \n } \n }\n}',version:"4.4.0"},{name:"Facet field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<number field name for faceting>}: [\n {\n "type": "numberFacet"\n },\n {\n "type": "number"\n },\n ],\n ${2:<date field name for faceting>}: [\n {\n "type": "dateFacet"\n }\n {\n "type": "date"\n }\n ],\n ${3:<string field name for faceting>}: [\n {\n "type": "stringFacet"\n },\n {\n "type": "string",\n "analyzer": "lucene.keyword"\n },\n ],\n } \n }\n}',version:"4.4.0"},{name:"KNN Vector field mapping",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<vector embedding field name>}: [\n {\n "type": "knnVector",\n "dimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n } \n ] \n } \n }\n}',version:"4.4.0"}],t.ATLAS_VECTOR_SEARCH_TEMPLATE={name:"Vector Search default template",snippet:'{\n "fields": [{\n "type": "vector",\n "path": "${1:<field name to index>}",\n "numDimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n }]\n}',version:"4.4.0"}},57544:(e,t,n)=>{const a=n(49764),{MAX_LENGTH:r,MAX_SAFE_INTEGER:s}=n(66078),{safeRe:i,t:o}=n(25522),l=n(43639),{compareIdentifiers:u}=n(40383);class c{constructor(e,t){if(t=l(t),e instanceof c){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[o.LOOSE]:i[o.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(a("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof c||(e=new c(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(a("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(a("build compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===n&&(a=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},57578:(e,t,n)=>{const a=n(43143);e.exports=(e,t,n)=>a(e,t,"<",n)},57681:(e,t,n)=>{const a=n(9350),r=n(96506),{ANY:s}=r,i=n(33629),o=n(52992),l=n(42734),u=n(63825),c=n(90898),p=n(66135);e.exports=(e,t,n,d)=>{let m,h,f,v,g;switch(e=new a(e,d),t=new i(t,d),n){case">":m=l,h=c,f=u,v=">",g=">=";break;case"<":m=u,h=p,f=l,v="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){const a=t.set[n];let i=null,o=null;if(a.forEach((e=>{e.semver===s&&(e=new r(">=0.0.0")),i=i||e,o=o||e,m(e.semver,i.semver,d)?i=e:f(e.semver,o.semver,d)&&(o=e)})),i.operator===v||i.operator===g)return!1;if((!o.operator||o.operator===v)&&h(e,o.semver))return!1;if(o.operator===g&&f(e,o.semver))return!1}return!0}},57893:(e,t,n)=>{n.d(t,{Ay:()=>u});var a={};n.r(a),n.d(a,{BRAND:()=>o.qt,DIRTY:()=>s.jm,EMPTY_PATH:()=>s.I3,INVALID:()=>s.uY,NEVER:()=>o.tm,OK:()=>s.OK,ParseStatus:()=>s.MY,Schema:()=>o.Sj,ZodAny:()=>o.Ml,ZodArray:()=>o.n,ZodBigInt:()=>o.Lr,ZodBoolean:()=>o.WF,ZodBranded:()=>o.eN,ZodCatch:()=>o.hw,ZodDate:()=>o.aP,ZodDefault:()=>o.Xi,ZodDiscriminatedUnion:()=>o.jv,ZodEffects:()=>o.k1,ZodEnum:()=>o.Vb,ZodError:()=>l.G,ZodFirstPartyTypeKind:()=>o.kY,ZodFunction:()=>o.CZ,ZodIntersection:()=>o.Jv,ZodIssueCode:()=>l.eq,ZodLazy:()=>o.Ih,ZodLiteral:()=>o.DN,ZodMap:()=>o.Ut,ZodNaN:()=>o.Tq,ZodNativeEnum:()=>o.WM,ZodNever:()=>o.iS,ZodNull:()=>o.PQ,ZodNullable:()=>o.l1,ZodNumber:()=>o.rS,ZodObject:()=>o.bv,ZodOptional:()=>o.Ii,ZodParsedType:()=>i.Zp,ZodPipeline:()=>o._c,ZodPromise:()=>o.$i,ZodReadonly:()=>o.EV,ZodRecord:()=>o.b8,ZodSchema:()=>o.lK,ZodSet:()=>o.Kz,ZodString:()=>o.ND,ZodSymbol:()=>o.K5,ZodTransformer:()=>o.BG,ZodTuple:()=>o.y0,ZodType:()=>o.aR,ZodUndefined:()=>o._Z,ZodUnion:()=>o.fZ,ZodUnknown:()=>o._,ZodVoid:()=>o.a0,addIssueToContext:()=>s.zn,any:()=>o.bz,array:()=>o.YO,bigint:()=>o.o,boolean:()=>o.zM,coerce:()=>o.au,custom:()=>o.Ie,date:()=>o.p6,datetimeRegex:()=>o.fm,defaultErrorMap:()=>r.su,discriminatedUnion:()=>o.gM,effect:()=>o.QZ,enum:()=>o.k5,function:()=>o.fH,getErrorMap:()=>r.$W,getParsedType:()=>i.CR,instanceof:()=>o.Nl,intersection:()=>o.E$,isAborted:()=>s.G4,isAsync:()=>s.xP,isDirty:()=>s.DM,isValid:()=>s.fn,late:()=>o.fn,lazy:()=>o.RZ,literal:()=>o.eu,makeIssue:()=>s.y7,map:()=>o.Tj,nan:()=>o.oi,nativeEnum:()=>o.fc,never:()=>o.Zm,null:()=>o.ch,nullable:()=>o.me,number:()=>o.ai,object:()=>o.Ik,objectUtil:()=>i.o6,oboolean:()=>o.yN,onumber:()=>o.p7,optional:()=>o.lq,ostring:()=>o.Di,pipeline:()=>o.Tk,preprocess:()=>o.vk,promise:()=>o.iv,quotelessJson:()=>l.WI,record:()=>o.g1,set:()=>o.hZ,setErrorMap:()=>r.pJ,strictObject:()=>o.re,string:()=>o.Yj,symbol:()=>o.HR,transformer:()=>o.Gu,tuple:()=>o.PV,undefined:()=>o.Vx,union:()=>o.KC,unknown:()=>o.L5,util:()=>i.ZS,void:()=>o.rI});var r=n(17769),s=n(63761),i=n(21392),o=n(3508),l=n(14487);const u=a},58313:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EXPRESSION_OPERATORS=void 0,t.EXPRESSION_OPERATORS=[{name:"$abs",value:"$abs",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$accumulator",value:"$accumulator",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$add",value:"$add",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$allElementsTrue",value:"$allElementsTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$and",value:"$and",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$anyElementTrue",value:"$anyElementTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$arrayElemAt",value:"$arrayElemAt",score:1,meta:"expr:array",version:"3.2.0"},{name:"$arrayToObject",value:"$arrayToObject",score:1,meta:"expr:array",version:"3.4.4"},{name:"$binarySize",value:"$binarySize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$bsonSize",value:"$bsonSize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$ceil",value:"$ceil",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$cmp",value:"$cmp",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$concat",value:"$concat",score:1,meta:"expr:string",version:"2.4.0"},{name:"$concatArrays",value:"$concatArrays",score:1,meta:"expr:array",version:"3.2.0"},{name:"$cond",value:"$cond",score:1,meta:"expr:cond",version:"2.6.0"},{name:"$dateAdd",value:"$dateAdd",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateDiff",value:"$dateDiff",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateFromParts",value:"$dateFromParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateFromString",value:"$dateFromString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateSubtract",value:"$dateSubtract",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateToParts",value:"$dateToParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateTrunc",value:"$dateTrunc",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dayOfMonth",value:"$dayOfMonth",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfWeek",value:"$dayOfWeek",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfYear",value:"$dayOfYear",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.0.0"},{name:"$divide",value:"$divide",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$eq",value:"$eq",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$exp",value:"$exp",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$filter",value:"$filter",score:1,meta:"expr:array",version:"3.2.0"},{name:"$first",value:"$first",score:1,meta:"expr:array",version:"4.4.0"},{name:"$floor",value:"$floor",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$function",value:"$function",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$getField",value:"$getField",score:1,meta:"expr:get",version:"5.0.0"},{name:"$gt",value:"$gt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$gte",value:"$gte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$hour",value:"$hour",score:1,meta:"expr:date",version:"2.2.0"},{name:"$ifNull",value:"$ifNull",score:1,meta:"expr:cond",version:"2.2.0"},{name:"$in",value:"$in",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfArray",value:"$indexOfArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfBytes",value:"$indexOfBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$indexOfCP",value:"$indexOfCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$isArray",value:"$isArray",score:1,meta:"expr:array",version:"3.2.0"},{name:"$isNumber",value:"$isNumber",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$isoDayOfWeek",value:"$isoDayOfWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeek",value:"$isoWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeekYear",value:"$isoWeekYear",score:1,meta:"expr:date",version:"3.4.0"},{name:"$last",value:"$last",score:1,meta:"expr:array",version:"4.4.0"},{name:"$let",value:"$let",score:1,meta:"expr:var",version:"2.6.0"},{name:"$literal",value:"$literal",score:1,meta:"expr:literal",version:"2.6.0"},{name:"$lt",value:"$lt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$lt",value:"$lte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$ln",value:"$ln",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log",value:"$log",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log10",value:"$log10",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$map",value:"$map",score:1,meta:"expr:array",version:"2.6.0"},{name:"$mergeObjects",value:"$mergeObjects",score:1,meta:"expr:obj",version:"3.6.0"},{name:"$meta",value:"$meta",score:1,meta:"expr:text",version:"2.6.0"},{name:"$millisecond",value:"$millisecond",score:1,meta:"expr:date",version:"2.4.0"},{name:"$minute",value:"$minute",score:1,meta:"expr:date",version:"2.2.0"},{name:"$mod",value:"$mod",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$month",value:"$month",score:1,meta:"expr:date",version:"2.2.0"},{name:"$multiply",value:"$multiply",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$new",value:"$new",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$not",value:"$not",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$objectToArray",value:"$objectToArray",score:1,meta:"expr:array",version:"3.4.4"},{name:"$or",value:"$or",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$pow",value:"$pow",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$range",value:"$range",score:1,meta:"expr:array",version:"3.4.0"},{name:"$reduce",value:"$reduce",score:1,meta:"expr:array",version:"3.4.0"},{name:"$regexFind",value:"$regexFind",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexFindAll",value:"$regexFindAll",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexMatch",value:"$regexMatch",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$replaceAll",value:"$replaceAll",score:1,meta:"expr:string",version:"4.4.0"},{name:"$replaceOne",value:"$replaceOne",score:1,meta:"expr:string",version:"4.4.0"},{name:"$reverseArray",value:"$reverseArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$second",value:"$second",score:1,meta:"expr:date",version:"2.2.0"},{name:"$setDifference",value:"$setDifference",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setEquals",value:"$setEquals",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIntersection",value:"$setIntersection",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIsSubset",value:"$setIsSubset",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setUnion",value:"$setUnion",score:1,meta:"expr:set",version:"2.6.0"},{name:"$similarityCosine",value:"$similarityCosine",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityDotProduct",value:"$similarityDotProduct",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityEuclidean",value:"$similarityEuclidean",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$size",value:"$size",score:1,meta:"expr:array",version:"2.6.0"},{name:"$slice",value:"$slice",score:1,meta:"expr:array",version:"3.2.0"},{name:"$sortArray",value:"$sortArray",score:1,meta:"expr:array",version:"5.2.0"},{name:"$split",value:"$split",score:1,meta:"expr:string",version:"3.4.0"},{name:"$sqrt",value:"$sqrt",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$strcasecmp",value:"$strcasecmp",score:1,meta:"expr:string",version:"2.2.0"},{name:"$strLenBytes",value:"$strLenBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$strLenCP",value:"$strLenCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substr",value:"$substr",score:1,meta:"expr:string",version:"2.2.0",deprecated:"3.4.0",replacement:"$substrBytes"},{name:"$substrBytes",value:"$substrBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substrCP",value:"$substrCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$subtract",value:"$subtract",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$switch",value:"$switch",score:1,meta:"expr:cond",version:"3.4.0"},{name:"$toHashedIndexKey",value:"$toHashedIndexKey",score:1,meta:"expr:arith",version:"4.2.24"},{name:"$toLower",value:"$toLower",score:1,meta:"expr:string",version:"2.2.0"},{name:"$toUpper",value:"$toUpper",score:1,meta:"expr:string",version:"2.2.0"},{name:"$tsSecond",value:"$tsSecond",score:1,meta:"expr:date",version:"5.1.0"},{name:"$tsIncrement",value:"$tsIncrement",score:1,meta:"expr:date",version:"5.1.0"},{name:"$trunc",value:"$trunc",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$type",value:"$type",score:1,meta:"expr:type",version:"3.4.0"},{name:"$week",value:"$week",score:1,meta:"expr:date",version:"2.2.0"},{name:"$year",value:"$year",score:1,meta:"expr:date",version:"2.2.0"},{name:"$zip",value:"$zip",score:1,meta:"expr:array",version:"3.4.0"},{name:"$bitAnd",value:"$bitAnd",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitOr",value:"$bitOr",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitXor",value:"$bitXor",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitNot",value:"$bitNot",score:1,meta:"expr:bit",version:"7.0.0"}]},58387:(e,t,n)=>{const a=Symbol("SemVer ANY");class r{static get ANY(){return a}constructor(e,t){if(t=s(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===a?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new c(n[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=s(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=r;const s=n(69348),{safeRe:i,t:o}=n(415),l=n(59382),u=n(67767),c=n(66283),p=n(38366)},58395:(e,t,n)=>{const a=n(9350);e.exports=(e,t)=>new a(e,t).patch},58505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VALIDATION_TEMPLATE=void 0,t.VALIDATION_TEMPLATE='/**\n * This is a starter template for a schema validation rule for a collection.\n * More information on schema validation rules can be found at:\n * https://www.mongodb.com/docs/manual/core/schema-validation/\n */\n{\n $jsonSchema: {\n title: "Library.books",\n bsonType: "object",\n required: ["fieldname1", "fieldname2"],\n properties: {\n fieldname1: {\n bsonType: "string",\n description: "Fieldname1 must be a string",\n },\n fieldname2: {\n bsonType: "int",\n description: "Fieldname2 must be an integer",\n },\n arrayFieldName: {\n bsonType: "array",\n items: {\n bsonType: "string"\n },\n description: "arrayFieldName must be an array of strings"\n },\n }\n }\n}'},58516:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPE_ALIASES=void 0,t.BSON_TYPE_ALIASES=[{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"string",value:"string",label:"string",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"object",value:"object",label:"object",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"array",value:"array",label:"array",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"binData",value:"binData",label:"binData",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"objectId",value:"objectId",label:"objectId",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"bool",value:"bool",label:"bool",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"date",value:"date",label:"date",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"null",value:"null",label:"null",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"regex",value:"regex",label:"regex",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascript",value:"javascript",label:"javascript",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascriptWithScope",value:"javascriptWithScope",label:"javascriptWithScope",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"int",value:"int",label:"int",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"timestamp",value:"timestamp",label:"timestamp",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"long",value:"long",label:"long",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"decimal",value:"decimal",label:"decimal",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"minKey",value:"minKey",label:"minKey",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"maxKey",value:"maxKey",label:"maxKey",score:1,meta:"bson-type-aliases",version:"3.6.0"}]},58809:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>a(e,t,n)>0},59025:(e,t,n)=>{const a=n(99385);e.exports=(e,t,n)=>a(e,t,">",n)},59263:(e,t,n)=>{const a=n(52992),r=n(99430);e.exports=(e,t,n)=>{const s=[];let i=null,o=null;const l=e.sort(((e,t)=>r(e,t,n)));for(const e of l)a(e,t,n)?(o=e,i||(i=e)):(o&&s.push([i,o]),o=null,i=null);i&&s.push([i,null]);const u=[];for(const[e,t]of s)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const c=u.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return c.length<p.length?c:t}},59382:(e,t,n)=>{const a=n(98746),r=n(78654),s=n(61607),i=n(15844),o=n(91152),l=n(80829);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a(e,n,u);case"!=":return r(e,n,u);case">":return s(e,n,u);case">=":return i(e,n,u);case"<":return o(e,n,u);case"<=":return l(e,n,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},59441:(e,t,n)=>{const a=n(66283);e.exports=(e,t,n=!1)=>{if(e instanceof a)return e;try{return new a(e,t)}catch(e){if(!n)return null;throw e}}},59588:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ANY_NAMESPACE=t.ANY_COLLECTION_NAMESPACE=t.TIME_SERIES=t.VIEW=t.COLLECTION=t.DATABASE=void 0,t.DATABASE="db";const n="coll";t.COLLECTION=n;const a="view";t.VIEW=a;const r="timeseries";t.TIME_SERIES=r;const s=[n,a,r];t.ANY_COLLECTION_NAMESPACE=s;const i=["db",...s];t.ANY_NAMESPACE=i},59591:(e,t,n)=>{const a=n(18104),r=n(4292),s=n(41694),i=n(90733),o=n(83586),l=n(20903),u=n(15144),c=n(89065),p=n(76654),d=n(86912),m=n(32924),h=n(65011),f=n(30403),v=n(40289),g=n(19896),y=n(54597),$=n(87391),b=n(42945),_=n(37359),E=n(43334),x=n(3449),S=n(94463),A=n(36749),I=n(47775),w=n(9418),T=n(94706),N=n(65816),O=n(96082),k=n(71333),R=n(9480),C=n(56741),P=n(34218),L=n(44016),j=n(77467),M=n(37276),D=n(99385),Y=n(59025),F=n(5992),q=n(73634),U=n(96775),V=n(36582);e.exports={parse:o,valid:l,clean:u,inc:c,diff:p,major:d,minor:m,patch:h,prerelease:f,compare:v,rcompare:g,compareLoose:y,compareBuild:$,sort:b,rsort:_,gt:E,lt:x,eq:S,neq:A,gte:I,lte:w,cmp:T,coerce:N,Comparator:O,Range:k,satisfies:R,toComparators:C,maxSatisfying:P,minSatisfying:L,minVersion:j,validRange:M,outside:D,gtr:Y,ltr:F,intersects:q,simplifyRange:U,subset:V,SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},59818:(e,t,n)=>{const a=n(38358);e.exports=(e,t)=>{const n=a(e,null,!0),r=a(t,null,!0),s=n.compare(r);if(0===s)return null;const i=s>0,o=i?n:r,l=i?r:n,u=!!o.prerelease.length;if(l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(o))return l.minor&&!l.patch?"minor":"patch"}const c=u?"pre":"";return n.major!==r.major?c+"major":n.minor!==r.minor?c+"minor":n.patch!==r.patch?c+"patch":"prerelease"}},59934:(e,t,n)=>{const a=n(57544),r=n(95323),s=n(72608);e.exports=(e,t)=>{e=new r(e,t);let n=new a("0.0.0");if(e.test(n))return n;if(n=new a("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new a(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!s(n,i)||(n=i)}return n&&e.test(n)?n:null}},59984:(e,t,n)=>{const a=n(72857);e.exports=(e,t)=>{try{return new a(e,t).range||"*"}catch(e){return null}}},60098:(e,t,n)=>{const a=n(9350),r=n(33629);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},60501:(e,t,n)=>{const a=n(66283);e.exports=(e,t,n)=>new a(e,n).compare(new a(t,n))},60679:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QUERY_OPERATORS=void 0,t.QUERY_OPERATORS=[{name:"$all",value:"$all",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$and",value:"$and",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$bitsAllClear",value:"$bitsAllClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAllSet",value:"$bitsAllSet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnyClear",value:"$bitsAnyClear",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$bitsAnySet",value:"$bitsAnySet",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$comment",value:"$comment",score:1,meta:"query",version:"3.2.0",geospatial:!1},{name:"$elemMatch",value:"$elemMatch",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$eq",value:"$eq",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$exists",value:"$exists",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$expr",value:"$expr",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$geoIntersects",value:"$geoIntersects",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$geoWithin",value:"$geoWithin",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$gt",value:"$gt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$gte",value:"$gte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$in",value:"$in",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$jsonSchema",value:"$jsonSchema",score:1,meta:"query",version:"3.6.0",geospatial:!1},{name:"$lt",value:"$lt",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$lte",value:"$lte",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$mod",value:"$mod",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$ne",value:"$ne",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$near",value:"$near",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nearSphere",value:"$nearSphere",score:1,meta:"query",version:"2.2.0",geospatial:!0},{name:"$nin",value:"$nin",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$not",value:"$not",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$nor",value:"$nor",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$or",value:"$or",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$regex",value:"$regex",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$size",value:"$size",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$slice",value:"$slice",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$text",value:"$text",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$type",value:"$type",score:1,meta:"query",version:"2.2.0",geospatial:!1},{name:"$where",value:"$where",score:1,meta:"query",version:"2.2.0",geospatial:!1}]},61607:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>a(e,t,n)>0},62280:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ACCUMULATORS=void 0,t.ACCUMULATORS=[{name:"$accumulator",value:"$accumulator",score:1,meta:"accumulator",version:"4.4.0"},{name:"$addToSet",value:"$addToSet",score:1,meta:"accumulator",version:"2.2.0"},{name:"$avg",value:"$avg",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$bottom",value:"$bottom",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$bottomN",value:"$bottomN",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$covariancePop",value:"$covariancePop",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$covarianceSamp",value:"$covarianceSamp",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$count",value:"$count",score:1,meta:"accumulator",version:"5.0.0"},{name:"$derivative",value:"$derivative",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$denseRank",value:"$denseRank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$documentNumber",value:"$documentNumber",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$expMovingAvg",value:"$expMovingAvg",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$first",value:"$first",score:1,meta:"accumulator",version:"2.2.0"},{name:"$firstN",value:"$firstN",score:1,meta:"accumulator",version:"5.1.0"},{name:"$integral",value:"$integral",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$last",value:"$last",score:1,meta:"accumulator",version:"2.2.0"},{name:"$lastN",value:"$lastN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$max",value:"$max",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$maxN",value:"$maxN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$median",value:"$median",score:1,meta:"accumulator",version:"7.0.0"},{name:"$min",value:"$min",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$minN",value:"$minN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$percentile",value:"$percentile",score:1,meta:"accumulator",version:"7.0.0"},{name:"$push",value:"$push",score:1,meta:"accumulator",version:"2.2.0"},{name:"$rank",value:"$rank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$stdDevPop",value:"$stdDevPop",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$stdDevSamp",value:"$stdDevSamp",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$shift",value:"$shift",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$sum",value:"$sum",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$top",value:"$top",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$topN",value:"$topN",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$locf",value:"$locf",score:1,meta:"accumulator:window",version:"5.3.0"},{name:"$linearFill",value:"$linearFill",score:1,meta:"accumulator:window",version:"5.3.0"}]},62525:(e,t,n)=>{const a=n(99430);e.exports=(e,t)=>a(e,t,!0)},62893:(e,t,n)=>{const a=n(12196);e.exports=(e,t)=>{const n=a(e,t);return n&&n.prerelease.length?n.prerelease:null}},62921:(e,t,n)=>{const a=n(57681);e.exports=(e,t,n)=>a(e,t,">",n)},63131:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ACCUMULATORS=void 0,t.ACCUMULATORS=[{name:"$accumulator",value:"$accumulator",score:1,meta:"accumulator",version:"4.4.0"},{name:"$addToSet",value:"$addToSet",score:1,meta:"accumulator",version:"2.2.0"},{name:"$avg",value:"$avg",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$bottom",value:"$bottom",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$bottomN",value:"$bottomN",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$covariancePop",value:"$covariancePop",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$covarianceSamp",value:"$covarianceSamp",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$count",value:"$count",score:1,meta:"accumulator",version:"5.0.0"},{name:"$derivative",value:"$derivative",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$denseRank",value:"$denseRank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$documentNumber",value:"$documentNumber",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$expMovingAvg",value:"$expMovingAvg",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$first",value:"$first",score:1,meta:"accumulator",version:"2.2.0"},{name:"$firstN",value:"$firstN",score:1,meta:"accumulator",version:"5.1.0"},{name:"$integral",value:"$integral",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$last",value:"$last",score:1,meta:"accumulator",version:"2.2.0"},{name:"$lastN",value:"$lastN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$max",value:"$max",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$maxN",value:"$maxN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$median",value:"$median",score:1,meta:"accumulator",version:"7.0.0"},{name:"$min",value:"$min",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$minN",value:"$minN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$percentile",value:"$percentile",score:1,meta:"accumulator",version:"7.0.0"},{name:"$push",value:"$push",score:1,meta:"accumulator",version:"2.2.0"},{name:"$rank",value:"$rank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$stdDevPop",value:"$stdDevPop",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$stdDevSamp",value:"$stdDevSamp",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$shift",value:"$shift",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$sum",value:"$sum",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$top",value:"$top",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$topN",value:"$topN",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$locf",value:"$locf",score:1,meta:"accumulator:window",version:"5.3.0"},{name:"$linearFill",value:"$linearFill",score:1,meta:"accumulator:window",version:"5.3.0"}]},63547:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPE_ALIASES=void 0,t.BSON_TYPE_ALIASES=[{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"string",value:"string",label:"string",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"object",value:"object",label:"object",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"array",value:"array",label:"array",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"binData",value:"binData",label:"binData",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"objectId",value:"objectId",label:"objectId",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"bool",value:"bool",label:"bool",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"date",value:"date",label:"date",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"null",value:"null",label:"null",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"regex",value:"regex",label:"regex",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascript",value:"javascript",label:"javascript",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascriptWithScope",value:"javascriptWithScope",label:"javascriptWithScope",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"int",value:"int",label:"int",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"timestamp",value:"timestamp",label:"timestamp",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"long",value:"long",label:"long",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"decimal",value:"decimal",label:"decimal",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"minKey",value:"minKey",label:"minKey",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"maxKey",value:"maxKey",label:"maxKey",score:1,meta:"bson-type-aliases",version:"3.6.0"}]},63761:(e,t,n)=>{n.d(t,{DM:()=>m,G4:()=>d,I3:()=>i,MY:()=>l,OK:()=>p,fn:()=>h,jm:()=>c,uY:()=>u,xP:()=>f,y7:()=>s,zn:()=>o});var a=n(17769),r=n(15625);const s=e=>{const{data:t,path:n,errorMaps:a,issueData:r}=e,s=[...n,...r.path||[]],i={...r,path:s};if(void 0!==r.message)return{...r,path:s,message:r.message};let o="";const l=a.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(i,{data:t,defaultError:o}).message;return{...r,path:s,message:o}},i=[];function o(e,t){const n=(0,a.$W)(),i=s({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===r.A?void 0:r.A].filter((e=>!!e))});e.common.issues.push(i)}class l{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if("aborted"===a.status)return u;"dirty"===a.status&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,a=await e.value;n.push({key:t,value:a})}return l.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:t,value:r}=a;if("aborted"===t.status)return u;if("aborted"===r.status)return u;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!a.alwaysSet||(n[t.value]=r.value)}return{status:e.value,value:n}}}const u=Object.freeze({status:"aborted"}),c=e=>({status:"dirty",value:e}),p=e=>({status:"valid",value:e}),d=e=>"aborted"===e.status,m=e=>"dirty"===e.status,h=e=>"valid"===e.status,f=e=>"undefined"!=typeof Promise&&e instanceof Promise},63825:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>a(e,t,n)<0},63875:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENVS=t.ON_PREM=t.ADL=t.ATLAS=void 0;const n="atlas";t.ATLAS=n,t.ADL="adl";const a="on-prem";t.ON_PREM=a;const r=[n,"adl",a];t.ENVS=r},63876:(e,t,n)=>{const a=n(24472);e.exports=(e,t,n)=>a(e,t,">",n)},64097:(e,t,n)=>{n.d(t,{Ah:()=>s,BF:()=>u,DP:()=>c,L5:()=>l,MD:()=>d,Ub:()=>r,gR:()=>m,n:()=>p,nP:()=>i,qp:()=>o,rd:()=>h,zM:()=>f});var a=n(14982);a.ACCUMULATORS;const r=a.ADL,s=(a.ANY_COLLECTION_NAMESPACE,a.ANY_NAMESPACE,a.ATLAS),i=(a.ATLAS_SEARCH_TEMPLATES,a.ATLAS_VECTOR_SEARCH_TEMPLATE,a.BSON_TYPES,a.BSON_TYPE_ALIASES,a.COLLECTION),o=(a.CONVERSION_OPERATORS,a.DATABASE,a.ENVS,a.EXPRESSION_OPERATORS,a.FULL_SCAN_STAGES),l=(a.JSON_SCHEMA,a.ON_PREM),u=a.OUT_STAGES,c=(a.QUERY_OPERATORS,a.REQUIRED_AS_FIRST_STAGE),p=a.STAGE_OPERATORS,d=(a.STAGE_OPERATOR_NAMES,a.SYSTEM_VARIABLES,a.TIME_SERIES),m=(a.VALIDATION_TEMPLATE,a.VIEW),h=a.VIEW_PIPELINE_UTILS,f=a.getFilteredCompletions;a.wrapField},64136:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},64279:e=>{const{AbortController:t,AbortSignal:n}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=n,e.exports.default=t},64757:function(e,t,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_PIPELINE_UTILS=void 0;const r=a(n(35647)),s="8.0.0",i="8.1.0";t.VIEW_PIPELINE_UTILS={MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_DE:s,MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_COMPASS:i,isPipelineSearchQueryable:e=>{for(const t of e){const e=Object.keys(t)[0];if("$addFields"!==e&&"$set"!==e&&"$match"!==e)return!1;if("$match"===e){const e=t.$match,n=Object.keys(e||{});if(1!==n.length||!n.includes("$expr"))return!1}}return!0},isVersionSearchCompatibleForViewsDataExplorer:e=>{try{return r.default.gte(e,s)}catch{return!1}},isVersionSearchCompatibleForViewsCompass:e=>{try{return r.default.gte(e,i)}catch{return!1}}}},64900:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CONVERSION_OPERATORS=void 0,t.CONVERSION_OPERATORS=[{name:"$convert",value:"$convert",score:1,meta:"conv",version:"3.7.2"},{name:"$ltrim",value:"$ltrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$rtrim",value:"$rtrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$toBool",value:"$toBool",score:1,meta:"conv",version:"3.7.2"},{name:"$toDate",value:"$toDate",score:1,meta:"conv",version:"3.7.2"},{name:"$toDecimal",value:"$toDecimal",score:1,meta:"conv",version:"3.7.2"},{name:"$toDouble",value:"$toDouble",score:1,meta:"conv",version:"3.7.2"},{name:"$toInt",value:"$toInt",score:1,meta:"conv",version:"3.7.2"},{name:"$toLong",value:"$toLong",score:1,meta:"conv",version:"3.7.2"},{name:"$toObjectId",value:"$toObjectId",score:1,meta:"conv",version:"3.7.2"},{name:"$toString",value:"$toString",score:1,meta:"conv",version:"3.7.2"},{name:"$trim",value:"$trim",score:1,meta:"accumulator",version:"3.7.2"}]},65011:(e,t,n)=>{const a=n(41694);e.exports=(e,t)=>new a(e,t).patch},65108:(e,t,n)=>{n.d(t,{ry:()=>ke});var a=n(7774),r=n(12240),s=n(94893),i=n(1280),o=n(9606).URL,l=s.Ik({error:s.Ik({message:s.Yj(),type:s.Yj().nullish(),param:s.bz().nullish(),code:s.KC([s.Yj(),s.ai()]).nullish()})}),u=(0,a.sl)({errorSchema:l,errorToMessage:e=>e.error.message});function c(e){const t=e.startsWith("o3")||e.startsWith("o4-mini")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-chat"),n=e.startsWith("gpt-4")||e.startsWith("gpt-5-mini")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-nano")&&!e.startsWith("gpt-5-chat")||e.startsWith("o3")||e.startsWith("o4-mini"),a=!(e.startsWith("gpt-3")||e.startsWith("gpt-4")||e.startsWith("chatgpt-4o")||e.startsWith("gpt-5-chat"));return{supportsFlexProcessing:t,supportsPriorityProcessing:n,isReasoningModel:a,systemMessageMode:a?"developer":"system",supportsNonReasoningParameters:e.startsWith("gpt-5.1")}}function p(e){var t,n,a,r,s,i;if(null==e)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};const o=null!=(t=e.prompt_tokens)?t:0,l=null!=(n=e.completion_tokens)?n:0,u=null!=(r=null==(a=e.prompt_tokens_details)?void 0:a.cached_tokens)?r:0,c=null!=(i=null==(s=e.completion_tokens_details)?void 0:s.reasoning_tokens)?i:0;return{inputTokens:{total:o,noCache:o-u,cacheRead:u,cacheWrite:void 0},outputTokens:{total:l,text:l-c,reasoning:c},raw:e}}function d({id:e,model:t,created:n}){return{id:null!=e?e:void 0,modelId:null!=t?t:void 0,timestamp:n?new Date(1e3*n):void 0}}function m(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var h=(0,a.ID)((()=>(0,a.jN)(s.Ik({id:s.Yj().nullish(),created:s.ai().nullish(),model:s.Yj().nullish(),choices:s.YO(s.Ik({message:s.Ik({role:s.eu("assistant").nullish(),content:s.Yj().nullish(),tool_calls:s.YO(s.Ik({id:s.Yj().nullish(),type:s.eu("function"),function:s.Ik({name:s.Yj(),arguments:s.Yj()})})).nullish(),annotations:s.YO(s.Ik({type:s.eu("url_citation"),url_citation:s.Ik({start_index:s.ai(),end_index:s.ai(),url:s.Yj(),title:s.Yj()})})).nullish()}),index:s.ai(),logprobs:s.Ik({content:s.YO(s.Ik({token:s.Yj(),logprob:s.ai(),top_logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai()}))})).nullish()}).nullish(),finish_reason:s.Yj().nullish()})),usage:s.Ik({prompt_tokens:s.ai().nullish(),completion_tokens:s.ai().nullish(),total_tokens:s.ai().nullish(),prompt_tokens_details:s.Ik({cached_tokens:s.ai().nullish()}).nullish(),completion_tokens_details:s.Ik({reasoning_tokens:s.ai().nullish(),accepted_prediction_tokens:s.ai().nullish(),rejected_prediction_tokens:s.ai().nullish()}).nullish()}).nullish()})))),f=(0,a.ID)((()=>(0,a.jN)(s.KC([s.Ik({id:s.Yj().nullish(),created:s.ai().nullish(),model:s.Yj().nullish(),choices:s.YO(s.Ik({delta:s.Ik({role:s.k5(["assistant"]).nullish(),content:s.Yj().nullish(),tool_calls:s.YO(s.Ik({index:s.ai(),id:s.Yj().nullish(),type:s.eu("function").nullish(),function:s.Ik({name:s.Yj().nullish(),arguments:s.Yj().nullish()})})).nullish(),annotations:s.YO(s.Ik({type:s.eu("url_citation"),url_citation:s.Ik({start_index:s.ai(),end_index:s.ai(),url:s.Yj(),title:s.Yj()})})).nullish()}).nullish(),logprobs:s.Ik({content:s.YO(s.Ik({token:s.Yj(),logprob:s.ai(),top_logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai()}))})).nullish()}).nullish(),finish_reason:s.Yj().nullish(),index:s.ai()})),usage:s.Ik({prompt_tokens:s.ai().nullish(),completion_tokens:s.ai().nullish(),total_tokens:s.ai().nullish(),prompt_tokens_details:s.Ik({cached_tokens:s.ai().nullish()}).nullish(),completion_tokens_details:s.Ik({reasoning_tokens:s.ai().nullish(),accepted_prediction_tokens:s.ai().nullish(),rejected_prediction_tokens:s.ai().nullish()}).nullish()}).nullish()}),l])))),v=(0,a.ID)((()=>(0,a.jN)(s.Ik({logitBias:s.g1(i.qG(s.rS,undefined),s.ai()).optional(),logprobs:s.KC([s.zM(),s.ai()]).optional(),parallelToolCalls:s.zM().optional(),user:s.Yj().optional(),reasoningEffort:s.k5(["none","minimal","low","medium","high","xhigh"]).optional(),maxCompletionTokens:s.ai().optional(),store:s.zM().optional(),metadata:s.g1(s.Yj().max(64),s.Yj().max(512)).optional(),prediction:s.g1(s.Yj(),s.bz()).optional(),serviceTier:s.k5(["auto","flex","priority","default"]).optional(),strictJsonSchema:s.zM().optional(),textVerbosity:s.k5(["low","medium","high"]).optional(),promptCacheKey:s.Yj().optional(),promptCacheRetention:s.k5(["in_memory","24h"]).optional(),safetyIdentifier:s.Yj().optional()})))),g=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=e,this.config=t}get provider(){return this.config.provider}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:s,topK:i,frequencyPenalty:l,presencePenalty:u,stopSequences:p,responseFormat:d,seed:m,tools:h,toolChoice:f,providerOptions:g}){var y,$,b;const _=[],E=null!=(y=await(0,a.xI)({provider:"openai",providerOptions:g,schema:v}))?y:{},x=c(this.modelId);null!=i&&_.push({type:"unsupported",feature:"topK"});const{messages:S,warnings:A}=function({prompt:e,systemMessageMode:t="system"}){var n;const s=[],i=[];for(const{role:l,content:u}of e)switch(l){case"system":switch(t){case"system":s.push({role:"system",content:u});break;case"developer":s.push({role:"developer",content:u});break;case"remove":i.push({type:"other",message:"system messages are removed for this model"});break;default:throw new Error(`Unsupported system message mode: ${t}`)}break;case"user":if(1===u.length&&"text"===u[0].type){s.push({role:"user",content:u[0].text});break}s.push({role:"user",content:u.map(((e,t)=>{var n,s,i;switch(e.type){case"text":return{type:"text",text:e.text};case"file":if(e.mediaType.startsWith("image/")){const t="image/*"===e.mediaType?"image/jpeg":e.mediaType;return{type:"image_url",image_url:{url:e.data instanceof o?e.data.toString():`data:${t};base64,${(0,a.ej)(e.data)}`,detail:null==(s=null==(n=e.providerOptions)?void 0:n.openai)?void 0:s.imageDetail}}}if(!e.mediaType.startsWith("audio/")){if("application/pdf"===e.mediaType){if(e.data instanceof o)throw new r.b8({functionality:"PDF file parts with URLs"});return{type:"file",file:"string"==typeof e.data&&e.data.startsWith("file-")?{file_id:e.data}:{filename:null!=(i=e.filename)?i:`part-${t}.pdf`,file_data:`data:application/pdf;base64,${(0,a.ej)(e.data)}`}}}throw new r.b8({functionality:`file part media type ${e.mediaType}`})}if(e.data instanceof o)throw new r.b8({functionality:"audio file parts with URLs"});switch(e.mediaType){case"audio/wav":return{type:"input_audio",input_audio:{data:(0,a.ej)(e.data),format:"wav"}};case"audio/mp3":case"audio/mpeg":return{type:"input_audio",input_audio:{data:(0,a.ej)(e.data),format:"mp3"}};default:throw new r.b8({functionality:`audio content parts with media type ${e.mediaType}`})}}}))});break;case"assistant":{let e="";const t=[];for(const n of u)switch(n.type){case"text":e+=n.text;break;case"tool-call":t.push({id:n.toolCallId,type:"function",function:{name:n.toolName,arguments:JSON.stringify(n.input)}})}s.push({role:"assistant",content:e,tool_calls:t.length>0?t:void 0});break}case"tool":for(const e of u){const t=e.output;let a;switch(t.type){case"text":case"error-text":a=t.value;break;case"execution-denied":a=null!=(n=t.reason)?n:"Tool execution denied.";break;case"content":case"json":case"error-json":a=JSON.stringify(t.value)}s.push({role:"tool",tool_call_id:e.toolCallId,content:a})}break;default:throw new Error(`Unsupported role: ${l}`)}return{messages:s,warnings:i}}({prompt:e,systemMessageMode:x.systemMessageMode});_.push(...A);const I=null==($=E.strictJsonSchema)||$,w={model:this.modelId,logit_bias:E.logitBias,logprobs:!0===E.logprobs||"number"==typeof E.logprobs||void 0,top_logprobs:"number"==typeof E.logprobs?E.logprobs:"boolean"==typeof E.logprobs&&E.logprobs?0:void 0,user:E.user,parallel_tool_calls:E.parallelToolCalls,max_tokens:t,temperature:n,top_p:s,frequency_penalty:l,presence_penalty:u,response_format:"json"===(null==d?void 0:d.type)?null!=d.schema?{type:"json_schema",json_schema:{schema:d.schema,strict:I,name:null!=(b=d.name)?b:"response",description:d.description}}:{type:"json_object"}:void 0,stop:p,seed:m,verbosity:E.textVerbosity,max_completion_tokens:E.maxCompletionTokens,store:E.store,metadata:E.metadata,prediction:E.prediction,reasoning_effort:E.reasoningEffort,service_tier:E.serviceTier,prompt_cache_key:E.promptCacheKey,prompt_cache_retention:E.promptCacheRetention,safety_identifier:E.safetyIdentifier,messages:S};x.isReasoningModel?("none"===E.reasoningEffort&&x.supportsNonReasoningParameters||(null!=w.temperature&&(w.temperature=void 0,_.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),null!=w.top_p&&(w.top_p=void 0,_.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"})),null!=w.logprobs&&(w.logprobs=void 0,_.push({type:"other",message:"logprobs is not supported for reasoning models"}))),null!=w.frequency_penalty&&(w.frequency_penalty=void 0,_.push({type:"unsupported",feature:"frequencyPenalty",details:"frequencyPenalty is not supported for reasoning models"})),null!=w.presence_penalty&&(w.presence_penalty=void 0,_.push({type:"unsupported",feature:"presencePenalty",details:"presencePenalty is not supported for reasoning models"})),null!=w.logit_bias&&(w.logit_bias=void 0,_.push({type:"other",message:"logitBias is not supported for reasoning models"})),null!=w.top_logprobs&&(w.top_logprobs=void 0,_.push({type:"other",message:"topLogprobs is not supported for reasoning models"})),null!=w.max_tokens&&(null==w.max_completion_tokens&&(w.max_completion_tokens=w.max_tokens),w.max_tokens=void 0)):(this.modelId.startsWith("gpt-4o-search-preview")||this.modelId.startsWith("gpt-4o-mini-search-preview"))&&null!=w.temperature&&(w.temperature=void 0,_.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for the search preview models and has been removed."})),"flex"!==E.serviceTier||x.supportsFlexProcessing||(_.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),w.service_tier=void 0),"priority"!==E.serviceTier||x.supportsPriorityProcessing||(_.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),w.service_tier=void 0);const{tools:T,toolChoice:N,toolWarnings:O}=function({tools:e,toolChoice:t}){const n=[];if(null==(e=(null==e?void 0:e.length)?e:void 0))return{tools:void 0,toolChoice:void 0,toolWarnings:n};const a=[];for(const t of e)"function"===t.type?a.push({type:"function",function:{name:t.name,description:t.description,parameters:t.inputSchema,...null!=t.strict?{strict:t.strict}:{}}}):n.push({type:"unsupported",feature:`tool type: ${t.type}`});if(null==t)return{tools:a,toolChoice:void 0,toolWarnings:n};const s=t.type;switch(s){case"auto":case"none":case"required":return{tools:a,toolChoice:s,toolWarnings:n};case"tool":return{tools:a,toolChoice:{type:"function",function:{name:t.toolName}},toolWarnings:n};default:{const e=s;throw new r.b8({functionality:`tool choice type: ${e}`})}}}({tools:h,toolChoice:f});return{args:{...w,tools:T,tool_choice:N},warnings:[..._,...O]}}async doGenerate(e){var t,n,r,s,i,o;const{args:l,warnings:c}=await this.getArgs(e),{responseHeaders:f,value:v,rawValue:g}=await(0,a.GU)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:l,failedResponseHandler:u,successfulResponseHandler:(0,a.cV)(h),abortSignal:e.abortSignal,fetch:this.config.fetch}),y=v.choices[0],$=[],b=y.message.content;null!=b&&b.length>0&&$.push({type:"text",text:b});for(const e of null!=(t=y.message.tool_calls)?t:[])$.push({type:"tool-call",toolCallId:null!=(n=e.id)?n:(0,a.$C)(),toolName:e.function.name,input:e.function.arguments});for(const e of null!=(r=y.message.annotations)?r:[])$.push({type:"source",sourceType:"url",id:(0,a.$C)(),url:e.url_citation.url,title:e.url_citation.title});const _=null==(s=v.usage)?void 0:s.completion_tokens_details,E=(null==(i=v.usage)||i.prompt_tokens_details,{openai:{}});return null!=(null==_?void 0:_.accepted_prediction_tokens)&&(E.openai.acceptedPredictionTokens=null==_?void 0:_.accepted_prediction_tokens),null!=(null==_?void 0:_.rejected_prediction_tokens)&&(E.openai.rejectedPredictionTokens=null==_?void 0:_.rejected_prediction_tokens),null!=(null==(o=y.logprobs)?void 0:o.content)&&(E.openai.logprobs=y.logprobs.content),{content:$,finishReason:m(y.finish_reason),usage:p(v.usage),request:{body:l},response:{...d(v),headers:f,body:g},warnings:c,providerMetadata:E}}async doStream(e){const{args:t,warnings:n}=await this.getArgs(e),s={...t,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:i,value:o}=await(0,a.GU)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:s,failedResponseHandler:u,successfulResponseHandler:(0,a.Ds)(f),abortSignal:e.abortSignal,fetch:this.config.fetch}),l=[];let c,h="unknown",v=!1,g=!1;const y={openai:{}};return{stream:o.pipeThrough(new TransformStream({start(e){e.enqueue({type:"stream-start",warnings:n})},transform(t,n){var s,i,o,u,p,f,$,b,_,E,x,S,A,I,w,T,N;if(e.includeRawChunks&&n.enqueue({type:"raw",rawValue:t.rawValue}),!t.success)return h="error",void n.enqueue({type:"error",error:t.error});const O=t.value;if("error"in O)return h="error",void n.enqueue({type:"error",error:O.error});if(!v){const e=d(O);Object.values(e).some(Boolean)&&(v=!0,n.enqueue({type:"response-metadata",...d(O)}))}null!=O.usage&&(c=O.usage,null!=(null==(s=O.usage.completion_tokens_details)?void 0:s.accepted_prediction_tokens)&&(y.openai.acceptedPredictionTokens=null==(i=O.usage.completion_tokens_details)?void 0:i.accepted_prediction_tokens),null!=(null==(o=O.usage.completion_tokens_details)?void 0:o.rejected_prediction_tokens)&&(y.openai.rejectedPredictionTokens=null==(u=O.usage.completion_tokens_details)?void 0:u.rejected_prediction_tokens));const k=O.choices[0];if(null!=(null==k?void 0:k.finish_reason)&&(h=m(k.finish_reason)),null!=(null==(p=null==k?void 0:k.logprobs)?void 0:p.content)&&(y.openai.logprobs=k.logprobs.content),null==(null==k?void 0:k.delta))return;const R=k.delta;if(null!=R.content&&(g||(n.enqueue({type:"text-start",id:"0"}),g=!0),n.enqueue({type:"text-delta",id:"0",delta:R.content})),null!=R.tool_calls)for(const e of R.tool_calls){const t=e.index;if(null==l[t]){if("function"!==e.type)throw new r.xn({data:e,message:"Expected 'function' type."});if(null==e.id)throw new r.xn({data:e,message:"Expected 'id' to be a string."});if(null==(null==(f=e.function)?void 0:f.name))throw new r.xn({data:e,message:"Expected 'function.name' to be a string."});n.enqueue({type:"tool-input-start",id:e.id,toolName:e.function.name}),l[t]={id:e.id,type:"function",function:{name:e.function.name,arguments:null!=($=e.function.arguments)?$:""},hasFinished:!1};const s=l[t];null!=(null==(b=s.function)?void 0:b.name)&&null!=(null==(_=s.function)?void 0:_.arguments)&&(s.function.arguments.length>0&&n.enqueue({type:"tool-input-delta",id:s.id,delta:s.function.arguments}),(0,a.v0)(s.function.arguments)&&(n.enqueue({type:"tool-input-end",id:s.id}),n.enqueue({type:"tool-call",toolCallId:null!=(E=s.id)?E:(0,a.$C)(),toolName:s.function.name,input:s.function.arguments}),s.hasFinished=!0));continue}const s=l[t];s.hasFinished||(null!=(null==(x=e.function)?void 0:x.arguments)&&(s.function.arguments+=null!=(A=null==(S=e.function)?void 0:S.arguments)?A:""),n.enqueue({type:"tool-input-delta",id:s.id,delta:null!=(I=e.function.arguments)?I:""}),null!=(null==(w=s.function)?void 0:w.name)&&null!=(null==(T=s.function)?void 0:T.arguments)&&(0,a.v0)(s.function.arguments)&&(n.enqueue({type:"tool-input-end",id:s.id}),n.enqueue({type:"tool-call",toolCallId:null!=(N=s.id)?N:(0,a.$C)(),toolName:s.function.name,input:s.function.arguments}),s.hasFinished=!0))}if(null!=R.annotations)for(const e of R.annotations)n.enqueue({type:"source",sourceType:"url",id:(0,a.$C)(),url:e.url_citation.url,title:e.url_citation.title})},flush(e){g&&e.enqueue({type:"text-end",id:"0"}),e.enqueue({type:"finish",finishReason:h,usage:p(c),...null!=y?{providerMetadata:y}:{}})}})),request:{body:s},response:{headers:i}}}};function y(e){var t,n,a,r;if(null==e)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};const s=null!=(t=e.prompt_tokens)?t:0,i=null!=(n=e.completion_tokens)?n:0;return{inputTokens:{total:null!=(a=e.prompt_tokens)?a:void 0,noCache:s,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:null!=(r=e.completion_tokens)?r:void 0,text:i,reasoning:void 0},raw:e}}function $({id:e,model:t,created:n}){return{id:null!=e?e:void 0,modelId:null!=t?t:void 0,timestamp:null!=n?new Date(1e3*n):void 0}}function b(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var _=(0,a.ID)((()=>(0,a.jN)(s.Ik({id:s.Yj().nullish(),created:s.ai().nullish(),model:s.Yj().nullish(),choices:s.YO(s.Ik({text:s.Yj(),finish_reason:s.Yj(),logprobs:s.Ik({tokens:s.YO(s.Yj()),token_logprobs:s.YO(s.ai()),top_logprobs:s.YO(s.g1(s.Yj(),s.ai())).nullish()}).nullish()})),usage:s.Ik({prompt_tokens:s.ai(),completion_tokens:s.ai(),total_tokens:s.ai()}).nullish()})))),E=(0,a.ID)((()=>(0,a.jN)(s.KC([s.Ik({id:s.Yj().nullish(),created:s.ai().nullish(),model:s.Yj().nullish(),choices:s.YO(s.Ik({text:s.Yj(),finish_reason:s.Yj().nullish(),index:s.ai(),logprobs:s.Ik({tokens:s.YO(s.Yj()),token_logprobs:s.YO(s.ai()),top_logprobs:s.YO(s.g1(s.Yj(),s.ai())).nullish()}).nullish()})),usage:s.Ik({prompt_tokens:s.ai(),completion_tokens:s.ai(),total_tokens:s.ai()}).nullish()}),l])))),x=(0,a.ID)((()=>(0,a.jN)(s.Ik({echo:s.zM().optional(),logitBias:s.g1(s.Yj(),s.ai()).optional(),suffix:s.Yj().optional(),user:s.Yj().optional(),logprobs:s.KC([s.zM(),s.ai()]).optional()})))),S=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={},this.modelId=e,this.config=t}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get provider(){return this.config.provider}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:s,topK:i,frequencyPenalty:o,presencePenalty:l,stopSequences:u,responseFormat:c,tools:p,toolChoice:d,seed:m,providerOptions:h}){const f=[],v={...await(0,a.xI)({provider:"openai",providerOptions:h,schema:x}),...await(0,a.xI)({provider:this.providerOptionsName,providerOptions:h,schema:x})};null!=i&&f.push({type:"unsupported",feature:"topK"}),(null==p?void 0:p.length)&&f.push({type:"unsupported",feature:"tools"}),null!=d&&f.push({type:"unsupported",feature:"toolChoice"}),null!=c&&"text"!==c.type&&f.push({type:"unsupported",feature:"responseFormat",details:"JSON response format is not supported."});const{prompt:g,stopSequences:y}=function({prompt:e,user:t="user",assistant:n="assistant"}){let a="";"system"===e[0].role&&(a+=`${e[0].content}\n\n`,e=e.slice(1));for(const{role:s,content:i}of e)switch(s){case"system":throw new r.M3({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":a+=`${t}:\n${i.map((e=>{if("text"===e.type)return e.text})).filter(Boolean).join("")}\n\n`;break;case"assistant":a+=`${n}:\n${i.map((e=>{switch(e.type){case"text":return e.text;case"tool-call":throw new r.b8({functionality:"tool-call messages"})}})).join("")}\n\n`;break;case"tool":throw new r.b8({functionality:"tool messages"});default:throw new Error(`Unsupported role: ${s}`)}return a+=`${n}:\n`,{prompt:a,stopSequences:[`\n${t}:`]}}({prompt:e}),$=[...null!=y?y:[],...null!=u?u:[]];return{args:{model:this.modelId,echo:v.echo,logit_bias:v.logitBias,logprobs:!0===(null==v?void 0:v.logprobs)?0:!1===(null==v?void 0:v.logprobs)||null==v?void 0:v.logprobs,suffix:v.suffix,user:v.user,max_tokens:t,temperature:n,top_p:s,frequency_penalty:o,presence_penalty:l,seed:m,prompt:g,stop:$.length>0?$:void 0},warnings:f}}async doGenerate(e){const{args:t,warnings:n}=await this.getArgs(e),{responseHeaders:r,value:s,rawValue:i}=await(0,a.GU)({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:t,failedResponseHandler:u,successfulResponseHandler:(0,a.cV)(_),abortSignal:e.abortSignal,fetch:this.config.fetch}),o=s.choices[0],l={openai:{}};return null!=o.logprobs&&(l.openai.logprobs=o.logprobs),{content:[{type:"text",text:o.text}],usage:y(s.usage),finishReason:b(o.finish_reason),request:{body:t},response:{...$(s),headers:r,body:i},providerMetadata:l,warnings:n}}async doStream(e){const{args:t,warnings:n}=await this.getArgs(e),r={...t,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:s,value:i}=await(0,a.GU)({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:r,failedResponseHandler:u,successfulResponseHandler:(0,a.Ds)(E),abortSignal:e.abortSignal,fetch:this.config.fetch});let o="unknown";const l={openai:{}};let c,p=!0;return{stream:i.pipeThrough(new TransformStream({start(e){e.enqueue({type:"stream-start",warnings:n})},transform(t,n){if(e.includeRawChunks&&n.enqueue({type:"raw",rawValue:t.rawValue}),!t.success)return o="error",void n.enqueue({type:"error",error:t.error});const a=t.value;if("error"in a)return o="error",void n.enqueue({type:"error",error:a.error});p&&(p=!1,n.enqueue({type:"response-metadata",...$(a)}),n.enqueue({type:"text-start",id:"0"})),null!=a.usage&&(c=a.usage);const r=a.choices[0];null!=(null==r?void 0:r.finish_reason)&&(o=b(r.finish_reason)),null!=(null==r?void 0:r.logprobs)&&(l.openai.logprobs=r.logprobs),null!=(null==r?void 0:r.text)&&r.text.length>0&&n.enqueue({type:"text-delta",id:"0",delta:r.text})},flush(e){p||e.enqueue({type:"text-end",id:"0"}),e.enqueue({type:"finish",finishReason:o,providerMetadata:l,usage:y(c)})}})),request:{body:r},response:{headers:s}}}},A=(0,a.ID)((()=>(0,a.jN)(s.Ik({dimensions:s.ai().optional(),user:s.Yj().optional()})))),I=(0,a.ID)((()=>(0,a.jN)(s.Ik({data:s.YO(s.Ik({embedding:s.YO(s.ai())})),usage:s.Ik({prompt_tokens:s.ai()}).nullish()})))),w=class{constructor(e,t){this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0,this.modelId=e,this.config=t}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:s}){var i;if(e.length>this.maxEmbeddingsPerCall)throw new r.Ch({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});const o=null!=(i=await(0,a.xI)({provider:"openai",providerOptions:s,schema:A}))?i:{},{responseHeaders:l,value:c,rawValue:p}=await(0,a.GU)({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),t),body:{model:this.modelId,input:e,encoding_format:"float",dimensions:o.dimensions,user:o.user},failedResponseHandler:u,successfulResponseHandler:(0,a.cV)(I),abortSignal:n,fetch:this.config.fetch});return{warnings:[],embeddings:c.data.map((e=>e.embedding)),usage:c.usage?{tokens:c.usage.prompt_tokens}:void 0,response:{headers:l,body:p}}}},T=(0,a.ID)((()=>(0,a.jN)(s.Ik({created:s.ai().nullish(),data:s.YO(s.Ik({b64_json:s.Yj(),revised_prompt:s.Yj().nullish()})),background:s.Yj().nullish(),output_format:s.Yj().nullish(),size:s.Yj().nullish(),quality:s.Yj().nullish(),usage:s.Ik({input_tokens:s.ai().nullish(),output_tokens:s.ai().nullish(),total_tokens:s.ai().nullish(),input_tokens_details:s.Ik({image_tokens:s.ai().nullish(),text_tokens:s.ai().nullish()}).nullish()}).nullish()})))),N={"dall-e-3":1,"dall-e-2":10,"gpt-image-1":10,"gpt-image-1-mini":10},O=new Set(["gpt-image-1","gpt-image-1-mini"]),k=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get maxImagesPerCall(){var e;return null!=(e=N[this.modelId])?e:1}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:n,aspectRatio:r,seed:s,providerOptions:i,headers:o,abortSignal:l}){var c,p,d,m,h,f,v;const g=[];null!=r&&g.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."}),null!=s&&g.push({type:"unsupported",feature:"seed"});const y=null!=(d=null==(p=null==(c=this.config._internal)?void 0:c.currentDate)?void 0:p.call(c))?d:new Date,{value:$,responseHeaders:b}=await(0,a.GU)({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),o),body:{model:this.modelId,prompt:e,n:t,size:n,...null!=(m=i.openai)?m:{},...O.has(this.modelId)?{}:{response_format:"b64_json"}},failedResponseHandler:u,successfulResponseHandler:(0,a.cV)(T),abortSignal:l,fetch:this.config.fetch});return{images:$.data.map((e=>e.b64_json)),warnings:g,usage:null!=$.usage?{inputTokens:null!=(h=$.usage.input_tokens)?h:void 0,outputTokens:null!=(f=$.usage.output_tokens)?f:void 0,totalTokens:null!=(v=$.usage.total_tokens)?v:void 0}:void 0,response:{timestamp:y,modelId:this.modelId,headers:b},providerMetadata:{openai:{images:$.data.map((e=>{var t,n,a,r,s;return{...e.revised_prompt?{revisedPrompt:e.revised_prompt}:{},created:null!=(t=$.created)?t:void 0,size:null!=(n=$.size)?n:void 0,quality:null!=(a=$.quality)?a:void 0,background:null!=(r=$.background)?r:void 0,outputFormat:null!=(s=$.output_format)?s:void 0}}))}}}}},R=(0,a.ID)((()=>(0,a.jN)(s.Ik({callId:s.Yj(),operation:s.gM("type",[s.Ik({type:s.eu("create_file"),path:s.Yj(),diff:s.Yj()}),s.Ik({type:s.eu("delete_file"),path:s.Yj()}),s.Ik({type:s.eu("update_file"),path:s.Yj(),diff:s.Yj()})])})))),C=(0,a.ID)((()=>(0,a.jN)(s.Ik({status:s.k5(["completed","failed"]),output:s.Yj().optional()})))),P=((0,a.ID)((()=>(0,a.jN)(s.Ik({})))),(0,a.wA)({id:"openai.apply_patch",inputSchema:R,outputSchema:C})),L=(0,a.ID)((()=>(0,a.jN)(s.Ik({code:s.Yj().nullish(),containerId:s.Yj()})))),j=(0,a.ID)((()=>(0,a.jN)(s.Ik({outputs:s.YO(s.gM("type",[s.Ik({type:s.eu("logs"),logs:s.Yj()}),s.Ik({type:s.eu("image"),url:s.Yj()})])).nullish()})))),M=(0,a.ID)((()=>(0,a.jN)(s.Ik({container:s.KC([s.Yj(),s.Ik({fileIds:s.YO(s.Yj()).optional()})]).optional()})))),D=(0,a.wA)({id:"openai.code_interpreter",inputSchema:L,outputSchema:j}),Y=s.Ik({key:s.Yj(),type:s.k5(["eq","ne","gt","gte","lt","lte","in","nin"]),value:s.KC([s.Yj(),s.ai(),s.zM(),s.YO(s.Yj())])}),F=s.Ik({type:s.k5(["and","or"]),filters:s.YO(s.KC([Y,s.RZ((()=>F))]))}),q=(0,a.ID)((()=>(0,a.jN)(s.Ik({vectorStoreIds:s.YO(s.Yj()),maxNumResults:s.ai().optional(),ranking:s.Ik({ranker:s.Yj().optional(),scoreThreshold:s.ai().optional()}).optional(),filters:s.KC([Y,F]).optional()})))),U=(0,a.ID)((()=>(0,a.jN)(s.Ik({queries:s.YO(s.Yj()),results:s.YO(s.Ik({attributes:s.g1(s.Yj(),s.L5()),fileId:s.Yj(),filename:s.Yj(),score:s.ai(),text:s.Yj()})).nullable()})))),V=(0,a.wA)({id:"openai.file_search",inputSchema:s.Ik({}),outputSchema:U}),z=(0,a.ID)((()=>(0,a.jN)(s.Ik({background:s.k5(["auto","opaque","transparent"]).optional(),inputFidelity:s.k5(["low","high"]).optional(),inputImageMask:s.Ik({fileId:s.Yj().optional(),imageUrl:s.Yj().optional()}).optional(),model:s.Yj().optional(),moderation:s.k5(["auto"]).optional(),outputCompression:s.ai().int().min(0).max(100).optional(),outputFormat:s.k5(["png","jpeg","webp"]).optional(),partialImages:s.ai().int().min(0).max(3).optional(),quality:s.k5(["auto","low","medium","high"]).optional(),size:s.k5(["1024x1024","1024x1536","1536x1024","auto"]).optional()}).strict()))),Z=(0,a.ID)((()=>(0,a.jN)(s.Ik({})))),B=(0,a.ID)((()=>(0,a.jN)(s.Ik({result:s.Yj()})))),G=(0,a.wA)({id:"openai.image_generation",inputSchema:Z,outputSchema:B}),W=(0,a.ID)((()=>(0,a.jN)(s.Ik({action:s.Ik({type:s.eu("exec"),command:s.YO(s.Yj()),timeoutMs:s.ai().optional(),user:s.Yj().optional(),workingDirectory:s.Yj().optional(),env:s.g1(s.Yj(),s.Yj()).optional()})})))),K=(0,a.ID)((()=>(0,a.jN)(s.Ik({output:s.Yj()})))),H=(0,a.wA)({id:"openai.local_shell",inputSchema:W,outputSchema:K}),J=(0,a.ID)((()=>(0,a.jN)(s.Ik({action:s.Ik({commands:s.YO(s.Yj()),timeoutMs:s.ai().optional(),maxOutputLength:s.ai().optional()})})))),X=(0,a.ID)((()=>(0,a.jN)(s.Ik({output:s.YO(s.Ik({stdout:s.Yj(),stderr:s.Yj(),outcome:s.gM("type",[s.Ik({type:s.eu("timeout")}),s.Ik({type:s.eu("exit"),exitCode:s.ai()})])}))})))),Q=(0,a.wA)({id:"openai.shell",inputSchema:J,outputSchema:X}),ee=(0,a.ID)((()=>(0,a.jN)(s.Ik({externalWebAccess:s.zM().optional(),filters:s.Ik({allowedDomains:s.YO(s.Yj()).optional()}).optional(),searchContextSize:s.k5(["low","medium","high"]).optional(),userLocation:s.Ik({type:s.eu("approximate"),country:s.Yj().optional(),city:s.Yj().optional(),region:s.Yj().optional(),timezone:s.Yj().optional()}).optional()})))),te=(0,a.ID)((()=>(0,a.jN)(s.Ik({})))),ne=(0,a.ID)((()=>(0,a.jN)(s.Ik({action:s.gM("type",[s.Ik({type:s.eu("search"),query:s.Yj().optional()}),s.Ik({type:s.eu("openPage"),url:s.Yj().nullish()}),s.Ik({type:s.eu("findInPage"),url:s.Yj().nullish(),pattern:s.Yj().nullish()})]),sources:s.YO(s.gM("type",[s.Ik({type:s.eu("url"),url:s.Yj()}),s.Ik({type:s.eu("api"),name:s.Yj()})])).optional()})))),ae=(0,a.wA)({id:"openai.web_search",inputSchema:te,outputSchema:ne}),re=(0,a.ID)((()=>(0,a.jN)(s.Ik({searchContextSize:s.k5(["low","medium","high"]).optional(),userLocation:s.Ik({type:s.eu("approximate"),country:s.Yj().optional(),city:s.Yj().optional(),region:s.Yj().optional(),timezone:s.Yj().optional()}).optional()})))),se=(0,a.ID)((()=>(0,a.jN)(s.Ik({})))),ie=(0,a.ID)((()=>(0,a.jN)(s.Ik({action:s.gM("type",[s.Ik({type:s.eu("search"),query:s.Yj().optional()}),s.Ik({type:s.eu("openPage"),url:s.Yj().nullish()}),s.Ik({type:s.eu("findInPage"),url:s.Yj().nullish(),pattern:s.Yj().nullish()})])})))),oe=(0,a.wA)({id:"openai.web_search_preview",inputSchema:se,outputSchema:ie}),le=s.RZ((()=>s.KC([s.Yj(),s.ai(),s.zM(),s.ch(),s.YO(le),s.g1(s.Yj(),le)]))),ue=(0,a.ID)((()=>(0,a.jN)(s.Ik({serverLabel:s.Yj(),allowedTools:s.KC([s.YO(s.Yj()),s.Ik({readOnly:s.zM().optional(),toolNames:s.YO(s.Yj()).optional()})]).optional(),authorization:s.Yj().optional(),connectorId:s.Yj().optional(),headers:s.g1(s.Yj(),s.Yj()).optional(),serverDescription:s.Yj().optional(),serverUrl:s.Yj().optional()}).refine((e=>null!=e.serverUrl||null!=e.connectorId),"One of serverUrl or connectorId must be provided.")))),ce=(0,a.ID)((()=>(0,a.jN)(s.Ik({})))),pe=(0,a.ID)((()=>(0,a.jN)(s.gM("type",[s.Ik({type:s.eu("call"),serverLabel:s.Yj(),name:s.Yj(),arguments:s.Yj(),output:s.Yj().nullable().optional(),error:s.KC([s.Yj(),le]).optional()}),s.Ik({type:s.eu("listTools"),serverLabel:s.Yj(),tools:s.YO(s.Ik({name:s.Yj(),description:s.Yj().optional(),inputSchema:le,annotations:s.g1(s.Yj(),le).optional()})),error:s.KC([s.Yj(),le]).optional()}),s.Ik({type:s.eu("approvalRequest"),serverLabel:s.Yj(),name:s.Yj(),arguments:s.Yj(),approvalRequestId:s.Yj()})])))),de=(0,a.wA)({id:"openai.mcp",inputSchema:ce,outputSchema:pe}),me={applyPatch:P,codeInterpreter:(e={})=>D(e),fileSearch:V,imageGeneration:(e={})=>G(e),localShell:H,shell:Q,webSearchPreview:oe,webSearch:(e={})=>ae(e),mcp:e=>de(e)};function he(e){var t,n,a,r;if(null==e)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};const s=e.input_tokens,i=e.output_tokens,o=null!=(n=null==(t=e.input_tokens_details)?void 0:t.cached_tokens)?n:0,l=null!=(r=null==(a=e.output_tokens_details)?void 0:a.reasoning_tokens)?r:0;return{inputTokens:{total:s,noCache:s-o,cacheRead:o,cacheWrite:void 0},outputTokens:{total:i,text:i-l,reasoning:l},raw:e}}function fe(e,t){return!!t&&t.some((t=>e.startsWith(t)))}var ve=s.Ik({itemId:s.Yj().nullish(),reasoningEncryptedContent:s.Yj().nullish()});function ge({finishReason:e,hasFunctionCall:t}){switch(e){case void 0:case null:return t?"tool-calls":"stop";case"max_output_tokens":return"length";case"content_filter":return"content-filter";default:return t?"tool-calls":"unknown"}}var ye=(0,a.ID)((()=>(0,a.jN)(s.KC([s.Ik({type:s.eu("response.output_text.delta"),item_id:s.Yj(),delta:s.Yj(),logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai(),top_logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai()}))})).nullish()}),s.Ik({type:s.k5(["response.completed","response.incomplete"]),response:s.Ik({incomplete_details:s.Ik({reason:s.Yj()}).nullish(),usage:s.Ik({input_tokens:s.ai(),input_tokens_details:s.Ik({cached_tokens:s.ai().nullish()}).nullish(),output_tokens:s.ai(),output_tokens_details:s.Ik({reasoning_tokens:s.ai().nullish()}).nullish()}),service_tier:s.Yj().nullish()})}),s.Ik({type:s.eu("response.created"),response:s.Ik({id:s.Yj(),created_at:s.ai(),model:s.Yj(),service_tier:s.Yj().nullish()})}),s.Ik({type:s.eu("response.output_item.added"),output_index:s.ai(),item:s.gM("type",[s.Ik({type:s.eu("message"),id:s.Yj()}),s.Ik({type:s.eu("reasoning"),id:s.Yj(),encrypted_content:s.Yj().nullish()}),s.Ik({type:s.eu("function_call"),id:s.Yj(),call_id:s.Yj(),name:s.Yj(),arguments:s.Yj()}),s.Ik({type:s.eu("web_search_call"),id:s.Yj(),status:s.Yj()}),s.Ik({type:s.eu("computer_call"),id:s.Yj(),status:s.Yj()}),s.Ik({type:s.eu("file_search_call"),id:s.Yj()}),s.Ik({type:s.eu("image_generation_call"),id:s.Yj()}),s.Ik({type:s.eu("code_interpreter_call"),id:s.Yj(),container_id:s.Yj(),code:s.Yj().nullable(),outputs:s.YO(s.gM("type",[s.Ik({type:s.eu("logs"),logs:s.Yj()}),s.Ik({type:s.eu("image"),url:s.Yj()})])).nullable(),status:s.Yj()}),s.Ik({type:s.eu("mcp_call"),id:s.Yj(),status:s.Yj()}),s.Ik({type:s.eu("mcp_list_tools"),id:s.Yj()}),s.Ik({type:s.eu("mcp_approval_request"),id:s.Yj()}),s.Ik({type:s.eu("apply_patch_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed"]),operation:s.gM("type",[s.Ik({type:s.eu("create_file"),path:s.Yj(),diff:s.Yj()}),s.Ik({type:s.eu("delete_file"),path:s.Yj()}),s.Ik({type:s.eu("update_file"),path:s.Yj(),diff:s.Yj()})])}),s.Ik({type:s.eu("shell_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed","incomplete"]),action:s.Ik({commands:s.YO(s.Yj())})})])}),s.Ik({type:s.eu("response.output_item.done"),output_index:s.ai(),item:s.gM("type",[s.Ik({type:s.eu("message"),id:s.Yj()}),s.Ik({type:s.eu("reasoning"),id:s.Yj(),encrypted_content:s.Yj().nullish()}),s.Ik({type:s.eu("function_call"),id:s.Yj(),call_id:s.Yj(),name:s.Yj(),arguments:s.Yj(),status:s.eu("completed")}),s.Ik({type:s.eu("code_interpreter_call"),id:s.Yj(),code:s.Yj().nullable(),container_id:s.Yj(),outputs:s.YO(s.gM("type",[s.Ik({type:s.eu("logs"),logs:s.Yj()}),s.Ik({type:s.eu("image"),url:s.Yj()})])).nullable()}),s.Ik({type:s.eu("image_generation_call"),id:s.Yj(),result:s.Yj()}),s.Ik({type:s.eu("web_search_call"),id:s.Yj(),status:s.Yj(),action:s.gM("type",[s.Ik({type:s.eu("search"),query:s.Yj().nullish(),sources:s.YO(s.gM("type",[s.Ik({type:s.eu("url"),url:s.Yj()}),s.Ik({type:s.eu("api"),name:s.Yj()})])).nullish()}),s.Ik({type:s.eu("open_page"),url:s.Yj().nullish()}),s.Ik({type:s.eu("find_in_page"),url:s.Yj().nullish(),pattern:s.Yj().nullish()})])}),s.Ik({type:s.eu("file_search_call"),id:s.Yj(),queries:s.YO(s.Yj()),results:s.YO(s.Ik({attributes:s.g1(s.Yj(),s.KC([s.Yj(),s.ai(),s.zM()])),file_id:s.Yj(),filename:s.Yj(),score:s.ai(),text:s.Yj()})).nullish()}),s.Ik({type:s.eu("local_shell_call"),id:s.Yj(),call_id:s.Yj(),action:s.Ik({type:s.eu("exec"),command:s.YO(s.Yj()),timeout_ms:s.ai().optional(),user:s.Yj().optional(),working_directory:s.Yj().optional(),env:s.g1(s.Yj(),s.Yj()).optional()})}),s.Ik({type:s.eu("computer_call"),id:s.Yj(),status:s.eu("completed")}),s.Ik({type:s.eu("mcp_call"),id:s.Yj(),status:s.Yj(),arguments:s.Yj(),name:s.Yj(),server_label:s.Yj(),output:s.Yj().nullish(),error:s.KC([s.Yj(),s.Ik({type:s.Yj().optional(),code:s.KC([s.ai(),s.Yj()]).optional(),message:s.Yj().optional()}).loose()]).nullish()}),s.Ik({type:s.eu("mcp_list_tools"),id:s.Yj(),server_label:s.Yj(),tools:s.YO(s.Ik({name:s.Yj(),description:s.Yj().optional(),input_schema:s.bz(),annotations:s.g1(s.Yj(),s.L5()).optional()})),error:s.KC([s.Yj(),s.Ik({type:s.Yj().optional(),code:s.KC([s.ai(),s.Yj()]).optional(),message:s.Yj().optional()}).loose()]).optional()}),s.Ik({type:s.eu("mcp_approval_request"),id:s.Yj(),server_label:s.Yj(),name:s.Yj(),arguments:s.Yj(),approval_request_id:s.Yj()}),s.Ik({type:s.eu("apply_patch_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed"]),operation:s.gM("type",[s.Ik({type:s.eu("create_file"),path:s.Yj(),diff:s.Yj()}),s.Ik({type:s.eu("delete_file"),path:s.Yj()}),s.Ik({type:s.eu("update_file"),path:s.Yj(),diff:s.Yj()})])}),s.Ik({type:s.eu("shell_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed","incomplete"]),action:s.Ik({commands:s.YO(s.Yj())})})])}),s.Ik({type:s.eu("response.function_call_arguments.delta"),item_id:s.Yj(),output_index:s.ai(),delta:s.Yj()}),s.Ik({type:s.eu("response.image_generation_call.partial_image"),item_id:s.Yj(),output_index:s.ai(),partial_image_b64:s.Yj()}),s.Ik({type:s.eu("response.code_interpreter_call_code.delta"),item_id:s.Yj(),output_index:s.ai(),delta:s.Yj()}),s.Ik({type:s.eu("response.code_interpreter_call_code.done"),item_id:s.Yj(),output_index:s.ai(),code:s.Yj()}),s.Ik({type:s.eu("response.output_text.annotation.added"),annotation:s.gM("type",[s.Ik({type:s.eu("url_citation"),start_index:s.ai(),end_index:s.ai(),url:s.Yj(),title:s.Yj()}),s.Ik({type:s.eu("file_citation"),file_id:s.Yj(),filename:s.Yj().nullish(),index:s.ai().nullish(),start_index:s.ai().nullish(),end_index:s.ai().nullish(),quote:s.Yj().nullish()}),s.Ik({type:s.eu("container_file_citation"),container_id:s.Yj(),file_id:s.Yj(),filename:s.Yj().nullish(),start_index:s.ai().nullish(),end_index:s.ai().nullish(),index:s.ai().nullish()}),s.Ik({type:s.eu("file_path"),file_id:s.Yj(),index:s.ai().nullish()})])}),s.Ik({type:s.eu("response.reasoning_summary_part.added"),item_id:s.Yj(),summary_index:s.ai()}),s.Ik({type:s.eu("response.reasoning_summary_text.delta"),item_id:s.Yj(),summary_index:s.ai(),delta:s.Yj()}),s.Ik({type:s.eu("response.reasoning_summary_part.done"),item_id:s.Yj(),summary_index:s.ai()}),s.Ik({type:s.eu("error"),sequence_number:s.ai(),error:s.Ik({type:s.Yj(),code:s.Yj(),message:s.Yj(),param:s.Yj().nullish()})}),s.Ik({type:s.Yj()}).loose().transform((e=>({type:"unknown_chunk",message:e.type})))])))),$e=(0,a.ID)((()=>(0,a.jN)(s.Ik({id:s.Yj().optional(),created_at:s.ai().optional(),error:s.Ik({message:s.Yj(),type:s.Yj(),param:s.Yj().nullish(),code:s.Yj()}).nullish(),model:s.Yj().optional(),output:s.YO(s.gM("type",[s.Ik({type:s.eu("message"),role:s.eu("assistant"),id:s.Yj(),content:s.YO(s.Ik({type:s.eu("output_text"),text:s.Yj(),logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai(),top_logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai()}))})).nullish(),annotations:s.YO(s.gM("type",[s.Ik({type:s.eu("url_citation"),start_index:s.ai(),end_index:s.ai(),url:s.Yj(),title:s.Yj()}),s.Ik({type:s.eu("file_citation"),file_id:s.Yj(),filename:s.Yj().nullish(),index:s.ai().nullish(),start_index:s.ai().nullish(),end_index:s.ai().nullish(),quote:s.Yj().nullish()}),s.Ik({type:s.eu("container_file_citation"),container_id:s.Yj(),file_id:s.Yj(),filename:s.Yj().nullish(),start_index:s.ai().nullish(),end_index:s.ai().nullish(),index:s.ai().nullish()}),s.Ik({type:s.eu("file_path"),file_id:s.Yj(),index:s.ai().nullish()})]))}))}),s.Ik({type:s.eu("web_search_call"),id:s.Yj(),status:s.Yj(),action:s.gM("type",[s.Ik({type:s.eu("search"),query:s.Yj().nullish(),sources:s.YO(s.gM("type",[s.Ik({type:s.eu("url"),url:s.Yj()}),s.Ik({type:s.eu("api"),name:s.Yj()})])).nullish()}),s.Ik({type:s.eu("open_page"),url:s.Yj().nullish()}),s.Ik({type:s.eu("find_in_page"),url:s.Yj().nullish(),pattern:s.Yj().nullish()})])}),s.Ik({type:s.eu("file_search_call"),id:s.Yj(),queries:s.YO(s.Yj()),results:s.YO(s.Ik({attributes:s.g1(s.Yj(),s.KC([s.Yj(),s.ai(),s.zM()])),file_id:s.Yj(),filename:s.Yj(),score:s.ai(),text:s.Yj()})).nullish()}),s.Ik({type:s.eu("code_interpreter_call"),id:s.Yj(),code:s.Yj().nullable(),container_id:s.Yj(),outputs:s.YO(s.gM("type",[s.Ik({type:s.eu("logs"),logs:s.Yj()}),s.Ik({type:s.eu("image"),url:s.Yj()})])).nullable()}),s.Ik({type:s.eu("image_generation_call"),id:s.Yj(),result:s.Yj()}),s.Ik({type:s.eu("local_shell_call"),id:s.Yj(),call_id:s.Yj(),action:s.Ik({type:s.eu("exec"),command:s.YO(s.Yj()),timeout_ms:s.ai().optional(),user:s.Yj().optional(),working_directory:s.Yj().optional(),env:s.g1(s.Yj(),s.Yj()).optional()})}),s.Ik({type:s.eu("function_call"),call_id:s.Yj(),name:s.Yj(),arguments:s.Yj(),id:s.Yj()}),s.Ik({type:s.eu("computer_call"),id:s.Yj(),status:s.Yj().optional()}),s.Ik({type:s.eu("reasoning"),id:s.Yj(),encrypted_content:s.Yj().nullish(),summary:s.YO(s.Ik({type:s.eu("summary_text"),text:s.Yj()}))}),s.Ik({type:s.eu("mcp_call"),id:s.Yj(),status:s.Yj(),arguments:s.Yj(),name:s.Yj(),server_label:s.Yj(),output:s.Yj().nullish(),error:s.KC([s.Yj(),s.Ik({type:s.Yj().optional(),code:s.KC([s.ai(),s.Yj()]).optional(),message:s.Yj().optional()}).loose()]).nullish()}),s.Ik({type:s.eu("mcp_list_tools"),id:s.Yj(),server_label:s.Yj(),tools:s.YO(s.Ik({name:s.Yj(),description:s.Yj().optional(),input_schema:s.bz(),annotations:s.g1(s.Yj(),s.L5()).optional()})),error:s.KC([s.Yj(),s.Ik({type:s.Yj().optional(),code:s.KC([s.ai(),s.Yj()]).optional(),message:s.Yj().optional()}).loose()]).optional()}),s.Ik({type:s.eu("mcp_approval_request"),id:s.Yj(),server_label:s.Yj(),name:s.Yj(),arguments:s.Yj(),approval_request_id:s.Yj()}),s.Ik({type:s.eu("apply_patch_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed"]),operation:s.gM("type",[s.Ik({type:s.eu("create_file"),path:s.Yj(),diff:s.Yj()}),s.Ik({type:s.eu("delete_file"),path:s.Yj()}),s.Ik({type:s.eu("update_file"),path:s.Yj(),diff:s.Yj()})])}),s.Ik({type:s.eu("shell_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed","incomplete"]),action:s.Ik({commands:s.YO(s.Yj())})})])).optional(),service_tier:s.Yj().nullish(),incomplete_details:s.Ik({reason:s.Yj()}).nullish(),usage:s.Ik({input_tokens:s.ai(),input_tokens_details:s.Ik({cached_tokens:s.ai().nullish()}).nullish(),output_tokens:s.ai(),output_tokens_details:s.Ik({reasoning_tokens:s.ai().nullish()}).nullish()}).optional()})))),be=(0,a.ID)((()=>(0,a.jN)(s.Ik({conversation:s.Yj().nullish(),include:s.YO(s.k5(["reasoning.encrypted_content","file_search_call.results","message.output_text.logprobs"])).nullish(),instructions:s.Yj().nullish(),logprobs:s.KC([s.zM(),s.ai().min(1).max(20)]).optional(),maxToolCalls:s.ai().nullish(),metadata:s.bz().nullish(),parallelToolCalls:s.zM().nullish(),previousResponseId:s.Yj().nullish(),promptCacheKey:s.Yj().nullish(),promptCacheRetention:s.k5(["in_memory","24h"]).nullish(),reasoningEffort:s.Yj().nullish(),reasoningSummary:s.Yj().nullish(),safetyIdentifier:s.Yj().nullish(),serviceTier:s.k5(["auto","flex","priority","default"]).nullish(),store:s.zM().nullish(),strictJsonSchema:s.zM().nullish(),textVerbosity:s.k5(["low","medium","high"]).nullish(),truncation:s.k5(["auto","disabled"]).nullish(),user:s.Yj().nullish()})))),_e=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]},this.modelId=e,this.config=t}get provider(){return this.config.provider}async getArgs({maxOutputTokens:e,temperature:t,stopSequences:n,topP:s,topK:i,presencePenalty:l,frequencyPenalty:u,seed:p,prompt:d,providerOptions:m,tools:h,toolChoice:f,responseFormat:v}){var g,y,$,b;const _=[],E=c(this.modelId);null!=i&&_.push({type:"unsupported",feature:"topK"}),null!=p&&_.push({type:"unsupported",feature:"seed"}),null!=l&&_.push({type:"unsupported",feature:"presencePenalty"}),null!=u&&_.push({type:"unsupported",feature:"frequencyPenalty"}),null!=n&&_.push({type:"unsupported",feature:"stopSequences"});const x=await(0,a.xI)({provider:"openai",providerOptions:m,schema:be});(null==x?void 0:x.conversation)&&(null==x?void 0:x.previousResponseId)&&_.push({type:"unsupported",feature:"conversation",details:"conversation and previousResponseId cannot be used together"});const S=(0,a.CR)({tools:h,providerToolNames:{"openai.code_interpreter":"code_interpreter","openai.file_search":"file_search","openai.image_generation":"image_generation","openai.local_shell":"local_shell","openai.shell":"shell","openai.web_search":"web_search","openai.web_search_preview":"web_search_preview","openai.mcp":"mcp","openai.apply_patch":"apply_patch"}}),{input:A,warnings:I}=await async function({prompt:e,toolNameMapping:t,systemMessageMode:n,fileIdPrefixes:s,store:i,hasLocalShellTool:l=!1,hasShellTool:u=!1,hasApplyPatchTool:c=!1}){var p,d,m,h,f;const v=[],g=[];for(const{role:y,content:$}of e)switch(y){case"system":switch(n){case"system":v.push({role:"system",content:$});break;case"developer":v.push({role:"developer",content:$});break;case"remove":g.push({type:"other",message:"system messages are removed for this model"});break;default:throw new Error(`Unsupported system message mode: ${n}`)}break;case"user":v.push({role:"user",content:$.map(((e,t)=>{var n,i,l;switch(e.type){case"text":return{type:"input_text",text:e.text};case"file":if(e.mediaType.startsWith("image/")){const t="image/*"===e.mediaType?"image/jpeg":e.mediaType;return{type:"input_image",...e.data instanceof o?{image_url:e.data.toString()}:"string"==typeof e.data&&fe(e.data,s)?{file_id:e.data}:{image_url:`data:${t};base64,${(0,a.ej)(e.data)}`},detail:null==(i=null==(n=e.providerOptions)?void 0:n.openai)?void 0:i.imageDetail}}if("application/pdf"===e.mediaType)return e.data instanceof o?{type:"input_file",file_url:e.data.toString()}:{type:"input_file",..."string"==typeof e.data&&fe(e.data,s)?{file_id:e.data}:{filename:null!=(l=e.filename)?l:`part-${t}.pdf`,file_data:`data:application/pdf;base64,${(0,a.ej)(e.data)}`}};throw new r.b8({functionality:`file part media type ${e.mediaType}`})}}))});break;case"assistant":{const e={};for(const n of $)switch(n.type){case"text":{const e=null==(d=null==(p=n.providerOptions)?void 0:p.openai)?void 0:d.itemId;if(i&&null!=e){v.push({type:"item_reference",id:e});break}v.push({role:"assistant",content:[{type:"output_text",text:n.text}],id:e});break}case"tool-call":{if(n.providerExecuted)break;const e=null==(h=null==(m=n.providerOptions)?void 0:m.openai)?void 0:h.itemId;if(i&&null!=e){v.push({type:"item_reference",id:e});break}const r=t.toProviderToolName(n.toolName);if(l&&"local_shell"===r){const t=await(0,a.k5)({value:n.input,schema:W});v.push({type:"local_shell_call",call_id:n.toolCallId,id:e,action:{type:"exec",command:t.action.command,timeout_ms:t.action.timeoutMs,user:t.action.user,working_directory:t.action.workingDirectory,env:t.action.env}});break}if(u&&"shell"===r){const t=await(0,a.k5)({value:n.input,schema:J});v.push({type:"shell_call",call_id:n.toolCallId,id:e,status:"completed",action:{commands:t.action.commands,timeout_ms:t.action.timeoutMs,max_output_length:t.action.maxOutputLength}});break}v.push({type:"function_call",call_id:n.toolCallId,name:r,arguments:JSON.stringify(n.input),id:e});break}case"tool-result":i?v.push({type:"item_reference",id:n.toolCallId}):g.push({type:"other",message:`Results for OpenAI tool ${n.toolName} are not sent to the API when store is false`});break;case"reasoning":{const t=await(0,a.xI)({provider:"openai",providerOptions:n.providerOptions,schema:ve}),r=null==t?void 0:t.itemId;if(null!=r){const a=e[r];if(i)void 0===a&&(v.push({type:"item_reference",id:r}),e[r]={type:"reasoning",id:r,summary:[]});else{const s=[];n.text.length>0?s.push({type:"summary_text",text:n.text}):void 0!==a&&g.push({type:"other",message:`Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(n)}.`}),void 0===a?(e[r]={type:"reasoning",id:r,encrypted_content:null==t?void 0:t.reasoningEncryptedContent,summary:s},v.push(e[r])):(a.summary.push(...s),null!=(null==t?void 0:t.reasoningEncryptedContent)&&(a.encrypted_content=t.reasoningEncryptedContent))}}else g.push({type:"other",message:`Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(n)}.`});break}}break}case"tool":for(const e of $){const n=e.output,r=t.toProviderToolName(e.toolName);if(l&&"local_shell"===r&&"json"===n.type){const t=await(0,a.k5)({value:n.value,schema:K});v.push({type:"local_shell_call_output",call_id:e.toolCallId,output:t.output});break}if(u&&"shell"===r&&"json"===n.type){const t=await(0,a.k5)({value:n.value,schema:X});v.push({type:"shell_call_output",call_id:e.toolCallId,output:t.output.map((e=>({stdout:e.stdout,stderr:e.stderr,outcome:"timeout"===e.outcome.type?{type:"timeout"}:{type:"exit",exit_code:e.outcome.exitCode}})))});break}if(c&&"apply_patch"===e.toolName&&"json"===n.type){const t=await(0,a.k5)({value:n.value,schema:C});v.push({type:"apply_patch_call_output",call_id:e.toolCallId,status:t.status,output:t.output});break}let s;switch(n.type){case"text":case"error-text":s=n.value;break;case"execution-denied":s=null!=(f=n.reason)?f:"Tool execution denied.";break;case"json":case"error-json":s=JSON.stringify(n.value);break;case"content":s=n.value.map((e=>{var t;switch(e.type){case"text":return{type:"input_text",text:e.text};case"image-data":return{type:"input_image",image_url:`data:${e.mediaType};base64,${e.data}`};case"file-data":return{type:"input_file",filename:null!=(t=e.filename)?t:"data",file_data:`data:${e.mediaType};base64,${e.data}`};default:return void g.push({type:"other",message:`unsupported tool content part type: ${e.type}`})}})).filter(a.R)}v.push({type:"function_call_output",call_id:e.toolCallId,output:s})}break;default:throw new Error(`Unsupported role: ${y}`)}return{input:v,warnings:g}}({prompt:d,toolNameMapping:S,systemMessageMode:E.systemMessageMode,fileIdPrefixes:this.config.fileIdPrefixes,store:null==(g=null==x?void 0:x.store)||g,hasLocalShellTool:O("openai.local_shell"),hasShellTool:O("openai.shell"),hasApplyPatchTool:O("openai.apply_patch")});_.push(...I);const w=null==(y=null==x?void 0:x.strictJsonSchema)||y;let T=null==x?void 0:x.include;function N(e){null==T?T=[e]:T.includes(e)||(T=[...T,e])}function O(e){return null!=(null==h?void 0:h.find((t=>"provider"===t.type&&t.id===e)))}const k="number"==typeof(null==x?void 0:x.logprobs)?null==x?void 0:x.logprobs:!0===(null==x?void 0:x.logprobs)?20:void 0;k&&N("message.output_text.logprobs");const R=null==($=null==h?void 0:h.find((e=>"provider"===e.type&&("openai.web_search"===e.id||"openai.web_search_preview"===e.id))))?void 0:$.name;R&&N("web_search_call.action.sources"),O("openai.code_interpreter")&&N("code_interpreter_call.outputs");const P=null==x?void 0:x.store;!1===P&&E.isReasoningModel&&N("reasoning.encrypted_content");const L={model:this.modelId,input:A,temperature:t,top_p:s,max_output_tokens:e,...("json"===(null==v?void 0:v.type)||(null==x?void 0:x.textVerbosity))&&{text:{..."json"===(null==v?void 0:v.type)&&{format:null!=v.schema?{type:"json_schema",strict:w,name:null!=(b=v.name)?b:"response",description:v.description,schema:v.schema}:{type:"json_object"}},...(null==x?void 0:x.textVerbosity)&&{verbosity:x.textVerbosity}}},conversation:null==x?void 0:x.conversation,max_tool_calls:null==x?void 0:x.maxToolCalls,metadata:null==x?void 0:x.metadata,parallel_tool_calls:null==x?void 0:x.parallelToolCalls,previous_response_id:null==x?void 0:x.previousResponseId,store:P,user:null==x?void 0:x.user,instructions:null==x?void 0:x.instructions,service_tier:null==x?void 0:x.serviceTier,include:T,prompt_cache_key:null==x?void 0:x.promptCacheKey,prompt_cache_retention:null==x?void 0:x.promptCacheRetention,safety_identifier:null==x?void 0:x.safetyIdentifier,top_logprobs:k,truncation:null==x?void 0:x.truncation,...E.isReasoningModel&&(null!=(null==x?void 0:x.reasoningEffort)||null!=(null==x?void 0:x.reasoningSummary))&&{reasoning:{...null!=(null==x?void 0:x.reasoningEffort)&&{effort:x.reasoningEffort},...null!=(null==x?void 0:x.reasoningSummary)&&{summary:x.reasoningSummary}}}};E.isReasoningModel?"none"===(null==x?void 0:x.reasoningEffort)&&E.supportsNonReasoningParameters||(null!=L.temperature&&(L.temperature=void 0,_.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),null!=L.top_p&&(L.top_p=void 0,_.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"}))):(null!=(null==x?void 0:x.reasoningEffort)&&_.push({type:"unsupported",feature:"reasoningEffort",details:"reasoningEffort is not supported for non-reasoning models"}),null!=(null==x?void 0:x.reasoningSummary)&&_.push({type:"unsupported",feature:"reasoningSummary",details:"reasoningSummary is not supported for non-reasoning models"})),"flex"!==(null==x?void 0:x.serviceTier)||E.supportsFlexProcessing||(_.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),delete L.service_tier),"priority"!==(null==x?void 0:x.serviceTier)||E.supportsPriorityProcessing||(_.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),delete L.service_tier);const{tools:j,toolChoice:D,toolWarnings:Y}=await async function({tools:e,toolChoice:t}){const n=[];if(null==(e=(null==e?void 0:e.length)?e:void 0))return{tools:void 0,toolChoice:void 0,toolWarnings:n};const s=[];for(const t of e)switch(t.type){case"function":s.push({type:"function",name:t.name,description:t.description,parameters:t.inputSchema,...null!=t.strict?{strict:t.strict}:{}});break;case"provider":switch(t.id){case"openai.file_search":{const e=await(0,a.k5)({value:t.args,schema:q});s.push({type:"file_search",vector_store_ids:e.vectorStoreIds,max_num_results:e.maxNumResults,ranking_options:e.ranking?{ranker:e.ranking.ranker,score_threshold:e.ranking.scoreThreshold}:void 0,filters:e.filters});break}case"openai.local_shell":s.push({type:"local_shell"});break;case"openai.shell":s.push({type:"shell"});break;case"openai.apply_patch":s.push({type:"apply_patch"});break;case"openai.web_search_preview":{const e=await(0,a.k5)({value:t.args,schema:re});s.push({type:"web_search_preview",search_context_size:e.searchContextSize,user_location:e.userLocation});break}case"openai.web_search":{const e=await(0,a.k5)({value:t.args,schema:ee});s.push({type:"web_search",filters:null!=e.filters?{allowed_domains:e.filters.allowedDomains}:void 0,external_web_access:e.externalWebAccess,search_context_size:e.searchContextSize,user_location:e.userLocation});break}case"openai.code_interpreter":{const e=await(0,a.k5)({value:t.args,schema:M});s.push({type:"code_interpreter",container:null==e.container?{type:"auto",file_ids:void 0}:"string"==typeof e.container?e.container:{type:"auto",file_ids:e.container.fileIds}});break}case"openai.image_generation":{const e=await(0,a.k5)({value:t.args,schema:z});s.push({type:"image_generation",background:e.background,input_fidelity:e.inputFidelity,input_image_mask:e.inputImageMask?{file_id:e.inputImageMask.fileId,image_url:e.inputImageMask.imageUrl}:void 0,model:e.model,moderation:e.moderation,partial_images:e.partialImages,quality:e.quality,output_compression:e.outputCompression,output_format:e.outputFormat,size:e.size});break}case"openai.mcp":{const e=await(0,a.k5)({value:t.args,schema:ue});s.push({type:"mcp",server_label:e.serverLabel,allowed_tools:Array.isArray(e.allowedTools)?e.allowedTools:e.allowedTools?{read_only:e.allowedTools.readOnly,tool_names:e.allowedTools.toolNames}:void 0,authorization:e.authorization,connector_id:e.connectorId,headers:e.headers,require_approval:"never",server_description:e.serverDescription,server_url:e.serverUrl});break}}break;default:n.push({type:"unsupported",feature:`function tool ${t}`})}if(null==t)return{tools:s,toolChoice:void 0,toolWarnings:n};const i=t.type;switch(i){case"auto":case"none":case"required":return{tools:s,toolChoice:i,toolWarnings:n};case"tool":return{tools:s,toolChoice:"code_interpreter"===t.toolName||"file_search"===t.toolName||"image_generation"===t.toolName||"web_search_preview"===t.toolName||"web_search"===t.toolName||"mcp"===t.toolName||"apply_patch"===t.toolName?{type:t.toolName}:{type:"function",name:t.toolName},toolWarnings:n};default:{const e=i;throw new r.b8({functionality:`tool choice type: ${e}`})}}}({tools:h,toolChoice:f});return{webSearchToolName:R,args:{...L,tools:j,tool_choice:D},warnings:[..._,...Y],store:P,toolNameMapping:S}}async doGenerate(e){var t,n,s,i,o,l,c,p,d,m,h,f,v,g,y,$,b,_,E,x,S,A,I,w;const{args:T,warnings:N,webSearchToolName:O,toolNameMapping:k}=await this.getArgs(e),R=this.config.url({path:"/responses",modelId:this.modelId}),C=this.config.provider.replace(".responses",""),{responseHeaders:P,value:L,rawValue:j}=await(0,a.GU)({url:R,headers:(0,a.m2)(this.config.headers(),e.headers),body:T,failedResponseHandler:u,successfulResponseHandler:(0,a.cV)($e),abortSignal:e.abortSignal,fetch:this.config.fetch});if(L.error)throw new r.hL({message:L.error.message,url:R,requestBodyValues:T,statusCode:400,responseHeaders:P,responseBody:j,isRetryable:!1});const M=[],D=[];let Y=!1;for(const r of L.output)switch(r.type){case"reasoning":0===r.summary.length&&r.summary.push({type:"summary_text",text:""});for(const e of r.summary)M.push({type:"reasoning",text:e.text,providerMetadata:{[C]:{itemId:r.id,reasoningEncryptedContent:null!=(t=r.encrypted_content)?t:null}}});break;case"image_generation_call":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("image_generation"),result:{result:r.result}});break;case"local_shell_call":M.push({type:"tool-call",toolCallId:r.call_id,toolName:k.toCustomToolName("local_shell"),input:JSON.stringify({action:r.action}),providerMetadata:{[C]:{itemId:r.id}}});break;case"shell_call":M.push({type:"tool-call",toolCallId:r.call_id,toolName:k.toCustomToolName("shell"),input:JSON.stringify({action:{commands:r.action.commands}}),providerMetadata:{[C]:{itemId:r.id}}});break;case"message":for(const t of r.content){(null==(s=null==(n=e.providerOptions)?void 0:n.openai)?void 0:s.logprobs)&&t.logprobs&&D.push(t.logprobs);const u={itemId:r.id,...t.annotations.length>0&&{annotations:t.annotations}};M.push({type:"text",text:t.text,providerMetadata:{[C]:u}});for(const e of t.annotations)"url_citation"===e.type?M.push({type:"source",sourceType:"url",id:null!=(l=null==(o=(i=this.config).generateId)?void 0:o.call(i))?l:(0,a.$C)(),url:e.url,title:e.title}):"file_citation"===e.type?M.push({type:"source",sourceType:"document",id:null!=(d=null==(p=(c=this.config).generateId)?void 0:p.call(c))?d:(0,a.$C)(),mediaType:"text/plain",title:null!=(h=null!=(m=e.quote)?m:e.filename)?h:"Document",filename:null!=(f=e.filename)?f:e.file_id,...e.file_id?{providerMetadata:{[C]:{fileId:e.file_id}}}:{}}):"container_file_citation"===e.type?M.push({type:"source",sourceType:"document",id:null!=(y=null==(g=(v=this.config).generateId)?void 0:g.call(v))?y:(0,a.$C)(),mediaType:"text/plain",title:null!=(b=null!=($=e.filename)?$:e.file_id)?b:"Document",filename:null!=(_=e.filename)?_:e.file_id,providerMetadata:{[C]:{fileId:e.file_id,containerId:e.container_id,...null!=e.index?{index:e.index}:{}}}}):"file_path"===e.type&&M.push({type:"source",sourceType:"document",id:null!=(S=null==(x=(E=this.config).generateId)?void 0:x.call(E))?S:(0,a.$C)(),mediaType:"application/octet-stream",title:e.file_id,filename:e.file_id,providerMetadata:{[C]:{fileId:e.file_id,...null!=e.index?{index:e.index}:{}}}})}break;case"function_call":Y=!0,M.push({type:"tool-call",toolCallId:r.call_id,toolName:r.name,input:r.arguments,providerMetadata:{[C]:{itemId:r.id}}});break;case"web_search_call":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName(null!=O?O:"web_search"),input:JSON.stringify({}),providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName(null!=O?O:"web_search"),result:xe(r.action)});break;case"mcp_call":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),input:JSON.stringify({}),providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),result:{type:"call",serverLabel:r.server_label,name:r.name,arguments:r.arguments,...null!=r.output?{output:r.output}:{},...null!=r.error?{error:r.error}:{}}});break;case"mcp_list_tools":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),input:JSON.stringify({}),providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),result:{type:"listTools",serverLabel:r.server_label,tools:r.tools.map((e=>{var t,n;return{name:e.name,description:null!=(t=e.description)?t:void 0,inputSchema:e.input_schema,annotations:null!=(n=e.annotations)?n:void 0}})),...null!=r.error?{error:r.error}:{}}});break;case"mcp_approval_request":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),input:JSON.stringify({}),providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),result:{type:"approvalRequest",serverLabel:r.server_label,name:r.name,arguments:r.arguments,approvalRequestId:r.approval_request_id}});break;case"computer_call":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:r.status||"completed"}});break;case"file_search_call":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("file_search"),input:"{}",providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("file_search"),result:{queries:r.queries,results:null!=(I=null==(A=r.results)?void 0:A.map((e=>({attributes:e.attributes,fileId:e.file_id,filename:e.filename,score:e.score,text:e.text}))))?I:null}});break;case"code_interpreter_call":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("code_interpreter"),input:JSON.stringify({code:r.code,containerId:r.container_id}),providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("code_interpreter"),result:{outputs:r.outputs}});break;case"apply_patch_call":M.push({type:"tool-call",toolCallId:r.call_id,toolName:k.toCustomToolName("apply_patch"),input:JSON.stringify({callId:r.call_id,operation:r.operation}),providerMetadata:{[C]:{itemId:r.id}}})}const F={[C]:{responseId:L.id}};D.length>0&&(F[C].logprobs=D),"string"==typeof L.service_tier&&(F[C].serviceTier=L.service_tier);const q=L.usage;return{content:M,finishReason:ge({finishReason:null==(w=L.incomplete_details)?void 0:w.reason,hasFunctionCall:Y}),usage:he(q),request:{body:T},response:{id:L.id,timestamp:new Date(1e3*L.created_at),modelId:L.model,headers:P,body:j},providerMetadata:F,warnings:N}}async doStream(e){const{args:t,warnings:n,webSearchToolName:r,toolNameMapping:s,store:i}=await this.getArgs(e),{responseHeaders:o,value:l}=await(0,a.GU)({url:this.config.url({path:"/responses",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:{...t,stream:!0},failedResponseHandler:u,successfulResponseHandler:(0,a.Ds)(ye),abortSignal:e.abortSignal,fetch:this.config.fetch}),c=this,p=this.config.provider.replace(".responses","");let d,m="unknown";const h=[];let f=null;const v={},g=[];let y=!1;const $={};let b;return{stream:l.pipeThrough(new TransformStream({start(e){e.enqueue({type:"stream-start",warnings:n})},transform(t,n){var o,l,u,_,E,x,S,A,I,w,T,N,O,k,R,C,P,L,j,M,D,Y,F,q,U,V,z;if(e.includeRawChunks&&n.enqueue({type:"raw",rawValue:t.rawValue}),!t.success)return m="error",void n.enqueue({type:"error",error:t.error});const Z=t.value;if(Ee(Z))"function_call"===Z.item.type?(v[Z.output_index]={toolName:Z.item.name,toolCallId:Z.item.call_id},n.enqueue({type:"tool-input-start",id:Z.item.call_id,toolName:Z.item.name})):"web_search_call"===Z.item.type?(v[Z.output_index]={toolName:s.toCustomToolName(null!=r?r:"web_search"),toolCallId:Z.item.id},n.enqueue({type:"tool-input-start",id:Z.item.id,toolName:s.toCustomToolName(null!=r?r:"web_search"),providerExecuted:!0}),n.enqueue({type:"tool-input-end",id:Z.item.id}),n.enqueue({type:"tool-call",toolCallId:Z.item.id,toolName:s.toCustomToolName(null!=r?r:"web_search"),input:JSON.stringify({}),providerExecuted:!0})):"computer_call"===Z.item.type?(v[Z.output_index]={toolName:s.toCustomToolName("computer_use"),toolCallId:Z.item.id},n.enqueue({type:"tool-input-start",id:Z.item.id,toolName:s.toCustomToolName("computer_use"),providerExecuted:!0})):"code_interpreter_call"===Z.item.type?(v[Z.output_index]={toolName:s.toCustomToolName("code_interpreter"),toolCallId:Z.item.id,codeInterpreter:{containerId:Z.item.container_id}},n.enqueue({type:"tool-input-start",id:Z.item.id,toolName:s.toCustomToolName("code_interpreter"),providerExecuted:!0}),n.enqueue({type:"tool-input-delta",id:Z.item.id,delta:`{"containerId":"${Z.item.container_id}","code":"`})):"file_search_call"===Z.item.type?n.enqueue({type:"tool-call",toolCallId:Z.item.id,toolName:s.toCustomToolName("file_search"),input:"{}",providerExecuted:!0}):"image_generation_call"===Z.item.type?n.enqueue({type:"tool-call",toolCallId:Z.item.id,toolName:s.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0}):"mcp_call"===Z.item.type||"mcp_list_tools"===Z.item.type||"mcp_approval_request"===Z.item.type?n.enqueue({type:"tool-call",toolCallId:Z.item.id,toolName:s.toCustomToolName("mcp"),input:"{}",providerExecuted:!0}):"apply_patch_call"===Z.item.type?(v[Z.output_index]={toolName:s.toCustomToolName("apply_patch"),toolCallId:Z.item.call_id},"completed"===Z.item.status&&n.enqueue({type:"tool-call",toolCallId:Z.item.call_id,toolName:s.toCustomToolName("apply_patch"),input:JSON.stringify({callId:Z.item.call_id,operation:Z.item.operation}),providerMetadata:{[p]:{itemId:Z.item.id}}})):"shell_call"===Z.item.type?v[Z.output_index]={toolName:s.toCustomToolName("shell"),toolCallId:Z.item.call_id}:"message"===Z.item.type?(g.splice(0,g.length),n.enqueue({type:"text-start",id:Z.item.id,providerMetadata:{[p]:{itemId:Z.item.id}}})):Ee(Z)&&"reasoning"===Z.item.type&&($[Z.item.id]={encryptedContent:Z.item.encrypted_content,summaryParts:{0:"active"}},n.enqueue({type:"reasoning-start",id:`${Z.item.id}:0`,providerMetadata:{[p]:{itemId:Z.item.id,reasoningEncryptedContent:null!=(o=Z.item.encrypted_content)?o:null}}}));else if(function(e){return"response.output_item.done"===e.type}(Z)){if("message"===Z.item.type)n.enqueue({type:"text-end",id:Z.item.id,providerMetadata:{[p]:{itemId:Z.item.id,...g.length>0&&{annotations:g}}}});else if("function_call"===Z.item.type)v[Z.output_index]=void 0,y=!0,n.enqueue({type:"tool-input-end",id:Z.item.call_id}),n.enqueue({type:"tool-call",toolCallId:Z.item.call_id,toolName:Z.item.name,input:Z.item.arguments,providerMetadata:{[p]:{itemId:Z.item.id}}});else if("web_search_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName(null!=r?r:"web_search"),result:xe(Z.item.action)});else if("computer_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-input-end",id:Z.item.id}),n.enqueue({type:"tool-call",toolCallId:Z.item.id,toolName:s.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:Z.item.status||"completed"}});else if("file_search_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("file_search"),result:{queries:Z.item.queries,results:null!=(u=null==(l=Z.item.results)?void 0:l.map((e=>({attributes:e.attributes,fileId:e.file_id,filename:e.filename,score:e.score,text:e.text}))))?u:null}});else if("code_interpreter_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("code_interpreter"),result:{outputs:Z.item.outputs}});else if("image_generation_call"===Z.item.type)n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("image_generation"),result:{result:Z.item.result}});else if("mcp_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("mcp"),result:{type:"call",serverLabel:Z.item.server_label,name:Z.item.name,arguments:Z.item.arguments,...null!=Z.item.output?{output:Z.item.output}:{},...null!=Z.item.error?{error:Z.item.error}:{}}});else if("mcp_list_tools"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("mcp"),result:{type:"listTools",serverLabel:Z.item.server_label,tools:Z.item.tools.map((e=>{var t,n;return{name:e.name,description:null!=(t=e.description)?t:void 0,inputSchema:e.input_schema,annotations:null!=(n=e.annotations)?n:void 0}})),...null!=Z.item.error?{error:Z.item.error}:{}}});else if("apply_patch_call"===Z.item.type)v[Z.output_index]=void 0,"completed"===Z.item.status&&n.enqueue({type:"tool-call",toolCallId:Z.item.call_id,toolName:s.toCustomToolName("apply_patch"),input:JSON.stringify({callId:Z.item.call_id,operation:Z.item.operation}),providerMetadata:{[p]:{itemId:Z.item.id}}});else if("mcp_approval_request"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("mcp"),result:{type:"approvalRequest",serverLabel:Z.item.server_label,name:Z.item.name,arguments:Z.item.arguments,approvalRequestId:Z.item.approval_request_id}});else if("local_shell_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-call",toolCallId:Z.item.call_id,toolName:s.toCustomToolName("local_shell"),input:JSON.stringify({action:{type:"exec",command:Z.item.action.command,timeoutMs:Z.item.action.timeout_ms,user:Z.item.action.user,workingDirectory:Z.item.action.working_directory,env:Z.item.action.env}}),providerMetadata:{[p]:{itemId:Z.item.id}}});else if("shell_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-call",toolCallId:Z.item.call_id,toolName:s.toCustomToolName("shell"),input:JSON.stringify({action:{commands:Z.item.action.commands}}),providerMetadata:{[p]:{itemId:Z.item.id}}});else if("reasoning"===Z.item.type){const e=$[Z.item.id],t=Object.entries(e.summaryParts).filter((([e,t])=>"active"===t||"can-conclude"===t)).map((([e])=>e));for(const e of t)n.enqueue({type:"reasoning-end",id:`${Z.item.id}:${e}`,providerMetadata:{[p]:{itemId:Z.item.id,reasoningEncryptedContent:null!=(_=Z.item.encrypted_content)?_:null}}});delete $[Z.item.id]}}else if(function(e){return"response.function_call_arguments.delta"===e.type}(Z)){const e=v[Z.output_index];null!=e&&n.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:Z.delta})}else if(function(e){return"response.image_generation_call.partial_image"===e.type}(Z))n.enqueue({type:"tool-result",toolCallId:Z.item_id,toolName:s.toCustomToolName("image_generation"),result:{result:Z.partial_image_b64},preliminary:!0});else if(function(e){return"response.code_interpreter_call_code.delta"===e.type}(Z)){const e=v[Z.output_index];null!=e&&n.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:JSON.stringify(Z.delta).slice(1,-1)})}else if(function(e){return"response.code_interpreter_call_code.done"===e.type}(Z)){const e=v[Z.output_index];null!=e&&(n.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:'"}'}),n.enqueue({type:"tool-input-end",id:e.toolCallId}),n.enqueue({type:"tool-call",toolCallId:e.toolCallId,toolName:s.toCustomToolName("code_interpreter"),input:JSON.stringify({code:Z.code,containerId:e.codeInterpreter.containerId}),providerExecuted:!0}))}else if(function(e){return"response.created"===e.type}(Z))f=Z.response.id,n.enqueue({type:"response-metadata",id:Z.response.id,timestamp:new Date(1e3*Z.response.created_at),modelId:Z.response.model});else if(function(e){return"response.output_text.delta"===e.type}(Z))n.enqueue({type:"text-delta",id:Z.item_id,delta:Z.delta}),(null==(x=null==(E=e.providerOptions)?void 0:E.openai)?void 0:x.logprobs)&&Z.logprobs&&h.push(Z.logprobs);else if("response.reasoning_summary_part.added"===Z.type){if(Z.summary_index>0){const e=$[Z.item_id];e.summaryParts[Z.summary_index]="active";for(const t of Object.keys(e.summaryParts))"can-conclude"===e.summaryParts[t]&&(n.enqueue({type:"reasoning-end",id:`${Z.item_id}:${t}`,providerMetadata:{[p]:{itemId:Z.item_id}}}),e.summaryParts[t]="concluded");n.enqueue({type:"reasoning-start",id:`${Z.item_id}:${Z.summary_index}`,providerMetadata:{[p]:{itemId:Z.item_id,reasoningEncryptedContent:null!=(A=null==(S=$[Z.item_id])?void 0:S.encryptedContent)?A:null}}})}}else"response.reasoning_summary_text.delta"===Z.type?n.enqueue({type:"reasoning-delta",id:`${Z.item_id}:${Z.summary_index}`,delta:Z.delta,providerMetadata:{[p]:{itemId:Z.item_id}}}):"response.reasoning_summary_part.done"===Z.type?i?(n.enqueue({type:"reasoning-end",id:`${Z.item_id}:${Z.summary_index}`,providerMetadata:{[p]:{itemId:Z.item_id}}}),$[Z.item_id].summaryParts[Z.summary_index]="concluded"):$[Z.item_id].summaryParts[Z.summary_index]="can-conclude":function(e){return"response.completed"===e.type||"response.incomplete"===e.type}(Z)?(m=ge({finishReason:null==(I=Z.response.incomplete_details)?void 0:I.reason,hasFunctionCall:y}),d=Z.response.usage,"string"==typeof Z.response.service_tier&&(b=Z.response.service_tier)):function(e){return"response.output_text.annotation.added"===e.type}(Z)?(g.push(Z.annotation),"url_citation"===Z.annotation.type?n.enqueue({type:"source",sourceType:"url",id:null!=(N=null==(T=(w=c.config).generateId)?void 0:T.call(w))?N:(0,a.$C)(),url:Z.annotation.url,title:Z.annotation.title}):"file_citation"===Z.annotation.type?n.enqueue({type:"source",sourceType:"document",id:null!=(R=null==(k=(O=c.config).generateId)?void 0:k.call(O))?R:(0,a.$C)(),mediaType:"text/plain",title:null!=(P=null!=(C=Z.annotation.quote)?C:Z.annotation.filename)?P:"Document",filename:null!=(L=Z.annotation.filename)?L:Z.annotation.file_id,...Z.annotation.file_id?{providerMetadata:{[p]:{fileId:Z.annotation.file_id}}}:{}}):"container_file_citation"===Z.annotation.type?n.enqueue({type:"source",sourceType:"document",id:null!=(D=null==(M=(j=c.config).generateId)?void 0:M.call(j))?D:(0,a.$C)(),mediaType:"text/plain",title:null!=(F=null!=(Y=Z.annotation.filename)?Y:Z.annotation.file_id)?F:"Document",filename:null!=(q=Z.annotation.filename)?q:Z.annotation.file_id,providerMetadata:{[p]:{fileId:Z.annotation.file_id,containerId:Z.annotation.container_id,...null!=Z.annotation.index?{index:Z.annotation.index}:{}}}}):"file_path"===Z.annotation.type&&n.enqueue({type:"source",sourceType:"document",id:null!=(z=null==(V=(U=c.config).generateId)?void 0:V.call(U))?z:(0,a.$C)(),mediaType:"application/octet-stream",title:Z.annotation.file_id,filename:Z.annotation.file_id,providerMetadata:{[p]:{fileId:Z.annotation.file_id,...null!=Z.annotation.index?{index:Z.annotation.index}:{}}}})):function(e){return"error"===e.type}(Z)&&n.enqueue({type:"error",error:Z})},flush(e){const t={[p]:{responseId:f}};h.length>0&&(t[p].logprobs=h),void 0!==b&&(t[p].serviceTier=b),e.enqueue({type:"finish",finishReason:m,usage:he(d),providerMetadata:t})}})),request:{body:t},response:{headers:o}}}};function Ee(e){return"response.output_item.added"===e.type}function xe(e){var t;switch(e.type){case"search":return{action:{type:"search",query:null!=(t=e.query)?t:void 0},...null!=e.sources&&{sources:e.sources}};case"open_page":return{action:{type:"openPage",url:e.url}};case"find_in_page":return{action:{type:"findInPage",url:e.url,pattern:e.pattern}}}}var Se=(0,a.ID)((()=>(0,a.jN)(s.Ik({instructions:s.Yj().nullish(),speed:s.ai().min(.25).max(4).default(1).nullish()})))),Ae=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({text:e,voice:t="alloy",outputFormat:n="mp3",speed:r,instructions:s,language:i,providerOptions:o}){const l=[],u=await(0,a.xI)({provider:"openai",providerOptions:o,schema:Se}),c={model:this.modelId,input:e,voice:t,response_format:"mp3",speed:r,instructions:s};if(n&&(["mp3","opus","aac","flac","wav","pcm"].includes(n)?c.response_format=n:l.push({type:"unsupported",feature:"outputFormat",details:`Unsupported output format: ${n}. Using mp3 instead.`})),u){const e={};for(const t in e){const n=e[t];void 0!==n&&(c[t]=n)}}return i&&l.push({type:"unsupported",feature:"language",details:`OpenAI speech models do not support language selection. Language parameter "${i}" was ignored.`}),{requestBody:c,warnings:l}}async doGenerate(e){var t,n,r;const s=null!=(r=null==(n=null==(t=this.config._internal)?void 0:t.currentDate)?void 0:n.call(t))?r:new Date,{requestBody:i,warnings:o}=await this.getArgs(e),{value:l,responseHeaders:c,rawValue:p}=await(0,a.GU)({url:this.config.url({path:"/audio/speech",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:i,failedResponseHandler:u,successfulResponseHandler:(0,a.HD)(),abortSignal:e.abortSignal,fetch:this.config.fetch});return{audio:l,warnings:o,request:{body:JSON.stringify(i)},response:{timestamp:s,modelId:this.modelId,headers:c,body:p}}}},Ie=(0,a.ID)((()=>(0,a.jN)(s.Ik({text:s.Yj(),language:s.Yj().nullish(),duration:s.ai().nullish(),words:s.YO(s.Ik({word:s.Yj(),start:s.ai(),end:s.ai()})).nullish(),segments:s.YO(s.Ik({id:s.ai(),seek:s.ai(),start:s.ai(),end:s.ai(),text:s.Yj(),tokens:s.YO(s.ai()),temperature:s.ai(),avg_logprob:s.ai(),compression_ratio:s.ai(),no_speech_prob:s.ai()})).nullish()})))),we=(0,a.ID)((()=>(0,a.jN)(s.Ik({include:s.YO(s.Yj()).optional(),language:s.Yj().optional(),prompt:s.Yj().optional(),temperature:s.ai().min(0).max(1).default(0).optional(),timestampGranularities:s.YO(s.k5(["word","segment"])).default(["segment"]).optional()})))),Te={afrikaans:"af",arabic:"ar",armenian:"hy",azerbaijani:"az",belarusian:"be",bosnian:"bs",bulgarian:"bg",catalan:"ca",chinese:"zh",croatian:"hr",czech:"cs",danish:"da",dutch:"nl",english:"en",estonian:"et",finnish:"fi",french:"fr",galician:"gl",german:"de",greek:"el",hebrew:"he",hindi:"hi",hungarian:"hu",icelandic:"is",indonesian:"id",italian:"it",japanese:"ja",kannada:"kn",kazakh:"kk",korean:"ko",latvian:"lv",lithuanian:"lt",macedonian:"mk",malay:"ms",marathi:"mr",maori:"mi",nepali:"ne",norwegian:"no",persian:"fa",polish:"pl",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"sr",slovak:"sk",slovenian:"sl",spanish:"es",swahili:"sw",swedish:"sv",tagalog:"tl",tamil:"ta",thai:"th",turkish:"tr",ukrainian:"uk",urdu:"ur",vietnamese:"vi",welsh:"cy"},Ne=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({audio:e,mediaType:t,providerOptions:n}){const r=await(0,a.xI)({provider:"openai",providerOptions:n,schema:we}),s=new FormData,i=e instanceof Uint8Array?new Blob([e]):new Blob([(0,a.Z9)(e)]);s.append("model",this.modelId);const o=(0,a.HQ)(t);if(s.append("file",new File([i],"audio",{type:t}),`audio.${o}`),r){const e={include:r.include,language:r.language,prompt:r.prompt,response_format:["gpt-4o-transcribe","gpt-4o-mini-transcribe"].includes(this.modelId)?"json":"verbose_json",temperature:r.temperature,timestamp_granularities:r.timestampGranularities};for(const[t,n]of Object.entries(e))if(null!=n)if(Array.isArray(n))for(const e of n)s.append(`${t}[]`,String(e));else s.append(t,String(n))}return{formData:s,warnings:[]}}async doGenerate(e){var t,n,r,s,i,o,l,c;const p=null!=(r=null==(n=null==(t=this.config._internal)?void 0:t.currentDate)?void 0:n.call(t))?r:new Date,{formData:d,warnings:m}=await this.getArgs(e),{value:h,responseHeaders:f,rawValue:v}=await(0,a.S)({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),formData:d,failedResponseHandler:u,successfulResponseHandler:(0,a.cV)(Ie),abortSignal:e.abortSignal,fetch:this.config.fetch}),g=null!=h.language&&h.language in Te?Te[h.language]:void 0;return{text:h.text,segments:null!=(l=null!=(o=null==(s=h.segments)?void 0:s.map((e=>({text:e.text,startSecond:e.start,endSecond:e.end}))))?o:null==(i=h.words)?void 0:i.map((e=>({text:e.word,startSecond:e.start,endSecond:e.end}))))?l:[],language:g,durationInSeconds:null!=(c=h.duration)?c:void 0,warnings:m,response:{timestamp:p,modelId:this.modelId,headers:f,body:v}}}},Oe="3.0.0-beta.96";function ke(e={}){var t,n;const r=null!=(t=(0,a.ae)((0,a.x3)({settingValue:e.baseURL,environmentVariableName:"OPENAI_BASE_URL"})))?t:"https://api.openai.com/v1",s=null!=(n=e.name)?n:"openai",i=()=>(0,a.WZ)({Authorization:`Bearer ${(0,a.WL)({apiKey:e.apiKey,environmentVariableName:"OPENAI_API_KEY",description:"OpenAI"})}`,"OpenAI-Organization":e.organization,"OpenAI-Project":e.project,...e.headers},`ai-sdk/openai/${Oe}`),o=t=>new w(t,{provider:`${s}.embedding`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),l=t=>new k(t,{provider:`${s}.image`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),u=t=>new Ne(t,{provider:`${s}.transcription`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),c=t=>new Ae(t,{provider:`${s}.speech`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),p=e=>{if(new.target)throw new Error("The OpenAI model function cannot be called with the new keyword.");return d(e)},d=t=>new _e(t,{provider:`${s}.responses`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch,fileIdPrefixes:["file-"]}),m=function(e){return p(e)};return m.specificationVersion="v3",m.languageModel=p,m.chat=t=>new g(t,{provider:`${s}.chat`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),m.completion=t=>new S(t,{provider:`${s}.completion`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),m.responses=d,m.embedding=o,m.embeddingModel=o,m.image=l,m.imageModel=l,m.transcription=u,m.transcriptionModel=u,m.speech=c,m.speechModel=c,m.tools=me,m}ke()},65684:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:s}=n(47755),i=n(71598),o=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],p=t.t={};let d=0;const m="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[m,r]],f=(e,t,n)=>{const a=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=d++;i(e,r,t),p[e]=r,u[r]=t,c[r]=a,o[r]=new RegExp(t,n?"g":void 0),l[r]=new RegExp(a,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),f("MAINVERSION",`(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${u[p.PRERELEASEIDENTIFIER]}(?:\\.${u[p.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${u[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[p.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${m}+`),f("BUILD",`(?:\\+(${u[p.BUILDIDENTIFIER]}(?:\\.${u[p.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${u[p.MAINVERSION]}${u[p.PRERELEASE]}?${u[p.BUILD]}?`),f("FULL",`^${u[p.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${u[p.MAINVERSIONLOOSE]}${u[p.PRERELEASELOOSE]}?${u[p.BUILD]}?`),f("LOOSE",`^${u[p.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${u[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${u[p.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:${u[p.PRERELEASE]})?${u[p.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:${u[p.PRERELEASELOOSE]})?${u[p.BUILD]}?)?)?`),f("XRANGE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),f("COERCE",`${u[p.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",u[p.COERCEPLAIN]+`(?:${u[p.PRERELEASE]})?`+`(?:${u[p.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",u[p.COERCE],!0),f("COERCERTLFULL",u[p.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${u[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${u[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${u[p.LONECARET]}${u[p.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${u[p.LONECARET]}${u[p.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${u[p.GTLT]}\\s*(${u[p.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]}|${u[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${u[p.XRANGEPLAIN]})\\s+-\\s+(${u[p.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${u[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[p.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},65789:(e,t,n)=>{const a=n(98855);e.exports=(e,t)=>{const n=a(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},65816:(e,t,n)=>{const a=n(41694),r=n(83586),{safeRe:s,t:i}=n(18104);e.exports=(e,t)=>{if(e instanceof a)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const a=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let r;for(;(r=a.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===n)return null;const o=n[2],l=n[3]||"0",u=n[4]||"0",c=t.includePrerelease&&n[5]?`-${n[5]}`:"",p=t.includePrerelease&&n[6]?`+${n[6]}`:"";return r(`${o}.${l}.${u}${c}${p}`,t)}},66078:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},66135:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>a(e,t,n)>=0},66239:(e,t,n)=>{const a=n(77203);e.exports=(e,t,n)=>a(e,t,n)<=0},66272:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CONVERSION_OPERATORS=void 0,t.CONVERSION_OPERATORS=[{name:"$convert",value:"$convert",score:1,meta:"conv",version:"3.7.2"},{name:"$ltrim",value:"$ltrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$rtrim",value:"$rtrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$toBool",value:"$toBool",score:1,meta:"conv",version:"3.7.2"},{name:"$toDate",value:"$toDate",score:1,meta:"conv",version:"3.7.2"},{name:"$toDecimal",value:"$toDecimal",score:1,meta:"conv",version:"3.7.2"},{name:"$toDouble",value:"$toDouble",score:1,meta:"conv",version:"3.7.2"},{name:"$toInt",value:"$toInt",score:1,meta:"conv",version:"3.7.2"},{name:"$toLong",value:"$toLong",score:1,meta:"conv",version:"3.7.2"},{name:"$toObjectId",value:"$toObjectId",score:1,meta:"conv",version:"3.7.2"},{name:"$toString",value:"$toString",score:1,meta:"conv",version:"3.7.2"},{name:"$trim",value:"$trim",score:1,meta:"accumulator",version:"3.7.2"}]},66283:(e,t,n)=>{const a=n(67767),{MAX_LENGTH:r,MAX_SAFE_INTEGER:s}=n(77693),{safeRe:i,t:o}=n(415),l=n(69348),{compareIdentifiers:u}=n(78900);class c{constructor(e,t){if(t=l(t),e instanceof c){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[o.LOOSE]:i[o.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(a("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof c||(e=new c(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(a("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(a("build compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===n&&(a=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},66529:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPE_ALIASES=void 0,t.BSON_TYPE_ALIASES=[{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"string",value:"string",label:"string",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"object",value:"object",label:"object",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"array",value:"array",label:"array",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"binData",value:"binData",label:"binData",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"objectId",value:"objectId",label:"objectId",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"bool",value:"bool",label:"bool",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"date",value:"date",label:"date",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"null",value:"null",label:"null",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"regex",value:"regex",label:"regex",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascript",value:"javascript",label:"javascript",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascriptWithScope",value:"javascriptWithScope",label:"javascriptWithScope",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"int",value:"int",label:"int",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"timestamp",value:"timestamp",label:"timestamp",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"long",value:"long",label:"long",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"decimal",value:"decimal",label:"decimal",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"minKey",value:"minKey",label:"minKey",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"maxKey",value:"maxKey",label:"maxKey",score:1,meta:"bson-type-aliases",version:"3.6.0"}]},67094:(e,t,n)=>{const a=Symbol("SemVer ANY");class r{static get ANY(){return a}constructor(e,t){if(t=s(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===a?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new c(n[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=s(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=r;const s=n(31145),{safeRe:i,t:o}=n(65684),l=n(98249),u=n(71598),c=n(50066),p=n(72857)},67105:(e,t,n)=>{const a=Symbol("SemVer ANY");class r{static get ANY(){return a}constructor(e,t){if(t=s(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===a?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new c(n[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=s(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=r;const s=n(40594),{safeRe:i,t:o}=n(36165),l=n(5544),u=n(95869),c=n(88825),p=n(20360)},67171:(e,t,n)=>{const a=n(57544);e.exports=(e,t,n,r,s)=>{"string"==typeof n&&(s=r,r=n,n=void 0);try{return new a(e instanceof a?e.version:e,n).inc(t,r,s).version}catch(e){return null}}},67223:(e,t,n)=>{const a=n(50066);e.exports=(e,t)=>new a(e,t).patch},67274:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const a=t.test(e),r=t.test(n);return a&&r&&(e=+e,n=+n),e===n?0:a&&!r?-1:r&&!a?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},67338:(e,t,n)=>{const a=n(95323);e.exports=(e,t,n)=>{try{t=new a(t,n)}catch(e){return!1}return t.test(e)}},67360:(e,t,n)=>{const a=n(85216);e.exports=(e,t)=>e.sort(((e,n)=>a(e,n,t)))},67531:(e,t,n)=>{const a=n(70692);e.exports=(e,t,n)=>0!==a(e,t,n)},67767:(e,t,n)=>{var a=n(65994).e;const r="object"==typeof a&&a.env&&a.env.NODE_DEBUG&&/\bsemver\b/i.test(a.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},67812:(e,t,n)=>{const a=n(50066),r=n(38358),{safeRe:s,t:i}=n(65684);e.exports=(e,t)=>{if(e instanceof a)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const a=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let r;for(;(r=a.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===n)return null;const o=n[2],l=n[3]||"0",u=n[4]||"0",c=t.includePrerelease&&n[5]?`-${n[5]}`:"",p=t.includePrerelease&&n[6]?`+${n[6]}`:"";return r(`${o}.${l}.${u}${c}${p}`,t)}},67994:(e,t,n)=>{const a=n(60501);e.exports=(e,t)=>a(e,t,!0)},68303:(e,t,n)=>{const a=n(70692);e.exports=(e,t)=>a(e,t,!0)},68716:(e,t,n)=>{const a=n(77203);e.exports=(e,t)=>a(e,t,!0)},68752:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:s}=n(28892),i=n(52378),o=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],p=t.t={};let d=0;const m="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[m,r]],f=(e,t,n)=>{const a=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=d++;i(e,r,t),p[e]=r,u[r]=t,c[r]=a,o[r]=new RegExp(t,n?"g":void 0),l[r]=new RegExp(a,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),f("MAINVERSION",`(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${u[p.PRERELEASEIDENTIFIER]}(?:\\.${u[p.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${u[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[p.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${m}+`),f("BUILD",`(?:\\+(${u[p.BUILDIDENTIFIER]}(?:\\.${u[p.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${u[p.MAINVERSION]}${u[p.PRERELEASE]}?${u[p.BUILD]}?`),f("FULL",`^${u[p.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${u[p.MAINVERSIONLOOSE]}${u[p.PRERELEASELOOSE]}?${u[p.BUILD]}?`),f("LOOSE",`^${u[p.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${u[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${u[p.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:${u[p.PRERELEASE]})?${u[p.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:${u[p.PRERELEASELOOSE]})?${u[p.BUILD]}?)?)?`),f("XRANGE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),f("COERCE",`${u[p.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",u[p.COERCEPLAIN]+`(?:${u[p.PRERELEASE]})?`+`(?:${u[p.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",u[p.COERCE],!0),f("COERCERTLFULL",u[p.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${u[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${u[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${u[p.LONECARET]}${u[p.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${u[p.LONECARET]}${u[p.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${u[p.GTLT]}\\s*(${u[p.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]}|${u[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${u[p.XRANGEPLAIN]})\\s+-\\s+(${u[p.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${u[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[p.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},68821:(e,t,n)=>{const a=n(9331);e.exports=(e,t)=>e.sort(((e,n)=>a(e,n,t)))},69316:(e,t,n)=>{var a=n(99174),r=n(4414),s=n(11710),i=n(18184),o=n(57116),l=Object.prototype.hasOwnProperty,u=1,c=2,p=3,d=4,m=1,h=2,f=3,v=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,g=/[\x85\u2028\u2029]/,y=/[,\[\]\{\}]/,$=/^(?:!|!!|![a-z\-]+!)$/i,b=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _(e){return Object.prototype.toString.call(e)}function E(e){return 10===e||13===e}function x(e){return 9===e||32===e}function S(e){return 9===e||32===e||10===e||13===e}function A(e){return 44===e||91===e||93===e||123===e||125===e}function I(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function w(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function T(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var N=new Array(256),O=new Array(256),k=0;k<256;k++)N[k]=w(k)?1:0,O[k]=w(k);function R(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||o,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function C(e,t){return new r(t,new s(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function P(e,t){throw C(e,t)}function L(e,t){e.onWarning&&e.onWarning.call(null,C(e,t))}var j={YAML:function(e,t,n){var a,r,s;null!==e.version&&P(e,"duplication of %YAML directive"),1!==n.length&&P(e,"YAML directive accepts exactly one argument"),null===(a=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&P(e,"ill-formed argument of the YAML directive"),r=parseInt(a[1],10),s=parseInt(a[2],10),1!==r&&P(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&L(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var a,r;2!==n.length&&P(e,"TAG directive accepts exactly two arguments"),a=n[0],r=n[1],$.test(a)||P(e,"ill-formed tag handle (first argument) of the TAG directive"),l.call(e.tagMap,a)&&P(e,'there is a previously declared suffix for "'+a+'" tag handle'),b.test(r)||P(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[a]=r}};function M(e,t,n,a){var r,s,i,o;if(t<n){if(o=e.input.slice(t,n),a)for(r=0,s=o.length;r<s;r+=1)9===(i=o.charCodeAt(r))||32<=i&&i<=1114111||P(e,"expected valid JSON character");else v.test(o)&&P(e,"the stream contains non-printable characters");e.result+=o}}function D(e,t,n,r){var s,i,o,u;for(a.isObject(n)||P(e,"cannot merge mappings; the provided source object is unacceptable"),o=0,u=(s=Object.keys(n)).length;o<u;o+=1)i=s[o],l.call(t,i)||(t[i]=n[i],r[i]=!0)}function Y(e,t,n,a,r,s,i,o){var u,c;if(Array.isArray(r))for(u=0,c=(r=Array.prototype.slice.call(r)).length;u<c;u+=1)Array.isArray(r[u])&&P(e,"nested arrays are not supported inside keys"),"object"==typeof r&&"[object Object]"===_(r[u])&&(r[u]="[object Object]");if("object"==typeof r&&"[object Object]"===_(r)&&(r="[object Object]"),r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===a)if(Array.isArray(s))for(u=0,c=s.length;u<c;u+=1)D(e,t,s[u],n);else D(e,t,s,n);else e.json||l.call(n,r)||!l.call(t,r)||(e.line=i||e.line,e.position=o||e.position,P(e,"duplicated mapping key")),t[r]=s,delete n[r];return t}function F(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):P(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function q(e,t,n){for(var a=0,r=e.input.charCodeAt(e.position);0!==r;){for(;x(r);)r=e.input.charCodeAt(++e.position);if(t&&35===r)do{r=e.input.charCodeAt(++e.position)}while(10!==r&&13!==r&&0!==r);if(!E(r))break;for(F(e),r=e.input.charCodeAt(e.position),a++,e.lineIndent=0;32===r;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return-1!==n&&0!==a&&e.lineIndent<n&&L(e,"deficient indentation"),a}function U(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!S(t)))}function V(e,t){1===t?e.result+=" ":t>1&&(e.result+=a.repeat("\n",t-1))}function z(e,t){var n,a,r=e.tag,s=e.anchor,i=[],o=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),a=e.input.charCodeAt(e.position);0!==a&&45===a&&S(e.input.charCodeAt(e.position+1));)if(o=!0,e.position++,q(e,!0,-1)&&e.lineIndent<=t)i.push(null),a=e.input.charCodeAt(e.position);else if(n=e.line,G(e,t,p,!1,!0),i.push(e.result),q(e,!0,-1),a=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==a)P(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!o&&(e.tag=r,e.anchor=s,e.kind="sequence",e.result=i,!0)}function Z(e){var t,n,a,r,s=!1,i=!1;if(33!==(r=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&P(e,"duplication of a tag property"),60===(r=e.input.charCodeAt(++e.position))?(s=!0,r=e.input.charCodeAt(++e.position)):33===r?(i=!0,n="!!",r=e.input.charCodeAt(++e.position)):n="!",t=e.position,s){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&62!==r);e.position<e.length?(a=e.input.slice(t,e.position),r=e.input.charCodeAt(++e.position)):P(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==r&&!S(r);)33===r&&(i?P(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),$.test(n)||P(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),r=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),y.test(a)&&P(e,"tag suffix cannot contain flow indicator characters")}return a&&!b.test(a)&&P(e,"tag name cannot contain such characters: "+a),s?e.tag=a:l.call(e.tagMap,n)?e.tag=e.tagMap[n]+a:"!"===n?e.tag="!"+a:"!!"===n?e.tag="tag:yaml.org,2002:"+a:P(e,'undeclared tag handle "'+n+'"'),!0}function B(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&P(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!S(n)&&!A(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&P(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function G(e,t,n,r,s){var i,o,v,g,y,$,b,_,w=1,k=!1,R=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=o=v=d===n||p===n,r&&q(e,!0,-1)&&(k=!0,e.lineIndent>t?w=1:e.lineIndent===t?w=0:e.lineIndent<t&&(w=-1)),1===w)for(;Z(e)||B(e);)q(e,!0,-1)?(k=!0,v=i,e.lineIndent>t?w=1:e.lineIndent===t?w=0:e.lineIndent<t&&(w=-1)):v=!1;if(v&&(v=k||s),1!==w&&d!==n||(b=u===n||c===n?t:t+1,_=e.position-e.lineStart,1===w?v&&(z(e,_)||function(e,t,n){var a,r,s,i,o,l=e.tag,u=e.anchor,p={},m={},h=null,f=null,v=null,g=!1,y=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=p),o=e.input.charCodeAt(e.position);0!==o;){if(a=e.input.charCodeAt(e.position+1),s=e.line,i=e.position,63!==o&&58!==o||!S(a)){if(!G(e,n,c,!1,!0))break;if(e.line===s){for(o=e.input.charCodeAt(e.position);x(o);)o=e.input.charCodeAt(++e.position);if(58===o)S(o=e.input.charCodeAt(++e.position))||P(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(Y(e,p,m,h,f,null),h=f=v=null),y=!0,g=!1,r=!1,h=e.tag,f=e.result;else{if(!y)return e.tag=l,e.anchor=u,!0;P(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!y)return e.tag=l,e.anchor=u,!0;P(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===o?(g&&(Y(e,p,m,h,f,null),h=f=v=null),y=!0,g=!0,r=!0):g?(g=!1,r=!0):P(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,o=a;if((e.line===s||e.lineIndent>t)&&(G(e,t,d,!0,r)&&(g?f=e.result:v=e.result),g||(Y(e,p,m,h,f,v,s,i),h=f=v=null),q(e,!0,-1),o=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==o)P(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return g&&Y(e,p,m,h,f,null),y&&(e.tag=l,e.anchor=u,e.kind="mapping",e.result=p),y}(e,_,b))||function(e,t){var n,a,r,s,i,o,l,c,p,d,m=!0,h=e.tag,f=e.anchor,v={};if(91===(d=e.input.charCodeAt(e.position)))r=93,o=!1,a=[];else{if(123!==d)return!1;r=125,o=!0,a={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),d=e.input.charCodeAt(++e.position);0!==d;){if(q(e,!0,t),(d=e.input.charCodeAt(e.position))===r)return e.position++,e.tag=h,e.anchor=f,e.kind=o?"mapping":"sequence",e.result=a,!0;m||P(e,"missed comma between flow collection entries"),p=null,s=i=!1,63===d&&S(e.input.charCodeAt(e.position+1))&&(s=i=!0,e.position++,q(e,!0,t)),n=e.line,G(e,t,u,!1,!0),c=e.tag,l=e.result,q(e,!0,t),d=e.input.charCodeAt(e.position),!i&&e.line!==n||58!==d||(s=!0,d=e.input.charCodeAt(++e.position),q(e,!0,t),G(e,t,u,!1,!0),p=e.result),o?Y(e,a,v,c,l,p):s?a.push(Y(e,null,v,c,l,p)):a.push(l),q(e,!0,t),44===(d=e.input.charCodeAt(e.position))?(m=!0,d=e.input.charCodeAt(++e.position)):m=!1}P(e,"unexpected end of the stream within a flow collection")}(e,b)?R=!0:(o&&function(e,t){var n,r,s,i,o,l=m,u=!1,c=!1,p=t,d=0,v=!1;if(124===(i=e.input.charCodeAt(e.position)))r=!1;else{if(62!==i)return!1;r=!0}for(e.kind="scalar",e.result="";0!==i;)if(43===(i=e.input.charCodeAt(++e.position))||45===i)m===l?l=43===i?f:h:P(e,"repeat of a chomping mode identifier");else{if(!((s=48<=(o=i)&&o<=57?o-48:-1)>=0))break;0===s?P(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?P(e,"repeat of an indentation width identifier"):(p=t+s-1,c=!0)}if(x(i)){do{i=e.input.charCodeAt(++e.position)}while(x(i));if(35===i)do{i=e.input.charCodeAt(++e.position)}while(!E(i)&&0!==i)}for(;0!==i;){for(F(e),e.lineIndent=0,i=e.input.charCodeAt(e.position);(!c||e.lineIndent<p)&&32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>p&&(p=e.lineIndent),E(i))d++;else{if(e.lineIndent<p){l===f?e.result+=a.repeat("\n",u?1+d:d):l===m&&u&&(e.result+="\n");break}for(r?x(i)?(v=!0,e.result+=a.repeat("\n",u?1+d:d)):v?(v=!1,e.result+=a.repeat("\n",d+1)):0===d?u&&(e.result+=" "):e.result+=a.repeat("\n",d):e.result+=a.repeat("\n",u?1+d:d),u=!0,c=!0,d=0,n=e.position;!E(i)&&0!==i;)i=e.input.charCodeAt(++e.position);M(e,n,e.position,!1)}}return!0}(e,b)||function(e,t){var n,a,r;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,a=r=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(M(e,a,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;a=e.position,e.position++,r=e.position}else E(n)?(M(e,a,r,!0),V(e,q(e,!1,t)),a=r=e.position):e.position===e.lineStart&&U(e)?P(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);P(e,"unexpected end of the stream within a single quoted scalar")}(e,b)||function(e,t){var n,a,r,s,i,o,l;if(34!==(o=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=a=e.position;0!==(o=e.input.charCodeAt(e.position));){if(34===o)return M(e,n,e.position,!0),e.position++,!0;if(92===o){if(M(e,n,e.position,!0),E(o=e.input.charCodeAt(++e.position)))q(e,!1,t);else if(o<256&&N[o])e.result+=O[o],e.position++;else if((i=120===(l=o)?2:117===l?4:85===l?8:0)>0){for(r=i,s=0;r>0;r--)(i=I(o=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+i:P(e,"expected hexadecimal character");e.result+=T(s),e.position++}else P(e,"unknown escape sequence");n=a=e.position}else E(o)?(M(e,n,a,!0),V(e,q(e,!1,t)),n=a=e.position):e.position===e.lineStart&&U(e)?P(e,"unexpected end of the document within a double quoted scalar"):(e.position++,a=e.position)}P(e,"unexpected end of the stream within a double quoted scalar")}(e,b)?R=!0:function(e){var t,n,a;if(42!==(a=e.input.charCodeAt(e.position)))return!1;for(a=e.input.charCodeAt(++e.position),t=e.position;0!==a&&!S(a)&&!A(a);)a=e.input.charCodeAt(++e.position);return e.position===t&&P(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),l.call(e.anchorMap,n)||P(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],q(e,!0,-1),!0}(e)?(R=!0,null===e.tag&&null===e.anchor||P(e,"alias node should not have any properties")):function(e,t,n){var a,r,s,i,o,l,u,c,p=e.kind,d=e.result;if(S(c=e.input.charCodeAt(e.position))||A(c)||35===c||38===c||42===c||33===c||124===c||62===c||39===c||34===c||37===c||64===c||96===c)return!1;if((63===c||45===c)&&(S(a=e.input.charCodeAt(e.position+1))||n&&A(a)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,i=!1;0!==c;){if(58===c){if(S(a=e.input.charCodeAt(e.position+1))||n&&A(a))break}else if(35===c){if(S(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&U(e)||n&&A(c))break;if(E(c)){if(o=e.line,l=e.lineStart,u=e.lineIndent,q(e,!1,-1),e.lineIndent>=t){i=!0,c=e.input.charCodeAt(e.position);continue}e.position=s,e.line=o,e.lineStart=l,e.lineIndent=u;break}}i&&(M(e,r,s,!1),V(e,e.line-o),r=s=e.position,i=!1),x(c)||(s=e.position+1),c=e.input.charCodeAt(++e.position)}return M(e,r,s,!1),!!e.result||(e.kind=p,e.result=d,!1)}(e,b,u===n)&&(R=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===w&&(R=v&&z(e,_))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&P(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),g=0,y=e.implicitTypes.length;g<y;g+=1)if(($=e.implicitTypes[g]).resolve(e.result)){e.result=$.construct(e.result),e.tag=$.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else l.call(e.typeMap[e.kind||"fallback"],e.tag)?($=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&$.kind!==e.kind&&P(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+$.kind+'", not "'+e.kind+'"'),$.resolve(e.result)?(e.result=$.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):P(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):P(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||R}function W(e){var t,n,a,r,s=e.position,i=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(r=e.input.charCodeAt(e.position))&&(q(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(i=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!S(r);)r=e.input.charCodeAt(++e.position);for(a=[],(n=e.input.slice(t,e.position)).length<1&&P(e,"directive name must not be less than one character in length");0!==r;){for(;x(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!E(r));break}if(E(r))break;for(t=e.position;0!==r&&!S(r);)r=e.input.charCodeAt(++e.position);a.push(e.input.slice(t,e.position))}0!==r&&F(e),l.call(j,n)?j[n](e,n,a):L(e,'unknown document directive "'+n+'"')}q(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,q(e,!0,-1)):i&&P(e,"directives end mark is expected"),G(e,e.lineIndent-1,d,!1,!0),q(e,!0,-1),e.checkLineBreaks&&g.test(e.input.slice(s,e.position))&&L(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&U(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,q(e,!0,-1)):e.position<e.length-1&&P(e,"end of the stream or a document separator is expected")}function K(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new R(e,t),a=e.indexOf("\0");for(-1!==a&&(n.position=a,P(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)W(n);return n.documents}function H(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var a=K(e,n);if("function"!=typeof t)return a;for(var r=0,s=a.length;r<s;r+=1)t(a[r])}function J(e,t){var n=K(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new r("expected a single document in the stream, but found more")}}e.exports.loadAll=H,e.exports.load=J,e.exports.safeLoadAll=function(e,t,n){return"object"==typeof t&&null!==t&&void 0===n&&(n=t,t=null),H(e,t,a.extend({schema:i},n))},e.exports.safeLoad=function(e,t){return J(e,a.extend({schema:i},t))}},69334:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_CONSTANTS=void 0,t.createConstantFilter=f,t.wrapField=function(e,t=!1){return t||!function(e){if(/[.\s"'()[\];={}:]/.test(e))return!1;try{return new Function(`"use strict";let _ = { ${e}: 0 };`),!0}catch{return!1}}(e)?`"${e.replace(/["\\]/g,"\\$&")}"`:e},t.getFilteredCompletions=function(e={},n=t.ALL_CONSTANTS){const{serverVersion:a=m,fields:r=[],meta:s,stage:i}=e,o=f({serverVersion:a,meta:s,stage:i});return n.concat(r.flatMap((e=>{const{value:t,description:n}=function(e){return"string"==typeof e?{value:e}:{value:e.name,description:e.description}}(e);return[{value:t,meta:"field:identifier",version:"0.0.0",description:n},{value:`$${t}`,meta:"field:reference",version:"0.0.0",description:n}]}))).filter((e=>o(e)))};const a=n(41738),r=n(17807),s=n(5698),i=n(50678),o=n(66272),l=n(20474),u=n(79188),c=n(10094),p=n(86812),d=n(30629);t.ALL_CONSTANTS=[...r.ACCUMULATORS,...i.BSON_TYPES,...s.BSON_TYPE_ALIASES,...o.CONVERSION_OPERATORS,...l.EXPRESSION_OPERATORS,...u.JSON_SCHEMA,...c.QUERY_OPERATORS,...p.STAGE_OPERATORS,...d.SYSTEM_VARIABLES];const m="999.999.999";function h(e,t){return void 0===e||void 0===t||(e=Array.isArray(e)?e:[e]).some((e=>t.includes(e)))}function f({meta:e,serverVersion:t=m,stage:n={}}={}){const r=/^(?<version>\d+\.\d+\.\d+)/.exec(t)?.groups?.version??m;return({version:t,meta:s,env:i,namespaces:o,apiVersions:l})=>function(e,t){const n=/^\d+\.\d+\.\d+$/.test(t);return(0,a.satisfies)(e,n?`>=${t}`:t)}(r,t)&&h(n.env,i)&&h(n.namespace,o)&&h(n.apiVersion,l)&&(!e||function(e,t){const n=t.split(":");return e.some((e=>{const t=e.split(":");return t.length===n.length&&t.every(((e,t)=>"*"===e||e===n[t]))}))}(e,s))}},69348:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},69750:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ATLAS_VECTOR_SEARCH_TEMPLATE=t.ATLAS_SEARCH_TEMPLATES=void 0,t.ATLAS_SEARCH_TEMPLATES=[{name:"Dynamic field mappings",snippet:'{\n "mappings": {\n "dynamic": true\n }\n}',version:"4.4.0"},{name:"Static field mappings",snippet:'{\n "mappings": {\n "dynamic": false,\n "fields": {\n ${1:<string field name>}: {\n "type": "string"\n },\n ${2:<number field name>}: {\n "type": "number"\n },\n ${3:<date field name>}: {\n "type": "date"\n },\n ${4:<geo field name>}: {\n "type": "geo"\n },\n } \n }\n}',version:"4.4.0"},{name:"Text field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<string field name>}: [\n {\n // Enables text queries\n "type": "string"\n },\n {\n // Enables autocomplete queries\n "type": "autocomplete"\n \n },\n {\n // Enables sorting\n "type": "token"\n }\n ] \n } \n }\n}',version:"4.4.0"},{name:"Facet field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<number field name for faceting>}: [\n {\n "type": "numberFacet"\n },\n {\n "type": "number"\n },\n ],\n ${2:<date field name for faceting>}: [\n {\n "type": "dateFacet"\n }\n {\n "type": "date"\n }\n ],\n ${3:<string field name for faceting>}: [\n {\n "type": "stringFacet"\n },\n {\n "type": "string",\n "analyzer": "lucene.keyword"\n },\n ],\n } \n }\n}',version:"4.4.0"},{name:"KNN Vector field mapping",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<vector embedding field name>}: [\n {\n "type": "knnVector",\n "dimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n } \n ] \n } \n }\n}',version:"4.4.0"}],t.ATLAS_VECTOR_SEARCH_TEMPLATE={name:"Vector Search default template",snippet:'{\n "fields": [{\n "type": "vector",\n "path": "${1:<field name to index>}",\n "numDimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n }]\n}',version:"4.4.0"}},69904:(e,t,n)=>{const a=n(57681);e.exports=(e,t,n)=>a(e,t,"<",n)},70449:(e,t,n)=>{const a=n(72857);e.exports=(e,t)=>new a(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},70509:(e,t,n)=>{const a=n(70692);e.exports=(e,t,n)=>a(e,t,n)>=0},70545:(e,t,n)=>{var a=n(65994).e;e.exports=async function(e,t,n,s){n instanceof Function&&(s=n,n={});const c=async function(e,t,n={}){let s,c;"string"==typeof n&&(n={encoding:n});const p=i(m((()=>c))),f=o.resolve(e);try{await function(e){return new Promise((t=>{u[e]||(u[e]=[]),u[e].push(t),1===u[e].length&&t()}))}(f);const i=await l(r.realpath)(e).catch((()=>e));if(c=d(i),!n.mode||!n.chown){const e=await l(r.stat)(i).catch((()=>{}));e&&(null==n.mode&&(n.mode=e.mode),null==n.chown&&a.getuid&&(n.chown={uid:e.uid,gid:e.gid}))}s=await l(r.open)(c,"w",n.mode),n.tmpfileCreated&&await n.tmpfileCreated(c),ArrayBuffer.isView(t)?await l(r.write)(s,t,0,t.length,0):null!=t&&await l(r.write)(s,String(t),0,String(n.encoding||"utf8")),!1!==n.fsync&&await l(r.fsync)(s),await l(r.close)(s),s=null,n.chown&&await l(r.chown)(c,n.chown.uid,n.chown.gid).catch((e=>{if(!h(e))throw e})),n.mode&&await l(r.chmod)(c,n.mode).catch((e=>{if(!h(e))throw e})),await l(r.rename)(c,i)}finally{s&&await l(r.close)(s).catch((()=>{})),p(),await l(r.unlink)(c).catch((()=>{})),u[f].shift(),u[f].length>0?u[f][0]():delete u[f]}}(e,t,n);if(s)try{return s(await c)}catch(e){return s(e)}return c},e.exports.sync=function(e,t,n){"string"==typeof n?n={encoding:n}:n||(n={});try{e=r.realpathSync(e)}catch(e){}const s=d(e);if(!n.mode||!n.chown)try{const t=r.statSync(e);(n=Object.assign({},n)).mode||(n.mode=t.mode),!n.chown&&a.getuid&&(n.chown={uid:t.uid,gid:t.gid})}catch(e){}let o;const l=m(s),u=i(l);let c=!0;try{if(o=r.openSync(s,"w",n.mode||438),n.tmpfileCreated&&n.tmpfileCreated(s),ArrayBuffer.isView(t)?r.writeSync(o,t,0,t.length,0):null!=t&&r.writeSync(o,String(t),0,String(n.encoding||"utf8")),!1!==n.fsync&&r.fsyncSync(o),r.closeSync(o),o=null,n.chown)try{r.chownSync(s,n.chown.uid,n.chown.gid)}catch(e){if(!h(e))throw e}if(n.mode)try{r.chmodSync(s,n.mode)}catch(e){if(!h(e))throw e}r.renameSync(s,e),c=!1}finally{if(o)try{r.closeSync(o)}catch(e){}u(),c&&l()}},e.exports._getTmpname=d,e.exports._cleanupOnExit=m;const r=n(36374),s=n(88906),{onExit:i}=n(41163),o=n(17642),{promisify:l}=n(98437),u={},c=function(){try{return n(86983).threadId}catch(e){return 0}}();let p=0;function d(e){return e+"."+s("/index.js").hash(String(a.pid)).hash(String(c)).hash(String(++p)).result()}function m(e){return()=>{try{r.unlinkSync("function"==typeof e?e():e)}catch{}}}function h(e){return"ENOSYS"===e.code||!(a.getuid&&0===a.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code)}},70692:(e,t,n)=>{const a=n(57544);e.exports=(e,t,n)=>new a(e,n).compare(new a(t,n))},71080:(e,t,n)=>{const a=n(95323);e.exports=(e,t,n)=>(e=new a(e,n),t=new a(t,n),e.intersects(t,n))},71174:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_VARIABLES=void 0,t.SYSTEM_VARIABLES=[{name:"$$NOW",value:"$$NOW",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current datetime value. NOW returns the same value for all members of the deployment and remains the same throughout all stages of the aggregation pipeline."},{name:"$$CLUSTER_TIME",value:"$$CLUSTER_TIME",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current timestamp value. CLUSTER_TIME is only available on replica sets and sharded clusters. CLUSTER_TIME returns the same value for all members of the deployment and remains the same throughout all stages of the pipeline."},{name:"$$ROOT",value:"$$ROOT",score:1,meta:"variable:system",version:"2.4.0",description:"References the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage."},{name:"$$CURRENT",value:"$$CURRENT",score:1,meta:"variable:system",version:"2.4.0",description:"References the start of the field path being processed in the aggregation pipeline stage. Unless documented otherwise, all stages start with CURRENT the same as ROOT. CURRENT is modifiable. However, since `$<field>` is equivalent to `$$CURRENT.<field>`, rebinding CURRENT changes the meaning of `$` accesses."},{name:"$$REMOVE",value:"$$REMOVE",score:1,meta:"variable:system",version:"3.6.0",description:"A variable which evaluates to the missing value. Allows for the conditional exclusion of fields. In a `$project`, a field set to the variable REMOVE is excluded from the output."},{name:"$$DESCEND",value:"$$DESCEND",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$PRUNE",value:"$$PRUNE",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$KEEP",value:"$$KEEP",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$SEARCH_META",value:"$$SEARCH_META",score:1,meta:"variable:system",version:"5.0.0",description:"A variable that stores the metadata results of an Atlas Search query. In all supported aggregation pipeline stages, a field set to the variable SEARCH_META returns the metadata results for the query. For an example of its usage, see Atlas Search facet and count."},{name:"$$USER_ROLES",value:"$$USER_ROLES",score:1,meta:"variable:system",version:"7.0.0",description:"A variable that stores the role names of the authenticated user running the command."}]},71295:(e,t,n)=>{n.d(t,{DG:()=>v,E6:()=>_,J:()=>b,J_:()=>u,Jk:()=>c,KH:()=>p,Kk:()=>m,NI:()=>g,QP:()=>i,RM:()=>h,Tt:()=>$,Yk:()=>d,kH:()=>y,ql:()=>f,sm:()=>l,v$:()=>E});var a=n(49189),r=n(7263),s=n(72510);const i=a.xI("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),o={number:"number",bigint:"bigint",object:"date"},l=a.xI("$ZodCheckLessThan",((e,t)=>{i.init(e,t);const n=o[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,a=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),u=a.xI("$ZodCheckGreaterThan",((e,t)=>{i.init(e,t);const n=o[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,a=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),c=a.xI("$ZodCheckMultipleOf",((e,t)=>{i.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===s.LG(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),p=a.xI("$ZodCheckNumberFormat",((e,t)=>{i.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[o,l]=s.zH[t.format];e._zod.onattach.push((e=>{const a=e._zod.bag;a.format=t.format,a.minimum=o,a.maximum=l,n&&(a.pattern=r.nd)})),e._zod.check=r=>{const s=r.value;if(n){if(!Number.isInteger(s))return void r.issues.push({expected:a,format:t.format,code:"invalid_type",input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?r.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,continue:!t.abort}):r.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,continue:!t.abort}))}s<o&&r.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>l&&r.issues.push({origin:"number",input:s,code:"too_big",maximum:l,inst:e})}})),d=a.xI("$ZodCheckMaxLength",((e,t)=>{var n;i.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!s.cl(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const a=n.value;if(a.length<=t.maximum)return;const r=s.Rc(a);n.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}})),m=a.xI("$ZodCheckMinLength",((e,t)=>{var n;i.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!s.cl(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const a=n.value;if(a.length>=t.minimum)return;const r=s.Rc(a);n.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}})),h=a.xI("$ZodCheckLengthEquals",((e,t)=>{var n;i.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!s.cl(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const a=n.value,r=a.length;if(r===t.length)return;const i=s.Rc(a),o=r>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),f=a.xI("$ZodCheckStringFormat",((e,t)=>{var n,a;i.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})})),v=a.xI("$ZodCheckRegex",((e,t)=>{f.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),g=a.xI("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=r.AC),f.init(e,t)})),y=a.xI("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=r.Zv),f.init(e,t)})),$=a.xI("$ZodCheckIncludes",((e,t)=>{i.init(e,t);const n=s.$f(t.includes),a=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(a)})),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}})),b=a.xI("$ZodCheckStartsWith",((e,t)=>{i.init(e,t);const n=new RegExp(`^${s.$f(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),_=a.xI("$ZodCheckEndsWith",((e,t)=>{i.init(e,t);const n=new RegExp(`.*${s.$f(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),E=a.xI("$ZodCheckOverwrite",((e,t)=>{i.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}))},71333:(e,t,n)=>{const a=/\s+/g;class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(a," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&v))+":"+e,n=s.get(t);if(n)return n;const a=this.options.loose,r=a?c[p.HYPHENRANGELOOSE]:c[p.HYPHENRANGE];e=e.replace(r,O(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(c[p.COMPARATORTRIM],d),l("comparator trim",e),e=e.replace(c[p.TILDETRIM],m),l("tilde trim",e),e=e.replace(c[p.CARETTRIM],h),l("caret trim",e);let i=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>N(e,this.options)));a&&(i=i.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(c[p.COMPARATORLOOSE]))))),l("range list",i);const u=new Map,y=i.map((e=>new o(e,this.options)));for(const e of y){if(g(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");const $=[...u.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>$(n,t)&&e.set.some((e=>$(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const s=new(n(21212)),i=n(8573),o=n(96082),l=n(72082),u=n(41694),{safeRe:c,t:p,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:h}=n(18104),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:v}=n(4292),g=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,$=(e,t)=>{let n=!0;const a=e.slice();let r=a.pop();for(;n&&a.length;)n=a.every((e=>r.intersects(e,t))),r=a.pop();return n},b=(e,t)=>(l("comp",e,t),e=S(e,t),l("caret",e),e=E(e,t),l("tildes",e),e=I(e,t),l("xrange",e),e=T(e,t),l("stars",e),e),_=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{const n=t.loose?c[p.TILDELOOSE]:c[p.TILDE];return e.replace(n,((t,n,a,r,s)=>{let i;return l("tilde",e,t,n,a,r,s),_(n)?i="":_(a)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:_(r)?i=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:s?(l("replaceTilde pr",s),i=`>=${n}.${a}.${r}-${s} <${n}.${+a+1}.0-0`):i=`>=${n}.${a}.${r} <${n}.${+a+1}.0-0`,l("tilde return",i),i}))},S=(e,t)=>e.trim().split(/\s+/).map((e=>A(e,t))).join(" "),A=(e,t)=>{l("caret",e,t);const n=t.loose?c[p.CARETLOOSE]:c[p.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,((t,n,r,s,i)=>{let o;return l("caret",e,t,n,r,s,i),_(n)?o="":_(r)?o=`>=${n}.0.0${a} <${+n+1}.0.0-0`:_(s)?o="0"===n?`>=${n}.${r}.0${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${a} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),o="0"===n?"0"===r?`>=${n}.${r}.${s}-${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${i} <${+n+1}.0.0-0`):(l("no pr"),o="0"===n?"0"===r?`>=${n}.${r}.${s}${a} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),l("caret return",o),o}))},I=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();const n=t.loose?c[p.XRANGELOOSE]:c[p.XRANGE];return e.replace(n,((n,a,r,s,i,o)=>{l("xRange",e,n,a,r,s,i,o);const u=_(r),c=u||_(s),p=c||_(i),d=p;return"="===a&&d&&(a=""),o=t.includePrerelease?"-0":"",u?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&d?(c&&(s=0),i=0,">"===a?(a=">=",c?(r=+r+1,s=0,i=0):(s=+s+1,i=0)):"<="===a&&(a="<",c?r=+r+1:s=+s+1),"<"===a&&(o="-0"),n=`${a+r}.${s}.${i}${o}`):c?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:p&&(n=`>=${r}.${s}.0${o} <${r}.${+s+1}.0-0`),l("xRange return",n),n}))},T=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[p.STAR],"")),N=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),O=e=>(t,n,a,r,s,i,o,l,u,c,p,d)=>`${n=_(a)?"":_(r)?`>=${a}.0.0${e?"-0":""}`:_(s)?`>=${a}.${r}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=_(u)?"":_(c)?`<${+u+1}.0.0-0`:_(p)?`<${u}.${+c+1}.0-0`:d?`<=${u}.${c}.${p}-${d}`:e?`<${u}.${c}.${+p+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const a=e[n].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},71595:(e,t,n)=>{const a=n(9331);e.exports=(e,t)=>e.sort(((e,n)=>a(n,e,t)))},71598:(e,t,n)=>{var a=n(65994).e;const r="object"==typeof a&&a.env&&a.env.NODE_DEBUG&&/\bsemver\b/i.test(a.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},71773:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>a(t,e,n)},71851:(e,t,n)=>{const a=n(25583);e.exports=(e,t,n)=>a(e,t,n)<=0},71925:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.REQUIRED_AS_FIRST_STAGE=t.FULL_SCAN_STAGES=t.OUT_STAGES=t.STAGE_OPERATOR_NAMES=t.STAGE_OPERATORS=void 0;const a=n(97008),r=n(59588),s=[{name:"$addFields",value:"$addFields",label:"$addFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value.",comment:"/**\n * newField: The new field name.\n * expression: The new field expression.\n */\n",snippet:"{\n ${1:newField}: ${2:expression}, ${3:...}\n}"},{name:"$bucket",value:"$bucket",label:"$bucket",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Categorizes incoming documents into groups, called buckets, based on specified boundaries.",comment:"/**\n * groupBy: The expression to group by.\n * boundaries: An array of the lower boundaries for each bucket.\n * default: The bucket name for documents that do not fall within the specified boundaries\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n */\n",snippet:"{\n groupBy: ${1:expression},\n boundaries: [ ${2:lowerbound}, ${3:...} ],\n default: ${4:literal},\n output: {\n ${5:outputN}: { ${6:accumulator} }, ${7:...}\n }\n}"},{name:"$bucketAuto",value:"$bucketAuto",label:"$bucketAuto",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.",comment:"/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n",snippet:"{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}"},{name:"$changeStream",value:"$changeStream",label:"$changeStream",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a Change Stream cursor for the collection.",comment:"/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n",snippet:"{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}"},{name:"$collStats",value:"$collStats",label:"$collStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Returns statistics regarding a collection or view.",comment:"/**\n * histograms: Optional latency histograms.\n * storageStats: Optional storage stats.\n */\n",snippet:"{\n latencyStats: {\n histograms: ${1:boolean}\n },\n storageStats: {${2:}},\n}"},{name:"$count",value:"$count",label:"$count",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns a count of the number of documents at this stage of the aggregation pipeline.",comment:"/**\n * Provide the field name for the count.\n */\n",snippet:"'${1:string}'"},{name:"$currentOp",value:"$currentOp",label:"$currentOp",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.",comment:"/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n",snippet:"{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}"},{name:"$densify",value:"$densify",label:"$densify",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.1.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level.",comment:"/**\n * field: The required field to densify.\n * partitionByFields: The set of fields that acts as a compound key to define each partition.\n * range: {\n * step: The amount to increment the field value in each document.\n * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.\n * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.\n * }\n */\n",snippet:"{\n field: ${1:string},\n partitionByFields: [${2:string}, ${3:string}, ...],\n range: {\n step: ${4:number},\n unit: ${5:string},\n bounds: [${6:lowerbound}, ${7:upperbound}, ...]\n }\n}"},{name:"$documents",value:"$documents",label:"$documents",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.9",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns literal documents from input values.",comment:"/**\n * expression: Any valid expression.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$facet",value:"$facet",label:"$facet",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Allows for multiple parellel aggregations to be specified.",comment:"/**\n * outputFieldN: The first output field.\n * stageN: The first aggregation stage.\n */\n",snippet:"{\n ${1:outputFieldN}: [ ${2:stageN}, ${3:...} ]\n}"},{name:"$fill",value:"$fill",label:"$fill",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.3.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Populates null and missing field values within documents.",comment:'/**\n * sortBy: Syntax is the same as $sort, required if "method" is used in at least one output spec otherwise optional\n * partitionBy: Optional, default is a single partition. Specification is the same as _id in $group (same as partitionBy in window functions).\n * partitionByFields: Optional, set of fields that acts as a compound key to define each partition.\n * output - Required, object for each field to fill in. For a single field, can be a single object.\n * output.<field> - A field to be filled with value, if missing or null in the current document.\n */\n',snippet:"{\n sortBy: ${1:sortSpec},\n partitionBy: ${2:expression},\n partitionByFields: [${3:string}, ${4:string}, ...],\n output: {\n field1: {value: ${5:expression}},\n field2: {method: ${6:string}},\n ...\n }\n}"},{name:"$geoNear",value:"$geoNear",label:"$geoNear",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns documents based on proximity to a geospatial point.",comment:"/**\n * near: The point to search near.\n * distanceField: The calculated distance.\n * maxDistance: The maximum distance, in meters, documents can be before being excluded from results.\n * query: Limits results that match the query\n * includeLocs: Optional. Labels and includes the point used to match the document.\n * num: Optional. The maximum number of documents to return.\n * spherical: Defaults to false. Specifies whether to use spherical geometry.\n */\n",snippet:"{\n near: { type: 'Point', coordinates: [ ${1:number}, ${2:number} ] },\n distanceField: '${3:string}',\n maxDistance: ${4:number},\n query: {${5}},\n includeLocs: '${6}',\n num: ${7:number},\n spherical: ${8:boolean}\n}"},{name:"$graphLookup",value:"$graphLookup",label:"$graphLookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a recursive search on a collection.",comment:"/**\n * from: The target collection.\n * startWith: Expression to start.\n * connectFromField: Field to connect.\n * connectToField: Field to connect to.\n * as: Name of the array field.\n * maxDepth: Optional max recursion depth.\n * depthField: Optional Name of the depth field.\n * restrictSearchWithMatch: Optional query.\n */\n",snippet:"{\n from: '${1:string}',\n startWith: ${2:expression},\n connectFromField: '${3:string}',\n connectToField: '${4:string}',\n as: '${5:string}',\n maxDepth: ${6:number},\n depthField: '${7:string}',\n restrictSearchWithMatch: {${8}}\n}"},{name:"$group",value:"$group",label:"$group",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups documents by a specified expression.",comment:"/**\n * _id: The id of the group.\n * fieldN: The first field name.\n */\n",snippet:"{\n _id: ${1:expression},\n ${2:fieldN}: {\n ${3:accumulatorN}: ${4:expressionN}\n }\n}"},{name:"$indexStats",value:"$indexStats",label:"$indexStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[],namespaces:[...r.ANY_NAMESPACE],description:"Returns statistics regarding the use of each index for the collection.",comment:"/**\n * No parameters.\n */\n",snippet:"{}"},{name:"$limit",value:"$limit",label:"$limit",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Limits the number of documents that flow into subsequent stages.",comment:"/**\n * Provide the number of documents to limit.\n */\n",snippet:"${1:number}"},{name:"$listLocalSessions",value:"$listLocalSessions",label:"$listLocalSessions",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Lists the sessions cached in memory by the mongod or mongos instance.",comment:"/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n",snippet:"{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}"},{name:"$lookup",value:"$lookup",label:"$lookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a join between two collections.",comment:"/**\n * from: The target collection.\n * localField: The local join field.\n * foreignField: The target join field.\n * as: The name for the results.\n * pipeline: Optional pipeline to run on the foreign collection.\n * let: Optional variables to use in the pipeline field stages.\n */\n",snippet:"{\n from: ${1:collection},\n localField: ${2:field},\n foreignField: ${3:field},\n as: ${4:result}\n}"},{name:"$match",value:"$match",label:"$match",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Filters the document stream to allow only matching documents to pass through to subsequent stages.",comment:"/**\n * query: The query in MQL.\n */\n",snippet:"{\n ${1:query}\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.1.11",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * into: The target collection.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: '${1:string}',\n on: '${2:string}',\n let: '${3:specification(s)}',\n whenMatched: '${4:string}',\n whenNotMatched: '${5:string}'\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * atlas: Location to write the documents from the aggregation pipeline.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: {\n atlas: {\n clusterName: '${1:atlasClusterName}',\n db: '${2:database}',\n coll: '${3:collection}',\n projectId: '${4:optionalAtlasProjectId}'\n }\n },\n on: '${5:identifier}',\n let: { ${6:specification(s)} },\n whenMatched: '${7:string}',\n whenNotMatched: '${8:string}'\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to a new or existing collection.",comment:"/**\n * Provide the name of the output database and collection.\n */\n",snippet:"{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to an Atlas cluster, S3 bucket, or Azure Blob Storage.",comment:"/**\n * Use any one of the following:\n * s3: Parameters to save the data to S3.\n * atlas: Parameters to save the data to Atlas. Example:\n * {\n * atlas: {\n * db: 'string',\n * coll: 'string',\n * projectId: 'string',\n * clusterName: 'string'\n * }\n * },\n * azure: Parameters to save the data to Azure. Example:\n * {\n * azure: {\n * serviceURL: 'string',\n * containerName: 'string',\n * region: 'string,\n * filename: 'string',\n * format: {\n * name: 'string',\n * maxFileSize: 'string',\n * maxRowGroupSize: 'string',\n * columnCompression: 'string'\n * },\n * errorMode: 'string'\n * }\n * }\n */\n",snippet:"{\n s3: {\n bucket: '${1:string}',\n region: '${2:string}',\n filename: '${3:string}',\n format: {\n name: '${4:string}',\n maxFileSize: '${5:bytes}',\n maxRowGroupSize: '${6:string}',\n columnCompression: '${7:string}'\n },\n errorMode: '${8:string}'\n }\n}"},{name:"$project",value:"$project",label:"$project",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value. Unlike $addFields, $project can also remove fields.",comment:"/**\n * specifications: The fields to\n * include or exclude.\n */\n",snippet:"{\n ${1:specification(s)}\n}"},{name:"$rankFusion",value:"$rankFusion",label:"$rankFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.0.14",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using reciprocal rank fusion to create hybrid search results.",comment:'/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be a Ranked Selection Pipeline operating on the same collection. Minimum of one pipeline.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information in {$meta: "scoreDetails"} for debugging and tuning.\n */\n',snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n }\n },\n combination: {\n weights: {\n ${6:searchPipeline}: ${7:number},\n ${8:vectorPipeline}: ${9:number}\n }\n },\n scoreDetails: ${10:false}\n}"},{name:"$redact",value:"$redact",label:"$redact",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.6.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Restricts the content for each document based on information stored in the documents themselves",comment:"/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$replaceRoot",value:"$replaceRoot",label:"$replaceRoot",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newRoot: ${1:replacementDocument}\n}"},{name:"$replaceWith",value:"$replaceWith",label:"$replaceWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newWith: ${1:replacementDocument}\n}"},{name:"$sample",value:"$sample",label:"$sample",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Randomly selects the specified number of documents from its input.",comment:"/**\n * size: The number of documents to sample.\n */\n",snippet:"{\n size: ${1:number}\n}"},{name:"$scoreFusion",value:"$scoreFusion",label:"$scoreFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.2.0",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using relative score fusion to create hybrid search results.",comment:"/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be operating on the same collection. Minimum of one pipeline.\n * input.normalization: Required. Normalizes the score to the range 0 to 1 before combining the results. Value can be none, sigmoid or minMaxScaler.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * combination.method: Optional. Specifies method for combining scores. Value can be avg or expression. Default is avg.\n * combination.expression: Optional. This is the custom expression that is used when combination.method is set to expression.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information.\n */\n",snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n },\n normalization: '${6:none|sigmoid|minMaxScaler}'\n },\n combination: {\n weights: {\n ${7:searchPipeline}: ${8:number},\n ${9:vectorPipeline}: ${10:number}\n },\n method: '${11:avg|expression}',\n expression: '${12:expression}'\n },\n scoreDetails: ${13:false}\n}"},{name:"$search",value:"$search",label:"$search",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.1.11",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s).",comment:"/**\n * index: The name of the Search index.\n * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. Use matchCriteria to match 'any' or 'all' query terms.\n * compound: Combines ops.\n * span: Find in text field regions.\n * exists: Test for presence of a field.\n * near: Find near number or date.\n * range: Find in numeric or date range.\n */\n",snippet:"{\n index: '${1:string}',\n text: {\n query: '${2:string}',\n path: '${3:string}',\n matchCriteria: '${4:any}',\n }\n}"},{name:"$searchMeta",value:"$searchMeta",label:"$searchMeta",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.4.9",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.",comment:"/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n",snippet:"{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}"},{name:"$set",value:"$set",label:"$set",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.",comment:"/**\n * field: The field name\n * expression: The expression.\n */\n",snippet:"{\n ${1:field}: ${2:expression}\n}"},{name:"$setWindowFields",value:"$setWindowFields",label:"$setWindowFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Capable of partitioning incoming data, and can apply one or more functions to defined windows within each partition.",comment:"/**\n * partitionBy: partitioning of data.\n * sortBy: fields to sort by.\n * output: {\n * path: {\n * function: The window function to compute over the given window.\n * window: {\n * documents: A number of documents before and after the current document.\n * range: A range of possible values around the value in the current document's sortBy field.\n * unit: Specifies the units for the window bounds.\n * }\n * }\n * }\n */\n",snippet:"{\n partitionBy: ${1:expression},\n sortBy: ${2:sortSpec},\n output: {\n ${3:path}: {\n ${4:function}: ${5:functionArgs},\n window: {\n documents: [${6:lowerbound}, ${7:upperbound}],\n range: [${8:lowerbound}, ${9:upperbound}],\n unit: ${10:string}\n }\n },\n ${11:path2}: ...\n }\n}"},{name:"$skip",value:"$skip",label:"$skip",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Skips a specified number of documents before advancing to the next stage.",comment:"/**\n * Provide the number of documents to skip.\n */\n",snippet:"${1:number}"},{name:"$sort",value:"$sort",label:"$sort",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Reorders the document stream by a specified sort key and direction.",comment:"/**\n * Provide any number of field/order pairs.\n */\n",snippet:"{\n ${1:field1}: ${2:sortOrder}\n}"},{name:"$sortByCount",value:"$sortByCount",label:"$sortByCount",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.",comment:"/**\n * expression: Grouping expression or string.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$unionWith",value:"$unionWith",label:"$unionWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Perform a union with a pipeline on another collection.",comment:"/**\n * coll: The collection name.\n * pipeline: The pipeline on the other collection.\n */\n",snippet:"{\n coll: '${1:coll}',\n pipeline: [${2:pipeline}]\n}"},{name:"$unset",value:"$unset",label:"$unset",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Excludes fields from the result document.",comment:"/**\n * Provide the field name to exclude.\n * To exclude multiple fields, pass the field names in an array.\n */\n",snippet:"'${1:string}'"},{name:"$unwind",value:"$unwind",label:"$unwind",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Outputs a new document for each element in a specified array. ",comment:"/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n",snippet:"{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}"},{name:"$vectorSearch",value:"$vectorSearch",label:"$vectorSearch",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS],meta:"stage",version:">=6.0.10 <7.0.0 || >=7.0.2",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a kNN search on embeddings in the specified field(s)",comment:"/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n * exact: Choose between false for ANN (Approximate Nearest Neighbor) and true for ENN (Exact Nearest Neighbor). Defaults to false. (Optional)\n */\n",snippet:"{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}},\n exact: ${8:boolean}\n}"}];t.STAGE_OPERATORS=s;const i=s.map((e=>e.name));t.STAGE_OPERATOR_NAMES=i;const o=s.filter((e=>e.outputStage));t.OUT_STAGES=o;const l=s.filter((e=>e.fullScan));t.FULL_SCAN_STAGES=l;const u=s.filter((e=>e.firstStage));t.REQUIRED_AS_FIRST_STAGE=u},72082:(e,t,n)=>{var a=n(65994).e;const r="object"==typeof a&&a.env&&a.env.NODE_DEBUG&&/\bsemver\b/i.test(a.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},72510:(e,t,n)=>{function a(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}function r(e,t){return"bigint"==typeof t?t.toString():t}function s(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function i(e){return null==e}function o(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function l(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,r=n>a?n:a;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}function u(e,t,n){Object.defineProperty(e,t,{get(){{const a=n();return e[t]=a,a}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function c(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function p(e){return JSON.stringify(e)}n.d(t,{$f:()=>g,A2:()=>$,Gv:()=>m,LG:()=>l,NM:()=>b,OH:()=>I,PO:()=>s,QH:()=>T,Qd:()=>f,Rc:()=>R,UQ:()=>p,Up:()=>E,Vy:()=>c,X$:()=>S,cJ:()=>x,cl:()=>i,gJ:()=>u,gx:()=>d,h1:()=>A,hI:()=>h,iR:()=>k,k8:()=>r,lQ:()=>N,mw:()=>w,o8:()=>y,p6:()=>o,qQ:()=>v,sn:()=>C,w5:()=>a,zH:()=>_});const d=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function m(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const h=s((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function f(e){if(!1===m(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==m(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}const v=new Set(["string","number","symbol"]);function g(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y(e,t,n){const a=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(a._zod.parent=e),a}function $(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function b(e){return Object.keys(e).filter((t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout))}new Set(["string","number","bigint","boolean","symbol","undefined"]);const _={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function E(e,t){const n={},a=e._zod.def;for(const e in t){if(!(e in a.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=a.shape[e])}return y(e,{...e._zod.def,shape:n,checks:[]})}function x(e,t){const n={...e._zod.def.shape},a=e._zod.def;for(const e in t){if(!(e in a.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return y(e,{...e._zod.def,shape:n,checks:[]})}function S(e,t){if(!f(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return c(this,"shape",n),n},checks:[]};return y(e,n)}function A(e,t){return y(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return c(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function I(e,t,n){const a=t._zod.def.shape,r={...a};if(n)for(const t in n){if(!(t in a))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=e?new e({type:"optional",innerType:a[t]}):a[t])}else for(const t in a)r[t]=e?new e({type:"optional",innerType:a[t]}):a[t];return y(t,{...t._zod.def,shape:r,checks:[]})}function w(e,t,n){const a=t._zod.def.shape,r={...a};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=new e({type:"nonoptional",innerType:a[t]}))}else for(const t in a)r[t]=new e({type:"nonoptional",innerType:a[t]});return y(t,{...t._zod.def,shape:r,checks:[]})}function T(e,t=0){for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function N(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function O(e){return"string"==typeof e?e:e?.message}function k(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const r=O(e.inst?._zod.def?.error?.(e))??O(t?.error?.(e))??O(n.customError?.(e))??O(n.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function R(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function C(...e){const[t,n,a]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:a}:{...t}}},72608:(e,t,n)=>{const a=n(70692);e.exports=(e,t,n)=>a(e,t,n)>0},72849:(e,t,n)=>{const a=n(20360);e.exports=(e,t,n)=>{try{t=new a(t,n)}catch(e){return!1}return t.test(e)}},72857:(e,t,n)=>{const a=/\s+/g;class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(a," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&v))+":"+e,n=s.get(t);if(n)return n;const a=this.options.loose,r=a?c[p.HYPHENRANGELOOSE]:c[p.HYPHENRANGE];e=e.replace(r,O(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(c[p.COMPARATORTRIM],d),l("comparator trim",e),e=e.replace(c[p.TILDETRIM],m),l("tilde trim",e),e=e.replace(c[p.CARETTRIM],h),l("caret trim",e);let i=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>N(e,this.options)));a&&(i=i.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(c[p.COMPARATORLOOSE]))))),l("range list",i);const u=new Map,y=i.map((e=>new o(e,this.options)));for(const e of y){if(g(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");const $=[...u.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>$(n,t)&&e.set.some((e=>$(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const s=new(n(13016)),i=n(31145),o=n(67094),l=n(71598),u=n(50066),{safeRe:c,t:p,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:h}=n(65684),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:v}=n(47755),g=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,$=(e,t)=>{let n=!0;const a=e.slice();let r=a.pop();for(;n&&a.length;)n=a.every((e=>r.intersects(e,t))),r=a.pop();return n},b=(e,t)=>(l("comp",e,t),e=S(e,t),l("caret",e),e=E(e,t),l("tildes",e),e=I(e,t),l("xrange",e),e=T(e,t),l("stars",e),e),_=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{const n=t.loose?c[p.TILDELOOSE]:c[p.TILDE];return e.replace(n,((t,n,a,r,s)=>{let i;return l("tilde",e,t,n,a,r,s),_(n)?i="":_(a)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:_(r)?i=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:s?(l("replaceTilde pr",s),i=`>=${n}.${a}.${r}-${s} <${n}.${+a+1}.0-0`):i=`>=${n}.${a}.${r} <${n}.${+a+1}.0-0`,l("tilde return",i),i}))},S=(e,t)=>e.trim().split(/\s+/).map((e=>A(e,t))).join(" "),A=(e,t)=>{l("caret",e,t);const n=t.loose?c[p.CARETLOOSE]:c[p.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,((t,n,r,s,i)=>{let o;return l("caret",e,t,n,r,s,i),_(n)?o="":_(r)?o=`>=${n}.0.0${a} <${+n+1}.0.0-0`:_(s)?o="0"===n?`>=${n}.${r}.0${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${a} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),o="0"===n?"0"===r?`>=${n}.${r}.${s}-${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${i} <${+n+1}.0.0-0`):(l("no pr"),o="0"===n?"0"===r?`>=${n}.${r}.${s}${a} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),l("caret return",o),o}))},I=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();const n=t.loose?c[p.XRANGELOOSE]:c[p.XRANGE];return e.replace(n,((n,a,r,s,i,o)=>{l("xRange",e,n,a,r,s,i,o);const u=_(r),c=u||_(s),p=c||_(i),d=p;return"="===a&&d&&(a=""),o=t.includePrerelease?"-0":"",u?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&d?(c&&(s=0),i=0,">"===a?(a=">=",c?(r=+r+1,s=0,i=0):(s=+s+1,i=0)):"<="===a&&(a="<",c?r=+r+1:s=+s+1),"<"===a&&(o="-0"),n=`${a+r}.${s}.${i}${o}`):c?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:p&&(n=`>=${r}.${s}.0${o} <${r}.${+s+1}.0-0`),l("xRange return",n),n}))},T=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[p.STAR],"")),N=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),O=e=>(t,n,a,r,s,i,o,l,u,c,p,d)=>`${n=_(a)?"":_(r)?`>=${a}.0.0${e?"-0":""}`:_(s)?`>=${a}.${r}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=_(u)?"":_(c)?`<${+u+1}.0.0-0`:_(p)?`<${u}.${+c+1}.0-0`:d?`<=${u}.${c}.${p}-${d}`:e?`<${u}.${c}.${+p+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const a=e[n].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},73634:(e,t,n)=>{const a=n(71333);e.exports=(e,t,n)=>(e=new a(e,n),t=new a(t,n),e.intersects(t,n))},73746:(e,t,n)=>{const a=n(66283);e.exports=(e,t,n,r,s)=>{"string"==typeof n&&(s=r,r=n,n=void 0);try{return new a(e instanceof a?e.version:e,n).inc(t,r,s).version}catch(e){return null}}},74145:(e,t,n)=>{const a=n(48381);e.exports=(e,t)=>new a(e,t).minor},74227:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>a(e,t,n)>=0},75092:(e,t,n)=>{const a=n(70692);e.exports=(e,t,n)=>a(e,t,n)<=0},75265:(e,t,n)=>{const a=n(57544);e.exports=(e,t,n)=>{const r=new a(e,n),s=new a(t,n);return r.compare(s)||r.compareBuild(s)}},75459:(e,t,n)=>{var a=n(40811);e.exports=new a("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},75689:(e,t,n)=>{const a=n(66283),r=n(59441),{safeRe:s,t:i}=n(415);e.exports=(e,t)=>{if(e instanceof a)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const a=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let r;for(;(r=a.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===n)return null;const o=n[2],l=n[3]||"0",u=n[4]||"0",c=t.includePrerelease&&n[5]?`-${n[5]}`:"",p=t.includePrerelease&&n[6]?`+${n[6]}`:"";return r(`${o}.${l}.${u}${c}${p}`,t)}},75732:(e,t,n)=>{const a=Symbol("SemVer ANY");class r{static get ANY(){return a}constructor(e,t){if(t=s(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===a?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new c(n[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=s(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=r;const s=n(43639),{safeRe:i,t:o}=n(25522),l=n(77043),u=n(49764),c=n(57544),p=n(95323)},75982:(e,t,n)=>{const a=n(36165),r=n(64136),s=n(88825),i=n(67274),o=n(98855),l=n(46526),u=n(65789),c=n(47384),p=n(4113),d=n(12169),m=n(9357),h=n(29478),f=n(160),v=n(25583),g=n(24975),y=n(98736),$=n(56206),b=n(9982),_=n(81521),E=n(51269),x=n(18082),S=n(26620),A=n(32056),I=n(54838),w=n(71851),T=n(5544),N=n(52539),O=n(67105),k=n(20360),R=n(72849),C=n(47544),P=n(79779),L=n(38185),j=n(23252),M=n(78767),D=n(87866),Y=n(22038),F=n(4827),q=n(27995),U=n(88834),V=n(99571);e.exports={parse:o,valid:l,clean:u,inc:c,diff:p,major:d,minor:m,patch:h,prerelease:f,compare:v,rcompare:g,compareLoose:y,compareBuild:$,sort:b,rsort:_,gt:E,lt:x,eq:S,neq:A,gte:I,lte:w,cmp:T,coerce:N,Comparator:O,Range:k,satisfies:R,toComparators:C,maxSatisfying:P,minSatisfying:L,minVersion:j,validRange:M,outside:D,gtr:Y,ltr:F,intersects:q,simplifyRange:U,subset:V,SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},76130:(e,t,n)=>{const a=n(32910);e.exports=(e,t,n)=>a(e,t,">",n)},76393:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const a=t.test(e),r=t.test(n);return a&&r&&(e=+e,n=+n),e===n?0:a&&!r?-1:r&&!a?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},76462:(e,t,n)=>{var a=n(99174),r=n(4414),s=n(57116),i=n(18184),o=Object.prototype.toString,l=Object.prototype.hasOwnProperty,u=9,c=10,p=13,d=32,m=33,h=34,f=35,v=37,g=38,y=39,$=42,b=44,_=45,E=58,x=61,S=62,A=63,I=64,w=91,T=93,N=96,O=123,k=124,R=125,C={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},P=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function L(e){var t,n,s;if(t=e.toString(16).toUpperCase(),e<=255)n="x",s=2;else if(e<=65535)n="u",s=4;else{if(!(e<=4294967295))throw new r("code point within a string may not be greater than 0xFFFFFFFF");n="U",s=8}return"\\"+n+a.repeat("0",s-t.length)+t}function j(e){this.schema=e.schema||s,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=a.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,a,r,s,i,o,u;if(null===t)return{};for(n={},r=0,s=(a=Object.keys(t)).length;r<s;r+=1)i=a[r],o=String(t[i]),"!!"===i.slice(0,2)&&(i="tag:yaml.org,2002:"+i.slice(2)),(u=e.compiledTypeMap.fallback[i])&&l.call(u.styleAliases,o)&&(o=u.styleAliases[o]),n[i]=o;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function M(e,t){for(var n,r=a.repeat(" ",t),s=0,i=-1,o="",l=e.length;s<l;)-1===(i=e.indexOf("\n",s))?(n=e.slice(s),s=l):(n=e.slice(s,i+1),s=i+1),n.length&&"\n"!==n&&(o+=r),o+=n;return o}function D(e,t){return"\n"+a.repeat(" ",e.indent*t)}function Y(e){return e===d||e===u}function F(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function q(e,t){return F(e)&&65279!==e&&e!==b&&e!==w&&e!==T&&e!==O&&e!==R&&e!==E&&(e!==f||t&&function(e){return F(e)&&!Y(e)&&65279!==e&&e!==p&&e!==c}(t))}function U(e){return/^\n* /.test(e)}var V=1,z=2,Z=3,B=4,G=5;function W(e,t,n,a){e.dump=function(){if(0===t.length)return"''";if(!e.noCompatMode&&-1!==P.indexOf(t))return"'"+t+"'";var s=e.indent*Math.max(1,n),i=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),o=a||e.flowLevel>-1&&n>=e.flowLevel;switch(function(e,t,n,a,r){var s,i,o,l,u=!1,p=!1,d=-1!==a,C=-1,P=F(l=e.charCodeAt(0))&&65279!==l&&!Y(l)&&l!==_&&l!==A&&l!==E&&l!==b&&l!==w&&l!==T&&l!==O&&l!==R&&l!==f&&l!==g&&l!==$&&l!==m&&l!==k&&l!==x&&l!==S&&l!==y&&l!==h&&l!==v&&l!==I&&l!==N&&!Y(e.charCodeAt(e.length-1));if(t)for(s=0;s<e.length;s++){if(!F(i=e.charCodeAt(s)))return G;o=s>0?e.charCodeAt(s-1):null,P=P&&q(i,o)}else{for(s=0;s<e.length;s++){if((i=e.charCodeAt(s))===c)u=!0,d&&(p=p||s-C-1>a&&" "!==e[C+1],C=s);else if(!F(i))return G;o=s>0?e.charCodeAt(s-1):null,P=P&&q(i,o)}p=p||d&&s-C-1>a&&" "!==e[C+1]}return u||p?n>9&&U(e)?G:p?B:Z:P&&!r(e)?V:z}(t,o,e.indent,i,(function(t){return function(e,t){var n,a;for(n=0,a=e.implicitTypes.length;n<a;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)}))){case V:return t;case z:return"'"+t.replace(/'/g,"''")+"'";case Z:return"|"+K(t,e.indent)+H(M(t,s));case B:return">"+K(t,e.indent)+H(M(function(e,t){for(var n,a,r,s=/(\n+)([^\n]*)/g,i=(r=-1!==(r=e.indexOf("\n"))?r:e.length,s.lastIndex=r,J(e.slice(0,r),t)),o="\n"===e[0]||" "===e[0];a=s.exec(e);){var l=a[1],u=a[2];n=" "===u[0],i+=l+(o||n||""===u?"":"\n")+J(u,t),o=n}return i}(t,i),s));case G:return'"'+function(e){for(var t,n,a,r="",s=0;s<e.length;s++)(t=e.charCodeAt(s))>=55296&&t<=56319&&(n=e.charCodeAt(s+1))>=56320&&n<=57343?(r+=L(1024*(t-55296)+n-56320+65536),s++):r+=!(a=C[t])&&F(t)?e[s]:a||L(t);return r}(t)+'"';default:throw new r("impossible error: invalid scalar style")}}()}function K(e,t){var n=U(e)?String(t):"",a="\n"===e[e.length-1];return n+(!a||"\n"!==e[e.length-2]&&"\n"!==e?a?"":"-":"+")+"\n"}function H(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function J(e,t){if(""===e||" "===e[0])return e;for(var n,a,r=/ [^ ]/g,s=0,i=0,o=0,l="";n=r.exec(e);)(o=n.index)-s>t&&(a=i>s?i:o,l+="\n"+e.slice(s,a),s=a+1),i=o;return l+="\n",e.length-s>t&&i>s?l+=e.slice(s,i)+"\n"+e.slice(i+1):l+=e.slice(s),l.slice(1)}function X(e,t,n){var a,s,i,u,c,p;for(i=0,u=(s=n?e.explicitTypes:e.implicitTypes).length;i<u;i+=1)if(((c=s[i]).instanceOf||c.predicate)&&(!c.instanceOf||"object"==typeof t&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(e.tag=n?c.tag:"?",c.represent){if(p=e.styleMap[c.tag]||c.defaultStyle,"[object Function]"===o.call(c.represent))a=c.represent(t,p);else{if(!l.call(c.represent,p))throw new r("!<"+c.tag+'> tag resolver accepts not "'+p+'" style');a=c.represent[p](t,p)}e.dump=a}return!0}return!1}function Q(e,t,n,a,s,i){e.tag=null,e.dump=n,X(e,n,!1)||X(e,n,!0);var l=o.call(e.dump);a&&(a=e.flowLevel<0||e.flowLevel>t);var u,p,d="[object Object]"===l||"[object Array]"===l;if(d&&(p=-1!==(u=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||p||2!==e.indent&&t>0)&&(s=!1),p&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(d&&p&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),"[object Object]"===l)a&&0!==Object.keys(e.dump).length?(function(e,t,n,a){var s,i,o,l,u,p,d="",m=e.tag,h=Object.keys(n);if(!0===e.sortKeys)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new r("sortKeys must be a boolean or a function");for(s=0,i=h.length;s<i;s+=1)p="",a&&0===s||(p+=D(e,t)),l=n[o=h[s]],Q(e,t+1,o,!0,!0,!0)&&((u=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&c===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,u&&(p+=D(e,t)),Q(e,t+1,l,!0,u)&&(e.dump&&c===e.dump.charCodeAt(0)?p+=":":p+=": ",d+=p+=e.dump));e.tag=m,e.dump=d||"{}"}(e,t,e.dump,s),p&&(e.dump="&ref_"+u+e.dump)):(function(e,t,n){var a,r,s,i,o,l="",u=e.tag,c=Object.keys(n);for(a=0,r=c.length;a<r;a+=1)o="",0!==a&&(o+=", "),e.condenseFlow&&(o+='"'),i=n[s=c[a]],Q(e,t,s,!1,!1)&&(e.dump.length>1024&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Q(e,t,i,!1,!1)&&(l+=o+=e.dump));e.tag=u,e.dump="{"+l+"}"}(e,t,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if("[object Array]"===l){var m=e.noArrayIndent&&t>0?t-1:t;a&&0!==e.dump.length?(function(e,t,n,a){var r,s,i="",o=e.tag;for(r=0,s=n.length;r<s;r+=1)Q(e,t+1,n[r],!0,!0)&&(a&&0===r||(i+=D(e,t)),e.dump&&c===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=o,e.dump=i||"[]"}(e,m,e.dump,s),p&&(e.dump="&ref_"+u+e.dump)):(function(e,t,n){var a,r,s="",i=e.tag;for(a=0,r=n.length;a<r;a+=1)Q(e,t,n[a],!1,!1)&&(0!==a&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=i,e.dump="["+s+"]"}(e,m,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump))}else{if("[object String]"!==l){if(e.skipInvalid)return!1;throw new r("unacceptable kind of an object to dump "+l)}"?"!==e.tag&&W(e,e.dump,t,i)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function ee(e,t){var n,a,r=[],s=[];for(te(e,r,s),n=0,a=s.length;n<a;n+=1)t.duplicates.push(r[s[n]]);t.usedDuplicates=new Array(a)}function te(e,t,n){var a,r,s;if(null!==e&&"object"==typeof e)if(-1!==(r=t.indexOf(e)))-1===n.indexOf(r)&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,s=e.length;r<s;r+=1)te(e[r],t,n);else for(r=0,s=(a=Object.keys(e)).length;r<s;r+=1)te(e[a[r]],t,n)}function ne(e,t){var n=new j(t=t||{});return n.noRefs||ee(e,n),Q(n,0,e,!0,!0)?n.dump+"\n":""}e.exports.dump=ne,e.exports.safeDump=function(e,t){return ne(e,a.extend({schema:i},t))}},76654:(e,t,n)=>{const a=n(83586);e.exports=(e,t)=>{const n=a(e,null,!0),r=a(t,null,!0),s=n.compare(r);if(0===s)return null;const i=s>0,o=i?n:r,l=i?r:n,u=!!o.prerelease.length;if(l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(o))return l.minor&&!l.patch?"minor":"patch"}const c=u?"pre":"";return n.major!==r.major?c+"major":n.minor!==r.minor?c+"minor":n.patch!==r.patch?c+"patch":"prerelease"}},77043:(e,t,n)=>{const a=n(35229),r=n(67531),s=n(72608),i=n(70509),o=n(86391),l=n(75092);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a(e,n,u);case"!=":return r(e,n,u);case">":return s(e,n,u);case">=":return i(e,n,u);case"<":return o(e,n,u);case"<=":return l(e,n,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},77192:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPES=void 0,t.BSON_TYPES=[{name:"Code",value:"Code",label:"Code",score:1,meta:"bson",version:"0.0.0",description:"BSON Code type",snippet:"Code('${1:code}')"},{name:"ObjectId",value:"ObjectId",label:"ObjectId",score:1,meta:"bson",version:"0.0.0",description:"BSON ObjectId type",snippet:"ObjectId('${1:id}')"},{name:"Binary",value:"Binary",label:"Binary",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary type",snippet:"Binary('${1:data}', '${2:subType}')"},{name:"DBRef",value:"DBRef",label:"DBRef",score:1,meta:"bson",version:"0.0.0",description:"BSON DBRef type",snippet:"DBRef('${1:ns}', '${2:oid}')"},{name:"Timestamp",value:"Timestamp",label:"Timestamp",score:1,meta:"bson",version:"0.0.0",description:"BSON Timestamp type",snippet:"Timestamp(${1:low}, ${2:high})"},{name:"NumberInt",value:"NumberInt",label:"NumberInt",score:1,meta:"bson",version:"0.0.0",description:"BSON 32 bit Integer type",snippet:"NumberInt(${1:value})"},{name:"NumberLong",value:"NumberLong",label:"NumberLong",score:1,meta:"bson",version:"0.0.0",description:"BSON 64 but Integer type",snippet:"NumberLong('${1:value}')"},{name:"NumberDecimal",value:"NumberDecimal",label:"NumberDecimal",score:1,meta:"bson",version:"3.4.0",description:"BSON Decimal128 type",snippet:"NumberDecimal('${1:value}')"},{name:"MaxKey",value:"MaxKey",label:"MaxKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MaxKey type",snippet:"MaxKey()"},{name:"MinKey",value:"MinKey",label:"MinKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MinKey type",snippet:"MinKey()"},{name:"ISODate",value:"ISODate",label:"ISODate",score:1,meta:"bson",version:"0.0.0",description:"BSON Date type",snippet:"ISODate('${1:date}')"},{name:"RegExp",value:"RegExp",label:"RegExp",score:1,meta:"bson",version:"0.0.0",description:"BSON Regex type",snippet:"RegExp('${1:source}', '${2:opts}')"},{name:"LegacyJavaUUID",value:"LegacyJavaUUID",label:"LegacyJavaUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Java legacy UUID)",snippet:"LegacyJavaUUID('${1:uuid}')"},{name:"LegacyCSharpUUID",value:"LegacyCSharpUUID",label:"LegacyCSharpUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (CSharp legacy UUID)",snippet:"LegacyCSharpUUID('${1:uuid}')"},{name:"LegacyPythonUUID",value:"LegacyPythonUUID",label:"LegacyPythonUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Python legacy UUID)",snippet:"LegacyPythonUUID('${1:uuid}')"},{name:"UUID",value:"UUID",label:"UUID",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary subtype 4",snippet:"UUID('${1:uuid}')"}]},77203:(e,t,n)=>{const a=n(48381);e.exports=(e,t,n)=>new a(e,n).compare(new a(t,n))},77277:(e,t,n)=>{const a=n(34219);e.exports=(e,t)=>{const n=a(e,null,!0),r=a(t,null,!0),s=n.compare(r);if(0===s)return null;const i=s>0,o=i?n:r,l=i?r:n,u=!!o.prerelease.length;if(l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(o))return l.minor&&!l.patch?"minor":"patch"}const c=u?"pre":"";return n.major!==r.major?c+"major":n.minor!==r.minor?c+"minor":n.patch!==r.patch?c+"patch":"prerelease"}},77467:(e,t,n)=>{const a=n(41694),r=n(71333),s=n(43334);e.exports=(e,t)=>{e=new r(e,t);let n=new a("0.0.0");if(e.test(n))return n;if(n=new a("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new a(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!s(n,i)||(n=i)}return n&&e.test(n)?n:null}},77693:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},77926:(e,t,n)=>{n.d(t,{JM:()=>l,Kd:()=>o,Wk:()=>u,a$:()=>i});var a=n(36710),r=n(87257);const s=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,r.k8,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},i=(0,a.xI)("$ZodError",s),o=(0,a.xI)("$ZodError",s,{Parent:Error});function l(e,t=e=>e.message){const n={},a=[];for(const r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:n}}function u(e,t){const n=t||function(e){return e.message},a={_errors:[]},r=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>r({issues:e})));else if("invalid_key"===t.code)r({issues:t.issues});else if("invalid_element"===t.code)r({issues:t.issues});else if(0===t.path.length)a._errors.push(n(t));else{let e=a,r=0;for(;r<t.path.length;){const a=t.path[r];r===t.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(n(t))):e[a]=e[a]||{_errors:[]},e=e[a],r++}}};return r(e),a}},77973:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPES=void 0,t.BSON_TYPES=[{name:"Code",value:"Code",label:"Code",score:1,meta:"bson",version:"0.0.0",description:"BSON Code type",snippet:"Code('${1:code}')"},{name:"ObjectId",value:"ObjectId",label:"ObjectId",score:1,meta:"bson",version:"0.0.0",description:"BSON ObjectId type",snippet:"ObjectId('${1:id}')"},{name:"Binary",value:"Binary",label:"Binary",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary type",snippet:"Binary('${1:data}', '${2:subType}')"},{name:"DBRef",value:"DBRef",label:"DBRef",score:1,meta:"bson",version:"0.0.0",description:"BSON DBRef type",snippet:"DBRef('${1:ns}', '${2:oid}')"},{name:"Timestamp",value:"Timestamp",label:"Timestamp",score:1,meta:"bson",version:"0.0.0",description:"BSON Timestamp type",snippet:"Timestamp(${1:low}, ${2:high})"},{name:"NumberInt",value:"NumberInt",label:"NumberInt",score:1,meta:"bson",version:"0.0.0",description:"BSON 32 bit Integer type",snippet:"NumberInt(${1:value})"},{name:"NumberLong",value:"NumberLong",label:"NumberLong",score:1,meta:"bson",version:"0.0.0",description:"BSON 64 but Integer type",snippet:"NumberLong('${1:value}')"},{name:"NumberDecimal",value:"NumberDecimal",label:"NumberDecimal",score:1,meta:"bson",version:"3.4.0",description:"BSON Decimal128 type",snippet:"NumberDecimal('${1:value}')"},{name:"MaxKey",value:"MaxKey",label:"MaxKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MaxKey type",snippet:"MaxKey()"},{name:"MinKey",value:"MinKey",label:"MinKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MinKey type",snippet:"MinKey()"},{name:"ISODate",value:"ISODate",label:"ISODate",score:1,meta:"bson",version:"0.0.0",description:"BSON Date type",snippet:"ISODate('${1:date}')"},{name:"RegExp",value:"RegExp",label:"RegExp",score:1,meta:"bson",version:"0.0.0",description:"BSON Regex type",snippet:"RegExp('${1:source}', '${2:opts}')"},{name:"LegacyJavaUUID",value:"LegacyJavaUUID",label:"LegacyJavaUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Java legacy UUID)",snippet:"LegacyJavaUUID('${1:uuid}')"},{name:"LegacyCSharpUUID",value:"LegacyCSharpUUID",label:"LegacyCSharpUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (CSharp legacy UUID)",snippet:"LegacyCSharpUUID('${1:uuid}')"},{name:"LegacyPythonUUID",value:"LegacyPythonUUID",label:"LegacyPythonUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Python legacy UUID)",snippet:"LegacyPythonUUID('${1:uuid}')"},{name:"UUID",value:"UUID",label:"UUID",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary subtype 4",snippet:"UUID('${1:uuid}')"}]},78145:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ALL_CONSTANTS=void 0,t.createConstantFilter=f,t.wrapField=function(e,t=!1){return t||!function(e){if(/[.\s"'()[\];={}:]/.test(e))return!1;try{return new Function(`"use strict";let _ = { ${e}: 0 };`),!0}catch{return!1}}(e)?`"${e.replace(/["\\]/g,"\\$&")}"`:e},t.getFilteredCompletions=function(e={},n=t.ALL_CONSTANTS){const{serverVersion:a=m,fields:r=[],meta:s,stage:i}=e,o=f({serverVersion:a,meta:s,stage:i});return n.concat(r.flatMap((e=>{const{value:t,description:n}=function(e){return"string"==typeof e?{value:e}:{value:e.name,description:e.description}}(e);return[{value:t,meta:"field:identifier",version:"0.0.0",description:n},{value:`$${t}`,meta:"field:reference",version:"0.0.0",description:n}]}))).filter((e=>o(e)))};const a=n(59591),r=n(46432),s=n(81379),i=n(34889),o=n(82663),l=n(47969),u=n(17941),c=n(28131),p=n(19133),d=n(10282);t.ALL_CONSTANTS=[...r.ACCUMULATORS,...i.BSON_TYPES,...s.BSON_TYPE_ALIASES,...o.CONVERSION_OPERATORS,...l.EXPRESSION_OPERATORS,...u.JSON_SCHEMA,...c.QUERY_OPERATORS,...p.STAGE_OPERATORS,...d.SYSTEM_VARIABLES];const m="999.999.999";function h(e,t){return void 0===e||void 0===t||(e=Array.isArray(e)?e:[e]).some((e=>t.includes(e)))}function f({meta:e,serverVersion:t=m,stage:n={}}={}){const r=/^(?<version>\d+\.\d+\.\d+)/.exec(t)?.groups?.version??m;return({version:t,meta:s,env:i,namespaces:o,apiVersions:l})=>function(e,t){const n=/^\d+\.\d+\.\d+$/.test(t);return(0,a.satisfies)(e,n?`>=${t}`:t)}(r,t)&&h(n.env,i)&&h(n.namespace,o)&&h(n.apiVersion,l)&&(!e||function(e,t){const n=t.split(":");return e.some((e=>{const t=e.split(":");return t.length===n.length&&t.every(((e,t)=>"*"===e||e===n[t]))}))}(e,s))}},78316:(e,t,n)=>{var a=n(40811),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new a("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==r.exec(e)||null!==s.exec(e))},construct:function(e){var t,n,a,i,o,l,u,c,p=0,d=null;if(null===(t=r.exec(e))&&(t=s.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],a=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,a,i));if(o=+t[4],l=+t[5],u=+t[6],t[7]){for(p=t[7].slice(0,3);p.length<3;)p+="0";p=+p}return t[9]&&(d=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(d=-d)),c=new Date(Date.UTC(n,a,i,o,l,u,p)),d&&c.setTime(c.getTime()-d),c},instanceOf:Date,represent:function(e){return e.toISOString()}})},78462:(e,t,n)=>{const a=n(70692);e.exports=(e,t,n)=>a(t,e,n)},78519:(e,t,n)=>{const a=n(20332);e.exports=(e,t,n)=>(e=new a(e,n),t=new a(t,n),e.intersects(t,n))},78654:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>0!==a(e,t,n)},78767:(e,t,n)=>{const a=n(20360);e.exports=(e,t)=>{try{return new a(e,t).range||"*"}catch(e){return null}}},78853:(e,t,n)=>{const a=n(48381);e.exports=(e,t)=>new a(e,t).major},78900:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const a=t.test(e),r=t.test(n);return a&&r&&(e=+e,n=+n),e===n?0:a&&!r?-1:r&&!a?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},78970:(e,t,n)=>{const a=n(12196);e.exports=(e,t)=>{const n=a(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},79188:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JSON_SCHEMA=void 0,t.JSON_SCHEMA=[{name:"bsonType",value:"bsonType",label:"bsonType",score:1,meta:"json-schema",version:"3.6.0",description:"Accepts same string aliases used for the $type operator"},{name:"enum",value:"enum",label:"enum",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates all possible values of the field"},{name:"type",value:"type",label:"type",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates the possible JSON types of the field"},{name:"allOf",value:"allOf",label:"allOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match all specified schemas"},{name:"anyOf",value:"anyOf",label:"anyOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match at least one of the specified schemas"},{name:"oneOf",value:"oneOf",label:"oneOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match exactly one of the specified schemas"},{name:"not",value:"not",label:"not",score:1,meta:"json-schema",version:"3.6.0",description:"Field must not match the schema"},{name:"multipleOf",value:"multipleOf",label:"multipleOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must be a multiple of this value"},{name:"maximum",value:"maximum",label:"maximum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum value of the field"},{name:"exclusiveMaximum",value:"exclusiveMaximum",label:"exclusiveMaximum",score:1,meta:"json-schema",version:"3.6.0",description:"If true and field is a number, maximum is an exclusive maximum"},{name:"minimum",value:"minimum",label:"minimum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum value of the field"},{name:"exclusiveMinimum",value:"exclusiveMinimum",label:"exclusiveMinimum",score:1,meta:"json-schema",version:"3.6.0",description:"If true, minimum is an exclusive minimum"},{name:"maxLength",value:"maxLength",label:"maxLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of the field"},{name:"minLength",value:"minLength",label:"minLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of the field"},{name:"pattern",value:"pattern",label:"pattern",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match the regular expression"},{name:"maxProperties",value:"maxProperties",label:"maxProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s maximum number of properties"},{name:"minProperties",value:"minProperties",label:"minProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s minimum number of properties"},{name:"required",value:"required",label:"required",score:1,meta:"json-schema",version:"3.6.0",description:"Object’s property set must contain all the specified elements in the array"},{name:"additionalProperties",value:"additionalProperties",label:"additionalProperties",score:1,meta:"json-schema",version:"3.6.0",description:"If true, additional fields are allowed"},{name:"properties",value:"properties",label:"properties",score:1,meta:"json-schema",version:"3.6.0",description:"A valid JSON Schema where each value is also a valid JSON Schema object"},{name:"patternProperties",value:"patternProperties",label:"patternProperties",score:1,meta:"json-schema",version:"3.6.0",description:"In addition to properties requirements, each property name of this object must be a valid regular expression"},{name:"dependencies",value:"dependencies",label:"dependencies",score:1,meta:"json-schema",version:"3.6.0",description:"Describes field or schema dependencies"},{name:"additionalItems",value:"additionalItems",label:"additionalItems",score:1,meta:"json-schema",version:"3.6.0",description:"If an object, must be a valid JSON Schema"},{name:"items",value:"items",label:"items",score:1,meta:"json-schema",version:"3.6.0",description:"Must be either a valid JSON Schema, or an array of valid JSON Schemas"},{name:"maxItems",value:"maxItems",label:"maxItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of array"},{name:"minItems",value:"minItems",label:"minItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of array"},{name:"uniqueItems",value:"uniqueItems",label:"uniqueItems",score:1,meta:"json-schema",version:"3.6.0",description:"If true, each item in the array must be unique"},{name:"title",value:"title",label:"title",score:1,meta:"json-schema",version:"3.6.0",description:"A descriptive title string with no effect"},{name:"description",value:"description",label:"description",score:1,meta:"json-schema",version:"3.6.0",description:"A string that describes the schema and has no effect."}]},79223:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ANY_NAMESPACE=t.ANY_COLLECTION_NAMESPACE=t.TIME_SERIES=t.VIEW=t.COLLECTION=t.DATABASE=void 0,t.DATABASE="db";const n="coll";t.COLLECTION=n;const a="view";t.VIEW=a;const r="timeseries";t.TIME_SERIES=r;const s=[n,a,r];t.ANY_COLLECTION_NAMESPACE=s;const i=["db",...s];t.ANY_NAMESPACE=i},79779:(e,t,n)=>{const a=n(88825),r=n(20360);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},79984:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.REQUIRED_AS_FIRST_STAGE=t.FULL_SCAN_STAGES=t.OUT_STAGES=t.STAGE_OPERATOR_NAMES=t.STAGE_OPERATORS=void 0;const a=n(92133),r=n(79223),s=[{name:"$addFields",value:"$addFields",label:"$addFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value.",comment:"/**\n * newField: The new field name.\n * expression: The new field expression.\n */\n",snippet:"{\n ${1:newField}: ${2:expression}, ${3:...}\n}"},{name:"$bucket",value:"$bucket",label:"$bucket",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Categorizes incoming documents into groups, called buckets, based on specified boundaries.",comment:"/**\n * groupBy: The expression to group by.\n * boundaries: An array of the lower boundaries for each bucket.\n * default: The bucket name for documents that do not fall within the specified boundaries\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n */\n",snippet:"{\n groupBy: ${1:expression},\n boundaries: [ ${2:lowerbound}, ${3:...} ],\n default: ${4:literal},\n output: {\n ${5:outputN}: { ${6:accumulator} }, ${7:...}\n }\n}"},{name:"$bucketAuto",value:"$bucketAuto",label:"$bucketAuto",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.",comment:"/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n",snippet:"{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}"},{name:"$changeStream",value:"$changeStream",label:"$changeStream",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a Change Stream cursor for the collection.",comment:"/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n",snippet:"{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}"},{name:"$collStats",value:"$collStats",label:"$collStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Returns statistics regarding a collection or view.",comment:"/**\n * histograms: Optional latency histograms.\n * storageStats: Optional storage stats.\n */\n",snippet:"{\n latencyStats: {\n histograms: ${1:boolean}\n },\n storageStats: {${2:}},\n}"},{name:"$count",value:"$count",label:"$count",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns a count of the number of documents at this stage of the aggregation pipeline.",comment:"/**\n * Provide the field name for the count.\n */\n",snippet:"'${1:string}'"},{name:"$currentOp",value:"$currentOp",label:"$currentOp",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.",comment:"/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n",snippet:"{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}"},{name:"$densify",value:"$densify",label:"$densify",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.1.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level.",comment:"/**\n * field: The required field to densify.\n * partitionByFields: The set of fields that acts as a compound key to define each partition.\n * range: {\n * step: The amount to increment the field value in each document.\n * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.\n * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.\n * }\n */\n",snippet:"{\n field: ${1:string},\n partitionByFields: [${2:string}, ${3:string}, ...],\n range: {\n step: ${4:number},\n unit: ${5:string},\n bounds: [${6:lowerbound}, ${7:upperbound}, ...]\n }\n}"},{name:"$documents",value:"$documents",label:"$documents",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.9",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns literal documents from input values.",comment:"/**\n * expression: Any valid expression.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$facet",value:"$facet",label:"$facet",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Allows for multiple parellel aggregations to be specified.",comment:"/**\n * outputFieldN: The first output field.\n * stageN: The first aggregation stage.\n */\n",snippet:"{\n ${1:outputFieldN}: [ ${2:stageN}, ${3:...} ]\n}"},{name:"$fill",value:"$fill",label:"$fill",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.3.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Populates null and missing field values within documents.",comment:'/**\n * sortBy: Syntax is the same as $sort, required if "method" is used in at least one output spec otherwise optional\n * partitionBy: Optional, default is a single partition. Specification is the same as _id in $group (same as partitionBy in window functions).\n * partitionByFields: Optional, set of fields that acts as a compound key to define each partition.\n * output - Required, object for each field to fill in. For a single field, can be a single object.\n * output.<field> - A field to be filled with value, if missing or null in the current document.\n */\n',snippet:"{\n sortBy: ${1:sortSpec},\n partitionBy: ${2:expression},\n partitionByFields: [${3:string}, ${4:string}, ...],\n output: {\n field1: {value: ${5:expression}},\n field2: {method: ${6:string}},\n ...\n }\n}"},{name:"$geoNear",value:"$geoNear",label:"$geoNear",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns documents based on proximity to a geospatial point.",comment:"/**\n * near: The point to search near.\n * distanceField: The calculated distance.\n * maxDistance: The maximum distance, in meters, documents can be before being excluded from results.\n * query: Limits results that match the query\n * includeLocs: Optional. Labels and includes the point used to match the document.\n * num: Optional. The maximum number of documents to return.\n * spherical: Defaults to false. Specifies whether to use spherical geometry.\n */\n",snippet:"{\n near: { type: 'Point', coordinates: [ ${1:number}, ${2:number} ] },\n distanceField: '${3:string}',\n maxDistance: ${4:number},\n query: {${5}},\n includeLocs: '${6}',\n num: ${7:number},\n spherical: ${8:boolean}\n}"},{name:"$graphLookup",value:"$graphLookup",label:"$graphLookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a recursive search on a collection.",comment:"/**\n * from: The target collection.\n * startWith: Expression to start.\n * connectFromField: Field to connect.\n * connectToField: Field to connect to.\n * as: Name of the array field.\n * maxDepth: Optional max recursion depth.\n * depthField: Optional Name of the depth field.\n * restrictSearchWithMatch: Optional query.\n */\n",snippet:"{\n from: '${1:string}',\n startWith: ${2:expression},\n connectFromField: '${3:string}',\n connectToField: '${4:string}',\n as: '${5:string}',\n maxDepth: ${6:number},\n depthField: '${7:string}',\n restrictSearchWithMatch: {${8}}\n}"},{name:"$group",value:"$group",label:"$group",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups documents by a specified expression.",comment:"/**\n * _id: The id of the group.\n * fieldN: The first field name.\n */\n",snippet:"{\n _id: ${1:expression},\n ${2:fieldN}: {\n ${3:accumulatorN}: ${4:expressionN}\n }\n}"},{name:"$indexStats",value:"$indexStats",label:"$indexStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[],namespaces:[...r.ANY_NAMESPACE],description:"Returns statistics regarding the use of each index for the collection.",comment:"/**\n * No parameters.\n */\n",snippet:"{}"},{name:"$limit",value:"$limit",label:"$limit",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Limits the number of documents that flow into subsequent stages.",comment:"/**\n * Provide the number of documents to limit.\n */\n",snippet:"${1:number}"},{name:"$listLocalSessions",value:"$listLocalSessions",label:"$listLocalSessions",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Lists the sessions cached in memory by the mongod or mongos instance.",comment:"/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n",snippet:"{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}"},{name:"$lookup",value:"$lookup",label:"$lookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a join between two collections.",comment:"/**\n * from: The target collection.\n * localField: The local join field.\n * foreignField: The target join field.\n * as: The name for the results.\n * pipeline: Optional pipeline to run on the foreign collection.\n * let: Optional variables to use in the pipeline field stages.\n */\n",snippet:"{\n from: ${1:collection},\n localField: ${2:field},\n foreignField: ${3:field},\n as: ${4:result}\n}"},{name:"$match",value:"$match",label:"$match",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Filters the document stream to allow only matching documents to pass through to subsequent stages.",comment:"/**\n * query: The query in MQL.\n */\n",snippet:"{\n ${1:query}\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.1.11",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * into: The target collection.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: '${1:string}',\n on: '${2:string}',\n let: '${3:specification(s)}',\n whenMatched: '${4:string}',\n whenNotMatched: '${5:string}'\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * atlas: Location to write the documents from the aggregation pipeline.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: {\n atlas: {\n clusterName: '${1:atlasClusterName}',\n db: '${2:database}',\n coll: '${3:collection}',\n projectId: '${4:optionalAtlasProjectId}'\n }\n },\n on: '${5:identifier}',\n let: { ${6:specification(s)} },\n whenMatched: '${7:string}',\n whenNotMatched: '${8:string}'\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to a new or existing collection.",comment:"/**\n * Provide the name of the output database and collection.\n */\n",snippet:"{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to an Atlas cluster, S3 bucket, or Azure Blob Storage.",comment:"/**\n * Use any one of the following:\n * s3: Parameters to save the data to S3.\n * atlas: Parameters to save the data to Atlas. Example:\n * {\n * atlas: {\n * db: 'string',\n * coll: 'string',\n * projectId: 'string',\n * clusterName: 'string'\n * }\n * },\n * azure: Parameters to save the data to Azure. Example:\n * {\n * azure: {\n * serviceURL: 'string',\n * containerName: 'string',\n * region: 'string,\n * filename: 'string',\n * format: {\n * name: 'string',\n * maxFileSize: 'string',\n * maxRowGroupSize: 'string',\n * columnCompression: 'string'\n * },\n * errorMode: 'string'\n * }\n * }\n */\n",snippet:"{\n s3: {\n bucket: '${1:string}',\n region: '${2:string}',\n filename: '${3:string}',\n format: {\n name: '${4:string}',\n maxFileSize: '${5:bytes}',\n maxRowGroupSize: '${6:string}',\n columnCompression: '${7:string}'\n },\n errorMode: '${8:string}'\n }\n}"},{name:"$project",value:"$project",label:"$project",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value. Unlike $addFields, $project can also remove fields.",comment:"/**\n * specifications: The fields to\n * include or exclude.\n */\n",snippet:"{\n ${1:specification(s)}\n}"},{name:"$rankFusion",value:"$rankFusion",label:"$rankFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.0.14",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using reciprocal rank fusion to create hybrid search results.",comment:'/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be a Ranked Selection Pipeline operating on the same collection. Minimum of one pipeline.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information in {$meta: "scoreDetails"} for debugging and tuning.\n */\n',snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n }\n },\n combination: {\n weights: {\n ${6:searchPipeline}: ${7:number},\n ${8:vectorPipeline}: ${9:number}\n }\n },\n scoreDetails: ${10:false}\n}"},{name:"$redact",value:"$redact",label:"$redact",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.6.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Restricts the content for each document based on information stored in the documents themselves",comment:"/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$replaceRoot",value:"$replaceRoot",label:"$replaceRoot",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newRoot: ${1:replacementDocument}\n}"},{name:"$replaceWith",value:"$replaceWith",label:"$replaceWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newWith: ${1:replacementDocument}\n}"},{name:"$sample",value:"$sample",label:"$sample",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Randomly selects the specified number of documents from its input.",comment:"/**\n * size: The number of documents to sample.\n */\n",snippet:"{\n size: ${1:number}\n}"},{name:"$scoreFusion",value:"$scoreFusion",label:"$scoreFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.2.0",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using relative score fusion to create hybrid search results.",comment:"/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be operating on the same collection. Minimum of one pipeline.\n * input.normalization: Required. Normalizes the score to the range 0 to 1 before combining the results. Value can be none, sigmoid or minMaxScaler.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * combination.method: Optional. Specifies method for combining scores. Value can be avg or expression. Default is avg.\n * combination.expression: Optional. This is the custom expression that is used when combination.method is set to expression.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information.\n */\n",snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n },\n normalization: '${6:none|sigmoid|minMaxScaler}'\n },\n combination: {\n weights: {\n ${7:searchPipeline}: ${8:number},\n ${9:vectorPipeline}: ${10:number}\n },\n method: '${11:avg|expression}',\n expression: '${12:expression}'\n },\n scoreDetails: ${13:false}\n}"},{name:"$search",value:"$search",label:"$search",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.1.11",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s).",comment:"/**\n * index: The name of the Search index.\n * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. Use matchCriteria to match 'any' or 'all' query terms.\n * compound: Combines ops.\n * span: Find in text field regions.\n * exists: Test for presence of a field.\n * near: Find near number or date.\n * range: Find in numeric or date range.\n */\n",snippet:"{\n index: '${1:string}',\n text: {\n query: '${2:string}',\n path: '${3:string}',\n matchCriteria: '${4:any}',\n }\n}"},{name:"$searchMeta",value:"$searchMeta",label:"$searchMeta",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.4.9",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.",comment:"/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n",snippet:"{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}"},{name:"$set",value:"$set",label:"$set",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.",comment:"/**\n * field: The field name\n * expression: The expression.\n */\n",snippet:"{\n ${1:field}: ${2:expression}\n}"},{name:"$setWindowFields",value:"$setWindowFields",label:"$setWindowFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Capable of partitioning incoming data, and can apply one or more functions to defined windows within each partition.",comment:"/**\n * partitionBy: partitioning of data.\n * sortBy: fields to sort by.\n * output: {\n * path: {\n * function: The window function to compute over the given window.\n * window: {\n * documents: A number of documents before and after the current document.\n * range: A range of possible values around the value in the current document's sortBy field.\n * unit: Specifies the units for the window bounds.\n * }\n * }\n * }\n */\n",snippet:"{\n partitionBy: ${1:expression},\n sortBy: ${2:sortSpec},\n output: {\n ${3:path}: {\n ${4:function}: ${5:functionArgs},\n window: {\n documents: [${6:lowerbound}, ${7:upperbound}],\n range: [${8:lowerbound}, ${9:upperbound}],\n unit: ${10:string}\n }\n },\n ${11:path2}: ...\n }\n}"},{name:"$skip",value:"$skip",label:"$skip",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Skips a specified number of documents before advancing to the next stage.",comment:"/**\n * Provide the number of documents to skip.\n */\n",snippet:"${1:number}"},{name:"$sort",value:"$sort",label:"$sort",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Reorders the document stream by a specified sort key and direction.",comment:"/**\n * Provide any number of field/order pairs.\n */\n",snippet:"{\n ${1:field1}: ${2:sortOrder}\n}"},{name:"$sortByCount",value:"$sortByCount",label:"$sortByCount",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.",comment:"/**\n * expression: Grouping expression or string.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$unionWith",value:"$unionWith",label:"$unionWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Perform a union with a pipeline on another collection.",comment:"/**\n * coll: The collection name.\n * pipeline: The pipeline on the other collection.\n */\n",snippet:"{\n coll: '${1:coll}',\n pipeline: [${2:pipeline}]\n}"},{name:"$unset",value:"$unset",label:"$unset",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Excludes fields from the result document.",comment:"/**\n * Provide the field name to exclude.\n * To exclude multiple fields, pass the field names in an array.\n */\n",snippet:"'${1:string}'"},{name:"$unwind",value:"$unwind",label:"$unwind",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Outputs a new document for each element in a specified array. ",comment:"/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n",snippet:"{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}"},{name:"$vectorSearch",value:"$vectorSearch",label:"$vectorSearch",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS],meta:"stage",version:">=6.0.10 <7.0.0 || >=7.0.2",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a kNN search on embeddings in the specified field(s)",comment:"/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n * exact: Choose between false for ANN (Approximate Nearest Neighbor) and true for ENN (Exact Nearest Neighbor). Defaults to false. (Optional)\n */\n",snippet:"{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}},\n exact: ${8:boolean}\n}"}];t.STAGE_OPERATORS=s;const i=s.map((e=>e.name));t.STAGE_OPERATOR_NAMES=i;const o=s.filter((e=>e.outputStage));t.OUT_STAGES=o;const l=s.filter((e=>e.fullScan));t.FULL_SCAN_STAGES=l;const u=s.filter((e=>e.firstStage));t.REQUIRED_AS_FIRST_STAGE=u},80003:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CONVERSION_OPERATORS=void 0,t.CONVERSION_OPERATORS=[{name:"$convert",value:"$convert",score:1,meta:"conv",version:"3.7.2"},{name:"$ltrim",value:"$ltrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$rtrim",value:"$rtrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$toBool",value:"$toBool",score:1,meta:"conv",version:"3.7.2"},{name:"$toDate",value:"$toDate",score:1,meta:"conv",version:"3.7.2"},{name:"$toDecimal",value:"$toDecimal",score:1,meta:"conv",version:"3.7.2"},{name:"$toDouble",value:"$toDouble",score:1,meta:"conv",version:"3.7.2"},{name:"$toInt",value:"$toInt",score:1,meta:"conv",version:"3.7.2"},{name:"$toLong",value:"$toLong",score:1,meta:"conv",version:"3.7.2"},{name:"$toObjectId",value:"$toObjectId",score:1,meta:"conv",version:"3.7.2"},{name:"$toString",value:"$toString",score:1,meta:"conv",version:"3.7.2"},{name:"$trim",value:"$trim",score:1,meta:"accumulator",version:"3.7.2"}]},80184:(e,t,n)=>{const a=n(415),r=n(77693),s=n(66283),i=n(78900),o=n(59441),l=n(22156),u=n(35735),c=n(73746),p=n(9703),d=n(36719),m=n(32939),h=n(91716),f=n(20242),v=n(60501),g=n(71773),y=n(67994),$=n(85216),b=n(67360),_=n(10760),E=n(61607),x=n(91152),S=n(98746),A=n(78654),I=n(15844),w=n(80829),T=n(59382),N=n(75689),O=n(58387),k=n(38366),R=n(50363),C=n(32654),P=n(5081),L=n(96675),j=n(25546),M=n(92945),D=n(24472),Y=n(63876),F=n(94045),q=n(88345),U=n(21148),V=n(82913);e.exports={parse:o,valid:l,clean:u,inc:c,diff:p,major:d,minor:m,patch:h,prerelease:f,compare:v,rcompare:g,compareLoose:y,compareBuild:$,sort:b,rsort:_,gt:E,lt:x,eq:S,neq:A,gte:I,lte:w,cmp:T,coerce:N,Comparator:O,Range:k,satisfies:R,toComparators:C,maxSatisfying:P,minSatisfying:L,minVersion:j,validRange:M,outside:D,gtr:Y,ltr:F,intersects:q,simplifyRange:U,subset:V,SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},80196:(e,t,n)=>{const a=n(12196);e.exports=(e,t)=>{const n=a(e,null,!0),r=a(t,null,!0),s=n.compare(r);if(0===s)return null;const i=s>0,o=i?n:r,l=i?r:n,u=!!o.prerelease.length;if(l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(o))return l.minor&&!l.patch?"minor":"patch"}const c=u?"pre":"";return n.major!==r.major?c+"major":n.minor!==r.minor?c+"minor":n.patch!==r.patch?c+"patch":"prerelease"}},80321:(e,t,n)=>{const a=n(32674);e.exports=(e,t)=>a(e,t,!0)},80417:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ANY_NAMESPACE=t.ANY_COLLECTION_NAMESPACE=t.TIME_SERIES=t.VIEW=t.COLLECTION=t.DATABASE=void 0,t.DATABASE="db";const n="coll";t.COLLECTION=n;const a="view";t.VIEW=a;const r="timeseries";t.TIME_SERIES=r;const s=[n,a,r];t.ANY_COLLECTION_NAMESPACE=s;const i=["db",...s];t.ANY_NAMESPACE=i},80661:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const a=t.test(e),r=t.test(n);return a&&r&&(e=+e,n=+n),e===n?0:a&&!r?-1:r&&!a?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},80829:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>a(e,t,n)<=0},81379:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPE_ALIASES=void 0,t.BSON_TYPE_ALIASES=[{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"string",value:"string",label:"string",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"object",value:"object",label:"object",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"array",value:"array",label:"array",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"binData",value:"binData",label:"binData",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"objectId",value:"objectId",label:"objectId",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"bool",value:"bool",label:"bool",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"date",value:"date",label:"date",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"null",value:"null",label:"null",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"regex",value:"regex",label:"regex",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascript",value:"javascript",label:"javascript",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascriptWithScope",value:"javascriptWithScope",label:"javascriptWithScope",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"int",value:"int",label:"int",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"timestamp",value:"timestamp",label:"timestamp",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"long",value:"long",label:"long",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"decimal",value:"decimal",label:"decimal",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"minKey",value:"minKey",label:"minKey",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"maxKey",value:"maxKey",label:"maxKey",score:1,meta:"bson-type-aliases",version:"3.6.0"}]},81521:(e,t,n)=>{const a=n(56206);e.exports=(e,t)=>e.sort(((e,n)=>a(n,e,t)))},81602:(e,t,n)=>{var a=n(40811);e.exports=new a("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},82214:(e,t,n)=>{const a=n(17914);e.exports=(e,t)=>{const n=a(e,null,!0),r=a(t,null,!0),s=n.compare(r);if(0===s)return null;const i=s>0,o=i?n:r,l=i?r:n,u=!!o.prerelease.length;if(l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(o))return l.minor&&!l.patch?"minor":"patch"}const c=u?"pre":"";return n.major!==r.major?c+"major":n.minor!==r.minor?c+"minor":n.patch!==r.patch?c+"patch":"prerelease"}},82660:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_VARIABLES=void 0,t.SYSTEM_VARIABLES=[{name:"$$NOW",value:"$$NOW",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current datetime value. NOW returns the same value for all members of the deployment and remains the same throughout all stages of the aggregation pipeline."},{name:"$$CLUSTER_TIME",value:"$$CLUSTER_TIME",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current timestamp value. CLUSTER_TIME is only available on replica sets and sharded clusters. CLUSTER_TIME returns the same value for all members of the deployment and remains the same throughout all stages of the pipeline."},{name:"$$ROOT",value:"$$ROOT",score:1,meta:"variable:system",version:"2.4.0",description:"References the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage."},{name:"$$CURRENT",value:"$$CURRENT",score:1,meta:"variable:system",version:"2.4.0",description:"References the start of the field path being processed in the aggregation pipeline stage. Unless documented otherwise, all stages start with CURRENT the same as ROOT. CURRENT is modifiable. However, since `$<field>` is equivalent to `$$CURRENT.<field>`, rebinding CURRENT changes the meaning of `$` accesses."},{name:"$$REMOVE",value:"$$REMOVE",score:1,meta:"variable:system",version:"3.6.0",description:"A variable which evaluates to the missing value. Allows for the conditional exclusion of fields. In a `$project`, a field set to the variable REMOVE is excluded from the output."},{name:"$$DESCEND",value:"$$DESCEND",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$PRUNE",value:"$$PRUNE",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$KEEP",value:"$$KEEP",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$SEARCH_META",value:"$$SEARCH_META",score:1,meta:"variable:system",version:"5.0.0",description:"A variable that stores the metadata results of an Atlas Search query. In all supported aggregation pipeline stages, a field set to the variable SEARCH_META returns the metadata results for the query. For an example of its usage, see Atlas Search facet and count."},{name:"$$USER_ROLES",value:"$$USER_ROLES",score:1,meta:"variable:system",version:"7.0.0",description:"A variable that stores the role names of the authenticated user running the command."}]},82663:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CONVERSION_OPERATORS=void 0,t.CONVERSION_OPERATORS=[{name:"$convert",value:"$convert",score:1,meta:"conv",version:"3.7.2"},{name:"$ltrim",value:"$ltrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$rtrim",value:"$rtrim",score:1,meta:"accumulator",version:"3.7.2"},{name:"$toBool",value:"$toBool",score:1,meta:"conv",version:"3.7.2"},{name:"$toDate",value:"$toDate",score:1,meta:"conv",version:"3.7.2"},{name:"$toDecimal",value:"$toDecimal",score:1,meta:"conv",version:"3.7.2"},{name:"$toDouble",value:"$toDouble",score:1,meta:"conv",version:"3.7.2"},{name:"$toInt",value:"$toInt",score:1,meta:"conv",version:"3.7.2"},{name:"$toLong",value:"$toLong",score:1,meta:"conv",version:"3.7.2"},{name:"$toObjectId",value:"$toObjectId",score:1,meta:"conv",version:"3.7.2"},{name:"$toString",value:"$toString",score:1,meta:"conv",version:"3.7.2"},{name:"$trim",value:"$trim",score:1,meta:"accumulator",version:"3.7.2"}]},82913:(e,t,n)=>{const a=n(38366),r=n(58387),{ANY:s}=r,i=n(50363),o=n(60501),l=[new r(">=0.0.0-0")],u=[new r(">=0.0.0")],c=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=n.includePrerelease?l:u}if(1===t.length&&t[0].semver===s){if(n.includePrerelease)return!0;t=u}const a=new Set;let r,c,m,h,f,v,g;for(const t of e)">"===t.operator||">="===t.operator?r=p(r,t,n):"<"===t.operator||"<="===t.operator?c=d(c,t,n):a.add(t.semver);if(a.size>1)return null;if(r&&c){if(m=o(r.semver,c.semver,n),m>0)return null;if(0===m&&(">="!==r.operator||"<="!==c.operator))return null}for(const e of a){if(r&&!i(e,String(r),n))return null;if(c&&!i(e,String(c),n))return null;for(const a of t)if(!i(e,String(a),n))return!1;return!0}let y=!(!c||n.includePrerelease||!c.semver.prerelease.length)&&c.semver,$=!(!r||n.includePrerelease||!r.semver.prerelease.length)&&r.semver;y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,v=v||"<"===e.operator||"<="===e.operator,r)if($&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===$.major&&e.semver.minor===$.minor&&e.semver.patch===$.patch&&($=!1),">"===e.operator||">="===e.operator){if(h=p(r,e,n),h===e&&h!==r)return!1}else if(">="===r.operator&&!i(r.semver,String(e),n))return!1;if(c)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(f=d(c,e,n),f===e&&f!==c)return!1}else if("<="===c.operator&&!i(c.semver,String(e),n))return!1;if(!e.operator&&(c||r)&&0!==m)return!1}return!(r&&v&&!c&&0!==m||c&&g&&!r&&0!==m||$||y)},p=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a>0?e:a<0||">"===t.operator&&">="===e.operator?t:e},d=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a<0?e:a>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new a(e,n),t=new a(t,n);let r=!1;e:for(const a of e.set){for(const e of t.set){const t=c(a,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},82981:(e,t,n)=>{n.d(t,{ry:()=>ke});var a=n(45890),r=n(12240),s=n(86224),i=n(42937),o=n(9606).URL,l=s.Ik({error:s.Ik({message:s.Yj(),type:s.Yj().nullish(),param:s.bz().nullish(),code:s.KC([s.Yj(),s.ai()]).nullish()})}),u=(0,a.sl)({errorSchema:l,errorToMessage:e=>e.error.message});function c(e){const t=e.startsWith("o3")||e.startsWith("o4-mini")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-chat"),n=e.startsWith("gpt-4")||e.startsWith("gpt-5-mini")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-nano")&&!e.startsWith("gpt-5-chat")||e.startsWith("o3")||e.startsWith("o4-mini"),a=!(e.startsWith("gpt-3")||e.startsWith("gpt-4")||e.startsWith("chatgpt-4o")||e.startsWith("gpt-5-chat"));return{supportsFlexProcessing:t,supportsPriorityProcessing:n,isReasoningModel:a,systemMessageMode:a?"developer":"system",supportsNonReasoningParameters:e.startsWith("gpt-5.1")}}function p(e){var t,n,a,r,s,i;if(null==e)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};const o=null!=(t=e.prompt_tokens)?t:0,l=null!=(n=e.completion_tokens)?n:0,u=null!=(r=null==(a=e.prompt_tokens_details)?void 0:a.cached_tokens)?r:0,c=null!=(i=null==(s=e.completion_tokens_details)?void 0:s.reasoning_tokens)?i:0;return{inputTokens:{total:o,noCache:o-u,cacheRead:u,cacheWrite:void 0},outputTokens:{total:l,text:l-c,reasoning:c},raw:e}}function d({id:e,model:t,created:n}){return{id:null!=e?e:void 0,modelId:null!=t?t:void 0,timestamp:n?new Date(1e3*n):void 0}}function m(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var h=(0,a.ID)((()=>(0,a.jN)(s.Ik({id:s.Yj().nullish(),created:s.ai().nullish(),model:s.Yj().nullish(),choices:s.YO(s.Ik({message:s.Ik({role:s.eu("assistant").nullish(),content:s.Yj().nullish(),tool_calls:s.YO(s.Ik({id:s.Yj().nullish(),type:s.eu("function"),function:s.Ik({name:s.Yj(),arguments:s.Yj()})})).nullish(),annotations:s.YO(s.Ik({type:s.eu("url_citation"),url_citation:s.Ik({start_index:s.ai(),end_index:s.ai(),url:s.Yj(),title:s.Yj()})})).nullish()}),index:s.ai(),logprobs:s.Ik({content:s.YO(s.Ik({token:s.Yj(),logprob:s.ai(),top_logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai()}))})).nullish()}).nullish(),finish_reason:s.Yj().nullish()})),usage:s.Ik({prompt_tokens:s.ai().nullish(),completion_tokens:s.ai().nullish(),total_tokens:s.ai().nullish(),prompt_tokens_details:s.Ik({cached_tokens:s.ai().nullish()}).nullish(),completion_tokens_details:s.Ik({reasoning_tokens:s.ai().nullish(),accepted_prediction_tokens:s.ai().nullish(),rejected_prediction_tokens:s.ai().nullish()}).nullish()}).nullish()})))),f=(0,a.ID)((()=>(0,a.jN)(s.KC([s.Ik({id:s.Yj().nullish(),created:s.ai().nullish(),model:s.Yj().nullish(),choices:s.YO(s.Ik({delta:s.Ik({role:s.k5(["assistant"]).nullish(),content:s.Yj().nullish(),tool_calls:s.YO(s.Ik({index:s.ai(),id:s.Yj().nullish(),type:s.eu("function").nullish(),function:s.Ik({name:s.Yj().nullish(),arguments:s.Yj().nullish()})})).nullish(),annotations:s.YO(s.Ik({type:s.eu("url_citation"),url_citation:s.Ik({start_index:s.ai(),end_index:s.ai(),url:s.Yj(),title:s.Yj()})})).nullish()}).nullish(),logprobs:s.Ik({content:s.YO(s.Ik({token:s.Yj(),logprob:s.ai(),top_logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai()}))})).nullish()}).nullish(),finish_reason:s.Yj().nullish(),index:s.ai()})),usage:s.Ik({prompt_tokens:s.ai().nullish(),completion_tokens:s.ai().nullish(),total_tokens:s.ai().nullish(),prompt_tokens_details:s.Ik({cached_tokens:s.ai().nullish()}).nullish(),completion_tokens_details:s.Ik({reasoning_tokens:s.ai().nullish(),accepted_prediction_tokens:s.ai().nullish(),rejected_prediction_tokens:s.ai().nullish()}).nullish()}).nullish()}),l])))),v=(0,a.ID)((()=>(0,a.jN)(s.Ik({logitBias:s.g1(i.qG(s.rS,undefined),s.ai()).optional(),logprobs:s.KC([s.zM(),s.ai()]).optional(),parallelToolCalls:s.zM().optional(),user:s.Yj().optional(),reasoningEffort:s.k5(["none","minimal","low","medium","high","xhigh"]).optional(),maxCompletionTokens:s.ai().optional(),store:s.zM().optional(),metadata:s.g1(s.Yj().max(64),s.Yj().max(512)).optional(),prediction:s.g1(s.Yj(),s.bz()).optional(),serviceTier:s.k5(["auto","flex","priority","default"]).optional(),strictJsonSchema:s.zM().optional(),textVerbosity:s.k5(["low","medium","high"]).optional(),promptCacheKey:s.Yj().optional(),promptCacheRetention:s.k5(["in_memory","24h"]).optional(),safetyIdentifier:s.Yj().optional()})))),g=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=e,this.config=t}get provider(){return this.config.provider}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:s,topK:i,frequencyPenalty:l,presencePenalty:u,stopSequences:p,responseFormat:d,seed:m,tools:h,toolChoice:f,providerOptions:g}){var y,$,b;const _=[],E=null!=(y=await(0,a.xI)({provider:"openai",providerOptions:g,schema:v}))?y:{},x=c(this.modelId);null!=i&&_.push({type:"unsupported",feature:"topK"});const{messages:S,warnings:A}=function({prompt:e,systemMessageMode:t="system"}){var n;const s=[],i=[];for(const{role:l,content:u}of e)switch(l){case"system":switch(t){case"system":s.push({role:"system",content:u});break;case"developer":s.push({role:"developer",content:u});break;case"remove":i.push({type:"other",message:"system messages are removed for this model"});break;default:throw new Error(`Unsupported system message mode: ${t}`)}break;case"user":if(1===u.length&&"text"===u[0].type){s.push({role:"user",content:u[0].text});break}s.push({role:"user",content:u.map(((e,t)=>{var n,s,i;switch(e.type){case"text":return{type:"text",text:e.text};case"file":if(e.mediaType.startsWith("image/")){const t="image/*"===e.mediaType?"image/jpeg":e.mediaType;return{type:"image_url",image_url:{url:e.data instanceof o?e.data.toString():`data:${t};base64,${(0,a.ej)(e.data)}`,detail:null==(s=null==(n=e.providerOptions)?void 0:n.openai)?void 0:s.imageDetail}}}if(!e.mediaType.startsWith("audio/")){if("application/pdf"===e.mediaType){if(e.data instanceof o)throw new r.b8({functionality:"PDF file parts with URLs"});return{type:"file",file:"string"==typeof e.data&&e.data.startsWith("file-")?{file_id:e.data}:{filename:null!=(i=e.filename)?i:`part-${t}.pdf`,file_data:`data:application/pdf;base64,${(0,a.ej)(e.data)}`}}}throw new r.b8({functionality:`file part media type ${e.mediaType}`})}if(e.data instanceof o)throw new r.b8({functionality:"audio file parts with URLs"});switch(e.mediaType){case"audio/wav":return{type:"input_audio",input_audio:{data:(0,a.ej)(e.data),format:"wav"}};case"audio/mp3":case"audio/mpeg":return{type:"input_audio",input_audio:{data:(0,a.ej)(e.data),format:"mp3"}};default:throw new r.b8({functionality:`audio content parts with media type ${e.mediaType}`})}}}))});break;case"assistant":{let e="";const t=[];for(const n of u)switch(n.type){case"text":e+=n.text;break;case"tool-call":t.push({id:n.toolCallId,type:"function",function:{name:n.toolName,arguments:JSON.stringify(n.input)}})}s.push({role:"assistant",content:e,tool_calls:t.length>0?t:void 0});break}case"tool":for(const e of u){const t=e.output;let a;switch(t.type){case"text":case"error-text":a=t.value;break;case"execution-denied":a=null!=(n=t.reason)?n:"Tool execution denied.";break;case"content":case"json":case"error-json":a=JSON.stringify(t.value)}s.push({role:"tool",tool_call_id:e.toolCallId,content:a})}break;default:throw new Error(`Unsupported role: ${l}`)}return{messages:s,warnings:i}}({prompt:e,systemMessageMode:x.systemMessageMode});_.push(...A);const I=null==($=E.strictJsonSchema)||$,w={model:this.modelId,logit_bias:E.logitBias,logprobs:!0===E.logprobs||"number"==typeof E.logprobs||void 0,top_logprobs:"number"==typeof E.logprobs?E.logprobs:"boolean"==typeof E.logprobs&&E.logprobs?0:void 0,user:E.user,parallel_tool_calls:E.parallelToolCalls,max_tokens:t,temperature:n,top_p:s,frequency_penalty:l,presence_penalty:u,response_format:"json"===(null==d?void 0:d.type)?null!=d.schema?{type:"json_schema",json_schema:{schema:d.schema,strict:I,name:null!=(b=d.name)?b:"response",description:d.description}}:{type:"json_object"}:void 0,stop:p,seed:m,verbosity:E.textVerbosity,max_completion_tokens:E.maxCompletionTokens,store:E.store,metadata:E.metadata,prediction:E.prediction,reasoning_effort:E.reasoningEffort,service_tier:E.serviceTier,prompt_cache_key:E.promptCacheKey,prompt_cache_retention:E.promptCacheRetention,safety_identifier:E.safetyIdentifier,messages:S};x.isReasoningModel?("none"===E.reasoningEffort&&x.supportsNonReasoningParameters||(null!=w.temperature&&(w.temperature=void 0,_.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),null!=w.top_p&&(w.top_p=void 0,_.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"})),null!=w.logprobs&&(w.logprobs=void 0,_.push({type:"other",message:"logprobs is not supported for reasoning models"}))),null!=w.frequency_penalty&&(w.frequency_penalty=void 0,_.push({type:"unsupported",feature:"frequencyPenalty",details:"frequencyPenalty is not supported for reasoning models"})),null!=w.presence_penalty&&(w.presence_penalty=void 0,_.push({type:"unsupported",feature:"presencePenalty",details:"presencePenalty is not supported for reasoning models"})),null!=w.logit_bias&&(w.logit_bias=void 0,_.push({type:"other",message:"logitBias is not supported for reasoning models"})),null!=w.top_logprobs&&(w.top_logprobs=void 0,_.push({type:"other",message:"topLogprobs is not supported for reasoning models"})),null!=w.max_tokens&&(null==w.max_completion_tokens&&(w.max_completion_tokens=w.max_tokens),w.max_tokens=void 0)):(this.modelId.startsWith("gpt-4o-search-preview")||this.modelId.startsWith("gpt-4o-mini-search-preview"))&&null!=w.temperature&&(w.temperature=void 0,_.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for the search preview models and has been removed."})),"flex"!==E.serviceTier||x.supportsFlexProcessing||(_.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),w.service_tier=void 0),"priority"!==E.serviceTier||x.supportsPriorityProcessing||(_.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),w.service_tier=void 0);const{tools:T,toolChoice:N,toolWarnings:O}=function({tools:e,toolChoice:t}){const n=[];if(null==(e=(null==e?void 0:e.length)?e:void 0))return{tools:void 0,toolChoice:void 0,toolWarnings:n};const a=[];for(const t of e)"function"===t.type?a.push({type:"function",function:{name:t.name,description:t.description,parameters:t.inputSchema,...null!=t.strict?{strict:t.strict}:{}}}):n.push({type:"unsupported",feature:`tool type: ${t.type}`});if(null==t)return{tools:a,toolChoice:void 0,toolWarnings:n};const s=t.type;switch(s){case"auto":case"none":case"required":return{tools:a,toolChoice:s,toolWarnings:n};case"tool":return{tools:a,toolChoice:{type:"function",function:{name:t.toolName}},toolWarnings:n};default:{const e=s;throw new r.b8({functionality:`tool choice type: ${e}`})}}}({tools:h,toolChoice:f});return{args:{...w,tools:T,tool_choice:N},warnings:[..._,...O]}}async doGenerate(e){var t,n,r,s,i,o;const{args:l,warnings:c}=await this.getArgs(e),{responseHeaders:f,value:v,rawValue:g}=await(0,a.GU)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:l,failedResponseHandler:u,successfulResponseHandler:(0,a.cV)(h),abortSignal:e.abortSignal,fetch:this.config.fetch}),y=v.choices[0],$=[],b=y.message.content;null!=b&&b.length>0&&$.push({type:"text",text:b});for(const e of null!=(t=y.message.tool_calls)?t:[])$.push({type:"tool-call",toolCallId:null!=(n=e.id)?n:(0,a.$C)(),toolName:e.function.name,input:e.function.arguments});for(const e of null!=(r=y.message.annotations)?r:[])$.push({type:"source",sourceType:"url",id:(0,a.$C)(),url:e.url_citation.url,title:e.url_citation.title});const _=null==(s=v.usage)?void 0:s.completion_tokens_details,E=(null==(i=v.usage)||i.prompt_tokens_details,{openai:{}});return null!=(null==_?void 0:_.accepted_prediction_tokens)&&(E.openai.acceptedPredictionTokens=null==_?void 0:_.accepted_prediction_tokens),null!=(null==_?void 0:_.rejected_prediction_tokens)&&(E.openai.rejectedPredictionTokens=null==_?void 0:_.rejected_prediction_tokens),null!=(null==(o=y.logprobs)?void 0:o.content)&&(E.openai.logprobs=y.logprobs.content),{content:$,finishReason:m(y.finish_reason),usage:p(v.usage),request:{body:l},response:{...d(v),headers:f,body:g},warnings:c,providerMetadata:E}}async doStream(e){const{args:t,warnings:n}=await this.getArgs(e),s={...t,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:i,value:o}=await(0,a.GU)({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:s,failedResponseHandler:u,successfulResponseHandler:(0,a.Ds)(f),abortSignal:e.abortSignal,fetch:this.config.fetch}),l=[];let c,h="unknown",v=!1,g=!1;const y={openai:{}};return{stream:o.pipeThrough(new TransformStream({start(e){e.enqueue({type:"stream-start",warnings:n})},transform(t,n){var s,i,o,u,p,f,$,b,_,E,x,S,A,I,w,T,N;if(e.includeRawChunks&&n.enqueue({type:"raw",rawValue:t.rawValue}),!t.success)return h="error",void n.enqueue({type:"error",error:t.error});const O=t.value;if("error"in O)return h="error",void n.enqueue({type:"error",error:O.error});if(!v){const e=d(O);Object.values(e).some(Boolean)&&(v=!0,n.enqueue({type:"response-metadata",...d(O)}))}null!=O.usage&&(c=O.usage,null!=(null==(s=O.usage.completion_tokens_details)?void 0:s.accepted_prediction_tokens)&&(y.openai.acceptedPredictionTokens=null==(i=O.usage.completion_tokens_details)?void 0:i.accepted_prediction_tokens),null!=(null==(o=O.usage.completion_tokens_details)?void 0:o.rejected_prediction_tokens)&&(y.openai.rejectedPredictionTokens=null==(u=O.usage.completion_tokens_details)?void 0:u.rejected_prediction_tokens));const k=O.choices[0];if(null!=(null==k?void 0:k.finish_reason)&&(h=m(k.finish_reason)),null!=(null==(p=null==k?void 0:k.logprobs)?void 0:p.content)&&(y.openai.logprobs=k.logprobs.content),null==(null==k?void 0:k.delta))return;const R=k.delta;if(null!=R.content&&(g||(n.enqueue({type:"text-start",id:"0"}),g=!0),n.enqueue({type:"text-delta",id:"0",delta:R.content})),null!=R.tool_calls)for(const e of R.tool_calls){const t=e.index;if(null==l[t]){if("function"!==e.type)throw new r.xn({data:e,message:"Expected 'function' type."});if(null==e.id)throw new r.xn({data:e,message:"Expected 'id' to be a string."});if(null==(null==(f=e.function)?void 0:f.name))throw new r.xn({data:e,message:"Expected 'function.name' to be a string."});n.enqueue({type:"tool-input-start",id:e.id,toolName:e.function.name}),l[t]={id:e.id,type:"function",function:{name:e.function.name,arguments:null!=($=e.function.arguments)?$:""},hasFinished:!1};const s=l[t];null!=(null==(b=s.function)?void 0:b.name)&&null!=(null==(_=s.function)?void 0:_.arguments)&&(s.function.arguments.length>0&&n.enqueue({type:"tool-input-delta",id:s.id,delta:s.function.arguments}),(0,a.v0)(s.function.arguments)&&(n.enqueue({type:"tool-input-end",id:s.id}),n.enqueue({type:"tool-call",toolCallId:null!=(E=s.id)?E:(0,a.$C)(),toolName:s.function.name,input:s.function.arguments}),s.hasFinished=!0));continue}const s=l[t];s.hasFinished||(null!=(null==(x=e.function)?void 0:x.arguments)&&(s.function.arguments+=null!=(A=null==(S=e.function)?void 0:S.arguments)?A:""),n.enqueue({type:"tool-input-delta",id:s.id,delta:null!=(I=e.function.arguments)?I:""}),null!=(null==(w=s.function)?void 0:w.name)&&null!=(null==(T=s.function)?void 0:T.arguments)&&(0,a.v0)(s.function.arguments)&&(n.enqueue({type:"tool-input-end",id:s.id}),n.enqueue({type:"tool-call",toolCallId:null!=(N=s.id)?N:(0,a.$C)(),toolName:s.function.name,input:s.function.arguments}),s.hasFinished=!0))}if(null!=R.annotations)for(const e of R.annotations)n.enqueue({type:"source",sourceType:"url",id:(0,a.$C)(),url:e.url_citation.url,title:e.url_citation.title})},flush(e){g&&e.enqueue({type:"text-end",id:"0"}),e.enqueue({type:"finish",finishReason:h,usage:p(c),...null!=y?{providerMetadata:y}:{}})}})),request:{body:s},response:{headers:i}}}};function y(e){var t,n,a,r;if(null==e)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};const s=null!=(t=e.prompt_tokens)?t:0,i=null!=(n=e.completion_tokens)?n:0;return{inputTokens:{total:null!=(a=e.prompt_tokens)?a:void 0,noCache:s,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:null!=(r=e.completion_tokens)?r:void 0,text:i,reasoning:void 0},raw:e}}function $({id:e,model:t,created:n}){return{id:null!=e?e:void 0,modelId:null!=t?t:void 0,timestamp:null!=n?new Date(1e3*n):void 0}}function b(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var _=(0,a.ID)((()=>(0,a.jN)(s.Ik({id:s.Yj().nullish(),created:s.ai().nullish(),model:s.Yj().nullish(),choices:s.YO(s.Ik({text:s.Yj(),finish_reason:s.Yj(),logprobs:s.Ik({tokens:s.YO(s.Yj()),token_logprobs:s.YO(s.ai()),top_logprobs:s.YO(s.g1(s.Yj(),s.ai())).nullish()}).nullish()})),usage:s.Ik({prompt_tokens:s.ai(),completion_tokens:s.ai(),total_tokens:s.ai()}).nullish()})))),E=(0,a.ID)((()=>(0,a.jN)(s.KC([s.Ik({id:s.Yj().nullish(),created:s.ai().nullish(),model:s.Yj().nullish(),choices:s.YO(s.Ik({text:s.Yj(),finish_reason:s.Yj().nullish(),index:s.ai(),logprobs:s.Ik({tokens:s.YO(s.Yj()),token_logprobs:s.YO(s.ai()),top_logprobs:s.YO(s.g1(s.Yj(),s.ai())).nullish()}).nullish()})),usage:s.Ik({prompt_tokens:s.ai(),completion_tokens:s.ai(),total_tokens:s.ai()}).nullish()}),l])))),x=(0,a.ID)((()=>(0,a.jN)(s.Ik({echo:s.zM().optional(),logitBias:s.g1(s.Yj(),s.ai()).optional(),suffix:s.Yj().optional(),user:s.Yj().optional(),logprobs:s.KC([s.zM(),s.ai()]).optional()})))),S=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={},this.modelId=e,this.config=t}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get provider(){return this.config.provider}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:s,topK:i,frequencyPenalty:o,presencePenalty:l,stopSequences:u,responseFormat:c,tools:p,toolChoice:d,seed:m,providerOptions:h}){const f=[],v={...await(0,a.xI)({provider:"openai",providerOptions:h,schema:x}),...await(0,a.xI)({provider:this.providerOptionsName,providerOptions:h,schema:x})};null!=i&&f.push({type:"unsupported",feature:"topK"}),(null==p?void 0:p.length)&&f.push({type:"unsupported",feature:"tools"}),null!=d&&f.push({type:"unsupported",feature:"toolChoice"}),null!=c&&"text"!==c.type&&f.push({type:"unsupported",feature:"responseFormat",details:"JSON response format is not supported."});const{prompt:g,stopSequences:y}=function({prompt:e,user:t="user",assistant:n="assistant"}){let a="";"system"===e[0].role&&(a+=`${e[0].content}\n\n`,e=e.slice(1));for(const{role:s,content:i}of e)switch(s){case"system":throw new r.M3({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":a+=`${t}:\n${i.map((e=>{if("text"===e.type)return e.text})).filter(Boolean).join("")}\n\n`;break;case"assistant":a+=`${n}:\n${i.map((e=>{switch(e.type){case"text":return e.text;case"tool-call":throw new r.b8({functionality:"tool-call messages"})}})).join("")}\n\n`;break;case"tool":throw new r.b8({functionality:"tool messages"});default:throw new Error(`Unsupported role: ${s}`)}return a+=`${n}:\n`,{prompt:a,stopSequences:[`\n${t}:`]}}({prompt:e}),$=[...null!=y?y:[],...null!=u?u:[]];return{args:{model:this.modelId,echo:v.echo,logit_bias:v.logitBias,logprobs:!0===(null==v?void 0:v.logprobs)?0:!1===(null==v?void 0:v.logprobs)||null==v?void 0:v.logprobs,suffix:v.suffix,user:v.user,max_tokens:t,temperature:n,top_p:s,frequency_penalty:o,presence_penalty:l,seed:m,prompt:g,stop:$.length>0?$:void 0},warnings:f}}async doGenerate(e){const{args:t,warnings:n}=await this.getArgs(e),{responseHeaders:r,value:s,rawValue:i}=await(0,a.GU)({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:t,failedResponseHandler:u,successfulResponseHandler:(0,a.cV)(_),abortSignal:e.abortSignal,fetch:this.config.fetch}),o=s.choices[0],l={openai:{}};return null!=o.logprobs&&(l.openai.logprobs=o.logprobs),{content:[{type:"text",text:o.text}],usage:y(s.usage),finishReason:b(o.finish_reason),request:{body:t},response:{...$(s),headers:r,body:i},providerMetadata:l,warnings:n}}async doStream(e){const{args:t,warnings:n}=await this.getArgs(e),r={...t,stream:!0,stream_options:{include_usage:!0}},{responseHeaders:s,value:i}=await(0,a.GU)({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:r,failedResponseHandler:u,successfulResponseHandler:(0,a.Ds)(E),abortSignal:e.abortSignal,fetch:this.config.fetch});let o="unknown";const l={openai:{}};let c,p=!0;return{stream:i.pipeThrough(new TransformStream({start(e){e.enqueue({type:"stream-start",warnings:n})},transform(t,n){if(e.includeRawChunks&&n.enqueue({type:"raw",rawValue:t.rawValue}),!t.success)return o="error",void n.enqueue({type:"error",error:t.error});const a=t.value;if("error"in a)return o="error",void n.enqueue({type:"error",error:a.error});p&&(p=!1,n.enqueue({type:"response-metadata",...$(a)}),n.enqueue({type:"text-start",id:"0"})),null!=a.usage&&(c=a.usage);const r=a.choices[0];null!=(null==r?void 0:r.finish_reason)&&(o=b(r.finish_reason)),null!=(null==r?void 0:r.logprobs)&&(l.openai.logprobs=r.logprobs),null!=(null==r?void 0:r.text)&&r.text.length>0&&n.enqueue({type:"text-delta",id:"0",delta:r.text})},flush(e){p||e.enqueue({type:"text-end",id:"0"}),e.enqueue({type:"finish",finishReason:o,providerMetadata:l,usage:y(c)})}})),request:{body:r},response:{headers:s}}}},A=(0,a.ID)((()=>(0,a.jN)(s.Ik({dimensions:s.ai().optional(),user:s.Yj().optional()})))),I=(0,a.ID)((()=>(0,a.jN)(s.Ik({data:s.YO(s.Ik({embedding:s.YO(s.ai())})),usage:s.Ik({prompt_tokens:s.ai()}).nullish()})))),w=class{constructor(e,t){this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0,this.modelId=e,this.config=t}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:s}){var i;if(e.length>this.maxEmbeddingsPerCall)throw new r.Ch({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});const o=null!=(i=await(0,a.xI)({provider:"openai",providerOptions:s,schema:A}))?i:{},{responseHeaders:l,value:c,rawValue:p}=await(0,a.GU)({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),t),body:{model:this.modelId,input:e,encoding_format:"float",dimensions:o.dimensions,user:o.user},failedResponseHandler:u,successfulResponseHandler:(0,a.cV)(I),abortSignal:n,fetch:this.config.fetch});return{warnings:[],embeddings:c.data.map((e=>e.embedding)),usage:c.usage?{tokens:c.usage.prompt_tokens}:void 0,response:{headers:l,body:p}}}},T=(0,a.ID)((()=>(0,a.jN)(s.Ik({created:s.ai().nullish(),data:s.YO(s.Ik({b64_json:s.Yj(),revised_prompt:s.Yj().nullish()})),background:s.Yj().nullish(),output_format:s.Yj().nullish(),size:s.Yj().nullish(),quality:s.Yj().nullish(),usage:s.Ik({input_tokens:s.ai().nullish(),output_tokens:s.ai().nullish(),total_tokens:s.ai().nullish(),input_tokens_details:s.Ik({image_tokens:s.ai().nullish(),text_tokens:s.ai().nullish()}).nullish()}).nullish()})))),N={"dall-e-3":1,"dall-e-2":10,"gpt-image-1":10,"gpt-image-1-mini":10},O=new Set(["gpt-image-1","gpt-image-1-mini"]),k=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get maxImagesPerCall(){var e;return null!=(e=N[this.modelId])?e:1}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:n,aspectRatio:r,seed:s,providerOptions:i,headers:o,abortSignal:l}){var c,p,d,m,h,f,v;const g=[];null!=r&&g.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."}),null!=s&&g.push({type:"unsupported",feature:"seed"});const y=null!=(d=null==(p=null==(c=this.config._internal)?void 0:c.currentDate)?void 0:p.call(c))?d:new Date,{value:$,responseHeaders:b}=await(0,a.GU)({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),o),body:{model:this.modelId,prompt:e,n:t,size:n,...null!=(m=i.openai)?m:{},...O.has(this.modelId)?{}:{response_format:"b64_json"}},failedResponseHandler:u,successfulResponseHandler:(0,a.cV)(T),abortSignal:l,fetch:this.config.fetch});return{images:$.data.map((e=>e.b64_json)),warnings:g,usage:null!=$.usage?{inputTokens:null!=(h=$.usage.input_tokens)?h:void 0,outputTokens:null!=(f=$.usage.output_tokens)?f:void 0,totalTokens:null!=(v=$.usage.total_tokens)?v:void 0}:void 0,response:{timestamp:y,modelId:this.modelId,headers:b},providerMetadata:{openai:{images:$.data.map((e=>{var t,n,a,r,s;return{...e.revised_prompt?{revisedPrompt:e.revised_prompt}:{},created:null!=(t=$.created)?t:void 0,size:null!=(n=$.size)?n:void 0,quality:null!=(a=$.quality)?a:void 0,background:null!=(r=$.background)?r:void 0,outputFormat:null!=(s=$.output_format)?s:void 0}}))}}}}},R=(0,a.ID)((()=>(0,a.jN)(s.Ik({callId:s.Yj(),operation:s.gM("type",[s.Ik({type:s.eu("create_file"),path:s.Yj(),diff:s.Yj()}),s.Ik({type:s.eu("delete_file"),path:s.Yj()}),s.Ik({type:s.eu("update_file"),path:s.Yj(),diff:s.Yj()})])})))),C=(0,a.ID)((()=>(0,a.jN)(s.Ik({status:s.k5(["completed","failed"]),output:s.Yj().optional()})))),P=((0,a.ID)((()=>(0,a.jN)(s.Ik({})))),(0,a.wA)({id:"openai.apply_patch",inputSchema:R,outputSchema:C})),L=(0,a.ID)((()=>(0,a.jN)(s.Ik({code:s.Yj().nullish(),containerId:s.Yj()})))),j=(0,a.ID)((()=>(0,a.jN)(s.Ik({outputs:s.YO(s.gM("type",[s.Ik({type:s.eu("logs"),logs:s.Yj()}),s.Ik({type:s.eu("image"),url:s.Yj()})])).nullish()})))),M=(0,a.ID)((()=>(0,a.jN)(s.Ik({container:s.KC([s.Yj(),s.Ik({fileIds:s.YO(s.Yj()).optional()})]).optional()})))),D=(0,a.wA)({id:"openai.code_interpreter",inputSchema:L,outputSchema:j}),Y=s.Ik({key:s.Yj(),type:s.k5(["eq","ne","gt","gte","lt","lte","in","nin"]),value:s.KC([s.Yj(),s.ai(),s.zM(),s.YO(s.Yj())])}),F=s.Ik({type:s.k5(["and","or"]),filters:s.YO(s.KC([Y,s.RZ((()=>F))]))}),q=(0,a.ID)((()=>(0,a.jN)(s.Ik({vectorStoreIds:s.YO(s.Yj()),maxNumResults:s.ai().optional(),ranking:s.Ik({ranker:s.Yj().optional(),scoreThreshold:s.ai().optional()}).optional(),filters:s.KC([Y,F]).optional()})))),U=(0,a.ID)((()=>(0,a.jN)(s.Ik({queries:s.YO(s.Yj()),results:s.YO(s.Ik({attributes:s.g1(s.Yj(),s.L5()),fileId:s.Yj(),filename:s.Yj(),score:s.ai(),text:s.Yj()})).nullable()})))),V=(0,a.wA)({id:"openai.file_search",inputSchema:s.Ik({}),outputSchema:U}),z=(0,a.ID)((()=>(0,a.jN)(s.Ik({background:s.k5(["auto","opaque","transparent"]).optional(),inputFidelity:s.k5(["low","high"]).optional(),inputImageMask:s.Ik({fileId:s.Yj().optional(),imageUrl:s.Yj().optional()}).optional(),model:s.Yj().optional(),moderation:s.k5(["auto"]).optional(),outputCompression:s.ai().int().min(0).max(100).optional(),outputFormat:s.k5(["png","jpeg","webp"]).optional(),partialImages:s.ai().int().min(0).max(3).optional(),quality:s.k5(["auto","low","medium","high"]).optional(),size:s.k5(["1024x1024","1024x1536","1536x1024","auto"]).optional()}).strict()))),Z=(0,a.ID)((()=>(0,a.jN)(s.Ik({})))),B=(0,a.ID)((()=>(0,a.jN)(s.Ik({result:s.Yj()})))),G=(0,a.wA)({id:"openai.image_generation",inputSchema:Z,outputSchema:B}),W=(0,a.ID)((()=>(0,a.jN)(s.Ik({action:s.Ik({type:s.eu("exec"),command:s.YO(s.Yj()),timeoutMs:s.ai().optional(),user:s.Yj().optional(),workingDirectory:s.Yj().optional(),env:s.g1(s.Yj(),s.Yj()).optional()})})))),K=(0,a.ID)((()=>(0,a.jN)(s.Ik({output:s.Yj()})))),H=(0,a.wA)({id:"openai.local_shell",inputSchema:W,outputSchema:K}),J=(0,a.ID)((()=>(0,a.jN)(s.Ik({action:s.Ik({commands:s.YO(s.Yj()),timeoutMs:s.ai().optional(),maxOutputLength:s.ai().optional()})})))),X=(0,a.ID)((()=>(0,a.jN)(s.Ik({output:s.YO(s.Ik({stdout:s.Yj(),stderr:s.Yj(),outcome:s.gM("type",[s.Ik({type:s.eu("timeout")}),s.Ik({type:s.eu("exit"),exitCode:s.ai()})])}))})))),Q=(0,a.wA)({id:"openai.shell",inputSchema:J,outputSchema:X}),ee=(0,a.ID)((()=>(0,a.jN)(s.Ik({externalWebAccess:s.zM().optional(),filters:s.Ik({allowedDomains:s.YO(s.Yj()).optional()}).optional(),searchContextSize:s.k5(["low","medium","high"]).optional(),userLocation:s.Ik({type:s.eu("approximate"),country:s.Yj().optional(),city:s.Yj().optional(),region:s.Yj().optional(),timezone:s.Yj().optional()}).optional()})))),te=(0,a.ID)((()=>(0,a.jN)(s.Ik({})))),ne=(0,a.ID)((()=>(0,a.jN)(s.Ik({action:s.gM("type",[s.Ik({type:s.eu("search"),query:s.Yj().optional()}),s.Ik({type:s.eu("openPage"),url:s.Yj().nullish()}),s.Ik({type:s.eu("findInPage"),url:s.Yj().nullish(),pattern:s.Yj().nullish()})]),sources:s.YO(s.gM("type",[s.Ik({type:s.eu("url"),url:s.Yj()}),s.Ik({type:s.eu("api"),name:s.Yj()})])).optional()})))),ae=(0,a.wA)({id:"openai.web_search",inputSchema:te,outputSchema:ne}),re=(0,a.ID)((()=>(0,a.jN)(s.Ik({searchContextSize:s.k5(["low","medium","high"]).optional(),userLocation:s.Ik({type:s.eu("approximate"),country:s.Yj().optional(),city:s.Yj().optional(),region:s.Yj().optional(),timezone:s.Yj().optional()}).optional()})))),se=(0,a.ID)((()=>(0,a.jN)(s.Ik({})))),ie=(0,a.ID)((()=>(0,a.jN)(s.Ik({action:s.gM("type",[s.Ik({type:s.eu("search"),query:s.Yj().optional()}),s.Ik({type:s.eu("openPage"),url:s.Yj().nullish()}),s.Ik({type:s.eu("findInPage"),url:s.Yj().nullish(),pattern:s.Yj().nullish()})])})))),oe=(0,a.wA)({id:"openai.web_search_preview",inputSchema:se,outputSchema:ie}),le=s.RZ((()=>s.KC([s.Yj(),s.ai(),s.zM(),s.ch(),s.YO(le),s.g1(s.Yj(),le)]))),ue=(0,a.ID)((()=>(0,a.jN)(s.Ik({serverLabel:s.Yj(),allowedTools:s.KC([s.YO(s.Yj()),s.Ik({readOnly:s.zM().optional(),toolNames:s.YO(s.Yj()).optional()})]).optional(),authorization:s.Yj().optional(),connectorId:s.Yj().optional(),headers:s.g1(s.Yj(),s.Yj()).optional(),serverDescription:s.Yj().optional(),serverUrl:s.Yj().optional()}).refine((e=>null!=e.serverUrl||null!=e.connectorId),"One of serverUrl or connectorId must be provided.")))),ce=(0,a.ID)((()=>(0,a.jN)(s.Ik({})))),pe=(0,a.ID)((()=>(0,a.jN)(s.gM("type",[s.Ik({type:s.eu("call"),serverLabel:s.Yj(),name:s.Yj(),arguments:s.Yj(),output:s.Yj().nullable().optional(),error:s.KC([s.Yj(),le]).optional()}),s.Ik({type:s.eu("listTools"),serverLabel:s.Yj(),tools:s.YO(s.Ik({name:s.Yj(),description:s.Yj().optional(),inputSchema:le,annotations:s.g1(s.Yj(),le).optional()})),error:s.KC([s.Yj(),le]).optional()}),s.Ik({type:s.eu("approvalRequest"),serverLabel:s.Yj(),name:s.Yj(),arguments:s.Yj(),approvalRequestId:s.Yj()})])))),de=(0,a.wA)({id:"openai.mcp",inputSchema:ce,outputSchema:pe}),me={applyPatch:P,codeInterpreter:(e={})=>D(e),fileSearch:V,imageGeneration:(e={})=>G(e),localShell:H,shell:Q,webSearchPreview:oe,webSearch:(e={})=>ae(e),mcp:e=>de(e)};function he(e){var t,n,a,r;if(null==e)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};const s=e.input_tokens,i=e.output_tokens,o=null!=(n=null==(t=e.input_tokens_details)?void 0:t.cached_tokens)?n:0,l=null!=(r=null==(a=e.output_tokens_details)?void 0:a.reasoning_tokens)?r:0;return{inputTokens:{total:s,noCache:s-o,cacheRead:o,cacheWrite:void 0},outputTokens:{total:i,text:i-l,reasoning:l},raw:e}}function fe(e,t){return!!t&&t.some((t=>e.startsWith(t)))}var ve=s.Ik({itemId:s.Yj().nullish(),reasoningEncryptedContent:s.Yj().nullish()});function ge({finishReason:e,hasFunctionCall:t}){switch(e){case void 0:case null:return t?"tool-calls":"stop";case"max_output_tokens":return"length";case"content_filter":return"content-filter";default:return t?"tool-calls":"unknown"}}var ye=(0,a.ID)((()=>(0,a.jN)(s.KC([s.Ik({type:s.eu("response.output_text.delta"),item_id:s.Yj(),delta:s.Yj(),logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai(),top_logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai()}))})).nullish()}),s.Ik({type:s.k5(["response.completed","response.incomplete"]),response:s.Ik({incomplete_details:s.Ik({reason:s.Yj()}).nullish(),usage:s.Ik({input_tokens:s.ai(),input_tokens_details:s.Ik({cached_tokens:s.ai().nullish()}).nullish(),output_tokens:s.ai(),output_tokens_details:s.Ik({reasoning_tokens:s.ai().nullish()}).nullish()}),service_tier:s.Yj().nullish()})}),s.Ik({type:s.eu("response.created"),response:s.Ik({id:s.Yj(),created_at:s.ai(),model:s.Yj(),service_tier:s.Yj().nullish()})}),s.Ik({type:s.eu("response.output_item.added"),output_index:s.ai(),item:s.gM("type",[s.Ik({type:s.eu("message"),id:s.Yj()}),s.Ik({type:s.eu("reasoning"),id:s.Yj(),encrypted_content:s.Yj().nullish()}),s.Ik({type:s.eu("function_call"),id:s.Yj(),call_id:s.Yj(),name:s.Yj(),arguments:s.Yj()}),s.Ik({type:s.eu("web_search_call"),id:s.Yj(),status:s.Yj()}),s.Ik({type:s.eu("computer_call"),id:s.Yj(),status:s.Yj()}),s.Ik({type:s.eu("file_search_call"),id:s.Yj()}),s.Ik({type:s.eu("image_generation_call"),id:s.Yj()}),s.Ik({type:s.eu("code_interpreter_call"),id:s.Yj(),container_id:s.Yj(),code:s.Yj().nullable(),outputs:s.YO(s.gM("type",[s.Ik({type:s.eu("logs"),logs:s.Yj()}),s.Ik({type:s.eu("image"),url:s.Yj()})])).nullable(),status:s.Yj()}),s.Ik({type:s.eu("mcp_call"),id:s.Yj(),status:s.Yj()}),s.Ik({type:s.eu("mcp_list_tools"),id:s.Yj()}),s.Ik({type:s.eu("mcp_approval_request"),id:s.Yj()}),s.Ik({type:s.eu("apply_patch_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed"]),operation:s.gM("type",[s.Ik({type:s.eu("create_file"),path:s.Yj(),diff:s.Yj()}),s.Ik({type:s.eu("delete_file"),path:s.Yj()}),s.Ik({type:s.eu("update_file"),path:s.Yj(),diff:s.Yj()})])}),s.Ik({type:s.eu("shell_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed","incomplete"]),action:s.Ik({commands:s.YO(s.Yj())})})])}),s.Ik({type:s.eu("response.output_item.done"),output_index:s.ai(),item:s.gM("type",[s.Ik({type:s.eu("message"),id:s.Yj()}),s.Ik({type:s.eu("reasoning"),id:s.Yj(),encrypted_content:s.Yj().nullish()}),s.Ik({type:s.eu("function_call"),id:s.Yj(),call_id:s.Yj(),name:s.Yj(),arguments:s.Yj(),status:s.eu("completed")}),s.Ik({type:s.eu("code_interpreter_call"),id:s.Yj(),code:s.Yj().nullable(),container_id:s.Yj(),outputs:s.YO(s.gM("type",[s.Ik({type:s.eu("logs"),logs:s.Yj()}),s.Ik({type:s.eu("image"),url:s.Yj()})])).nullable()}),s.Ik({type:s.eu("image_generation_call"),id:s.Yj(),result:s.Yj()}),s.Ik({type:s.eu("web_search_call"),id:s.Yj(),status:s.Yj(),action:s.gM("type",[s.Ik({type:s.eu("search"),query:s.Yj().nullish(),sources:s.YO(s.gM("type",[s.Ik({type:s.eu("url"),url:s.Yj()}),s.Ik({type:s.eu("api"),name:s.Yj()})])).nullish()}),s.Ik({type:s.eu("open_page"),url:s.Yj().nullish()}),s.Ik({type:s.eu("find_in_page"),url:s.Yj().nullish(),pattern:s.Yj().nullish()})])}),s.Ik({type:s.eu("file_search_call"),id:s.Yj(),queries:s.YO(s.Yj()),results:s.YO(s.Ik({attributes:s.g1(s.Yj(),s.KC([s.Yj(),s.ai(),s.zM()])),file_id:s.Yj(),filename:s.Yj(),score:s.ai(),text:s.Yj()})).nullish()}),s.Ik({type:s.eu("local_shell_call"),id:s.Yj(),call_id:s.Yj(),action:s.Ik({type:s.eu("exec"),command:s.YO(s.Yj()),timeout_ms:s.ai().optional(),user:s.Yj().optional(),working_directory:s.Yj().optional(),env:s.g1(s.Yj(),s.Yj()).optional()})}),s.Ik({type:s.eu("computer_call"),id:s.Yj(),status:s.eu("completed")}),s.Ik({type:s.eu("mcp_call"),id:s.Yj(),status:s.Yj(),arguments:s.Yj(),name:s.Yj(),server_label:s.Yj(),output:s.Yj().nullish(),error:s.KC([s.Yj(),s.Ik({type:s.Yj().optional(),code:s.KC([s.ai(),s.Yj()]).optional(),message:s.Yj().optional()}).loose()]).nullish()}),s.Ik({type:s.eu("mcp_list_tools"),id:s.Yj(),server_label:s.Yj(),tools:s.YO(s.Ik({name:s.Yj(),description:s.Yj().optional(),input_schema:s.bz(),annotations:s.g1(s.Yj(),s.L5()).optional()})),error:s.KC([s.Yj(),s.Ik({type:s.Yj().optional(),code:s.KC([s.ai(),s.Yj()]).optional(),message:s.Yj().optional()}).loose()]).optional()}),s.Ik({type:s.eu("mcp_approval_request"),id:s.Yj(),server_label:s.Yj(),name:s.Yj(),arguments:s.Yj(),approval_request_id:s.Yj()}),s.Ik({type:s.eu("apply_patch_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed"]),operation:s.gM("type",[s.Ik({type:s.eu("create_file"),path:s.Yj(),diff:s.Yj()}),s.Ik({type:s.eu("delete_file"),path:s.Yj()}),s.Ik({type:s.eu("update_file"),path:s.Yj(),diff:s.Yj()})])}),s.Ik({type:s.eu("shell_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed","incomplete"]),action:s.Ik({commands:s.YO(s.Yj())})})])}),s.Ik({type:s.eu("response.function_call_arguments.delta"),item_id:s.Yj(),output_index:s.ai(),delta:s.Yj()}),s.Ik({type:s.eu("response.image_generation_call.partial_image"),item_id:s.Yj(),output_index:s.ai(),partial_image_b64:s.Yj()}),s.Ik({type:s.eu("response.code_interpreter_call_code.delta"),item_id:s.Yj(),output_index:s.ai(),delta:s.Yj()}),s.Ik({type:s.eu("response.code_interpreter_call_code.done"),item_id:s.Yj(),output_index:s.ai(),code:s.Yj()}),s.Ik({type:s.eu("response.output_text.annotation.added"),annotation:s.gM("type",[s.Ik({type:s.eu("url_citation"),start_index:s.ai(),end_index:s.ai(),url:s.Yj(),title:s.Yj()}),s.Ik({type:s.eu("file_citation"),file_id:s.Yj(),filename:s.Yj().nullish(),index:s.ai().nullish(),start_index:s.ai().nullish(),end_index:s.ai().nullish(),quote:s.Yj().nullish()}),s.Ik({type:s.eu("container_file_citation"),container_id:s.Yj(),file_id:s.Yj(),filename:s.Yj().nullish(),start_index:s.ai().nullish(),end_index:s.ai().nullish(),index:s.ai().nullish()}),s.Ik({type:s.eu("file_path"),file_id:s.Yj(),index:s.ai().nullish()})])}),s.Ik({type:s.eu("response.reasoning_summary_part.added"),item_id:s.Yj(),summary_index:s.ai()}),s.Ik({type:s.eu("response.reasoning_summary_text.delta"),item_id:s.Yj(),summary_index:s.ai(),delta:s.Yj()}),s.Ik({type:s.eu("response.reasoning_summary_part.done"),item_id:s.Yj(),summary_index:s.ai()}),s.Ik({type:s.eu("error"),sequence_number:s.ai(),error:s.Ik({type:s.Yj(),code:s.Yj(),message:s.Yj(),param:s.Yj().nullish()})}),s.Ik({type:s.Yj()}).loose().transform((e=>({type:"unknown_chunk",message:e.type})))])))),$e=(0,a.ID)((()=>(0,a.jN)(s.Ik({id:s.Yj().optional(),created_at:s.ai().optional(),error:s.Ik({message:s.Yj(),type:s.Yj(),param:s.Yj().nullish(),code:s.Yj()}).nullish(),model:s.Yj().optional(),output:s.YO(s.gM("type",[s.Ik({type:s.eu("message"),role:s.eu("assistant"),id:s.Yj(),content:s.YO(s.Ik({type:s.eu("output_text"),text:s.Yj(),logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai(),top_logprobs:s.YO(s.Ik({token:s.Yj(),logprob:s.ai()}))})).nullish(),annotations:s.YO(s.gM("type",[s.Ik({type:s.eu("url_citation"),start_index:s.ai(),end_index:s.ai(),url:s.Yj(),title:s.Yj()}),s.Ik({type:s.eu("file_citation"),file_id:s.Yj(),filename:s.Yj().nullish(),index:s.ai().nullish(),start_index:s.ai().nullish(),end_index:s.ai().nullish(),quote:s.Yj().nullish()}),s.Ik({type:s.eu("container_file_citation"),container_id:s.Yj(),file_id:s.Yj(),filename:s.Yj().nullish(),start_index:s.ai().nullish(),end_index:s.ai().nullish(),index:s.ai().nullish()}),s.Ik({type:s.eu("file_path"),file_id:s.Yj(),index:s.ai().nullish()})]))}))}),s.Ik({type:s.eu("web_search_call"),id:s.Yj(),status:s.Yj(),action:s.gM("type",[s.Ik({type:s.eu("search"),query:s.Yj().nullish(),sources:s.YO(s.gM("type",[s.Ik({type:s.eu("url"),url:s.Yj()}),s.Ik({type:s.eu("api"),name:s.Yj()})])).nullish()}),s.Ik({type:s.eu("open_page"),url:s.Yj().nullish()}),s.Ik({type:s.eu("find_in_page"),url:s.Yj().nullish(),pattern:s.Yj().nullish()})])}),s.Ik({type:s.eu("file_search_call"),id:s.Yj(),queries:s.YO(s.Yj()),results:s.YO(s.Ik({attributes:s.g1(s.Yj(),s.KC([s.Yj(),s.ai(),s.zM()])),file_id:s.Yj(),filename:s.Yj(),score:s.ai(),text:s.Yj()})).nullish()}),s.Ik({type:s.eu("code_interpreter_call"),id:s.Yj(),code:s.Yj().nullable(),container_id:s.Yj(),outputs:s.YO(s.gM("type",[s.Ik({type:s.eu("logs"),logs:s.Yj()}),s.Ik({type:s.eu("image"),url:s.Yj()})])).nullable()}),s.Ik({type:s.eu("image_generation_call"),id:s.Yj(),result:s.Yj()}),s.Ik({type:s.eu("local_shell_call"),id:s.Yj(),call_id:s.Yj(),action:s.Ik({type:s.eu("exec"),command:s.YO(s.Yj()),timeout_ms:s.ai().optional(),user:s.Yj().optional(),working_directory:s.Yj().optional(),env:s.g1(s.Yj(),s.Yj()).optional()})}),s.Ik({type:s.eu("function_call"),call_id:s.Yj(),name:s.Yj(),arguments:s.Yj(),id:s.Yj()}),s.Ik({type:s.eu("computer_call"),id:s.Yj(),status:s.Yj().optional()}),s.Ik({type:s.eu("reasoning"),id:s.Yj(),encrypted_content:s.Yj().nullish(),summary:s.YO(s.Ik({type:s.eu("summary_text"),text:s.Yj()}))}),s.Ik({type:s.eu("mcp_call"),id:s.Yj(),status:s.Yj(),arguments:s.Yj(),name:s.Yj(),server_label:s.Yj(),output:s.Yj().nullish(),error:s.KC([s.Yj(),s.Ik({type:s.Yj().optional(),code:s.KC([s.ai(),s.Yj()]).optional(),message:s.Yj().optional()}).loose()]).nullish()}),s.Ik({type:s.eu("mcp_list_tools"),id:s.Yj(),server_label:s.Yj(),tools:s.YO(s.Ik({name:s.Yj(),description:s.Yj().optional(),input_schema:s.bz(),annotations:s.g1(s.Yj(),s.L5()).optional()})),error:s.KC([s.Yj(),s.Ik({type:s.Yj().optional(),code:s.KC([s.ai(),s.Yj()]).optional(),message:s.Yj().optional()}).loose()]).optional()}),s.Ik({type:s.eu("mcp_approval_request"),id:s.Yj(),server_label:s.Yj(),name:s.Yj(),arguments:s.Yj(),approval_request_id:s.Yj()}),s.Ik({type:s.eu("apply_patch_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed"]),operation:s.gM("type",[s.Ik({type:s.eu("create_file"),path:s.Yj(),diff:s.Yj()}),s.Ik({type:s.eu("delete_file"),path:s.Yj()}),s.Ik({type:s.eu("update_file"),path:s.Yj(),diff:s.Yj()})])}),s.Ik({type:s.eu("shell_call"),id:s.Yj(),call_id:s.Yj(),status:s.k5(["in_progress","completed","incomplete"]),action:s.Ik({commands:s.YO(s.Yj())})})])).optional(),service_tier:s.Yj().nullish(),incomplete_details:s.Ik({reason:s.Yj()}).nullish(),usage:s.Ik({input_tokens:s.ai(),input_tokens_details:s.Ik({cached_tokens:s.ai().nullish()}).nullish(),output_tokens:s.ai(),output_tokens_details:s.Ik({reasoning_tokens:s.ai().nullish()}).nullish()}).optional()})))),be=(0,a.ID)((()=>(0,a.jN)(s.Ik({conversation:s.Yj().nullish(),include:s.YO(s.k5(["reasoning.encrypted_content","file_search_call.results","message.output_text.logprobs"])).nullish(),instructions:s.Yj().nullish(),logprobs:s.KC([s.zM(),s.ai().min(1).max(20)]).optional(),maxToolCalls:s.ai().nullish(),metadata:s.bz().nullish(),parallelToolCalls:s.zM().nullish(),previousResponseId:s.Yj().nullish(),promptCacheKey:s.Yj().nullish(),promptCacheRetention:s.k5(["in_memory","24h"]).nullish(),reasoningEffort:s.Yj().nullish(),reasoningSummary:s.Yj().nullish(),safetyIdentifier:s.Yj().nullish(),serviceTier:s.k5(["auto","flex","priority","default"]).nullish(),store:s.zM().nullish(),strictJsonSchema:s.zM().nullish(),textVerbosity:s.k5(["low","medium","high"]).nullish(),truncation:s.k5(["auto","disabled"]).nullish(),user:s.Yj().nullish()})))),_e=class{constructor(e,t){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]},this.modelId=e,this.config=t}get provider(){return this.config.provider}async getArgs({maxOutputTokens:e,temperature:t,stopSequences:n,topP:s,topK:i,presencePenalty:l,frequencyPenalty:u,seed:p,prompt:d,providerOptions:m,tools:h,toolChoice:f,responseFormat:v}){var g,y,$,b;const _=[],E=c(this.modelId);null!=i&&_.push({type:"unsupported",feature:"topK"}),null!=p&&_.push({type:"unsupported",feature:"seed"}),null!=l&&_.push({type:"unsupported",feature:"presencePenalty"}),null!=u&&_.push({type:"unsupported",feature:"frequencyPenalty"}),null!=n&&_.push({type:"unsupported",feature:"stopSequences"});const x=await(0,a.xI)({provider:"openai",providerOptions:m,schema:be});(null==x?void 0:x.conversation)&&(null==x?void 0:x.previousResponseId)&&_.push({type:"unsupported",feature:"conversation",details:"conversation and previousResponseId cannot be used together"});const S=(0,a.CR)({tools:h,providerToolNames:{"openai.code_interpreter":"code_interpreter","openai.file_search":"file_search","openai.image_generation":"image_generation","openai.local_shell":"local_shell","openai.shell":"shell","openai.web_search":"web_search","openai.web_search_preview":"web_search_preview","openai.mcp":"mcp","openai.apply_patch":"apply_patch"}}),{input:A,warnings:I}=await async function({prompt:e,toolNameMapping:t,systemMessageMode:n,fileIdPrefixes:s,store:i,hasLocalShellTool:l=!1,hasShellTool:u=!1,hasApplyPatchTool:c=!1}){var p,d,m,h,f;const v=[],g=[];for(const{role:y,content:$}of e)switch(y){case"system":switch(n){case"system":v.push({role:"system",content:$});break;case"developer":v.push({role:"developer",content:$});break;case"remove":g.push({type:"other",message:"system messages are removed for this model"});break;default:throw new Error(`Unsupported system message mode: ${n}`)}break;case"user":v.push({role:"user",content:$.map(((e,t)=>{var n,i,l;switch(e.type){case"text":return{type:"input_text",text:e.text};case"file":if(e.mediaType.startsWith("image/")){const t="image/*"===e.mediaType?"image/jpeg":e.mediaType;return{type:"input_image",...e.data instanceof o?{image_url:e.data.toString()}:"string"==typeof e.data&&fe(e.data,s)?{file_id:e.data}:{image_url:`data:${t};base64,${(0,a.ej)(e.data)}`},detail:null==(i=null==(n=e.providerOptions)?void 0:n.openai)?void 0:i.imageDetail}}if("application/pdf"===e.mediaType)return e.data instanceof o?{type:"input_file",file_url:e.data.toString()}:{type:"input_file",..."string"==typeof e.data&&fe(e.data,s)?{file_id:e.data}:{filename:null!=(l=e.filename)?l:`part-${t}.pdf`,file_data:`data:application/pdf;base64,${(0,a.ej)(e.data)}`}};throw new r.b8({functionality:`file part media type ${e.mediaType}`})}}))});break;case"assistant":{const e={};for(const n of $)switch(n.type){case"text":{const e=null==(d=null==(p=n.providerOptions)?void 0:p.openai)?void 0:d.itemId;if(i&&null!=e){v.push({type:"item_reference",id:e});break}v.push({role:"assistant",content:[{type:"output_text",text:n.text}],id:e});break}case"tool-call":{if(n.providerExecuted)break;const e=null==(h=null==(m=n.providerOptions)?void 0:m.openai)?void 0:h.itemId;if(i&&null!=e){v.push({type:"item_reference",id:e});break}const r=t.toProviderToolName(n.toolName);if(l&&"local_shell"===r){const t=await(0,a.k5)({value:n.input,schema:W});v.push({type:"local_shell_call",call_id:n.toolCallId,id:e,action:{type:"exec",command:t.action.command,timeout_ms:t.action.timeoutMs,user:t.action.user,working_directory:t.action.workingDirectory,env:t.action.env}});break}if(u&&"shell"===r){const t=await(0,a.k5)({value:n.input,schema:J});v.push({type:"shell_call",call_id:n.toolCallId,id:e,status:"completed",action:{commands:t.action.commands,timeout_ms:t.action.timeoutMs,max_output_length:t.action.maxOutputLength}});break}v.push({type:"function_call",call_id:n.toolCallId,name:r,arguments:JSON.stringify(n.input),id:e});break}case"tool-result":i?v.push({type:"item_reference",id:n.toolCallId}):g.push({type:"other",message:`Results for OpenAI tool ${n.toolName} are not sent to the API when store is false`});break;case"reasoning":{const t=await(0,a.xI)({provider:"openai",providerOptions:n.providerOptions,schema:ve}),r=null==t?void 0:t.itemId;if(null!=r){const a=e[r];if(i)void 0===a&&(v.push({type:"item_reference",id:r}),e[r]={type:"reasoning",id:r,summary:[]});else{const s=[];n.text.length>0?s.push({type:"summary_text",text:n.text}):void 0!==a&&g.push({type:"other",message:`Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(n)}.`}),void 0===a?(e[r]={type:"reasoning",id:r,encrypted_content:null==t?void 0:t.reasoningEncryptedContent,summary:s},v.push(e[r])):(a.summary.push(...s),null!=(null==t?void 0:t.reasoningEncryptedContent)&&(a.encrypted_content=t.reasoningEncryptedContent))}}else g.push({type:"other",message:`Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(n)}.`});break}}break}case"tool":for(const e of $){const n=e.output,r=t.toProviderToolName(e.toolName);if(l&&"local_shell"===r&&"json"===n.type){const t=await(0,a.k5)({value:n.value,schema:K});v.push({type:"local_shell_call_output",call_id:e.toolCallId,output:t.output});break}if(u&&"shell"===r&&"json"===n.type){const t=await(0,a.k5)({value:n.value,schema:X});v.push({type:"shell_call_output",call_id:e.toolCallId,output:t.output.map((e=>({stdout:e.stdout,stderr:e.stderr,outcome:"timeout"===e.outcome.type?{type:"timeout"}:{type:"exit",exit_code:e.outcome.exitCode}})))});break}if(c&&"apply_patch"===e.toolName&&"json"===n.type){const t=await(0,a.k5)({value:n.value,schema:C});v.push({type:"apply_patch_call_output",call_id:e.toolCallId,status:t.status,output:t.output});break}let s;switch(n.type){case"text":case"error-text":s=n.value;break;case"execution-denied":s=null!=(f=n.reason)?f:"Tool execution denied.";break;case"json":case"error-json":s=JSON.stringify(n.value);break;case"content":s=n.value.map((e=>{var t;switch(e.type){case"text":return{type:"input_text",text:e.text};case"image-data":return{type:"input_image",image_url:`data:${e.mediaType};base64,${e.data}`};case"file-data":return{type:"input_file",filename:null!=(t=e.filename)?t:"data",file_data:`data:${e.mediaType};base64,${e.data}`};default:return void g.push({type:"other",message:`unsupported tool content part type: ${e.type}`})}})).filter(a.R)}v.push({type:"function_call_output",call_id:e.toolCallId,output:s})}break;default:throw new Error(`Unsupported role: ${y}`)}return{input:v,warnings:g}}({prompt:d,toolNameMapping:S,systemMessageMode:E.systemMessageMode,fileIdPrefixes:this.config.fileIdPrefixes,store:null==(g=null==x?void 0:x.store)||g,hasLocalShellTool:O("openai.local_shell"),hasShellTool:O("openai.shell"),hasApplyPatchTool:O("openai.apply_patch")});_.push(...I);const w=null==(y=null==x?void 0:x.strictJsonSchema)||y;let T=null==x?void 0:x.include;function N(e){null==T?T=[e]:T.includes(e)||(T=[...T,e])}function O(e){return null!=(null==h?void 0:h.find((t=>"provider"===t.type&&t.id===e)))}const k="number"==typeof(null==x?void 0:x.logprobs)?null==x?void 0:x.logprobs:!0===(null==x?void 0:x.logprobs)?20:void 0;k&&N("message.output_text.logprobs");const R=null==($=null==h?void 0:h.find((e=>"provider"===e.type&&("openai.web_search"===e.id||"openai.web_search_preview"===e.id))))?void 0:$.name;R&&N("web_search_call.action.sources"),O("openai.code_interpreter")&&N("code_interpreter_call.outputs");const P=null==x?void 0:x.store;!1===P&&E.isReasoningModel&&N("reasoning.encrypted_content");const L={model:this.modelId,input:A,temperature:t,top_p:s,max_output_tokens:e,...("json"===(null==v?void 0:v.type)||(null==x?void 0:x.textVerbosity))&&{text:{..."json"===(null==v?void 0:v.type)&&{format:null!=v.schema?{type:"json_schema",strict:w,name:null!=(b=v.name)?b:"response",description:v.description,schema:v.schema}:{type:"json_object"}},...(null==x?void 0:x.textVerbosity)&&{verbosity:x.textVerbosity}}},conversation:null==x?void 0:x.conversation,max_tool_calls:null==x?void 0:x.maxToolCalls,metadata:null==x?void 0:x.metadata,parallel_tool_calls:null==x?void 0:x.parallelToolCalls,previous_response_id:null==x?void 0:x.previousResponseId,store:P,user:null==x?void 0:x.user,instructions:null==x?void 0:x.instructions,service_tier:null==x?void 0:x.serviceTier,include:T,prompt_cache_key:null==x?void 0:x.promptCacheKey,prompt_cache_retention:null==x?void 0:x.promptCacheRetention,safety_identifier:null==x?void 0:x.safetyIdentifier,top_logprobs:k,truncation:null==x?void 0:x.truncation,...E.isReasoningModel&&(null!=(null==x?void 0:x.reasoningEffort)||null!=(null==x?void 0:x.reasoningSummary))&&{reasoning:{...null!=(null==x?void 0:x.reasoningEffort)&&{effort:x.reasoningEffort},...null!=(null==x?void 0:x.reasoningSummary)&&{summary:x.reasoningSummary}}}};E.isReasoningModel?"none"===(null==x?void 0:x.reasoningEffort)&&E.supportsNonReasoningParameters||(null!=L.temperature&&(L.temperature=void 0,_.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"})),null!=L.top_p&&(L.top_p=void 0,_.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"}))):(null!=(null==x?void 0:x.reasoningEffort)&&_.push({type:"unsupported",feature:"reasoningEffort",details:"reasoningEffort is not supported for non-reasoning models"}),null!=(null==x?void 0:x.reasoningSummary)&&_.push({type:"unsupported",feature:"reasoningSummary",details:"reasoningSummary is not supported for non-reasoning models"})),"flex"!==(null==x?void 0:x.serviceTier)||E.supportsFlexProcessing||(_.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),delete L.service_tier),"priority"!==(null==x?void 0:x.serviceTier)||E.supportsPriorityProcessing||(_.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),delete L.service_tier);const{tools:j,toolChoice:D,toolWarnings:Y}=await async function({tools:e,toolChoice:t}){const n=[];if(null==(e=(null==e?void 0:e.length)?e:void 0))return{tools:void 0,toolChoice:void 0,toolWarnings:n};const s=[];for(const t of e)switch(t.type){case"function":s.push({type:"function",name:t.name,description:t.description,parameters:t.inputSchema,...null!=t.strict?{strict:t.strict}:{}});break;case"provider":switch(t.id){case"openai.file_search":{const e=await(0,a.k5)({value:t.args,schema:q});s.push({type:"file_search",vector_store_ids:e.vectorStoreIds,max_num_results:e.maxNumResults,ranking_options:e.ranking?{ranker:e.ranking.ranker,score_threshold:e.ranking.scoreThreshold}:void 0,filters:e.filters});break}case"openai.local_shell":s.push({type:"local_shell"});break;case"openai.shell":s.push({type:"shell"});break;case"openai.apply_patch":s.push({type:"apply_patch"});break;case"openai.web_search_preview":{const e=await(0,a.k5)({value:t.args,schema:re});s.push({type:"web_search_preview",search_context_size:e.searchContextSize,user_location:e.userLocation});break}case"openai.web_search":{const e=await(0,a.k5)({value:t.args,schema:ee});s.push({type:"web_search",filters:null!=e.filters?{allowed_domains:e.filters.allowedDomains}:void 0,external_web_access:e.externalWebAccess,search_context_size:e.searchContextSize,user_location:e.userLocation});break}case"openai.code_interpreter":{const e=await(0,a.k5)({value:t.args,schema:M});s.push({type:"code_interpreter",container:null==e.container?{type:"auto",file_ids:void 0}:"string"==typeof e.container?e.container:{type:"auto",file_ids:e.container.fileIds}});break}case"openai.image_generation":{const e=await(0,a.k5)({value:t.args,schema:z});s.push({type:"image_generation",background:e.background,input_fidelity:e.inputFidelity,input_image_mask:e.inputImageMask?{file_id:e.inputImageMask.fileId,image_url:e.inputImageMask.imageUrl}:void 0,model:e.model,moderation:e.moderation,partial_images:e.partialImages,quality:e.quality,output_compression:e.outputCompression,output_format:e.outputFormat,size:e.size});break}case"openai.mcp":{const e=await(0,a.k5)({value:t.args,schema:ue});s.push({type:"mcp",server_label:e.serverLabel,allowed_tools:Array.isArray(e.allowedTools)?e.allowedTools:e.allowedTools?{read_only:e.allowedTools.readOnly,tool_names:e.allowedTools.toolNames}:void 0,authorization:e.authorization,connector_id:e.connectorId,headers:e.headers,require_approval:"never",server_description:e.serverDescription,server_url:e.serverUrl});break}}break;default:n.push({type:"unsupported",feature:`function tool ${t}`})}if(null==t)return{tools:s,toolChoice:void 0,toolWarnings:n};const i=t.type;switch(i){case"auto":case"none":case"required":return{tools:s,toolChoice:i,toolWarnings:n};case"tool":return{tools:s,toolChoice:"code_interpreter"===t.toolName||"file_search"===t.toolName||"image_generation"===t.toolName||"web_search_preview"===t.toolName||"web_search"===t.toolName||"mcp"===t.toolName||"apply_patch"===t.toolName?{type:t.toolName}:{type:"function",name:t.toolName},toolWarnings:n};default:{const e=i;throw new r.b8({functionality:`tool choice type: ${e}`})}}}({tools:h,toolChoice:f});return{webSearchToolName:R,args:{...L,tools:j,tool_choice:D},warnings:[..._,...Y],store:P,toolNameMapping:S}}async doGenerate(e){var t,n,s,i,o,l,c,p,d,m,h,f,v,g,y,$,b,_,E,x,S,A,I,w;const{args:T,warnings:N,webSearchToolName:O,toolNameMapping:k}=await this.getArgs(e),R=this.config.url({path:"/responses",modelId:this.modelId}),C=this.config.provider.replace(".responses",""),{responseHeaders:P,value:L,rawValue:j}=await(0,a.GU)({url:R,headers:(0,a.m2)(this.config.headers(),e.headers),body:T,failedResponseHandler:u,successfulResponseHandler:(0,a.cV)($e),abortSignal:e.abortSignal,fetch:this.config.fetch});if(L.error)throw new r.hL({message:L.error.message,url:R,requestBodyValues:T,statusCode:400,responseHeaders:P,responseBody:j,isRetryable:!1});const M=[],D=[];let Y=!1;for(const r of L.output)switch(r.type){case"reasoning":0===r.summary.length&&r.summary.push({type:"summary_text",text:""});for(const e of r.summary)M.push({type:"reasoning",text:e.text,providerMetadata:{[C]:{itemId:r.id,reasoningEncryptedContent:null!=(t=r.encrypted_content)?t:null}}});break;case"image_generation_call":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("image_generation"),result:{result:r.result}});break;case"local_shell_call":M.push({type:"tool-call",toolCallId:r.call_id,toolName:k.toCustomToolName("local_shell"),input:JSON.stringify({action:r.action}),providerMetadata:{[C]:{itemId:r.id}}});break;case"shell_call":M.push({type:"tool-call",toolCallId:r.call_id,toolName:k.toCustomToolName("shell"),input:JSON.stringify({action:{commands:r.action.commands}}),providerMetadata:{[C]:{itemId:r.id}}});break;case"message":for(const t of r.content){(null==(s=null==(n=e.providerOptions)?void 0:n.openai)?void 0:s.logprobs)&&t.logprobs&&D.push(t.logprobs);const u={itemId:r.id,...t.annotations.length>0&&{annotations:t.annotations}};M.push({type:"text",text:t.text,providerMetadata:{[C]:u}});for(const e of t.annotations)"url_citation"===e.type?M.push({type:"source",sourceType:"url",id:null!=(l=null==(o=(i=this.config).generateId)?void 0:o.call(i))?l:(0,a.$C)(),url:e.url,title:e.title}):"file_citation"===e.type?M.push({type:"source",sourceType:"document",id:null!=(d=null==(p=(c=this.config).generateId)?void 0:p.call(c))?d:(0,a.$C)(),mediaType:"text/plain",title:null!=(h=null!=(m=e.quote)?m:e.filename)?h:"Document",filename:null!=(f=e.filename)?f:e.file_id,...e.file_id?{providerMetadata:{[C]:{fileId:e.file_id}}}:{}}):"container_file_citation"===e.type?M.push({type:"source",sourceType:"document",id:null!=(y=null==(g=(v=this.config).generateId)?void 0:g.call(v))?y:(0,a.$C)(),mediaType:"text/plain",title:null!=(b=null!=($=e.filename)?$:e.file_id)?b:"Document",filename:null!=(_=e.filename)?_:e.file_id,providerMetadata:{[C]:{fileId:e.file_id,containerId:e.container_id,...null!=e.index?{index:e.index}:{}}}}):"file_path"===e.type&&M.push({type:"source",sourceType:"document",id:null!=(S=null==(x=(E=this.config).generateId)?void 0:x.call(E))?S:(0,a.$C)(),mediaType:"application/octet-stream",title:e.file_id,filename:e.file_id,providerMetadata:{[C]:{fileId:e.file_id,...null!=e.index?{index:e.index}:{}}}})}break;case"function_call":Y=!0,M.push({type:"tool-call",toolCallId:r.call_id,toolName:r.name,input:r.arguments,providerMetadata:{[C]:{itemId:r.id}}});break;case"web_search_call":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName(null!=O?O:"web_search"),input:JSON.stringify({}),providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName(null!=O?O:"web_search"),result:xe(r.action)});break;case"mcp_call":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),input:JSON.stringify({}),providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),result:{type:"call",serverLabel:r.server_label,name:r.name,arguments:r.arguments,...null!=r.output?{output:r.output}:{},...null!=r.error?{error:r.error}:{}}});break;case"mcp_list_tools":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),input:JSON.stringify({}),providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),result:{type:"listTools",serverLabel:r.server_label,tools:r.tools.map((e=>{var t,n;return{name:e.name,description:null!=(t=e.description)?t:void 0,inputSchema:e.input_schema,annotations:null!=(n=e.annotations)?n:void 0}})),...null!=r.error?{error:r.error}:{}}});break;case"mcp_approval_request":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),input:JSON.stringify({}),providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("mcp"),result:{type:"approvalRequest",serverLabel:r.server_label,name:r.name,arguments:r.arguments,approvalRequestId:r.approval_request_id}});break;case"computer_call":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:r.status||"completed"}});break;case"file_search_call":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("file_search"),input:"{}",providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("file_search"),result:{queries:r.queries,results:null!=(I=null==(A=r.results)?void 0:A.map((e=>({attributes:e.attributes,fileId:e.file_id,filename:e.filename,score:e.score,text:e.text}))))?I:null}});break;case"code_interpreter_call":M.push({type:"tool-call",toolCallId:r.id,toolName:k.toCustomToolName("code_interpreter"),input:JSON.stringify({code:r.code,containerId:r.container_id}),providerExecuted:!0}),M.push({type:"tool-result",toolCallId:r.id,toolName:k.toCustomToolName("code_interpreter"),result:{outputs:r.outputs}});break;case"apply_patch_call":M.push({type:"tool-call",toolCallId:r.call_id,toolName:k.toCustomToolName("apply_patch"),input:JSON.stringify({callId:r.call_id,operation:r.operation}),providerMetadata:{[C]:{itemId:r.id}}})}const F={[C]:{responseId:L.id}};D.length>0&&(F[C].logprobs=D),"string"==typeof L.service_tier&&(F[C].serviceTier=L.service_tier);const q=L.usage;return{content:M,finishReason:ge({finishReason:null==(w=L.incomplete_details)?void 0:w.reason,hasFunctionCall:Y}),usage:he(q),request:{body:T},response:{id:L.id,timestamp:new Date(1e3*L.created_at),modelId:L.model,headers:P,body:j},providerMetadata:F,warnings:N}}async doStream(e){const{args:t,warnings:n,webSearchToolName:r,toolNameMapping:s,store:i}=await this.getArgs(e),{responseHeaders:o,value:l}=await(0,a.GU)({url:this.config.url({path:"/responses",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:{...t,stream:!0},failedResponseHandler:u,successfulResponseHandler:(0,a.Ds)(ye),abortSignal:e.abortSignal,fetch:this.config.fetch}),c=this,p=this.config.provider.replace(".responses","");let d,m="unknown";const h=[];let f=null;const v={},g=[];let y=!1;const $={};let b;return{stream:l.pipeThrough(new TransformStream({start(e){e.enqueue({type:"stream-start",warnings:n})},transform(t,n){var o,l,u,_,E,x,S,A,I,w,T,N,O,k,R,C,P,L,j,M,D,Y,F,q,U,V,z;if(e.includeRawChunks&&n.enqueue({type:"raw",rawValue:t.rawValue}),!t.success)return m="error",void n.enqueue({type:"error",error:t.error});const Z=t.value;if(Ee(Z))"function_call"===Z.item.type?(v[Z.output_index]={toolName:Z.item.name,toolCallId:Z.item.call_id},n.enqueue({type:"tool-input-start",id:Z.item.call_id,toolName:Z.item.name})):"web_search_call"===Z.item.type?(v[Z.output_index]={toolName:s.toCustomToolName(null!=r?r:"web_search"),toolCallId:Z.item.id},n.enqueue({type:"tool-input-start",id:Z.item.id,toolName:s.toCustomToolName(null!=r?r:"web_search"),providerExecuted:!0}),n.enqueue({type:"tool-input-end",id:Z.item.id}),n.enqueue({type:"tool-call",toolCallId:Z.item.id,toolName:s.toCustomToolName(null!=r?r:"web_search"),input:JSON.stringify({}),providerExecuted:!0})):"computer_call"===Z.item.type?(v[Z.output_index]={toolName:s.toCustomToolName("computer_use"),toolCallId:Z.item.id},n.enqueue({type:"tool-input-start",id:Z.item.id,toolName:s.toCustomToolName("computer_use"),providerExecuted:!0})):"code_interpreter_call"===Z.item.type?(v[Z.output_index]={toolName:s.toCustomToolName("code_interpreter"),toolCallId:Z.item.id,codeInterpreter:{containerId:Z.item.container_id}},n.enqueue({type:"tool-input-start",id:Z.item.id,toolName:s.toCustomToolName("code_interpreter"),providerExecuted:!0}),n.enqueue({type:"tool-input-delta",id:Z.item.id,delta:`{"containerId":"${Z.item.container_id}","code":"`})):"file_search_call"===Z.item.type?n.enqueue({type:"tool-call",toolCallId:Z.item.id,toolName:s.toCustomToolName("file_search"),input:"{}",providerExecuted:!0}):"image_generation_call"===Z.item.type?n.enqueue({type:"tool-call",toolCallId:Z.item.id,toolName:s.toCustomToolName("image_generation"),input:"{}",providerExecuted:!0}):"mcp_call"===Z.item.type||"mcp_list_tools"===Z.item.type||"mcp_approval_request"===Z.item.type?n.enqueue({type:"tool-call",toolCallId:Z.item.id,toolName:s.toCustomToolName("mcp"),input:"{}",providerExecuted:!0}):"apply_patch_call"===Z.item.type?(v[Z.output_index]={toolName:s.toCustomToolName("apply_patch"),toolCallId:Z.item.call_id},"completed"===Z.item.status&&n.enqueue({type:"tool-call",toolCallId:Z.item.call_id,toolName:s.toCustomToolName("apply_patch"),input:JSON.stringify({callId:Z.item.call_id,operation:Z.item.operation}),providerMetadata:{[p]:{itemId:Z.item.id}}})):"shell_call"===Z.item.type?v[Z.output_index]={toolName:s.toCustomToolName("shell"),toolCallId:Z.item.call_id}:"message"===Z.item.type?(g.splice(0,g.length),n.enqueue({type:"text-start",id:Z.item.id,providerMetadata:{[p]:{itemId:Z.item.id}}})):Ee(Z)&&"reasoning"===Z.item.type&&($[Z.item.id]={encryptedContent:Z.item.encrypted_content,summaryParts:{0:"active"}},n.enqueue({type:"reasoning-start",id:`${Z.item.id}:0`,providerMetadata:{[p]:{itemId:Z.item.id,reasoningEncryptedContent:null!=(o=Z.item.encrypted_content)?o:null}}}));else if(function(e){return"response.output_item.done"===e.type}(Z)){if("message"===Z.item.type)n.enqueue({type:"text-end",id:Z.item.id,providerMetadata:{[p]:{itemId:Z.item.id,...g.length>0&&{annotations:g}}}});else if("function_call"===Z.item.type)v[Z.output_index]=void 0,y=!0,n.enqueue({type:"tool-input-end",id:Z.item.call_id}),n.enqueue({type:"tool-call",toolCallId:Z.item.call_id,toolName:Z.item.name,input:Z.item.arguments,providerMetadata:{[p]:{itemId:Z.item.id}}});else if("web_search_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName(null!=r?r:"web_search"),result:xe(Z.item.action)});else if("computer_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-input-end",id:Z.item.id}),n.enqueue({type:"tool-call",toolCallId:Z.item.id,toolName:s.toCustomToolName("computer_use"),input:"",providerExecuted:!0}),n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("computer_use"),result:{type:"computer_use_tool_result",status:Z.item.status||"completed"}});else if("file_search_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("file_search"),result:{queries:Z.item.queries,results:null!=(u=null==(l=Z.item.results)?void 0:l.map((e=>({attributes:e.attributes,fileId:e.file_id,filename:e.filename,score:e.score,text:e.text}))))?u:null}});else if("code_interpreter_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("code_interpreter"),result:{outputs:Z.item.outputs}});else if("image_generation_call"===Z.item.type)n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("image_generation"),result:{result:Z.item.result}});else if("mcp_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("mcp"),result:{type:"call",serverLabel:Z.item.server_label,name:Z.item.name,arguments:Z.item.arguments,...null!=Z.item.output?{output:Z.item.output}:{},...null!=Z.item.error?{error:Z.item.error}:{}}});else if("mcp_list_tools"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("mcp"),result:{type:"listTools",serverLabel:Z.item.server_label,tools:Z.item.tools.map((e=>{var t,n;return{name:e.name,description:null!=(t=e.description)?t:void 0,inputSchema:e.input_schema,annotations:null!=(n=e.annotations)?n:void 0}})),...null!=Z.item.error?{error:Z.item.error}:{}}});else if("apply_patch_call"===Z.item.type)v[Z.output_index]=void 0,"completed"===Z.item.status&&n.enqueue({type:"tool-call",toolCallId:Z.item.call_id,toolName:s.toCustomToolName("apply_patch"),input:JSON.stringify({callId:Z.item.call_id,operation:Z.item.operation}),providerMetadata:{[p]:{itemId:Z.item.id}}});else if("mcp_approval_request"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-result",toolCallId:Z.item.id,toolName:s.toCustomToolName("mcp"),result:{type:"approvalRequest",serverLabel:Z.item.server_label,name:Z.item.name,arguments:Z.item.arguments,approvalRequestId:Z.item.approval_request_id}});else if("local_shell_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-call",toolCallId:Z.item.call_id,toolName:s.toCustomToolName("local_shell"),input:JSON.stringify({action:{type:"exec",command:Z.item.action.command,timeoutMs:Z.item.action.timeout_ms,user:Z.item.action.user,workingDirectory:Z.item.action.working_directory,env:Z.item.action.env}}),providerMetadata:{[p]:{itemId:Z.item.id}}});else if("shell_call"===Z.item.type)v[Z.output_index]=void 0,n.enqueue({type:"tool-call",toolCallId:Z.item.call_id,toolName:s.toCustomToolName("shell"),input:JSON.stringify({action:{commands:Z.item.action.commands}}),providerMetadata:{[p]:{itemId:Z.item.id}}});else if("reasoning"===Z.item.type){const e=$[Z.item.id],t=Object.entries(e.summaryParts).filter((([e,t])=>"active"===t||"can-conclude"===t)).map((([e])=>e));for(const e of t)n.enqueue({type:"reasoning-end",id:`${Z.item.id}:${e}`,providerMetadata:{[p]:{itemId:Z.item.id,reasoningEncryptedContent:null!=(_=Z.item.encrypted_content)?_:null}}});delete $[Z.item.id]}}else if(function(e){return"response.function_call_arguments.delta"===e.type}(Z)){const e=v[Z.output_index];null!=e&&n.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:Z.delta})}else if(function(e){return"response.image_generation_call.partial_image"===e.type}(Z))n.enqueue({type:"tool-result",toolCallId:Z.item_id,toolName:s.toCustomToolName("image_generation"),result:{result:Z.partial_image_b64},preliminary:!0});else if(function(e){return"response.code_interpreter_call_code.delta"===e.type}(Z)){const e=v[Z.output_index];null!=e&&n.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:JSON.stringify(Z.delta).slice(1,-1)})}else if(function(e){return"response.code_interpreter_call_code.done"===e.type}(Z)){const e=v[Z.output_index];null!=e&&(n.enqueue({type:"tool-input-delta",id:e.toolCallId,delta:'"}'}),n.enqueue({type:"tool-input-end",id:e.toolCallId}),n.enqueue({type:"tool-call",toolCallId:e.toolCallId,toolName:s.toCustomToolName("code_interpreter"),input:JSON.stringify({code:Z.code,containerId:e.codeInterpreter.containerId}),providerExecuted:!0}))}else if(function(e){return"response.created"===e.type}(Z))f=Z.response.id,n.enqueue({type:"response-metadata",id:Z.response.id,timestamp:new Date(1e3*Z.response.created_at),modelId:Z.response.model});else if(function(e){return"response.output_text.delta"===e.type}(Z))n.enqueue({type:"text-delta",id:Z.item_id,delta:Z.delta}),(null==(x=null==(E=e.providerOptions)?void 0:E.openai)?void 0:x.logprobs)&&Z.logprobs&&h.push(Z.logprobs);else if("response.reasoning_summary_part.added"===Z.type){if(Z.summary_index>0){const e=$[Z.item_id];e.summaryParts[Z.summary_index]="active";for(const t of Object.keys(e.summaryParts))"can-conclude"===e.summaryParts[t]&&(n.enqueue({type:"reasoning-end",id:`${Z.item_id}:${t}`,providerMetadata:{[p]:{itemId:Z.item_id}}}),e.summaryParts[t]="concluded");n.enqueue({type:"reasoning-start",id:`${Z.item_id}:${Z.summary_index}`,providerMetadata:{[p]:{itemId:Z.item_id,reasoningEncryptedContent:null!=(A=null==(S=$[Z.item_id])?void 0:S.encryptedContent)?A:null}}})}}else"response.reasoning_summary_text.delta"===Z.type?n.enqueue({type:"reasoning-delta",id:`${Z.item_id}:${Z.summary_index}`,delta:Z.delta,providerMetadata:{[p]:{itemId:Z.item_id}}}):"response.reasoning_summary_part.done"===Z.type?i?(n.enqueue({type:"reasoning-end",id:`${Z.item_id}:${Z.summary_index}`,providerMetadata:{[p]:{itemId:Z.item_id}}}),$[Z.item_id].summaryParts[Z.summary_index]="concluded"):$[Z.item_id].summaryParts[Z.summary_index]="can-conclude":function(e){return"response.completed"===e.type||"response.incomplete"===e.type}(Z)?(m=ge({finishReason:null==(I=Z.response.incomplete_details)?void 0:I.reason,hasFunctionCall:y}),d=Z.response.usage,"string"==typeof Z.response.service_tier&&(b=Z.response.service_tier)):function(e){return"response.output_text.annotation.added"===e.type}(Z)?(g.push(Z.annotation),"url_citation"===Z.annotation.type?n.enqueue({type:"source",sourceType:"url",id:null!=(N=null==(T=(w=c.config).generateId)?void 0:T.call(w))?N:(0,a.$C)(),url:Z.annotation.url,title:Z.annotation.title}):"file_citation"===Z.annotation.type?n.enqueue({type:"source",sourceType:"document",id:null!=(R=null==(k=(O=c.config).generateId)?void 0:k.call(O))?R:(0,a.$C)(),mediaType:"text/plain",title:null!=(P=null!=(C=Z.annotation.quote)?C:Z.annotation.filename)?P:"Document",filename:null!=(L=Z.annotation.filename)?L:Z.annotation.file_id,...Z.annotation.file_id?{providerMetadata:{[p]:{fileId:Z.annotation.file_id}}}:{}}):"container_file_citation"===Z.annotation.type?n.enqueue({type:"source",sourceType:"document",id:null!=(D=null==(M=(j=c.config).generateId)?void 0:M.call(j))?D:(0,a.$C)(),mediaType:"text/plain",title:null!=(F=null!=(Y=Z.annotation.filename)?Y:Z.annotation.file_id)?F:"Document",filename:null!=(q=Z.annotation.filename)?q:Z.annotation.file_id,providerMetadata:{[p]:{fileId:Z.annotation.file_id,containerId:Z.annotation.container_id,...null!=Z.annotation.index?{index:Z.annotation.index}:{}}}}):"file_path"===Z.annotation.type&&n.enqueue({type:"source",sourceType:"document",id:null!=(z=null==(V=(U=c.config).generateId)?void 0:V.call(U))?z:(0,a.$C)(),mediaType:"application/octet-stream",title:Z.annotation.file_id,filename:Z.annotation.file_id,providerMetadata:{[p]:{fileId:Z.annotation.file_id,...null!=Z.annotation.index?{index:Z.annotation.index}:{}}}})):function(e){return"error"===e.type}(Z)&&n.enqueue({type:"error",error:Z})},flush(e){const t={[p]:{responseId:f}};h.length>0&&(t[p].logprobs=h),void 0!==b&&(t[p].serviceTier=b),e.enqueue({type:"finish",finishReason:m,usage:he(d),providerMetadata:t})}})),request:{body:t},response:{headers:o}}}};function Ee(e){return"response.output_item.added"===e.type}function xe(e){var t;switch(e.type){case"search":return{action:{type:"search",query:null!=(t=e.query)?t:void 0},...null!=e.sources&&{sources:e.sources}};case"open_page":return{action:{type:"openPage",url:e.url}};case"find_in_page":return{action:{type:"findInPage",url:e.url,pattern:e.pattern}}}}var Se=(0,a.ID)((()=>(0,a.jN)(s.Ik({instructions:s.Yj().nullish(),speed:s.ai().min(.25).max(4).default(1).nullish()})))),Ae=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({text:e,voice:t="alloy",outputFormat:n="mp3",speed:r,instructions:s,language:i,providerOptions:o}){const l=[],u=await(0,a.xI)({provider:"openai",providerOptions:o,schema:Se}),c={model:this.modelId,input:e,voice:t,response_format:"mp3",speed:r,instructions:s};if(n&&(["mp3","opus","aac","flac","wav","pcm"].includes(n)?c.response_format=n:l.push({type:"unsupported",feature:"outputFormat",details:`Unsupported output format: ${n}. Using mp3 instead.`})),u){const e={};for(const t in e){const n=e[t];void 0!==n&&(c[t]=n)}}return i&&l.push({type:"unsupported",feature:"language",details:`OpenAI speech models do not support language selection. Language parameter "${i}" was ignored.`}),{requestBody:c,warnings:l}}async doGenerate(e){var t,n,r;const s=null!=(r=null==(n=null==(t=this.config._internal)?void 0:t.currentDate)?void 0:n.call(t))?r:new Date,{requestBody:i,warnings:o}=await this.getArgs(e),{value:l,responseHeaders:c,rawValue:p}=await(0,a.GU)({url:this.config.url({path:"/audio/speech",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),body:i,failedResponseHandler:u,successfulResponseHandler:(0,a.HD)(),abortSignal:e.abortSignal,fetch:this.config.fetch});return{audio:l,warnings:o,request:{body:JSON.stringify(i)},response:{timestamp:s,modelId:this.modelId,headers:c,body:p}}}},Ie=(0,a.ID)((()=>(0,a.jN)(s.Ik({text:s.Yj(),language:s.Yj().nullish(),duration:s.ai().nullish(),words:s.YO(s.Ik({word:s.Yj(),start:s.ai(),end:s.ai()})).nullish(),segments:s.YO(s.Ik({id:s.ai(),seek:s.ai(),start:s.ai(),end:s.ai(),text:s.Yj(),tokens:s.YO(s.ai()),temperature:s.ai(),avg_logprob:s.ai(),compression_ratio:s.ai(),no_speech_prob:s.ai()})).nullish()})))),we=(0,a.ID)((()=>(0,a.jN)(s.Ik({include:s.YO(s.Yj()).optional(),language:s.Yj().optional(),prompt:s.Yj().optional(),temperature:s.ai().min(0).max(1).default(0).optional(),timestampGranularities:s.YO(s.k5(["word","segment"])).default(["segment"]).optional()})))),Te={afrikaans:"af",arabic:"ar",armenian:"hy",azerbaijani:"az",belarusian:"be",bosnian:"bs",bulgarian:"bg",catalan:"ca",chinese:"zh",croatian:"hr",czech:"cs",danish:"da",dutch:"nl",english:"en",estonian:"et",finnish:"fi",french:"fr",galician:"gl",german:"de",greek:"el",hebrew:"he",hindi:"hi",hungarian:"hu",icelandic:"is",indonesian:"id",italian:"it",japanese:"ja",kannada:"kn",kazakh:"kk",korean:"ko",latvian:"lv",lithuanian:"lt",macedonian:"mk",malay:"ms",marathi:"mr",maori:"mi",nepali:"ne",norwegian:"no",persian:"fa",polish:"pl",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"sr",slovak:"sk",slovenian:"sl",spanish:"es",swahili:"sw",swedish:"sv",tagalog:"tl",tamil:"ta",thai:"th",turkish:"tr",ukrainian:"uk",urdu:"ur",vietnamese:"vi",welsh:"cy"},Ne=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({audio:e,mediaType:t,providerOptions:n}){const r=await(0,a.xI)({provider:"openai",providerOptions:n,schema:we}),s=new FormData,i=e instanceof Uint8Array?new Blob([e]):new Blob([(0,a.Z9)(e)]);s.append("model",this.modelId);const o=(0,a.HQ)(t);if(s.append("file",new File([i],"audio",{type:t}),`audio.${o}`),r){const e={include:r.include,language:r.language,prompt:r.prompt,response_format:["gpt-4o-transcribe","gpt-4o-mini-transcribe"].includes(this.modelId)?"json":"verbose_json",temperature:r.temperature,timestamp_granularities:r.timestampGranularities};for(const[t,n]of Object.entries(e))if(null!=n)if(Array.isArray(n))for(const e of n)s.append(`${t}[]`,String(e));else s.append(t,String(n))}return{formData:s,warnings:[]}}async doGenerate(e){var t,n,r,s,i,o,l,c;const p=null!=(r=null==(n=null==(t=this.config._internal)?void 0:t.currentDate)?void 0:n.call(t))?r:new Date,{formData:d,warnings:m}=await this.getArgs(e),{value:h,responseHeaders:f,rawValue:v}=await(0,a.S)({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:(0,a.m2)(this.config.headers(),e.headers),formData:d,failedResponseHandler:u,successfulResponseHandler:(0,a.cV)(Ie),abortSignal:e.abortSignal,fetch:this.config.fetch}),g=null!=h.language&&h.language in Te?Te[h.language]:void 0;return{text:h.text,segments:null!=(l=null!=(o=null==(s=h.segments)?void 0:s.map((e=>({text:e.text,startSecond:e.start,endSecond:e.end}))))?o:null==(i=h.words)?void 0:i.map((e=>({text:e.word,startSecond:e.start,endSecond:e.end}))))?l:[],language:g,durationInSeconds:null!=(c=h.duration)?c:void 0,warnings:m,response:{timestamp:p,modelId:this.modelId,headers:f,body:v}}}},Oe="3.0.0-beta.96";function ke(e={}){var t,n;const r=null!=(t=(0,a.ae)((0,a.x3)({settingValue:e.baseURL,environmentVariableName:"OPENAI_BASE_URL"})))?t:"https://api.openai.com/v1",s=null!=(n=e.name)?n:"openai",i=()=>(0,a.WZ)({Authorization:`Bearer ${(0,a.WL)({apiKey:e.apiKey,environmentVariableName:"OPENAI_API_KEY",description:"OpenAI"})}`,"OpenAI-Organization":e.organization,"OpenAI-Project":e.project,...e.headers},`ai-sdk/openai/${Oe}`),o=t=>new w(t,{provider:`${s}.embedding`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),l=t=>new k(t,{provider:`${s}.image`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),u=t=>new Ne(t,{provider:`${s}.transcription`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),c=t=>new Ae(t,{provider:`${s}.speech`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),p=e=>{if(new.target)throw new Error("The OpenAI model function cannot be called with the new keyword.");return d(e)},d=t=>new _e(t,{provider:`${s}.responses`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch,fileIdPrefixes:["file-"]}),m=function(e){return p(e)};return m.specificationVersion="v3",m.languageModel=p,m.chat=t=>new g(t,{provider:`${s}.chat`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),m.completion=t=>new S(t,{provider:`${s}.completion`,url:({path:e})=>`${r}${e}`,headers:i,fetch:e.fetch}),m.responses=d,m.embedding=o,m.embeddingModel=o,m.image=l,m.imageModel=l,m.transcription=u,m.transcriptionModel=u,m.speech=c,m.speechModel=c,m.tools=me,m}ke()},83214:e=>{const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},83586:(e,t,n)=>{const a=n(41694);e.exports=(e,t,n=!1)=>{if(e instanceof a)return e;try{return new a(e,t)}catch(e){if(!n)return null;throw e}}},84112:(e,t,n)=>{const a=n(9350),r=n(17914),{safeRe:s,t:i}=n(68752);e.exports=(e,t)=>{if(e instanceof a)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const a=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let r;for(;(r=a.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===n)return null;const o=n[2],l=n[3]||"0",u=n[4]||"0",c=t.includePrerelease&&n[5]?`-${n[5]}`:"",p=t.includePrerelease&&n[6]?`+${n[6]}`:"";return r(`${o}.${l}.${u}${c}${p}`,t)}},84527:(e,t,n)=>{n.d(t,{Od:()=>l,Rb:()=>o,Tj:()=>i,bp:()=>p,wG:()=>c,xL:()=>u});var a=n(49189),r=n(99629),s=n(72510);const i=e=>(t,n,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},o);if(l instanceof Promise)throw new a.GT;if(l.issues.length){const t=new(i?.Err??e)(l.issues.map((e=>s.iR(e,o,a.$W()))));throw s.gx(t,i?.callee),t}return l.value},o=(r.Kd,e=>async(t,n,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},o);if(l instanceof Promise&&(l=await l),l.issues.length){const t=new(i?.Err??e)(l.issues.map((e=>s.iR(e,o,a.$W()))));throw s.gx(t,i?.callee),t}return l.value}),l=(r.Kd,e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},l=t._zod.run({value:n,issues:[]},o);if(l instanceof Promise)throw new a.GT;return l.issues.length?{success:!1,error:new(e??r.a$)(l.issues.map((e=>s.iR(e,o,a.$W()))))}:{success:!0,data:l.value}}),u=l(r.Kd),c=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map((e=>s.iR(e,i,a.$W()))))}:{success:!0,data:o.value}},p=c(r.Kd)},84537:function(e,t){!function(e){var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],a="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ꟑꟑꟓꟕ-ꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",r={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},s="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",i={5:s,"5module":s+" export import",6:s+" const class extends export import super"},o=/^in(stanceof)?$/,l=new RegExp("["+a+"]"),u=new RegExp("["+a+"·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]");function c(e,t){for(var n=65536,a=0;a<t.length;a+=2){if((n+=t[a])>e)return!1;if((n+=t[a+1])>=e)return!0}return!1}function p(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&l.test(String.fromCharCode(e)):!1!==t&&c(e,n)))}function d(e,a){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&u.test(String.fromCharCode(e)):!1!==a&&(c(e,n)||c(e,t)))))}var m=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function h(e,t){return new m(e,{beforeExpr:!0,binop:t})}var f={beforeExpr:!0},v={startsExpr:!0},g={};function y(e,t){return void 0===t&&(t={}),t.keyword=e,g[e]=new m(e,t)}var $={num:new m("num",v),regexp:new m("regexp",v),string:new m("string",v),name:new m("name",v),privateId:new m("privateId",v),eof:new m("eof"),bracketL:new m("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new m("]"),braceL:new m("{",{beforeExpr:!0,startsExpr:!0}),braceR:new m("}"),parenL:new m("(",{beforeExpr:!0,startsExpr:!0}),parenR:new m(")"),comma:new m(",",f),semi:new m(";",f),colon:new m(":",f),dot:new m("."),question:new m("?",f),questionDot:new m("?."),arrow:new m("=>",f),template:new m("template"),invalidTemplate:new m("invalidTemplate"),ellipsis:new m("...",f),backQuote:new m("`",v),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m("=",{beforeExpr:!0,isAssign:!0}),assign:new m("_=",{beforeExpr:!0,isAssign:!0}),incDec:new m("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:h("||",1),logicalAND:h("&&",2),bitwiseOR:h("|",3),bitwiseXOR:h("^",4),bitwiseAND:h("&",5),equality:h("==/!=/===/!==",6),relational:h("</>/<=/>=",7),bitShift:h("<</>>/>>>",8),plusMin:new m("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:h("%",10),star:h("*",10),slash:h("/",10),starstar:new m("**",{beforeExpr:!0}),coalesce:h("??",1),_break:y("break"),_case:y("case",f),_catch:y("catch"),_continue:y("continue"),_debugger:y("debugger"),_default:y("default",f),_do:y("do",{isLoop:!0,beforeExpr:!0}),_else:y("else",f),_finally:y("finally"),_for:y("for",{isLoop:!0}),_function:y("function",v),_if:y("if"),_return:y("return",f),_switch:y("switch"),_throw:y("throw",f),_try:y("try"),_var:y("var"),_const:y("const"),_while:y("while",{isLoop:!0}),_with:y("with"),_new:y("new",{beforeExpr:!0,startsExpr:!0}),_this:y("this",v),_super:y("super",v),_class:y("class",v),_extends:y("extends",f),_export:y("export"),_import:y("import",v),_null:y("null",v),_true:y("true",v),_false:y("false",v),_in:y("in",{beforeExpr:!0,binop:7}),_instanceof:y("instanceof",{beforeExpr:!0,binop:7}),_typeof:y("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},b=/\r\n?|\n|\u2028|\u2029/,_=new RegExp(b.source,"g");function E(e){return 10===e||13===e||8232===e||8233===e}function x(e,t,n){void 0===n&&(n=e.length);for(var a=t;a<n;a++){var r=e.charCodeAt(a);if(E(r))return a<n-1&&13===r&&10===e.charCodeAt(a+1)?a+2:a+1}return-1}var S=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,A=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,I=Object.prototype,w=I.hasOwnProperty,T=I.toString,N=Object.hasOwn||function(e,t){return w.call(e,t)},O=Array.isArray||function(e){return"[object Array]"===T.call(e)},k=Object.create(null);function R(e){return k[e]||(k[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function C(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}var P=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,L=function(e,t){this.line=e,this.column=t};L.prototype.offset=function(e){return new L(this.line,this.column+e)};var j=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)};function M(e,t){for(var n=1,a=0;;){var r=x(e,a,t);if(r<0)return new L(n,t-a);++n,a=r}}var D={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Y=!1;function F(e){var t={};for(var n in D)t[n]=e&&N(e,n)?e[n]:D[n];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!Y&&"object"==typeof console&&console.warn&&(Y=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),e&&null!=e.allowHashBang||(t.allowHashBang=t.ecmaVersion>=14),O(t.onToken)){var a=t.onToken;t.onToken=function(e){return a.push(e)}}return O(t.onComment)&&(t.onComment=function(e,t){return function(n,a,r,s,i,o){var l={type:n?"Block":"Line",value:a,start:r,end:s};e.locations&&(l.loc=new j(this,i,o)),e.ranges&&(l.range=[r,s]),t.push(l)}}(t,t.onComment)),t}var q=256,U=259;function V(e,t){return 2|(e?4:0)|(t?8:0)}var z=function(e,t,n){this.options=e=F(e),this.sourceFile=e.sourceFile,this.keywords=R(i[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var a="";!0!==e.allowReserved&&(a=r[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(a+=" await")),this.reservedWords=R(a);var s=(a?a+" ":"")+r.strict;this.reservedWordsStrict=R(s),this.reservedWordsStrictBind=R(s+" "+r.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(b).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=$.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null,this.privateNameStack=[]},Z={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};z.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},Z.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},Z.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},Z.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},Z.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t)return!1;if(2&t)return(4&t)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Z.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0||this.options.allowSuperOutsideMethod},Z.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},Z.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Z.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(768&t||2&t&&!(16&t))return!0}return!1},Z.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&q)>0},z.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,a=0;a<e.length;a++)n=e[a](n);return n},z.parse=function(e,t){return new this(t,e).parse()},z.parseExpressionAt=function(e,t,n){var a=new this(n,e,t);return a.nextToken(),a.parseExpression()},z.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(z.prototype,Z);var B=z.prototype,G=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;B.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){A.lastIndex=e,e+=A.exec(this.input)[0].length;var t=G.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){A.lastIndex=e+t[0].length;var n=A.exec(this.input),a=n.index+n[0].length,r=this.input.charAt(a);return";"===r||"}"===r||b.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||"!"===r&&"="===this.input.charAt(a+1))}e+=t[0].length,A.lastIndex=e,e+=A.exec(this.input)[0].length,";"===this.input[e]&&e++}},B.eat=function(e){return this.type===e&&(this.next(),!0)},B.isContextual=function(e){return this.type===$.name&&this.value===e&&!this.containsEsc},B.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},B.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},B.canInsertSemicolon=function(){return this.type===$.eof||this.type===$.braceR||b.test(this.input.slice(this.lastTokEnd,this.start))},B.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},B.semicolon=function(){this.eat($.semi)||this.insertSemicolon()||this.unexpected()},B.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},B.expect=function(e){this.eat(e)||this.unexpected()},B.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var W=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};B.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?"Assigning to rvalue":"Parenthesized pattern")}},B.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,a=e.doubleProto;if(!t)return n>=0||a>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),a>=0&&this.raiseRecoverable(a,"Redefinition of __proto__ property")},B.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},B.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var K=z.prototype;K.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==$.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var a=0,r=Object.keys(this.undefinedExports);a<r.length;a+=1){var s=r[a];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var H={kind:"loop"},J={kind:"switch"};K.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;A.lastIndex=this.pos;var t=A.exec(this.input),n=this.pos+t[0].length,a=this.input.charCodeAt(n);if(91===a||92===a)return!0;if(e)return!1;if(123===a||a>55295&&a<56320)return!0;if(p(a,!0)){for(var r=n+1;d(a=this.input.charCodeAt(r),!0);)++r;if(92===a||a>55295&&a<56320)return!0;var s=this.input.slice(n,r);if(!o.test(s))return!0}return!1},K.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;A.lastIndex=this.pos;var e,t=A.exec(this.input),n=this.pos+t[0].length;return!(b.test(this.input.slice(this.pos,n))||"function"!==this.input.slice(n,n+8)||n+8!==this.input.length&&(d(e=this.input.charCodeAt(n+8))||e>55295&&e<56320))},K.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;A.lastIndex=this.pos;var n=A.exec(this.input),a=this.pos+n[0].length;if(b.test(this.input.slice(this.pos,a)))return!1;if(e){var r,s=a+5;if("using"!==this.input.slice(a,s)||s===this.input.length||d(r=this.input.charCodeAt(s))||r>55295&&r<56320)return!1;A.lastIndex=s;var i=A.exec(this.input);if(i&&b.test(this.input.slice(s,s+i[0].length)))return!1}if(t){var o,l=a+2;if(!("of"!==this.input.slice(a,l)||l!==this.input.length&&(d(o=this.input.charCodeAt(l))||o>55295&&o<56320)))return!1}var u=this.input.charCodeAt(a);return p(u,!0)||92===u},K.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},K.isUsing=function(e){return this.isUsingKeyword(!1,e)},K.parseStatement=function(e,t,n){var a,r=this.type,s=this.startNode();switch(this.isLet(e)&&(r=$._var,a="let"),r){case $._break:case $._continue:return this.parseBreakContinueStatement(s,r.keyword);case $._debugger:return this.parseDebuggerStatement(s);case $._do:return this.parseDoStatement(s);case $._for:return this.parseForStatement(s);case $._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case $._class:return e&&this.unexpected(),this.parseClass(s,!0);case $._if:return this.parseIfStatement(s);case $._return:return this.parseReturnStatement(s);case $._switch:return this.parseSwitchStatement(s);case $._throw:return this.parseThrowStatement(s);case $._try:return this.parseTryStatement(s);case $._const:case $._var:return a=a||this.value,e&&"var"!==a&&this.unexpected(),this.parseVarStatement(s,a);case $._while:return this.parseWhileStatement(s);case $._with:return this.parseWithStatement(s);case $.braceL:return this.parseBlock(!0,s);case $.semi:return this.parseEmptyStatement(s);case $._export:case $._import:if(this.options.ecmaVersion>10&&r===$._import){A.lastIndex=this.pos;var i=A.exec(this.input),o=this.pos+i[0].length,l=this.input.charCodeAt(o);if(40===l||46===l)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===$._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var u=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(u)return t&&"script"===this.options.sourceType&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),"await using"===u&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(s,!1,u),this.semicolon(),this.finishNode(s,"VariableDeclaration");var c=this.value,p=this.parseExpression();return r===$.name&&"Identifier"===p.type&&this.eat($.colon)?this.parseLabeledStatement(s,c,p,e):this.parseExpressionStatement(s,p)}},K.parseBreakContinueStatement=function(e,t){var n="break"===t;this.next(),this.eat($.semi)||this.insertSemicolon()?e.label=null:this.type!==$.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var a=0;a<this.labels.length;++a){var r=this.labels[a];if(null==e.label||r.name===e.label.name){if(null!=r.kind&&(n||"loop"===r.kind))break;if(e.label&&n)break}}return a===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,n?"BreakStatement":"ContinueStatement")},K.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},K.parseDoStatement=function(e){return this.next(),this.labels.push(H),e.body=this.parseStatement("do"),this.labels.pop(),this.expect($._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat($.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},K.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(H),this.enterScope(0),this.expect($.parenL),this.type===$.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===$._var||this.type===$._const||n){var a=this.startNode(),r=n?"let":this.value;return this.next(),this.parseVar(a,!0,r),this.finishNode(a,"VariableDeclaration"),this.parseForAfterInit(e,a,t)}var s=this.isContextual("let"),i=!1,o=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(o){var l=this.startNode();return this.next(),"await using"===o&&this.next(),this.parseVar(l,!0,o),this.finishNode(l,"VariableDeclaration"),this.parseForAfterInit(e,l,t)}var u=this.containsEsc,c=new W,p=this.start,d=t>-1?this.parseExprSubscripts(c,"await"):this.parseExpression(!0,c);return this.type===$._in||(i=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===$._in&&this.unexpected(t),e.await=!0):i&&this.options.ecmaVersion>=8&&(d.start!==p||u||"Identifier"!==d.type||"async"!==d.name?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),s&&i&&this.raise(d.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(d,!1,c),this.checkLValPattern(d),this.parseForIn(e,d)):(this.checkExpressionErrors(c,!0),t>-1&&this.unexpected(t),this.parseFor(e,d))},K.parseForAfterInit=function(e,t,n){return(this.type===$._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===t.declarations.length?(this.options.ecmaVersion>=9&&(this.type===$._in?n>-1&&this.unexpected(n):e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},K.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Q|(n?0:ee),!1,t)},K.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat($._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},K.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat($.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},K.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect($.braceL),this.labels.push(J),this.enterScope(0);for(var n=!1;this.type!==$.braceR;)if(this.type===$._case||this.type===$._default){var a=this.type===$._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),a?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect($.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},K.parseThrowStatement=function(e){return this.next(),b.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var X=[];K.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?32:0),this.checkLValPattern(e,t?4:2),this.expect($.parenR),e},K.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===$._catch){var t=this.startNode();this.next(),this.eat($.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat($._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},K.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,"VariableDeclaration")},K.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(H),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},K.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},K.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},K.parseLabeledStatement=function(e,t,n,a){for(var r=0,s=this.labels;r<s.length;r+=1)s[r].name===t&&this.raise(n.start,"Label '"+t+"' is already declared");for(var i=this.type.isLoop?"loop":this.type===$._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var l=this.labels[o];if(l.statementStart!==e.start)break;l.statementStart=this.start,l.kind=i}return this.labels.push({name:t,kind:i,statementStart:this.start}),e.body=this.parseStatement(a?-1===a.indexOf("label")?a+"label":a:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},K.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},K.parseBlock=function(e,t,n){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect($.braceL),e&&this.enterScope(0);this.type!==$.braceR;){var a=this.parseStatement(null);t.body.push(a)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},K.parseFor=function(e,t){return e.init=t,this.expect($.semi),e.test=this.type===$.semi?null:this.parseExpression(),this.expect($.semi),e.update=this.type===$.parenR?null:this.parseExpression(),this.expect($.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},K.parseForIn=function(e,t){var n=this.type===$._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!n||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect($.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")},K.parseVar=function(e,t,n,a){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat($.eq)?r.init=this.parseMaybeAssign(t):a||"const"!==n||this.type===$._in||this.options.ecmaVersion>=6&&this.isContextual("of")?a||"using"!==n&&"await using"!==n||!(this.options.ecmaVersion>=17)||this.type===$._in||this.isContextual("of")?a||"Identifier"===r.id.type||t&&(this.type===$._in||this.isContextual("of"))?r.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+n+" declaration"):this.unexpected(),e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat($.comma))break}return e},K.parseVarId=function(e,t){e.id="using"===t||"await using"===t?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?1:2,!1)};var Q=1,ee=2;function te(e,t){var n=t.key.name,a=e[n],r="true";return"MethodDefinition"!==t.type||"get"!==t.kind&&"set"!==t.kind||(r=(t.static?"s":"i")+t.kind),"iget"===a&&"iset"===r||"iset"===a&&"iget"===r||"sget"===a&&"sset"===r||"sset"===a&&"sget"===r?(e[n]="true",!1):!!a||(e[n]=r,!1)}function ne(e,t){var n=e.computed,a=e.key;return!n&&("Identifier"===a.type&&a.name===t||"Literal"===a.type&&a.value===t)}K.parseFunction=function(e,t,n,a,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!a)&&(this.type===$.star&&t&ee&&this.unexpected(),e.generator=this.eat($.star)),this.options.ecmaVersion>=8&&(e.async=!!a),t&Q&&(e.id=4&t&&this.type!==$.name?null:this.parseIdent(),!e.id||t&ee||this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var s=this.yieldPos,i=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(V(e.async,e.generator)),t&Q||(e.id=this.type===$.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,r),this.yieldPos=s,this.awaitPos=i,this.awaitIdentPos=o,this.finishNode(e,t&Q?"FunctionDeclaration":"FunctionExpression")},K.parseFunctionParams=function(e){this.expect($.parenL),e.params=this.parseBindingList($.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},K.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var a=this.enterClassBody(),r=this.startNode(),s=!1;for(r.body=[],this.expect($.braceL);this.type!==$.braceR;){var i=this.parseClassElement(null!==e.superClass);i&&(r.body.push(i),"MethodDefinition"===i.type&&"constructor"===i.kind?(s&&this.raiseRecoverable(i.start,"Duplicate constructor in the same class"),s=!0):i.key&&"PrivateIdentifier"===i.key.type&&te(a,i)&&this.raiseRecoverable(i.key.start,"Identifier '#"+i.key.name+"' has already been declared"))}return this.strict=n,this.next(),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},K.parseClassElement=function(e){if(this.eat($.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),a="",r=!1,s=!1,i="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat($.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===$.star?o=!0:a="static"}if(n.static=o,!a&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==$.star||this.canInsertSemicolon()?a="async":s=!0),!a&&(t>=9||!s)&&this.eat($.star)&&(r=!0),!a&&!s&&!r){var l=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?i=l:a=l)}if(a?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=a,this.finishNode(n.key,"Identifier")):this.parseClassElementName(n),t<13||this.type===$.parenL||"method"!==i||r||s){var u=!n.static&&ne(n,"constructor"),c=u&&e;u&&"method"!==i&&this.raise(n.key.start,"Constructor can't have get/set modifier"),n.kind=u?"constructor":i,this.parseClassMethod(n,r,s,c)}else this.parseClassField(n);return n},K.isClassElementNameStart=function(){return this.type===$.name||this.type===$.privateId||this.type===$.num||this.type===$.string||this.type===$.bracketL||this.type.keyword},K.parseClassElementName=function(e){this.type===$.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},K.parseClassMethod=function(e,t,n,a){var r=e.key;"constructor"===e.kind?(t&&this.raise(r.start,"Constructor can't be a generator"),n&&this.raise(r.start,"Constructor can't be an async method")):e.static&&ne(e,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");var s=e.value=this.parseMethod(t,n,a);return"get"===e.kind&&0!==s.params.length&&this.raiseRecoverable(s.start,"getter should have no params"),"set"===e.kind&&1!==s.params.length&&this.raiseRecoverable(s.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===s.params[0].type&&this.raiseRecoverable(s.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},K.parseClassField=function(e){return ne(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&ne(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat($.eq)?(this.enterScope(576),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},K.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(320);this.type!==$.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},K.parseClassId=function(e,t){this.type===$.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},K.parseClassSuper=function(e){e.superClass=this.eat($._extends)?this.parseExprSubscripts(null,!1):null},K.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},K.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var a=this.privateNameStack.length,r=0===a?null:this.privateNameStack[a-1],s=0;s<n.length;++s){var i=n[s];N(t,i.name)||(r?r.used.push(i):this.raiseRecoverable(i.start,"Private field '#"+i.name+"' must be declared in an enclosing class"))}},K.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==$.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},K.parseExport=function(e,t){if(this.next(),this.eat($.star))return this.parseExportAllDeclaration(e,t);if(this.eat($._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==$.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,a=e.specifiers;n<a.length;n+=1){var r=a[n];this.checkUnreserved(r.local),this.checkLocalExport(r.local),"Literal"===r.local.type&&this.raise(r.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},K.parseExportDeclaration=function(e){return this.parseStatement(null)},K.parseExportDefaultDeclaration=function(){var e;if(this.type===$._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,4|Q,!1,e)}if(this.type===$._class){var n=this.startNode();return this.parseClass(n,"nullableID")}var a=this.parseMaybeAssign();return this.semicolon(),a},K.checkExport=function(e,t,n){e&&("string"!=typeof t&&(t="Identifier"===t.type?t.name:t.value),N(e,t)&&this.raiseRecoverable(n,"Duplicate export '"+t+"'"),e[t]=!0)},K.checkPatternExport=function(e,t){var n=t.type;if("Identifier"===n)this.checkExport(e,t,t.start);else if("ObjectPattern"===n)for(var a=0,r=t.properties;a<r.length;a+=1){var s=r[a];this.checkPatternExport(e,s)}else if("ArrayPattern"===n)for(var i=0,o=t.elements;i<o.length;i+=1){var l=o[i];l&&this.checkPatternExport(e,l)}else"Property"===n?this.checkPatternExport(e,t.value):"AssignmentPattern"===n?this.checkPatternExport(e,t.left):"RestElement"===n&&this.checkPatternExport(e,t.argument)},K.checkVariableExport=function(e,t){if(e)for(var n=0,a=t;n<a.length;n+=1){var r=a[n];this.checkPatternExport(e,r.id)}},K.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},K.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},K.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect($.braceL);!this.eat($.braceR);){if(n)n=!1;else if(this.expect($.comma),this.afterTrailingComma($.braceR))break;t.push(this.parseExportSpecifier(e))}return t},K.parseImport=function(e){return this.next(),this.type===$.string?(e.specifiers=X,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===$.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},K.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportSpecifier")},K.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportDefaultSpecifier")},K.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,2),this.finishNode(e,"ImportNamespaceSpecifier")},K.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===$.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat($.comma)))return e;if(this.type===$.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect($.braceL);!this.eat($.braceR);){if(t)t=!1;else if(this.expect($.comma),this.afterTrailingComma($.braceR))break;e.push(this.parseImportSpecifier())}return e},K.parseWithClause=function(){var e=[];if(!this.eat($._with))return e;this.expect($.braceL);for(var t={},n=!0;!this.eat($.braceR);){if(n)n=!1;else if(this.expect($.comma),this.afterTrailingComma($.braceR))break;var a=this.parseImportAttribute(),r="Identifier"===a.key.type?a.key.name:a.key.value;N(t,r)&&this.raiseRecoverable(a.key.start,"Duplicate attribute key '"+r+"'"),t[r]=!0,e.push(a)}return e},K.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===$.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect($.colon),this.type!==$.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},K.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===$.string){var e=this.parseLiteral(this.value);return P.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},K.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},K.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var ae=z.prototype;ae.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var a=0,r=e.properties;a<r.length;a+=1){var s=r[a];this.toAssignable(s,t),"RestElement"!==s.type||"ArrayPattern"!==s.argument.type&&"ObjectPattern"!==s.argument.type||this.raise(s.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,n);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else n&&this.checkPatternErrors(n,!0);return e},ae.toAssignableList=function(e,t){for(var n=e.length,a=0;a<n;a++){var r=e[a];r&&this.toAssignable(r,t)}if(n){var s=e[n-1];6===this.options.ecmaVersion&&t&&s&&"RestElement"===s.type&&"Identifier"!==s.argument.type&&this.unexpected(s.argument.start)}return e},ae.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},ae.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==$.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},ae.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case $.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList($.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case $.braceL:return this.parseObj(!0)}return this.parseIdent()},ae.parseBindingList=function(e,t,n,a){for(var r=[],s=!0;!this.eat(e);)if(s?s=!1:this.expect($.comma),t&&this.type===$.comma)r.push(null);else{if(n&&this.afterTrailingComma(e))break;if(this.type===$.ellipsis){var i=this.parseRestBinding();this.parseBindingListItem(i),r.push(i),this.type===$.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}r.push(this.parseAssignableListItem(a))}return r},ae.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},ae.parseBindingListItem=function(e){return e},ae.parseMaybeDefault=function(e,t,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat($.eq))return n;var a=this.startNodeAt(e,t);return a.left=n,a.right=this.parseMaybeAssign(),this.finishNode(a,"AssignmentPattern")},ae.checkLValSimple=function(e,t,n){void 0===t&&(t=0);var a=0!==t;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(a?"Binding ":"Assigning to ")+e.name+" in strict mode"),a&&(2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),n&&(N(n,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),n[e.name]=!0),5!==t&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":a&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return a&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(a?"Binding":"Assigning to")+" rvalue")}},ae.checkLValPattern=function(e,t,n){switch(void 0===t&&(t=0),e.type){case"ObjectPattern":for(var a=0,r=e.properties;a<r.length;a+=1){var s=r[a];this.checkLValInnerPattern(s,t,n)}break;case"ArrayPattern":for(var i=0,o=e.elements;i<o.length;i+=1){var l=o[i];l&&this.checkLValInnerPattern(l,t,n)}break;default:this.checkLValSimple(e,t,n)}},ae.checkLValInnerPattern=function(e,t,n){switch(void 0===t&&(t=0),e.type){case"Property":this.checkLValInnerPattern(e.value,t,n);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,n);break;case"RestElement":this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var re=function(e,t,n,a,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=a,this.generator=!!r},se={b_stat:new re("{",!1),b_expr:new re("{",!0),b_tmpl:new re("${",!1),p_stat:new re("(",!1),p_expr:new re("(",!0),q_tmpl:new re("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new re("function",!1),f_expr:new re("function",!0),f_expr_gen:new re("function",!0,!1,null,!0),f_gen:new re("function",!1,!1,null,!0)},ie=z.prototype;ie.initialContext=function(){return[se.b_stat]},ie.curContext=function(){return this.context[this.context.length-1]},ie.braceIsBlock=function(e){var t=this.curContext();return t===se.f_expr||t===se.f_stat||(e!==$.colon||t!==se.b_stat&&t!==se.b_expr?e===$._return||e===$.name&&this.exprAllowed?b.test(this.input.slice(this.lastTokEnd,this.start)):e===$._else||e===$.semi||e===$.eof||e===$.parenR||e===$.arrow||(e===$.braceL?t===se.b_stat:e!==$._var&&e!==$._const&&e!==$.name&&!this.exprAllowed):!t.isExpr)},ie.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},ie.updateContext=function(e){var t,n=this.type;n.keyword&&e===$.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},ie.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},$.parenR.updateContext=$.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===se.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},$.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?se.b_stat:se.b_expr),this.exprAllowed=!0},$.dollarBraceL.updateContext=function(){this.context.push(se.b_tmpl),this.exprAllowed=!0},$.parenL.updateContext=function(e){var t=e===$._if||e===$._for||e===$._with||e===$._while;this.context.push(t?se.p_stat:se.p_expr),this.exprAllowed=!0},$.incDec.updateContext=function(){},$._function.updateContext=$._class.updateContext=function(e){!e.beforeExpr||e===$._else||e===$.semi&&this.curContext()!==se.p_stat||e===$._return&&b.test(this.input.slice(this.lastTokEnd,this.start))||(e===$.colon||e===$.braceL)&&this.curContext()===se.b_stat?this.context.push(se.f_stat):this.context.push(se.f_expr),this.exprAllowed=!1},$.colon.updateContext=function(){"function"===this.curContext().token&&this.context.pop(),this.exprAllowed=!0},$.backQuote.updateContext=function(){this.curContext()===se.q_tmpl?this.context.pop():this.context.push(se.q_tmpl),this.exprAllowed=!1},$.star.updateContext=function(e){if(e===$._function){var t=this.context.length-1;this.context[t]===se.f_expr?this.context[t]=se.f_expr_gen:this.context[t]=se.f_gen}this.exprAllowed=!0},$.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==$.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var oe=z.prototype;function le(e){return"Identifier"===e.type||"ParenthesizedExpression"===e.type&&le(e.expression)}function ue(e){return"MemberExpression"===e.type&&"PrivateIdentifier"===e.property.type||"ChainExpression"===e.type&&ue(e.expression)||"ParenthesizedExpression"===e.type&&ue(e.expression)}oe.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var a,r=e.key;switch(r.type){case"Identifier":a=r.name;break;case"Literal":a=String(r.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===a&&"init"===s&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=!0);else{var i=t[a="$"+a];i?("init"===s?this.strict&&i.init||i.get||i.set:i.init||i[s])&&this.raiseRecoverable(r.start,"Redefinition of property"):i=t[a]={init:!1,get:!1,set:!1},i[s]=!0}}},oe.parseExpression=function(e,t){var n=this.start,a=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===$.comma){var s=this.startNodeAt(n,a);for(s.expressions=[r];this.eat($.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return r},oe.parseMaybeAssign=function(e,t,n){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var a=!1,r=-1,s=-1,i=-1;t?(r=t.parenthesizedAssign,s=t.trailingComma,i=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new W,a=!0);var o=this.start,l=this.startLoc;this.type!==$.parenL&&this.type!==$.name||(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===e);var u=this.parseMaybeConditional(e,t);if(n&&(u=n.call(this,u,o,l)),this.type.isAssign){var c=this.startNodeAt(o,l);return c.operator=this.value,this.type===$.eq&&(u=this.toAssignable(u,!1,t)),a||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=u.start&&(t.shorthandAssign=-1),this.type===$.eq?this.checkLValPattern(u):this.checkLValSimple(u),c.left=u,this.next(),c.right=this.parseMaybeAssign(e),i>-1&&(t.doubleProto=i),this.finishNode(c,"AssignmentExpression")}return a&&this.checkExpressionErrors(t,!0),r>-1&&(t.parenthesizedAssign=r),s>-1&&(t.trailingComma=s),u},oe.parseMaybeConditional=function(e,t){var n=this.start,a=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(this.eat($.question)){var s=this.startNodeAt(n,a);return s.test=r,s.consequent=this.parseMaybeAssign(),this.expect($.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return r},oe.parseExprOps=function(e,t){var n=this.start,a=this.startLoc,r=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||r.start===n&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,n,a,-1,e)},oe.parseExprOp=function(e,t,n,a,r){var s=this.type.binop;if(null!=s&&(!r||this.type!==$._in)&&s>a){var i=this.type===$.logicalOR||this.type===$.logicalAND,o=this.type===$.coalesce;o&&(s=$.logicalAND.binop);var l=this.value;this.next();var u=this.start,c=this.startLoc,p=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),u,c,s,r),d=this.buildBinary(t,n,e,p,l,i||o);return(i&&this.type===$.coalesce||o&&(this.type===$.logicalOR||this.type===$.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(d,t,n,a,r)}return e},oe.buildBinary=function(e,t,n,a,r,s){"PrivateIdentifier"===a.type&&this.raise(a.start,"Private identifier can only be left side of binary expression");var i=this.startNodeAt(e,t);return i.left=n,i.operator=r,i.right=a,this.finishNode(i,s?"LogicalExpression":"BinaryExpression")},oe.parseMaybeUnary=function(e,t,n,a){var r,s=this.start,i=this.startLoc;if(this.isContextual("await")&&this.canAwait)r=this.parseAwait(a),t=!0;else if(this.type.prefix){var o=this.startNode(),l=this.type===$.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,l,a),this.checkExpressionErrors(e,!0),l?this.checkLValSimple(o.argument):this.strict&&"delete"===o.operator&&le(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):"delete"===o.operator&&ue(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,r=this.finishNode(o,l?"UpdateExpression":"UnaryExpression")}else if(t||this.type!==$.privateId){if(r=this.parseExprSubscripts(e,a),this.checkExpressionErrors(e))return r;for(;this.type.postfix&&!this.canInsertSemicolon();){var u=this.startNodeAt(s,i);u.operator=this.value,u.prefix=!1,u.argument=r,this.checkLValSimple(r),this.next(),r=this.finishNode(u,"UpdateExpression")}}else(a||0===this.privateNameStack.length)&&this.options.checkPrivateFields&&this.unexpected(),r=this.parsePrivateIdent(),this.type!==$._in&&this.unexpected();return n||!this.eat($.starstar)?r:t?void this.unexpected(this.lastTokStart):this.buildBinary(s,i,r,this.parseMaybeUnary(null,!1,!1,a),"**",!1)},oe.parseExprSubscripts=function(e,t){var n=this.start,a=this.startLoc,r=this.parseExprAtom(e,t);if("ArrowFunctionExpression"===r.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return r;var s=this.parseSubscripts(r,n,a,!1,t);return e&&"MemberExpression"===s.type&&(e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),s},oe.parseSubscripts=function(e,t,n,a,r){for(var s=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start==5&&this.potentialArrowAt===e.start,i=!1;;){var o=this.parseSubscript(e,t,n,a,s,i,r);if(o.optional&&(i=!0),o===e||"ArrowFunctionExpression"===o.type){if(i){var l=this.startNodeAt(t,n);l.expression=o,o=this.finishNode(l,"ChainExpression")}return o}e=o}},oe.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat($.arrow)},oe.parseSubscriptAsyncArrow=function(e,t,n,a){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,a)},oe.parseSubscript=function(e,t,n,a,r,s,i){var o=this.options.ecmaVersion>=11,l=o&&this.eat($.questionDot);a&&l&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var u=this.eat($.bracketL);if(u||l&&this.type!==$.parenL&&this.type!==$.backQuote||this.eat($.dot)){var c=this.startNodeAt(t,n);c.object=e,u?(c.property=this.parseExpression(),this.expect($.bracketR)):this.type===$.privateId&&"Super"!==e.type?c.property=this.parsePrivateIdent():c.property=this.parseIdent("never"!==this.options.allowReserved),c.computed=!!u,o&&(c.optional=l),e=this.finishNode(c,"MemberExpression")}else if(!a&&this.eat($.parenL)){var p=new W,d=this.yieldPos,m=this.awaitPos,h=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var f=this.parseExprList($.parenR,this.options.ecmaVersion>=8,!1,p);if(r&&!l&&this.shouldParseAsyncArrow())return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=d,this.awaitPos=m,this.awaitIdentPos=h,this.parseSubscriptAsyncArrow(t,n,f,i);this.checkExpressionErrors(p,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=m||this.awaitPos,this.awaitIdentPos=h||this.awaitIdentPos;var v=this.startNodeAt(t,n);v.callee=e,v.arguments=f,o&&(v.optional=l),e=this.finishNode(v,"CallExpression")}else if(this.type===$.backQuote){(l||s)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var g=this.startNodeAt(t,n);g.tag=e,g.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(g,"TaggedTemplateExpression")}return e},oe.parseExprAtom=function(e,t,n){this.type===$.slash&&this.readRegexp();var a,r=this.potentialArrowAt===this.start;switch(this.type){case $._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),a=this.startNode(),this.next(),this.type!==$.parenL||this.allowDirectSuper||this.raise(a.start,"super() call outside constructor of a subclass"),this.type!==$.dot&&this.type!==$.bracketL&&this.type!==$.parenL&&this.unexpected(),this.finishNode(a,"Super");case $._this:return a=this.startNode(),this.next(),this.finishNode(a,"ThisExpression");case $.name:var s=this.start,i=this.startLoc,o=this.containsEsc,l=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&"async"===l.name&&!this.canInsertSemicolon()&&this.eat($._function))return this.overrideContext(se.f_expr),this.parseFunction(this.startNodeAt(s,i),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat($.arrow))return this.parseArrowExpression(this.startNodeAt(s,i),[l],!1,t);if(this.options.ecmaVersion>=8&&"async"===l.name&&this.type===$.name&&!o&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return l=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat($.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,i),[l],!0,t)}return l;case $.regexp:var u=this.value;return(a=this.parseLiteral(u.value)).regex={pattern:u.pattern,flags:u.flags},a;case $.num:case $.string:return this.parseLiteral(this.value);case $._null:case $._true:case $._false:return(a=this.startNode()).value=this.type===$._null?null:this.type===$._true,a.raw=this.type.keyword,this.next(),this.finishNode(a,"Literal");case $.parenL:var c=this.start,p=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),p;case $.bracketL:return a=this.startNode(),this.next(),a.elements=this.parseExprList($.bracketR,!0,!0,e),this.finishNode(a,"ArrayExpression");case $.braceL:return this.overrideContext(se.b_expr),this.parseObj(!1,e);case $._function:return a=this.startNode(),this.next(),this.parseFunction(a,0);case $._class:return this.parseClass(this.startNode(),!1);case $._new:return this.parseNew();case $.backQuote:return this.parseTemplate();case $._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},oe.parseExprAtomDefault=function(){this.unexpected()},oe.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===$.parenL&&!e)return this.parseDynamicImport(t);if(this.type===$.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name="import",t.meta=this.finishNode(n,"Identifier"),this.parseImportMeta(t)}this.unexpected()},oe.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat($.parenR)?e.options=null:(this.expect($.comma),this.afterTrailingComma($.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat($.parenR)||(this.expect($.comma),this.afterTrailingComma($.parenR)||this.unexpected())));else if(!this.eat($.parenR)){var t=this.start;this.eat($.comma)&&this.eat($.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},oe.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},oe.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=null!=t.value?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},oe.parseParenExpression=function(){this.expect($.parenL);var e=this.parseExpression();return this.expect($.parenR),e},oe.shouldParseArrow=function(e){return!this.canInsertSemicolon()},oe.parseParenAndDistinguishExpression=function(e,t){var n,a=this.start,r=this.startLoc,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var i,o=this.start,l=this.startLoc,u=[],c=!0,p=!1,d=new W,m=this.yieldPos,h=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==$.parenR;){if(c?c=!1:this.expect($.comma),s&&this.afterTrailingComma($.parenR,!0)){p=!0;break}if(this.type===$.ellipsis){i=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===$.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}u.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var f=this.lastTokEnd,v=this.lastTokEndLoc;if(this.expect($.parenR),e&&this.shouldParseArrow(u)&&this.eat($.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=m,this.awaitPos=h,this.parseParenArrowList(a,r,u,t);u.length&&!p||this.unexpected(this.lastTokStart),i&&this.unexpected(i),this.checkExpressionErrors(d,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=h||this.awaitPos,u.length>1?((n=this.startNodeAt(o,l)).expressions=u,this.finishNodeAt(n,"SequenceExpression",f,v)):n=u[0]}else n=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(a,r);return g.expression=n,this.finishNode(g,"ParenthesizedExpression")}return n},oe.parseParenItem=function(e){return e},oe.parseParenArrowList=function(e,t,n,a){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,a)};var ce=[];oe.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===$.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var a=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),a,r,!0,!1),this.eat($.parenL)?e.arguments=this.parseExprList($.parenR,this.options.ecmaVersion>=8,!1):e.arguments=ce,this.finishNode(e,"NewExpression")},oe.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===$.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===$.backQuote,this.finishNode(n,"TemplateElement")},oe.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var a=this.parseTemplateElement({isTagged:t});for(n.quasis=[a];!a.tail;)this.type===$.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect($.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect($.braceR),n.quasis.push(a=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")},oe.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===$.name||this.type===$.num||this.type===$.string||this.type===$.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===$.star)&&!b.test(this.input.slice(this.lastTokEnd,this.start))},oe.parseObj=function(e,t){var n=this.startNode(),a=!0,r={};for(n.properties=[],this.next();!this.eat($.braceR);){if(a)a=!1;else if(this.expect($.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma($.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,r,t),n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},oe.parseProperty=function(e,t){var n,a,r,s,i=this.startNode();if(this.options.ecmaVersion>=9&&this.eat($.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===$.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===$.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(r=this.start,s=this.startLoc),e||(n=this.eat($.star)));var o=this.containsEsc;return this.parsePropertyName(i),!e&&!o&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(i)?(a=!0,n=this.options.ecmaVersion>=9&&this.eat($.star),this.parsePropertyName(i)):a=!1,this.parsePropertyValue(i,e,n,a,r,s,t,o),this.finishNode(i,"Property")},oe.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n="get"===e.kind?0:1;if(e.value.params.length!==n){var a=e.value.start;"get"===e.kind?this.raiseRecoverable(a,"getter should have no params"):this.raiseRecoverable(a,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},oe.parsePropertyValue=function(e,t,n,a,r,s,i,o){(n||a)&&this.type===$.colon&&this.unexpected(),this.eat($.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,i),e.kind="init"):this.options.ecmaVersion>=6&&this.type===$.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,a),e.kind="init"):t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===$.comma||this.type===$.braceR||this.type===$.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((n||a)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=r),t?e.value=this.parseMaybeDefault(r,s,this.copyNode(e.key)):this.type===$.eq&&i?(i.shorthandAssign<0&&(i.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,s,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected():((n||a)&&this.unexpected(),this.parseGetterSetter(e))},oe.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat($.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect($.bracketR),e.key;e.computed=!1}return e.key=this.type===$.num||this.type===$.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},oe.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},oe.parseMethod=function(e,t,n){var a=this.startNode(),r=this.yieldPos,s=this.awaitPos,i=this.awaitIdentPos;return this.initFunction(a),this.options.ecmaVersion>=6&&(a.generator=e),this.options.ecmaVersion>=8&&(a.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|V(t,a.generator)|(n?128:0)),this.expect($.parenL),a.params=this.parseBindingList($.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(a,!1,!0,!1),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=i,this.finishNode(a,"FunctionExpression")},oe.parseArrowExpression=function(e,t,n,a){var r=this.yieldPos,s=this.awaitPos,i=this.awaitIdentPos;return this.enterScope(16|V(n,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,a),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=i,this.finishNode(e,"ArrowFunctionExpression")},oe.parseFunctionBody=function(e,t,n,a){var r=t&&this.type!==$.braceL,s=this.strict,i=!1;if(r)e.body=this.parseMaybeAssign(a),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);s&&!o||(i=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var l=this.labels;this.labels=[],i&&(this.strict=!0),this.checkParams(e,!s&&!i&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,5),e.body=this.parseBlock(!1,void 0,i&&!s),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=l}this.exitScope()},oe.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if("Identifier"!==n[t].type)return!1;return!0},oe.checkParams=function(e,t){for(var n=Object.create(null),a=0,r=e.params;a<r.length;a+=1){var s=r[a];this.checkLValInnerPattern(s,1,t?null:n)}},oe.parseExprList=function(e,t,n,a){for(var r=[],s=!0;!this.eat(e);){if(s)s=!1;else if(this.expect($.comma),t&&this.afterTrailingComma(e))break;var i=void 0;n&&this.type===$.comma?i=null:this.type===$.ellipsis?(i=this.parseSpread(a),a&&this.type===$.comma&&a.trailingComma<0&&(a.trailingComma=this.start)):i=this.parseMaybeAssign(!1,a),r.push(i)}return r},oe.checkUnreserved=function(e){var t=e.start,n=e.end,a=e.name;this.inGenerator&&"yield"===a&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===a&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().flags&U||"arguments"!==a||this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),!this.inClassStaticBlock||"arguments"!==a&&"await"!==a||this.raise(t,"Cannot use "+a+" in class static initialization block"),this.keywords.test(a)&&this.raise(t,"Unexpected keyword '"+a+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,n).indexOf("\\")||(this.strict?this.reservedWordsStrict:this.reservedWords).test(a)&&(this.inAsync||"await"!==a||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+a+"' is reserved"))},oe.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),"await"!==t.name||this.awaitIdentPos||(this.awaitIdentPos=t.start)),t},oe.parseIdentNode=function(){var e=this.startNode();return this.type===$.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,"class"!==e.name&&"function"!==e.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop(),this.type=$.name):this.unexpected(),e},oe.parsePrivateIdent=function(){var e=this.startNode();return this.type===$.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(0===this.privateNameStack.length?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},oe.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===$.semi||this.canInsertSemicolon()||this.type!==$.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat($.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},oe.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var pe=z.prototype;pe.raise=function(e,t){var n=M(this.input,e);t+=" ("+n.line+":"+n.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var a=new SyntaxError(t);throw a.pos=e,a.loc=n,a.raisedAt=this.pos,a},pe.raiseRecoverable=pe.raise,pe.curPosition=function(){if(this.options.locations)return new L(this.curLine,this.pos-this.lineStart)};var de=z.prototype,me=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};de.enterScope=function(e){this.scopeStack.push(new me(e))},de.exitScope=function(){this.scopeStack.pop()},de.treatFunctionsAsVarInScope=function(e){return 2&e.flags||!this.inModule&&1&e.flags},de.declareName=function(e,t,n){var a=!1;if(2===t){var r=this.currentScope();a=r.lexical.indexOf(e)>-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&1&r.flags&&delete this.undefinedExports[e]}else if(4===t)this.currentScope().lexical.push(e);else if(3===t){var s=this.currentScope();a=this.treatFunctionsAsVar?s.lexical.indexOf(e)>-1:s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var i=this.scopeStack.length-1;i>=0;--i){var o=this.scopeStack[i];if(o.lexical.indexOf(e)>-1&&!(32&o.flags&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){a=!0;break}if(o.var.push(e),this.inModule&&1&o.flags&&delete this.undefinedExports[e],o.flags&U)break}a&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")},de.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},de.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},de.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags)return t}},de.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(771&t.flags&&!(16&t.flags))return t}};var he=function(e,t,n){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new j(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},fe=z.prototype;function ve(e,t,n,a){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=a),this.options.ranges&&(e.range[1]=n),e}fe.startNode=function(){return new he(this,this.start,this.startLoc)},fe.startNodeAt=function(e,t){return new he(this,e,t)},fe.finishNode=function(e,t){return ve.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},fe.finishNodeAt=function(e,t,n,a){return ve.call(this,e,t,n,a)},fe.copyNode=function(e){var t=new he(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var ge,ye,$e="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",be=$e+" Extended_Pictographic",_e=be+" EBase EComp EMod EPres ExtPict",Ee={9:$e,10:be,11:be,12:_e,13:_e,14:_e},xe={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},Se="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ae="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ie=Ae+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",we=Ie+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Te=we+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Ne=Te+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Oe={9:Ae,10:Ie,11:we,12:Te,13:Ne,14:Ne+" Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz"},ke={};for(var Re=0,Ce=[9,10,11,12,13,14];Re<Ce.length;Re+=1)ye=void 0,(ye=ke[ge=Ce[Re]]={binary:R(Ee[ge]+" "+Se),binaryOfStrings:R(xe[ge]),nonBinary:{General_Category:R(Se),Script:R(Oe[ge])}}).nonBinary.Script_Extensions=ye.nonBinary.Script,ye.nonBinary.gc=ye.nonBinary.General_Category,ye.nonBinary.sc=ye.nonBinary.Script,ye.nonBinary.scx=ye.nonBinary.Script_Extensions;var Pe=z.prototype,Le=function(e,t){this.parent=e,this.base=t||this};Le.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},Le.prototype.sibling=function(){return new Le(this.parent,this.base)};var je=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=ke[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function Me(e){return 105===e||109===e||115===e}function De(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Ye(e){return e>=65&&e<=90||e>=97&&e<=122}je.prototype.reset=function(e,t,n){var a=-1!==n.indexOf("v"),r=-1!==n.indexOf("u");this.start=0|e,this.source=t+"",this.flags=n,a&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=r&&this.parser.options.ecmaVersion>=9)},je.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},je.prototype.at=function(e,t){void 0===t&&(t=!1);var n=this.source,a=n.length;if(e>=a)return-1;var r=n.charCodeAt(e);if(!t&&!this.switchU||r<=55295||r>=57344||e+1>=a)return r;var s=n.charCodeAt(e+1);return s>=56320&&s<=57343?(r<<10)+s-56613888:r},je.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var n=this.source,a=n.length;if(e>=a)return a;var r,s=n.charCodeAt(e);return!t&&!this.switchU||s<=55295||s>=57344||e+1>=a||(r=n.charCodeAt(e+1))<56320||r>57343?e+1:e+2},je.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},je.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},je.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},je.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},je.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var n=this.pos,a=0,r=e;a<r.length;a+=1){var s=r[a],i=this.at(n,t);if(-1===i||i!==s)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},Pe.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,a=!1,r=!1,s=0;s<n.length;s++){var i=n.charAt(s);-1===t.indexOf(i)&&this.raise(e.start,"Invalid regular expression flag"),n.indexOf(i,s+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===i&&(a=!0),"v"===i&&(r=!0)}this.options.ecmaVersion>=15&&a&&r&&this.raise(e.start,"Invalid regular expression flag")},Pe.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&function(e){for(var t in e)return!0;return!1}(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Pe.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var a=n[t];e.groupNames[a]||e.raise("Invalid named capture referenced")}},Pe.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Le(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},Pe.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Pe.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},Pe.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},Pe.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},Pe.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Pe.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var a=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(a=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return-1!==r&&r<a&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=n}return!1},Pe.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Pe.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Pe.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),a=e.eat(45);if(n||a){for(var r=0;r<n.length;r++){var s=n.charAt(r);n.indexOf(s,r+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(a){var i=this.regexp_eatModifiers(e);n||i||58!==e.current()||e.raise("Invalid regular expression modifiers");for(var o=0;o<i.length;o++){var l=i.charAt(o);(i.indexOf(l,o+1)>-1||n.indexOf(l)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},Pe.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},Pe.regexp_eatModifiers=function(e){for(var t="",n=0;-1!==(n=e.current())&&Me(n);)t+=C(n),e.advance();return t},Pe.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Pe.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},Pe.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!De(t)&&(e.lastIntValue=t,e.advance(),!0)},Pe.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;-1!==(n=e.current())&&!De(n);)e.advance();return e.pos!==t},Pe.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t||(e.advance(),0))},Pe.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var a=0,r=n;a<r.length;a+=1)r[a].separatedFrom(e.branchID)||e.raise("Duplicate capture group name");else e.raise("Duplicate capture group name");t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},Pe.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},Pe.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=C(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=C(e.lastIntValue);return!0}return!1},Pe.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,a=e.current(n);return e.advance(n),92===a&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(a=e.lastIntValue),function(e){return p(e,!0)||36===e||95===e}(a)?(e.lastIntValue=a,!0):(e.pos=t,!1)},Pe.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,a=e.current(n);return e.advance(n),92===a&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(a=e.lastIntValue),function(e){return d(e,!0)||36===e||95===e||8204===e||8205===e}(a)?(e.lastIntValue=a,!0):(e.pos=t,!1)},Pe.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},Pe.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},Pe.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},Pe.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Pe.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Pe.regexp_eatZero=function(e){return 48===e.current()&&!Ue(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Pe.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},Pe.regexp_eatControlLetter=function(e){var t=e.current();return!!Ye(t)&&(e.lastIntValue=t%32,e.advance(),!0)},Pe.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var n,a=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(r&&s>=55296&&s<=56319){var i=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(s-55296)+(o-56320)+65536,!0}e.pos=i,e.lastIntValue=s}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((n=e.lastIntValue)>=0&&n<=1114111))return!0;r&&e.raise("Invalid unicode escape"),e.pos=a}return!1},Pe.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t||(e.lastIntValue=t,e.advance(),0))},Pe.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};function Fe(e){return Ye(e)||95===e}function qe(e){return Fe(e)||Ue(e)}function Ue(e){return e>=48&&e<=57}function Ve(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function ze(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ze(e){return e>=48&&e<=55}Pe.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),1;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=80===t)||112===t)){var a;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(a=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&2===a&&e.raise("Invalid property name"),a;e.raise("Invalid property name")}return 0},Pe.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var a=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,a),1}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r)}return 0},Pe.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){N(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")},Pe.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?1:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?2:void e.raise("Invalid property name")},Pe.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Fe(t=e.current());)e.lastStringValue+=C(t),e.advance();return""!==e.lastStringValue},Pe.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";qe(t=e.current());)e.lastStringValue+=C(t),e.advance();return""!==e.lastStringValue},Pe.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Pe.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&2===n&&e.raise("Negated character class may contain strings"),!0}return!1},Pe.regexp_classContents=function(e){return 93===e.current()?1:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),1)},Pe.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;!e.switchU||-1!==t&&-1!==n||e.raise("Invalid character class"),-1!==t&&-1!==n&&t>n&&e.raise("Range out of order in character class")}}},Pe.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(99===n||Ze(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var a=e.current();return 93!==a&&(e.lastIntValue=a,e.advance(),!0)},Pe.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Pe.regexp_classSetExpression=function(e){var t,n=1;if(this.regexp_eatClassSetRange(e));else if(t=this.regexp_eatClassSetOperand(e)){2===t&&(n=2);for(var a=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?2!==t&&(n=1):e.raise("Invalid character in character class");if(a!==e.pos)return n;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(a!==e.pos)return n}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return n;2===t&&(n=2)}},Pe.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var a=e.lastIntValue;return-1!==n&&-1!==a&&n>a&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},Pe.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?1:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Pe.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),a=this.regexp_classContents(e);if(e.eat(93))return n&&2===a&&e.raise("Negated character class may contain strings"),a;e.pos=t}if(e.eat(92)){var r=this.regexp_eatCharacterClassEscape(e);if(r)return r;e.pos=t}return null},Pe.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise("Invalid escape");e.pos=t}return null},Pe.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)2===this.regexp_classString(e)&&(t=2);return t},Pe.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?1:2},Pe.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e)&&(e.eat(98)?(e.lastIntValue=8,0):(e.pos=t,1)));var n=e.current();return!(n<0||n===e.lookahead()&&function(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}(n)||function(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}(n)||(e.advance(),e.lastIntValue=n,0))},Pe.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!function(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}(t)&&(e.lastIntValue=t,e.advance(),!0)},Pe.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Ue(t)&&95!==t||(e.lastIntValue=t%32,e.advance(),0))},Pe.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},Pe.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ue(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t},Pe.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ve(n=e.current());)e.lastIntValue=16*e.lastIntValue+ze(n),e.advance();return e.pos!==t},Pe.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*n+e.lastIntValue:e.lastIntValue=8*t+n}else e.lastIntValue=t;return!0}return!1},Pe.regexp_eatOctalDigit=function(e){var t=e.current();return Ze(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},Pe.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var a=0;a<t;++a){var r=e.current();if(!Ve(r))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+ze(r),e.advance()}return!0};var Be=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new j(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Ge=z.prototype;function We(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}Ge.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Be(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Ge.getToken=function(){return this.next(),new Be(this)},"undefined"!=typeof Symbol&&(Ge[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===$.eof,value:t}}}}),Ge.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken($.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Ge.readToken=function(e){return p(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Ge.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},Ge.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(var a=void 0,r=t;(a=x(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=a;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Ge.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),a=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!E(a);)a=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Ge.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&S.test(String.fromCharCode(e))))break e;++this.pos}}},Ge.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Ge.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken($.ellipsis)):(++this.pos,this.finishToken($.dot))},Ge.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp($.assign,2):this.finishOp($.slash,1)},Ge.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,a=42===e?$.star:$.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++n,a=$.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp($.assign,n+1):this.finishOp(a,n)},Ge.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp($.assign,3):this.finishOp(124===e?$.logicalOR:$.logicalAND,2):61===t?this.finishOp($.assign,2):this.finishOp(124===e?$.bitwiseOR:$.bitwiseAND,1)},Ge.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp($.assign,2):this.finishOp($.bitwiseXOR,1)},Ge.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!b.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp($.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp($.assign,2):this.finishOp($.plusMin,1)},Ge.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp($.assign,n+1):this.finishOp($.bitShift,n)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(n=2),this.finishOp($.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Ge.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp($.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken($.arrow)):this.finishOp(61===e?$.eq:$.prefix,1)},Ge.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp($.questionDot,2)}if(63===t)return e>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp($.assign,3):this.finishOp($.coalesce,2)}return this.finishOp($.question,1)},Ge.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,p(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken($.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+C(e)+"'")},Ge.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken($.parenL);case 41:return++this.pos,this.finishToken($.parenR);case 59:return++this.pos,this.finishToken($.semi);case 44:return++this.pos,this.finishToken($.comma);case 91:return++this.pos,this.finishToken($.bracketL);case 93:return++this.pos,this.finishToken($.bracketR);case 123:return++this.pos,this.finishToken($.braceL);case 125:return++this.pos,this.finishToken($.braceR);case 58:return++this.pos,this.finishToken($.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken($.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp($.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+C(e)+"'")},Ge.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Ge.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var a=this.input.charAt(this.pos);if(b.test(a)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===a)t=!0;else if("]"===a&&t)t=!1;else if("/"===a&&!t)break;e="\\"===a}++this.pos}var r=this.input.slice(n,this.pos);++this.pos;var s=this.pos,i=this.readWord1();this.containsEsc&&this.unexpected(s);var o=this.regexpState||(this.regexpState=new je(this));o.reset(n,r,i),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var l=null;try{l=new RegExp(r,i)}catch(e){}return this.finishToken($.regexp,{pattern:r,flags:i,value:l})},Ge.readInt=function(e,t,n){for(var a=this.options.ecmaVersion>=12&&void 0===t,r=n&&48===this.input.charCodeAt(this.pos),s=this.pos,i=0,o=0,l=0,u=null==t?1/0:t;l<u;++l,++this.pos){var c=this.input.charCodeAt(this.pos),p=void 0;if(a&&95===c)r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===o&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===l&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=c;else{if((p=c>=97?c-97+10:c>=65?c-65+10:c>=48&&c<=57?c-48:1/0)>=e)break;o=c,i=i*e+p}}return a&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||null!=t&&this.pos-s!==t?null:i},Ge.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return null==n&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(n=We(this.input.slice(t,this.pos)),++this.pos):p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken($.num,n)},Ge.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var n=this.pos-t>=2&&48===this.input.charCodeAt(t);n&&this.strict&&this.raise(t,"Invalid number");var a=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&110===a){var r=We(this.input.slice(t,this.pos));return++this.pos,p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken($.num,r)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),46!==a||n||(++this.pos,this.readInt(10),a=this.input.charCodeAt(this.pos)),69!==a&&101!==a||n||(43!==(a=this.input.charCodeAt(++this.pos))&&45!==a||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s,i=(s=this.input.slice(t,this.pos),n?parseInt(s,8):parseFloat(s.replace(/_/g,"")));return this.finishToken($.num,i)},Ge.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},Ge.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var a=this.input.charCodeAt(this.pos);if(a===e)break;92===a?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):8232===a||8233===a?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(E(a)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken($.string,t)};var Ke={};Ge.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Ke)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Ge.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ke;this.raise(e,t)},Ge.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==$.template&&this.type!==$.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken($.template,e)):36===n?(this.pos+=2,this.finishToken($.dollarBraceL)):(++this.pos,this.finishToken($.backQuote));if(92===n)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(E(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Ge.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken($.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":"\n"===this.input[this.pos+1]&&++this.pos;case"\n":case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,"Unterminated template")},Ge.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return C(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var a=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(a,8);return r>255&&(a=a.slice(0,-1),r=parseInt(a,8)),this.pos+=a.length-1,t=this.input.charCodeAt(this.pos),"0"===a&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-a.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return E(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},Ge.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.invalidStringToken(t,"Bad character escape sequence"),n},Ge.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,a=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(d(r,a))this.pos+=r<=65535?1:2;else{if(92!==r)break;this.containsEsc=!0,e+=this.input.slice(n,this.pos);var s=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var i=this.readCodePoint();(t?p:d)(i,a)||this.invalidStringToken(s,"Invalid Unicode escape"),e+=C(i),n=this.pos}t=!1}return e+this.input.slice(n,this.pos)},Ge.readWord=function(){var e=this.readWord1(),t=$.name;return this.keywords.test(e)&&(t=g[e]),this.finishToken(t,e)};var He="8.15.0";z.acorn={Parser:z,version:He,defaultOptions:D,Position:L,SourceLocation:j,getLineInfo:M,Node:he,TokenType:m,tokTypes:$,keywordTypes:g,TokContext:re,tokContexts:se,isIdentifierChar:d,isIdentifierStart:p,Token:Be,isNewLine:E,lineBreak:b,lineBreakG:_,nonASCIIwhitespace:S},e.Node=he,e.Parser=z,e.Position=L,e.SourceLocation=j,e.TokContext=re,e.Token=Be,e.TokenType=m,e.defaultOptions=D,e.getLineInfo=M,e.isIdentifierChar=d,e.isIdentifierStart=p,e.isNewLine=E,e.keywordTypes=g,e.lineBreak=b,e.lineBreakG=_,e.nonASCIIwhitespace=S,e.parse=function(e,t){return z.parse(e,t)},e.parseExpressionAt=function(e,t,n){return z.parseExpressionAt(e,t,n)},e.tokContexts=se,e.tokTypes=$,e.tokenizer=function(e,t){return z.tokenizer(e,t)},e.version=He}(t)},84591:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.wrapField=t.getFilteredCompletions=void 0,r(n(46432),t),r(n(81379),t),r(n(34889),t),r(n(82663),t),r(n(99352),t),r(n(47969),t),r(n(17941),t),r(n(37724),t),r(n(28131),t),r(n(19133),t),r(n(10282),t),r(n(56911),t);var s=n(78145);Object.defineProperty(t,"getFilteredCompletions",{enumerable:!0,get:function(){return s.getFilteredCompletions}}),Object.defineProperty(t,"wrapField",{enumerable:!0,get:function(){return s.wrapField}}),r(n(96807),t),r(n(40957),t)},85070:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EXPRESSION_OPERATORS=void 0,t.EXPRESSION_OPERATORS=[{name:"$abs",value:"$abs",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$accumulator",value:"$accumulator",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$add",value:"$add",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$allElementsTrue",value:"$allElementsTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$and",value:"$and",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$anyElementTrue",value:"$anyElementTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$arrayElemAt",value:"$arrayElemAt",score:1,meta:"expr:array",version:"3.2.0"},{name:"$arrayToObject",value:"$arrayToObject",score:1,meta:"expr:array",version:"3.4.4"},{name:"$binarySize",value:"$binarySize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$bsonSize",value:"$bsonSize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$ceil",value:"$ceil",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$cmp",value:"$cmp",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$concat",value:"$concat",score:1,meta:"expr:string",version:"2.4.0"},{name:"$concatArrays",value:"$concatArrays",score:1,meta:"expr:array",version:"3.2.0"},{name:"$cond",value:"$cond",score:1,meta:"expr:cond",version:"2.6.0"},{name:"$dateAdd",value:"$dateAdd",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateDiff",value:"$dateDiff",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateFromParts",value:"$dateFromParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateFromString",value:"$dateFromString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateSubtract",value:"$dateSubtract",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateToParts",value:"$dateToParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateTrunc",value:"$dateTrunc",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dayOfMonth",value:"$dayOfMonth",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfWeek",value:"$dayOfWeek",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfYear",value:"$dayOfYear",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.0.0"},{name:"$divide",value:"$divide",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$eq",value:"$eq",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$exp",value:"$exp",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$filter",value:"$filter",score:1,meta:"expr:array",version:"3.2.0"},{name:"$first",value:"$first",score:1,meta:"expr:array",version:"4.4.0"},{name:"$floor",value:"$floor",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$function",value:"$function",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$getField",value:"$getField",score:1,meta:"expr:get",version:"5.0.0"},{name:"$gt",value:"$gt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$gte",value:"$gte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$hour",value:"$hour",score:1,meta:"expr:date",version:"2.2.0"},{name:"$ifNull",value:"$ifNull",score:1,meta:"expr:cond",version:"2.2.0"},{name:"$in",value:"$in",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfArray",value:"$indexOfArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfBytes",value:"$indexOfBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$indexOfCP",value:"$indexOfCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$isArray",value:"$isArray",score:1,meta:"expr:array",version:"3.2.0"},{name:"$isNumber",value:"$isNumber",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$isoDayOfWeek",value:"$isoDayOfWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeek",value:"$isoWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeekYear",value:"$isoWeekYear",score:1,meta:"expr:date",version:"3.4.0"},{name:"$last",value:"$last",score:1,meta:"expr:array",version:"4.4.0"},{name:"$let",value:"$let",score:1,meta:"expr:var",version:"2.6.0"},{name:"$literal",value:"$literal",score:1,meta:"expr:literal",version:"2.6.0"},{name:"$lt",value:"$lt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$lt",value:"$lte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$ln",value:"$ln",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log",value:"$log",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log10",value:"$log10",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$map",value:"$map",score:1,meta:"expr:array",version:"2.6.0"},{name:"$mergeObjects",value:"$mergeObjects",score:1,meta:"expr:obj",version:"3.6.0"},{name:"$meta",value:"$meta",score:1,meta:"expr:text",version:"2.6.0"},{name:"$millisecond",value:"$millisecond",score:1,meta:"expr:date",version:"2.4.0"},{name:"$minute",value:"$minute",score:1,meta:"expr:date",version:"2.2.0"},{name:"$mod",value:"$mod",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$month",value:"$month",score:1,meta:"expr:date",version:"2.2.0"},{name:"$multiply",value:"$multiply",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$new",value:"$new",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$not",value:"$not",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$objectToArray",value:"$objectToArray",score:1,meta:"expr:array",version:"3.4.4"},{name:"$or",value:"$or",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$pow",value:"$pow",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$range",value:"$range",score:1,meta:"expr:array",version:"3.4.0"},{name:"$reduce",value:"$reduce",score:1,meta:"expr:array",version:"3.4.0"},{name:"$regexFind",value:"$regexFind",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexFindAll",value:"$regexFindAll",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexMatch",value:"$regexMatch",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$replaceAll",value:"$replaceAll",score:1,meta:"expr:string",version:"4.4.0"},{name:"$replaceOne",value:"$replaceOne",score:1,meta:"expr:string",version:"4.4.0"},{name:"$reverseArray",value:"$reverseArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$second",value:"$second",score:1,meta:"expr:date",version:"2.2.0"},{name:"$setDifference",value:"$setDifference",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setEquals",value:"$setEquals",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIntersection",value:"$setIntersection",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIsSubset",value:"$setIsSubset",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setUnion",value:"$setUnion",score:1,meta:"expr:set",version:"2.6.0"},{name:"$similarityCosine",value:"$similarityCosine",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityDotProduct",value:"$similarityDotProduct",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityEuclidean",value:"$similarityEuclidean",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$size",value:"$size",score:1,meta:"expr:array",version:"2.6.0"},{name:"$slice",value:"$slice",score:1,meta:"expr:array",version:"3.2.0"},{name:"$sortArray",value:"$sortArray",score:1,meta:"expr:array",version:"5.2.0"},{name:"$split",value:"$split",score:1,meta:"expr:string",version:"3.4.0"},{name:"$sqrt",value:"$sqrt",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$strcasecmp",value:"$strcasecmp",score:1,meta:"expr:string",version:"2.2.0"},{name:"$strLenBytes",value:"$strLenBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$strLenCP",value:"$strLenCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substr",value:"$substr",score:1,meta:"expr:string",version:"2.2.0",deprecated:"3.4.0",replacement:"$substrBytes"},{name:"$substrBytes",value:"$substrBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substrCP",value:"$substrCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$subtract",value:"$subtract",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$switch",value:"$switch",score:1,meta:"expr:cond",version:"3.4.0"},{name:"$toHashedIndexKey",value:"$toHashedIndexKey",score:1,meta:"expr:arith",version:"4.2.24"},{name:"$toLower",value:"$toLower",score:1,meta:"expr:string",version:"2.2.0"},{name:"$toUpper",value:"$toUpper",score:1,meta:"expr:string",version:"2.2.0"},{name:"$tsSecond",value:"$tsSecond",score:1,meta:"expr:date",version:"5.1.0"},{name:"$tsIncrement",value:"$tsIncrement",score:1,meta:"expr:date",version:"5.1.0"},{name:"$trunc",value:"$trunc",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$type",value:"$type",score:1,meta:"expr:type",version:"3.4.0"},{name:"$week",value:"$week",score:1,meta:"expr:date",version:"2.2.0"},{name:"$year",value:"$year",score:1,meta:"expr:date",version:"2.2.0"},{name:"$zip",value:"$zip",score:1,meta:"expr:array",version:"3.4.0"},{name:"$bitAnd",value:"$bitAnd",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitOr",value:"$bitOr",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitXor",value:"$bitXor",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitNot",value:"$bitNot",score:1,meta:"expr:bit",version:"7.0.0"}]},85216:(e,t,n)=>{const a=n(66283);e.exports=(e,t,n)=>{const r=new a(e,n),s=new a(t,n);return r.compare(s)||r.compareBuild(s)}},85426:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.REQUIRED_AS_FIRST_STAGE=t.FULL_SCAN_STAGES=t.OUT_STAGES=t.STAGE_OPERATOR_NAMES=t.STAGE_OPERATORS=void 0;const a=n(63875),r=n(80417),s=[{name:"$addFields",value:"$addFields",label:"$addFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value.",comment:"/**\n * newField: The new field name.\n * expression: The new field expression.\n */\n",snippet:"{\n ${1:newField}: ${2:expression}, ${3:...}\n}"},{name:"$bucket",value:"$bucket",label:"$bucket",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Categorizes incoming documents into groups, called buckets, based on specified boundaries.",comment:"/**\n * groupBy: The expression to group by.\n * boundaries: An array of the lower boundaries for each bucket.\n * default: The bucket name for documents that do not fall within the specified boundaries\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n */\n",snippet:"{\n groupBy: ${1:expression},\n boundaries: [ ${2:lowerbound}, ${3:...} ],\n default: ${4:literal},\n output: {\n ${5:outputN}: { ${6:accumulator} }, ${7:...}\n }\n}"},{name:"$bucketAuto",value:"$bucketAuto",label:"$bucketAuto",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.",comment:"/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n",snippet:"{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}"},{name:"$changeStream",value:"$changeStream",label:"$changeStream",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a Change Stream cursor for the collection.",comment:"/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n",snippet:"{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}"},{name:"$collStats",value:"$collStats",label:"$collStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Returns statistics regarding a collection or view.",comment:"/**\n * histograms: Optional latency histograms.\n * storageStats: Optional storage stats.\n */\n",snippet:"{\n latencyStats: {\n histograms: ${1:boolean}\n },\n storageStats: {${2:}},\n}"},{name:"$count",value:"$count",label:"$count",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns a count of the number of documents at this stage of the aggregation pipeline.",comment:"/**\n * Provide the field name for the count.\n */\n",snippet:"'${1:string}'"},{name:"$currentOp",value:"$currentOp",label:"$currentOp",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.",comment:"/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n",snippet:"{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}"},{name:"$densify",value:"$densify",label:"$densify",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.1.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level.",comment:"/**\n * field: The required field to densify.\n * partitionByFields: The set of fields that acts as a compound key to define each partition.\n * range: {\n * step: The amount to increment the field value in each document.\n * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.\n * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.\n * }\n */\n",snippet:"{\n field: ${1:string},\n partitionByFields: [${2:string}, ${3:string}, ...],\n range: {\n step: ${4:number},\n unit: ${5:string},\n bounds: [${6:lowerbound}, ${7:upperbound}, ...]\n }\n}"},{name:"$documents",value:"$documents",label:"$documents",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.9",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns literal documents from input values.",comment:"/**\n * expression: Any valid expression.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$facet",value:"$facet",label:"$facet",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Allows for multiple parellel aggregations to be specified.",comment:"/**\n * outputFieldN: The first output field.\n * stageN: The first aggregation stage.\n */\n",snippet:"{\n ${1:outputFieldN}: [ ${2:stageN}, ${3:...} ]\n}"},{name:"$fill",value:"$fill",label:"$fill",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.3.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Populates null and missing field values within documents.",comment:'/**\n * sortBy: Syntax is the same as $sort, required if "method" is used in at least one output spec otherwise optional\n * partitionBy: Optional, default is a single partition. Specification is the same as _id in $group (same as partitionBy in window functions).\n * partitionByFields: Optional, set of fields that acts as a compound key to define each partition.\n * output - Required, object for each field to fill in. For a single field, can be a single object.\n * output.<field> - A field to be filled with value, if missing or null in the current document.\n */\n',snippet:"{\n sortBy: ${1:sortSpec},\n partitionBy: ${2:expression},\n partitionByFields: [${3:string}, ${4:string}, ...],\n output: {\n field1: {value: ${5:expression}},\n field2: {method: ${6:string}},\n ...\n }\n}"},{name:"$geoNear",value:"$geoNear",label:"$geoNear",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns documents based on proximity to a geospatial point.",comment:"/**\n * near: The point to search near.\n * distanceField: The calculated distance.\n * maxDistance: The maximum distance, in meters, documents can be before being excluded from results.\n * query: Limits results that match the query\n * includeLocs: Optional. Labels and includes the point used to match the document.\n * num: Optional. The maximum number of documents to return.\n * spherical: Defaults to false. Specifies whether to use spherical geometry.\n */\n",snippet:"{\n near: { type: 'Point', coordinates: [ ${1:number}, ${2:number} ] },\n distanceField: '${3:string}',\n maxDistance: ${4:number},\n query: {${5}},\n includeLocs: '${6}',\n num: ${7:number},\n spherical: ${8:boolean}\n}"},{name:"$graphLookup",value:"$graphLookup",label:"$graphLookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a recursive search on a collection.",comment:"/**\n * from: The target collection.\n * startWith: Expression to start.\n * connectFromField: Field to connect.\n * connectToField: Field to connect to.\n * as: Name of the array field.\n * maxDepth: Optional max recursion depth.\n * depthField: Optional Name of the depth field.\n * restrictSearchWithMatch: Optional query.\n */\n",snippet:"{\n from: '${1:string}',\n startWith: ${2:expression},\n connectFromField: '${3:string}',\n connectToField: '${4:string}',\n as: '${5:string}',\n maxDepth: ${6:number},\n depthField: '${7:string}',\n restrictSearchWithMatch: {${8}}\n}"},{name:"$group",value:"$group",label:"$group",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups documents by a specified expression.",comment:"/**\n * _id: The id of the group.\n * fieldN: The first field name.\n */\n",snippet:"{\n _id: ${1:expression},\n ${2:fieldN}: {\n ${3:accumulatorN}: ${4:expressionN}\n }\n}"},{name:"$indexStats",value:"$indexStats",label:"$indexStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[],namespaces:[...r.ANY_NAMESPACE],description:"Returns statistics regarding the use of each index for the collection.",comment:"/**\n * No parameters.\n */\n",snippet:"{}"},{name:"$limit",value:"$limit",label:"$limit",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Limits the number of documents that flow into subsequent stages.",comment:"/**\n * Provide the number of documents to limit.\n */\n",snippet:"${1:number}"},{name:"$listLocalSessions",value:"$listLocalSessions",label:"$listLocalSessions",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Lists the sessions cached in memory by the mongod or mongos instance.",comment:"/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n",snippet:"{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}"},{name:"$lookup",value:"$lookup",label:"$lookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a join between two collections.",comment:"/**\n * from: The target collection.\n * localField: The local join field.\n * foreignField: The target join field.\n * as: The name for the results.\n * pipeline: Optional pipeline to run on the foreign collection.\n * let: Optional variables to use in the pipeline field stages.\n */\n",snippet:"{\n from: ${1:collection},\n localField: ${2:field},\n foreignField: ${3:field},\n as: ${4:result}\n}"},{name:"$match",value:"$match",label:"$match",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Filters the document stream to allow only matching documents to pass through to subsequent stages.",comment:"/**\n * query: The query in MQL.\n */\n",snippet:"{\n ${1:query}\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.1.11",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * into: The target collection.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: '${1:string}',\n on: '${2:string}',\n let: '${3:specification(s)}',\n whenMatched: '${4:string}',\n whenNotMatched: '${5:string}'\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * atlas: Location to write the documents from the aggregation pipeline.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: {\n atlas: {\n clusterName: '${1:atlasClusterName}',\n db: '${2:database}',\n coll: '${3:collection}',\n projectId: '${4:optionalAtlasProjectId}'\n }\n },\n on: '${5:identifier}',\n let: { ${6:specification(s)} },\n whenMatched: '${7:string}',\n whenNotMatched: '${8:string}'\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to a new or existing collection.",comment:"/**\n * Provide the name of the output database and collection.\n */\n",snippet:"{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to an Atlas cluster, S3 bucket, or Azure Blob Storage.",comment:"/**\n * Use any one of the following:\n * s3: Parameters to save the data to S3.\n * atlas: Parameters to save the data to Atlas. Example:\n * {\n * atlas: {\n * db: 'string',\n * coll: 'string',\n * projectId: 'string',\n * clusterName: 'string'\n * }\n * },\n * azure: Parameters to save the data to Azure. Example:\n * {\n * azure: {\n * serviceURL: 'string',\n * containerName: 'string',\n * region: 'string,\n * filename: 'string',\n * format: {\n * name: 'string',\n * maxFileSize: 'string',\n * maxRowGroupSize: 'string',\n * columnCompression: 'string'\n * },\n * errorMode: 'string'\n * }\n * }\n */\n",snippet:"{\n s3: {\n bucket: '${1:string}',\n region: '${2:string}',\n filename: '${3:string}',\n format: {\n name: '${4:string}',\n maxFileSize: '${5:bytes}',\n maxRowGroupSize: '${6:string}',\n columnCompression: '${7:string}'\n },\n errorMode: '${8:string}'\n }\n}"},{name:"$project",value:"$project",label:"$project",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value. Unlike $addFields, $project can also remove fields.",comment:"/**\n * specifications: The fields to\n * include or exclude.\n */\n",snippet:"{\n ${1:specification(s)}\n}"},{name:"$rankFusion",value:"$rankFusion",label:"$rankFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.0.14",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using reciprocal rank fusion to create hybrid search results.",comment:'/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be a Ranked Selection Pipeline operating on the same collection. Minimum of one pipeline.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information in {$meta: "scoreDetails"} for debugging and tuning.\n */\n',snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n }\n },\n combination: {\n weights: {\n ${6:searchPipeline}: ${7:number},\n ${8:vectorPipeline}: ${9:number}\n }\n },\n scoreDetails: ${10:false}\n}"},{name:"$redact",value:"$redact",label:"$redact",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.6.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Restricts the content for each document based on information stored in the documents themselves",comment:"/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$replaceRoot",value:"$replaceRoot",label:"$replaceRoot",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newRoot: ${1:replacementDocument}\n}"},{name:"$replaceWith",value:"$replaceWith",label:"$replaceWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newWith: ${1:replacementDocument}\n}"},{name:"$sample",value:"$sample",label:"$sample",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Randomly selects the specified number of documents from its input.",comment:"/**\n * size: The number of documents to sample.\n */\n",snippet:"{\n size: ${1:number}\n}"},{name:"$scoreFusion",value:"$scoreFusion",label:"$scoreFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.2.0",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using relative score fusion to create hybrid search results.",comment:"/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be operating on the same collection. Minimum of one pipeline.\n * input.normalization: Required. Normalizes the score to the range 0 to 1 before combining the results. Value can be none, sigmoid or minMaxScaler.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * combination.method: Optional. Specifies method for combining scores. Value can be avg or expression. Default is avg.\n * combination.expression: Optional. This is the custom expression that is used when combination.method is set to expression.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information.\n */\n",snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n },\n normalization: '${6:none|sigmoid|minMaxScaler}'\n },\n combination: {\n weights: {\n ${7:searchPipeline}: ${8:number},\n ${9:vectorPipeline}: ${10:number}\n },\n method: '${11:avg|expression}',\n expression: '${12:expression}'\n },\n scoreDetails: ${13:false}\n}"},{name:"$search",value:"$search",label:"$search",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.1.11",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s).",comment:"/**\n * index: The name of the Search index.\n * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. Use matchCriteria to match 'any' or 'all' query terms.\n * compound: Combines ops.\n * span: Find in text field regions.\n * exists: Test for presence of a field.\n * near: Find near number or date.\n * range: Find in numeric or date range.\n */\n",snippet:"{\n index: '${1:string}',\n text: {\n query: '${2:string}',\n path: '${3:string}',\n matchCriteria: '${4:any}',\n }\n}"},{name:"$searchMeta",value:"$searchMeta",label:"$searchMeta",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.4.9",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.",comment:"/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n",snippet:"{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}"},{name:"$set",value:"$set",label:"$set",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.",comment:"/**\n * field: The field name\n * expression: The expression.\n */\n",snippet:"{\n ${1:field}: ${2:expression}\n}"},{name:"$setWindowFields",value:"$setWindowFields",label:"$setWindowFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Capable of partitioning incoming data, and can apply one or more functions to defined windows within each partition.",comment:"/**\n * partitionBy: partitioning of data.\n * sortBy: fields to sort by.\n * output: {\n * path: {\n * function: The window function to compute over the given window.\n * window: {\n * documents: A number of documents before and after the current document.\n * range: A range of possible values around the value in the current document's sortBy field.\n * unit: Specifies the units for the window bounds.\n * }\n * }\n * }\n */\n",snippet:"{\n partitionBy: ${1:expression},\n sortBy: ${2:sortSpec},\n output: {\n ${3:path}: {\n ${4:function}: ${5:functionArgs},\n window: {\n documents: [${6:lowerbound}, ${7:upperbound}],\n range: [${8:lowerbound}, ${9:upperbound}],\n unit: ${10:string}\n }\n },\n ${11:path2}: ...\n }\n}"},{name:"$skip",value:"$skip",label:"$skip",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Skips a specified number of documents before advancing to the next stage.",comment:"/**\n * Provide the number of documents to skip.\n */\n",snippet:"${1:number}"},{name:"$sort",value:"$sort",label:"$sort",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Reorders the document stream by a specified sort key and direction.",comment:"/**\n * Provide any number of field/order pairs.\n */\n",snippet:"{\n ${1:field1}: ${2:sortOrder}\n}"},{name:"$sortByCount",value:"$sortByCount",label:"$sortByCount",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.",comment:"/**\n * expression: Grouping expression or string.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$unionWith",value:"$unionWith",label:"$unionWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Perform a union with a pipeline on another collection.",comment:"/**\n * coll: The collection name.\n * pipeline: The pipeline on the other collection.\n */\n",snippet:"{\n coll: '${1:coll}',\n pipeline: [${2:pipeline}]\n}"},{name:"$unset",value:"$unset",label:"$unset",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Excludes fields from the result document.",comment:"/**\n * Provide the field name to exclude.\n * To exclude multiple fields, pass the field names in an array.\n */\n",snippet:"'${1:string}'"},{name:"$unwind",value:"$unwind",label:"$unwind",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Outputs a new document for each element in a specified array. ",comment:"/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n",snippet:"{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}"},{name:"$vectorSearch",value:"$vectorSearch",label:"$vectorSearch",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS],meta:"stage",version:">=6.0.10 <7.0.0 || >=7.0.2",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a kNN search on embeddings in the specified field(s)",comment:"/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n * exact: Choose between false for ANN (Approximate Nearest Neighbor) and true for ENN (Exact Nearest Neighbor). Defaults to false. (Optional)\n */\n",snippet:"{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}},\n exact: ${8:boolean}\n}"}];t.STAGE_OPERATORS=s;const i=s.map((e=>e.name));t.STAGE_OPERATOR_NAMES=i;const o=s.filter((e=>e.outputStage));t.OUT_STAGES=o;const l=s.filter((e=>e.fullScan));t.FULL_SCAN_STAGES=l;const u=s.filter((e=>e.firstStage));t.REQUIRED_AS_FIRST_STAGE=u},85623:(e,t,n)=>{const a=n(44455);e.exports=(e,t)=>e.sort(((e,n)=>a(n,e,t)))},85665:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPES=void 0,t.BSON_TYPES=[{name:"Code",value:"Code",label:"Code",score:1,meta:"bson",version:"0.0.0",description:"BSON Code type",snippet:"Code('${1:code}')"},{name:"ObjectId",value:"ObjectId",label:"ObjectId",score:1,meta:"bson",version:"0.0.0",description:"BSON ObjectId type",snippet:"ObjectId('${1:id}')"},{name:"Binary",value:"Binary",label:"Binary",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary type",snippet:"Binary('${1:data}', '${2:subType}')"},{name:"DBRef",value:"DBRef",label:"DBRef",score:1,meta:"bson",version:"0.0.0",description:"BSON DBRef type",snippet:"DBRef('${1:ns}', '${2:oid}')"},{name:"Timestamp",value:"Timestamp",label:"Timestamp",score:1,meta:"bson",version:"0.0.0",description:"BSON Timestamp type",snippet:"Timestamp(${1:low}, ${2:high})"},{name:"NumberInt",value:"NumberInt",label:"NumberInt",score:1,meta:"bson",version:"0.0.0",description:"BSON 32 bit Integer type",snippet:"NumberInt(${1:value})"},{name:"NumberLong",value:"NumberLong",label:"NumberLong",score:1,meta:"bson",version:"0.0.0",description:"BSON 64 but Integer type",snippet:"NumberLong('${1:value}')"},{name:"NumberDecimal",value:"NumberDecimal",label:"NumberDecimal",score:1,meta:"bson",version:"3.4.0",description:"BSON Decimal128 type",snippet:"NumberDecimal('${1:value}')"},{name:"MaxKey",value:"MaxKey",label:"MaxKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MaxKey type",snippet:"MaxKey()"},{name:"MinKey",value:"MinKey",label:"MinKey",score:1,meta:"bson",version:"0.0.0",description:"BSON MinKey type",snippet:"MinKey()"},{name:"ISODate",value:"ISODate",label:"ISODate",score:1,meta:"bson",version:"0.0.0",description:"BSON Date type",snippet:"ISODate('${1:date}')"},{name:"RegExp",value:"RegExp",label:"RegExp",score:1,meta:"bson",version:"0.0.0",description:"BSON Regex type",snippet:"RegExp('${1:source}', '${2:opts}')"},{name:"LegacyJavaUUID",value:"LegacyJavaUUID",label:"LegacyJavaUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Java legacy UUID)",snippet:"LegacyJavaUUID('${1:uuid}')"},{name:"LegacyCSharpUUID",value:"LegacyCSharpUUID",label:"LegacyCSharpUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (CSharp legacy UUID)",snippet:"LegacyCSharpUUID('${1:uuid}')"},{name:"LegacyPythonUUID",value:"LegacyPythonUUID",label:"LegacyPythonUUID",score:1,meta:"bson-legacy-uuid",version:"0.0.0",description:"BSON Binary subtype 3 (Python legacy UUID)",snippet:"LegacyPythonUUID('${1:uuid}')"},{name:"UUID",value:"UUID",label:"UUID",score:1,meta:"bson",version:"0.0.0",description:"BSON Binary subtype 4",snippet:"UUID('${1:uuid}')"}]},86224:(e,t,n)=>{n.d(t,{rS:()=>Xe,EB:()=>Re,bz:()=>ot,YO:()=>mt,zM:()=>at,Ie:()=>Vt,gM:()=>bt,k5:()=>At,Nl:()=>zt,RZ:()=>qt,eu:()=>wt,Zm:()=>pt,ch:()=>st,ai:()=>Qe,Ik:()=>ft,g1:()=>xt,re:()=>vt,Yj:()=>ke,KC:()=>yt,L5:()=>ut});var a=n(36710),r=n(13008);class s{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),a=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of a)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}var i=n(27750),o=n(53266),l=n(87257);const u={major:4,minor:0,patch:0};var c=n(9606).URL;const p=a.xI("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=u;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let r,s=l.QH(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,o=i._zod.check(e);if(o instanceof Promise&&!1===n?.async)throw new a.GT;if(r||o instanceof Promise)r=(r??Promise.resolve()).then((async()=>{await o,e.issues.length!==t&&(s||(s=l.QH(e,t)))}));else{if(e.issues.length===t)continue;s||(s=l.QH(e,t))}}return r?r.then((()=>e)):e};e._zod.run=(n,s)=>{const i=e._zod.parse(n,s);if(i instanceof Promise){if(!1===s.async)throw new a.GT;return i.then((e=>t(e,r,s)))}return t(i,r,s)}}e["~standard"]={validate:t=>{try{const n=(0,i.xL)(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return(0,i.bp)(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),d=a.xI("$ZodString",((e,t)=>{p.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??o.Yj(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch(a){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),m=a.xI("$ZodStringFormat",((e,t)=>{r.ql.init(e,t),d.init(e,t)})),h=a.xI("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=o.Os),m.init(e,t)})),f=a.xI("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=o.uR(e))}else t.pattern??(t.pattern=o.uR());m.init(e,t)})),v=a.xI("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=o.Rp),m.init(e,t)})),g=a.xI("$ZodURL",((e,t)=>{m.init(e,t),e._zod.check=n=>{try{const a=n.value,r=new c(a),s=r.href;return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:o.OI.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(!a.endsWith("/")&&s.endsWith("/")?n.value=s.slice(0,-1):n.value=s)}catch(a){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),y=a.xI("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=o.Zg()),m.init(e,t)})),$=a.xI("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=o.Ak),m.init(e,t)})),b=a.xI("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=o.gF),m.init(e,t)})),_=a.xI("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=o.Gl),m.init(e,t)})),E=a.xI("$ZodULID",((e,t)=>{t.pattern??(t.pattern=o.Z0),m.init(e,t)})),x=a.xI("$ZodXID",((e,t)=>{t.pattern??(t.pattern=o.kM),m.init(e,t)})),S=a.xI("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=o.fO),m.init(e,t)})),A=a.xI("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=o.w$(t)),m.init(e,t)})),I=a.xI("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=o.p6),m.init(e,t)})),w=a.xI("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=o.kB(t)),m.init(e,t)})),T=a.xI("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=o.p0),m.init(e,t)})),N=a.xI("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=o.uX),m.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),O=a.xI("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=o.ug),m.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv6"})),e._zod.check=n=>{try{new c(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),k=a.xI("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=o.zr),m.init(e,t)})),R=a.xI("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=o.l7),m.init(e,t),e._zod.check=n=>{const[a,r]=n.value.split("/");try{if(!r)throw new Error;const e=Number(r);if(`${e}`!==r)throw new Error;if(e<0||e>128)throw new Error;new c(`http://[${a}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function C(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const P=a.xI("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=o.K3),m.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{C(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),L=a.xI("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=o.r0),m.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!o.r0.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return C(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),j=a.xI("$ZodE164",((e,t)=>{t.pattern??(t.pattern=o.hQ),m.init(e,t)})),M=a.xI("$ZodJWT",((e,t)=>{m.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[a]=n;if(!a)return!1;const r=JSON.parse(atob(a));return!("typ"in r&&"JWT"!==r?.typ||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),D=a.xI("$ZodNumber",((e,t)=>{p.init(e,t),e._zod.pattern=e._zod.bag.pattern??o.ai,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const r=n.value;if("number"==typeof r&&!Number.isNaN(r)&&Number.isFinite(r))return n;const s="number"==typeof r?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...s?{received:s}:{}}),n}})),Y=a.xI("$ZodNumber",((e,t)=>{r.KH.init(e,t),D.init(e,t)})),F=a.xI("$ZodBoolean",((e,t)=>{p.init(e,t),e._zod.pattern=o.zM,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const r=n.value;return"boolean"==typeof r||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}})),q=a.xI("$ZodNull",((e,t)=>{p.init(e,t),e._zod.pattern=o.ch,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{const a=t.value;return null===a||t.issues.push({expected:"null",code:"invalid_type",input:a,inst:e}),t}})),U=a.xI("$ZodAny",((e,t)=>{p.init(e,t),e._zod.parse=e=>e})),V=a.xI("$ZodUnknown",((e,t)=>{p.init(e,t),e._zod.parse=e=>e})),z=a.xI("$ZodNever",((e,t)=>{p.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}));function Z(e,t,n){e.issues.length&&t.issues.push(...l.lQ(n,e.issues)),t.value[n]=e.value}const B=a.xI("$ZodArray",((e,t)=>{p.init(e,t),e._zod.parse=(n,a)=>{const r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);const s=[];for(let e=0;e<r.length;e++){const i=r[e],o=t.element._zod.run({value:i,issues:[]},a);o instanceof Promise?s.push(o.then((t=>Z(t,n,e)))):Z(o,n,e)}return s.length?Promise.all(s).then((()=>n)):n}}));function G(e,t,n){e.issues.length&&t.issues.push(...l.lQ(n,e.issues)),t.value[n]=e.value}function W(e,t,n,a){e.issues.length?void 0===a[n]?t.value[n]=n in a?void 0:e.value:t.issues.push(...l.lQ(n,e.issues)):void 0===e.value?n in a&&(t.value[n]=void 0):t.value[n]=e.value}const K=a.xI("$ZodObject",((e,t)=>{p.init(e,t);const n=l.PO((()=>{const e=Object.keys(t.shape);for(const n of e)if(!(t.shape[n]instanceof p))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=l.NM(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}));let r;l.gJ(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const a=e[t]._zod;if(a.values){n[t]??(n[t]=new Set);for(const e of a.values)n[t].add(e)}}return n}));const i=l.Gv,o=!a.cr.jitless,u=l.hI,c=o&&u.value,d=t.catchall;let m;e._zod.parse=(a,u)=>{m??(m=n.value);const p=a.value;if(!i(p))return a.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),a;const h=[];if(o&&c&&!1===u?.async&&!0!==u.jitless)r||(r=(e=>{const t=new s(["shape","payload","ctx"]),a=n.value,r=e=>{const t=l.UQ(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let o=0;for(const e of a.keys)i[e]="key_"+o++;t.write("const newResult = {}");for(const e of a.keys)if(a.optionalKeys.has(e)){const n=i[e];t.write(`const ${n} = ${r(e)};`);const a=l.UQ(e);t.write(`\n if (${n}.issues.length) {\n if (input[${a}] === undefined) {\n if (${a} in input) {\n newResult[${a}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${n}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${a}, ...iss.path] : [${a}],\n }))\n );\n }\n } else if (${n}.value === undefined) {\n if (${a} in input) newResult[${a}] = undefined;\n } else {\n newResult[${a}] = ${n}.value;\n }\n `)}else{const n=i[e];t.write(`const ${n} = ${r(e)};`),t.write(`\n if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${l.UQ(e)}, ...iss.path] : [${l.UQ(e)}]\n })));`),t.write(`newResult[${l.UQ(e)}] = ${n}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");const u=t.compile();return(t,n)=>u(e,t,n)})(t.shape)),a=r(a,u);else{a.value={};const e=m.shape;for(const t of m.keys){const n=e[t],r=n._zod.run({value:p[t],issues:[]},u),s="optional"===n._zod.optin&&"optional"===n._zod.optout;r instanceof Promise?h.push(r.then((e=>s?W(e,a,t,p):G(e,a,t)))):s?W(r,a,t,p):G(r,a,t)}}if(!d)return h.length?Promise.all(h).then((()=>a)):a;const f=[],v=m.keySet,g=d._zod,y=g.def.type;for(const e of Object.keys(p)){if(v.has(e))continue;if("never"===y){f.push(e);continue}const t=g.run({value:p[e],issues:[]},u);t instanceof Promise?h.push(t.then((t=>G(t,a,e)))):G(t,a,e)}return f.length&&a.issues.push({code:"unrecognized_keys",keys:f,input:p,inst:e}),h.length?Promise.all(h).then((()=>a)):a}}));function H(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>l.iR(e,r,a.$W())))))}),t}const J=a.xI("$ZodUnion",((e,t)=>{p.init(e,t),l.gJ(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),l.gJ(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),l.gJ(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),l.gJ(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>l.p6(e.source))).join("|")})$`)}})),e._zod.parse=(n,a)=>{let r=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:n.value,issues:[]},a);if(t instanceof Promise)s.push(t),r=!0;else{if(0===t.issues.length)return t;s.push(t)}}return r?Promise.all(s).then((t=>H(t,n,e,a))):H(s,n,e,a)}})),X=a.xI("$ZodDiscriminatedUnion",((e,t)=>{J.init(e,t);const n=e._zod.parse;l.gJ(e._zod,"propValues",(()=>{const e={};for(const n of t.options){const a=n._zod.propValues;if(!a||0===Object.keys(a).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(a)){e[t]||(e[t]=new Set);for(const a of n)e[t].add(a)}}return e}));const a=l.PO((()=>{const e=t.options,n=new Map;for(const a of e){const e=a._zod.propValues[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,a)}}return n}));e._zod.parse=(r,s)=>{const i=r.value;if(!l.Gv(i))return r.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),r;const o=a.value.get(i?.[t.discriminator]);return o?o._zod.run(r,s):t.unionFallback?n(r,s):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:i,path:[t.discriminator],inst:e}),r)}})),Q=a.xI("$ZodIntersection",((e,t)=>{p.init(e,t),e._zod.parse=(e,n)=>{const a=e.value,r=t.left._zod.run({value:a,issues:[]},n),s=t.right._zod.run({value:a,issues:[]},n);return r instanceof Promise||s instanceof Promise?Promise.all([r,s]).then((([t,n])=>te(e,t,n))):te(e,r,s)}}));function ee(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(l.Qd(e)&&l.Qd(t)){const n=Object.keys(t),a=Object.keys(e).filter((e=>-1!==n.indexOf(e))),r={...e,...t};for(const n of a){const a=ee(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r[n]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const r=ee(e[a],t[a]);if(!r.valid)return{valid:!1,mergeErrorPath:[a,...r.mergeErrorPath]};n.push(r.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function te(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),l.QH(e))return e;const a=ee(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const ne=a.xI("$ZodRecord",((e,t)=>{p.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!l.Qd(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[];if(t.keyType._zod.values){const a=t.keyType._zod.values;n.value={};for(const e of a)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const a=t.valueType._zod.run({value:s[e],issues:[]},r);a instanceof Promise?i.push(a.then((t=>{t.issues.length&&n.issues.push(...l.lQ(e,t.issues)),n.value[e]=t.value}))):(a.issues.length&&n.issues.push(...l.lQ(e,a.issues)),n.value[e]=a.value)}let o;for(const e in s)a.has(e)||(o=o??[],o.push(e));o&&o.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:o})}else{n.value={};for(const o of Reflect.ownKeys(s)){if("__proto__"===o)continue;const u=t.keyType._zod.run({value:o,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:u.issues.map((e=>l.iR(e,r,a.$W()))),input:o,path:[o],inst:e}),n.value[u.value]=u.value;continue}const c=t.valueType._zod.run({value:s[o],issues:[]},r);c instanceof Promise?i.push(c.then((e=>{e.issues.length&&n.issues.push(...l.lQ(o,e.issues)),n.value[u.value]=e.value}))):(c.issues.length&&n.issues.push(...l.lQ(o,c.issues)),n.value[u.value]=c.value)}}return i.length?Promise.all(i).then((()=>n)):n}})),ae=a.xI("$ZodEnum",((e,t)=>{p.init(e,t);const n=l.w5(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter((e=>l.qQ.has(typeof e))).map((e=>"string"==typeof e?l.$f(e):e.toString())).join("|")})$`),e._zod.parse=(t,a)=>{const r=t.value;return e._zod.values.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),re=a.xI("$ZodLiteral",((e,t)=>{p.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map((e=>"string"==typeof e?l.$f(e):e?e.toString():String(e))).join("|")})$`),e._zod.parse=(n,a)=>{const r=n.value;return e._zod.values.has(r)||n.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),n}})),se=a.xI("$ZodTransform",((e,t)=>{p.init(e,t),e._zod.parse=(e,n)=>{const r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then((t=>(e.value=t,e)));if(r instanceof Promise)throw new a.GT;return e.value=r,e}})),ie=a.xI("$ZodOptional",((e,t)=>{p.init(e,t),e._zod.optin="optional",e._zod.optout="optional",l.gJ(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),l.gJ(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${l.p6(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,n):void 0===e.value?e:t.innerType._zod.run(e,n)})),oe=a.xI("$ZodNullable",((e,t)=>{p.init(e,t),l.gJ(e._zod,"optin",(()=>t.innerType._zod.optin)),l.gJ(e._zod,"optout",(()=>t.innerType._zod.optout)),l.gJ(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${l.p6(e.source)}|null)$`):void 0})),l.gJ(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),le=a.xI("$ZodDefault",((e,t)=>{p.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if(void 0===e.value)return e.value=t.defaultValue,e;const a=t.innerType._zod.run(e,n);return a instanceof Promise?a.then((e=>ue(e,t))):ue(a,t)}}));function ue(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const ce=a.xI("$ZodPrefault",((e,t)=>{p.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),pe=a.xI("$ZodNonOptional",((e,t)=>{p.init(e,t),l.gJ(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,a)=>{const r=t.innerType._zod.run(n,a);return r instanceof Promise?r.then((t=>de(t,e))):de(r,e)}}));function de(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const me=a.xI("$ZodCatch",((e,t)=>{p.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"optout",(()=>t.innerType._zod.optout)),l.gJ(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then((r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map((e=>l.iR(e,n,a.$W())))},input:e.value}),e.issues=[]),e))):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map((e=>l.iR(e,n,a.$W())))},input:e.value}),e.issues=[]),e)}})),he=a.xI("$ZodPipe",((e,t)=>{p.init(e,t),l.gJ(e._zod,"values",(()=>t.in._zod.values)),l.gJ(e._zod,"optin",(()=>t.in._zod.optin)),l.gJ(e._zod,"optout",(()=>t.out._zod.optout)),e._zod.parse=(e,n)=>{const a=t.in._zod.run(e,n);return a instanceof Promise?a.then((e=>fe(e,t,n))):fe(a,t,n)}}));function fe(e,t,n){return l.QH(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const ve=a.xI("$ZodReadonly",((e,t)=>{p.init(e,t),l.gJ(e._zod,"propValues",(()=>t.innerType._zod.propValues)),l.gJ(e._zod,"values",(()=>t.innerType._zod.values)),l.gJ(e._zod,"optin",(()=>t.innerType._zod.optin)),l.gJ(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{const a=t.innerType._zod.run(e,n);return a instanceof Promise?a.then(ge):ge(a)}}));function ge(e){return e.value=Object.freeze(e.value),e}const ye=a.xI("$ZodLazy",((e,t)=>{p.init(e,t),l.gJ(e._zod,"innerType",(()=>t.getter())),l.gJ(e._zod,"pattern",(()=>e._zod.innerType._zod.pattern)),l.gJ(e._zod,"propValues",(()=>e._zod.innerType._zod.propValues)),l.gJ(e._zod,"optin",(()=>e._zod.innerType._zod.optin)),l.gJ(e._zod,"optout",(()=>e._zod.innerType._zod.optout)),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)})),$e=a.xI("$ZodCustom",((e,t)=>{r.QP.init(e,t),p.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const a=n.value,r=t.fn(a);if(r instanceof Promise)return r.then((t=>be(t,n,a,e)));be(r,n,a,e)}}));function be(e,t,n,a){if(!e){const e={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(e.params=a._zod.def.params),t.issues.push(l.sn(e))}}var _e=n(26518),Ee=n(42937);const xe=a.xI("ZodISODateTime",((e,t)=>{A.init(e,t),Re.init(e,t)})),Se=a.xI("ZodISODate",((e,t)=>{I.init(e,t),Re.init(e,t)})),Ae=a.xI("ZodISOTime",((e,t)=>{w.init(e,t),Re.init(e,t)})),Ie=a.xI("ZodISODuration",((e,t)=>{T.init(e,t),Re.init(e,t)}));var we=n(23253);const Te=a.xI("ZodType",((e,t)=>(p.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>l.o8(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>we.qg(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>we.xL(e,t,n),e.parseAsync=async(t,n)=>we.EJ(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>we.bp(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(function(e,t={}){return Ee.fU(Ut,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e){const t=new r.QP({check:"custom"});return t._zod.check=e,t}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(l.sn(e,n.value,t._zod.def));else{const a=e;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!t._zod.def.abort),n.issues.push(l.sn(a))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Ee.bS(t)),e.optional=()=>Ot(e),e.nullable=()=>Rt(e),e.nullish=()=>Ot(Rt(e)),e.nonoptional=t=>function(e,t){return new Lt({type:"nonoptional",innerType:e,...l.A2(t)})}(e,t),e.array=()=>mt(e),e.or=t=>yt([e,t]),e.and=t=>new _t({type:"intersection",left:e,right:t}),e.transform=t=>Dt(e,new Tt({type:"transform",transform:t})),e.default=t=>{return n=t,new Ct({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.prefault=t=>{return n=t,new Pt({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.catch=t=>{return new jt({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>Dt(e,t),e.readonly=()=>new Yt({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return _e.fd.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>_e.fd.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return _e.fd.get(e);const n=e.clone();return _e.fd.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),Ne=a.xI("_ZodString",((e,t)=>{d.init(e,t),Te.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Ee.Fk(...t)),e.includes=(...t)=>e.check(Ee.dR(...t)),e.startsWith=(...t)=>e.check(Ee.$S(...t)),e.endsWith=(...t)=>e.check(Ee.ER(...t)),e.min=(...t)=>e.check(Ee.m9(...t)),e.max=(...t)=>e.check(Ee.Eb(...t)),e.length=(...t)=>e.check(Ee.YA(...t)),e.nonempty=(...t)=>e.check(Ee.m9(1,...t)),e.lowercase=t=>e.check(Ee.hH(t)),e.uppercase=t=>e.check(Ee.qF(t)),e.trim=()=>e.check(Ee.WN()),e.normalize=(...t)=>e.check(Ee.lo(...t)),e.toLowerCase=()=>e.check(Ee.Il()),e.toUpperCase=()=>e.check(Ee.xY())})),Oe=a.xI("ZodString",((e,t)=>{d.init(e,t),Ne.init(e,t),e.email=t=>e.check(Ee.Mu(Ce,t)),e.url=t=>e.check(Ee.Fn(je,t)),e.jwt=t=>e.check(Ee.rk(Je,t)),e.emoji=t=>e.check(Ee.aC(Me,t)),e.guid=t=>e.check(Ee.tB(Pe,t)),e.uuid=t=>e.check(Ee.Be(Le,t)),e.uuidv4=t=>e.check(Ee.nA(Le,t)),e.uuidv6=t=>e.check(Ee.pY(Le,t)),e.uuidv7=t=>e.check(Ee.wA(Le,t)),e.nanoid=t=>e.check(Ee.Dl(De,t)),e.guid=t=>e.check(Ee.tB(Pe,t)),e.cuid=t=>e.check(Ee.fs(Ye,t)),e.cuid2=t=>e.check(Ee.Bj(Fe,t)),e.ulid=t=>e.check(Ee.Ct(qe,t)),e.base64=t=>e.check(Ee.rt(We,t)),e.base64url=t=>e.check(Ee.cU(Ke,t)),e.xid=t=>e.check(Ee.Pw(Ue,t)),e.ksuid=t=>e.check(Ee._z(Ve,t)),e.ipv4=t=>e.check(Ee.Ny(ze,t)),e.ipv6=t=>e.check(Ee.$O(Ze,t)),e.cidrv4=t=>e.check(Ee.Uy(Be,t)),e.cidrv6=t=>e.check(Ee.gP(Ge,t)),e.e164=t=>e.check(Ee.KB(He,t)),e.datetime=t=>e.check(function(e){return Ee.G1(xe,e)}(t)),e.date=t=>e.check(function(e){return Ee.db(Se,e)}(t)),e.time=t=>e.check(function(e){return Ee.Kn(Ae,e)}(t)),e.duration=t=>e.check(function(e){return Ee.f2(Ie,e)}(t))}));function ke(e){return Ee.Rl(Oe,e)}const Re=a.xI("ZodStringFormat",((e,t)=>{m.init(e,t),Ne.init(e,t)})),Ce=a.xI("ZodEmail",((e,t)=>{v.init(e,t),Re.init(e,t)})),Pe=a.xI("ZodGUID",((e,t)=>{h.init(e,t),Re.init(e,t)})),Le=a.xI("ZodUUID",((e,t)=>{f.init(e,t),Re.init(e,t)})),je=a.xI("ZodURL",((e,t)=>{g.init(e,t),Re.init(e,t)})),Me=a.xI("ZodEmoji",((e,t)=>{y.init(e,t),Re.init(e,t)})),De=a.xI("ZodNanoID",((e,t)=>{$.init(e,t),Re.init(e,t)})),Ye=a.xI("ZodCUID",((e,t)=>{b.init(e,t),Re.init(e,t)})),Fe=a.xI("ZodCUID2",((e,t)=>{_.init(e,t),Re.init(e,t)})),qe=a.xI("ZodULID",((e,t)=>{E.init(e,t),Re.init(e,t)})),Ue=a.xI("ZodXID",((e,t)=>{x.init(e,t),Re.init(e,t)})),Ve=a.xI("ZodKSUID",((e,t)=>{S.init(e,t),Re.init(e,t)})),ze=a.xI("ZodIPv4",((e,t)=>{N.init(e,t),Re.init(e,t)})),Ze=a.xI("ZodIPv6",((e,t)=>{O.init(e,t),Re.init(e,t)})),Be=a.xI("ZodCIDRv4",((e,t)=>{k.init(e,t),Re.init(e,t)})),Ge=a.xI("ZodCIDRv6",((e,t)=>{R.init(e,t),Re.init(e,t)})),We=a.xI("ZodBase64",((e,t)=>{P.init(e,t),Re.init(e,t)})),Ke=a.xI("ZodBase64URL",((e,t)=>{L.init(e,t),Re.init(e,t)})),He=a.xI("ZodE164",((e,t)=>{j.init(e,t),Re.init(e,t)})),Je=a.xI("ZodJWT",((e,t)=>{M.init(e,t),Re.init(e,t)})),Xe=a.xI("ZodNumber",((e,t)=>{D.init(e,t),Te.init(e,t),e.gt=(t,n)=>e.check(Ee.Tx(t,n)),e.gte=(t,n)=>e.check(Ee.qm(t,n)),e.min=(t,n)=>e.check(Ee.qm(t,n)),e.lt=(t,n)=>e.check(Ee.Au(t,n)),e.lte=(t,n)=>e.check(Ee.Zm(t,n)),e.max=(t,n)=>e.check(Ee.Zm(t,n)),e.int=t=>e.check(tt(t)),e.safe=t=>e.check(tt(t)),e.positive=t=>e.check(Ee.Tx(0,t)),e.nonnegative=t=>e.check(Ee.qm(0,t)),e.negative=t=>e.check(Ee.Au(0,t)),e.nonpositive=t=>e.check(Ee.Zm(0,t)),e.multipleOf=(t,n)=>e.check(Ee.Hi(t,n)),e.step=(t,n)=>e.check(Ee.Hi(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Qe(e){return Ee.F7(Xe,e)}const et=a.xI("ZodNumberFormat",((e,t)=>{Y.init(e,t),Xe.init(e,t)}));function tt(e){return Ee.LK(et,e)}const nt=a.xI("ZodBoolean",((e,t)=>{F.init(e,t),Te.init(e,t)}));function at(e){return Ee._L(nt,e)}const rt=a.xI("ZodNull",((e,t)=>{q.init(e,t),Te.init(e,t)}));function st(e){return Ee.jw(rt,e)}const it=a.xI("ZodAny",((e,t)=>{U.init(e,t),Te.init(e,t)}));function ot(){return Ee.KA(it)}const lt=a.xI("ZodUnknown",((e,t)=>{V.init(e,t),Te.init(e,t)}));function ut(){return Ee.em(lt)}const ct=a.xI("ZodNever",((e,t)=>{z.init(e,t),Te.init(e,t)}));function pt(e){return Ee.G8(ct,e)}const dt=a.xI("ZodArray",((e,t)=>{B.init(e,t),Te.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Ee.m9(t,n)),e.nonempty=t=>e.check(Ee.m9(1,t)),e.max=(t,n)=>e.check(Ee.Eb(t,n)),e.length=(t,n)=>e.check(Ee.YA(t,n)),e.unwrap=()=>e.element}));function mt(e,t){return Ee.dZ(dt,e,t)}const ht=a.xI("ZodObject",((e,t)=>{K.init(e,t),Te.init(e,t),l.gJ(e,"shape",(()=>t.shape)),e.keyof=()=>At(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ut()}),e.loose=()=>e.clone({...e._zod.def,catchall:ut()}),e.strict=()=>e.clone({...e._zod.def,catchall:pt()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>l.X$(e,t),e.merge=t=>l.h1(e,t),e.pick=t=>l.Up(e,t),e.omit=t=>l.cJ(e,t),e.partial=(...t)=>l.OH(Nt,e,t[0]),e.required=(...t)=>l.mw(Lt,e,t[0])}));function ft(e,t){const n={type:"object",get shape(){return l.Vy(this,"shape",{...e}),this.shape},...l.A2(t)};return new ht(n)}function vt(e,t){return new ht({type:"object",get shape(){return l.Vy(this,"shape",{...e}),this.shape},catchall:pt(),...l.A2(t)})}const gt=a.xI("ZodUnion",((e,t)=>{J.init(e,t),Te.init(e,t),e.options=t.options}));function yt(e,t){return new gt({type:"union",options:e,...l.A2(t)})}const $t=a.xI("ZodDiscriminatedUnion",((e,t)=>{gt.init(e,t),X.init(e,t)}));function bt(e,t,n){return new $t({type:"union",options:t,discriminator:e,...l.A2(n)})}const _t=a.xI("ZodIntersection",((e,t)=>{Q.init(e,t),Te.init(e,t)})),Et=a.xI("ZodRecord",((e,t)=>{ne.init(e,t),Te.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}));function xt(e,t,n){return new Et({type:"record",keyType:e,valueType:t,...l.A2(n)})}const St=a.xI("ZodEnum",((e,t)=>{ae.init(e,t),Te.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,a)=>{const r={};for(const a of e){if(!n.has(a))throw new Error(`Key ${a} not found in enum`);r[a]=t.entries[a]}return new St({...t,checks:[],...l.A2(a),entries:r})},e.exclude=(e,a)=>{const r={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete r[t]}return new St({...t,checks:[],...l.A2(a),entries:r})}}));function At(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new St({type:"enum",entries:n,...l.A2(t)})}const It=a.xI("ZodLiteral",((e,t)=>{re.init(e,t),Te.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}));function wt(e,t){return new It({type:"literal",values:Array.isArray(e)?e:[e],...l.A2(t)})}const Tt=a.xI("ZodTransform",((e,t)=>{se.init(e,t),Te.init(e,t),e._zod.parse=(n,a)=>{n.addIssue=a=>{if("string"==typeof a)n.issues.push(l.sn(a,n.value,t));else{const t=a;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),t.continue??(t.continue=!0),n.issues.push(l.sn(t))}};const r=t.transform(n.value,n);return r instanceof Promise?r.then((e=>(n.value=e,n))):(n.value=r,n)}}));const Nt=a.xI("ZodOptional",((e,t)=>{ie.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Ot(e){return new Nt({type:"optional",innerType:e})}const kt=a.xI("ZodNullable",((e,t)=>{oe.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Rt(e){return new kt({type:"nullable",innerType:e})}const Ct=a.xI("ZodDefault",((e,t)=>{le.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Pt=a.xI("ZodPrefault",((e,t)=>{ce.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Lt=a.xI("ZodNonOptional",((e,t)=>{pe.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.innerType})),jt=a.xI("ZodCatch",((e,t)=>{me.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),Mt=a.xI("ZodPipe",((e,t)=>{he.init(e,t),Te.init(e,t),e.in=t.in,e.out=t.out}));function Dt(e,t){return new Mt({type:"pipe",in:e,out:t})}const Yt=a.xI("ZodReadonly",((e,t)=>{ve.init(e,t),Te.init(e,t)})),Ft=a.xI("ZodLazy",((e,t)=>{ye.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.getter()}));function qt(e){return new Ft({type:"lazy",getter:e})}const Ut=a.xI("ZodCustom",((e,t)=>{$e.init(e,t),Te.init(e,t)}));function Vt(e,t){return Ee.FO(Ut,e??(()=>!0),t)}function zt(e,t={error:`Input not instance of ${e.name}`}){const n=new Ut({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...l.A2(t)});return n._zod.bag.Class=e,n}},86391:(e,t,n)=>{const a=n(70692);e.exports=(e,t,n)=>a(e,t,n)<0},86506:(e,t,n)=>{const a=n(48381);e.exports=(e,t)=>new a(e,t).patch},86543:(e,t,n)=>{const a=n(38358);e.exports=(e,t)=>{const n=a(e,t);return n&&n.prerelease.length?n.prerelease:null}},86812:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.REQUIRED_AS_FIRST_STAGE=t.FULL_SCAN_STAGES=t.OUT_STAGES=t.STAGE_OPERATOR_NAMES=t.STAGE_OPERATORS=void 0;const a=n(26633),r=n(93555),s=[{name:"$addFields",value:"$addFields",label:"$addFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value.",comment:"/**\n * newField: The new field name.\n * expression: The new field expression.\n */\n",snippet:"{\n ${1:newField}: ${2:expression}, ${3:...}\n}"},{name:"$bucket",value:"$bucket",label:"$bucket",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Categorizes incoming documents into groups, called buckets, based on specified boundaries.",comment:"/**\n * groupBy: The expression to group by.\n * boundaries: An array of the lower boundaries for each bucket.\n * default: The bucket name for documents that do not fall within the specified boundaries\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n */\n",snippet:"{\n groupBy: ${1:expression},\n boundaries: [ ${2:lowerbound}, ${3:...} ],\n default: ${4:literal},\n output: {\n ${5:outputN}: { ${6:accumulator} }, ${7:...}\n }\n}"},{name:"$bucketAuto",value:"$bucketAuto",label:"$bucketAuto",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.",comment:"/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n",snippet:"{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}"},{name:"$changeStream",value:"$changeStream",label:"$changeStream",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a Change Stream cursor for the collection.",comment:"/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n",snippet:"{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}"},{name:"$collStats",value:"$collStats",label:"$collStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Returns statistics regarding a collection or view.",comment:"/**\n * histograms: Optional latency histograms.\n * storageStats: Optional storage stats.\n */\n",snippet:"{\n latencyStats: {\n histograms: ${1:boolean}\n },\n storageStats: {${2:}},\n}"},{name:"$count",value:"$count",label:"$count",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns a count of the number of documents at this stage of the aggregation pipeline.",comment:"/**\n * Provide the field name for the count.\n */\n",snippet:"'${1:string}'"},{name:"$currentOp",value:"$currentOp",label:"$currentOp",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.",comment:"/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n",snippet:"{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}"},{name:"$densify",value:"$densify",label:"$densify",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.1.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level.",comment:"/**\n * field: The required field to densify.\n * partitionByFields: The set of fields that acts as a compound key to define each partition.\n * range: {\n * step: The amount to increment the field value in each document.\n * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.\n * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.\n * }\n */\n",snippet:"{\n field: ${1:string},\n partitionByFields: [${2:string}, ${3:string}, ...],\n range: {\n step: ${4:number},\n unit: ${5:string},\n bounds: [${6:lowerbound}, ${7:upperbound}, ...]\n }\n}"},{name:"$documents",value:"$documents",label:"$documents",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.9",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns literal documents from input values.",comment:"/**\n * expression: Any valid expression.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$facet",value:"$facet",label:"$facet",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Allows for multiple parellel aggregations to be specified.",comment:"/**\n * outputFieldN: The first output field.\n * stageN: The first aggregation stage.\n */\n",snippet:"{\n ${1:outputFieldN}: [ ${2:stageN}, ${3:...} ]\n}"},{name:"$fill",value:"$fill",label:"$fill",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.3.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Populates null and missing field values within documents.",comment:'/**\n * sortBy: Syntax is the same as $sort, required if "method" is used in at least one output spec otherwise optional\n * partitionBy: Optional, default is a single partition. Specification is the same as _id in $group (same as partitionBy in window functions).\n * partitionByFields: Optional, set of fields that acts as a compound key to define each partition.\n * output - Required, object for each field to fill in. For a single field, can be a single object.\n * output.<field> - A field to be filled with value, if missing or null in the current document.\n */\n',snippet:"{\n sortBy: ${1:sortSpec},\n partitionBy: ${2:expression},\n partitionByFields: [${3:string}, ${4:string}, ...],\n output: {\n field1: {value: ${5:expression}},\n field2: {method: ${6:string}},\n ...\n }\n}"},{name:"$geoNear",value:"$geoNear",label:"$geoNear",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns documents based on proximity to a geospatial point.",comment:"/**\n * near: The point to search near.\n * distanceField: The calculated distance.\n * maxDistance: The maximum distance, in meters, documents can be before being excluded from results.\n * query: Limits results that match the query\n * includeLocs: Optional. Labels and includes the point used to match the document.\n * num: Optional. The maximum number of documents to return.\n * spherical: Defaults to false. Specifies whether to use spherical geometry.\n */\n",snippet:"{\n near: { type: 'Point', coordinates: [ ${1:number}, ${2:number} ] },\n distanceField: '${3:string}',\n maxDistance: ${4:number},\n query: {${5}},\n includeLocs: '${6}',\n num: ${7:number},\n spherical: ${8:boolean}\n}"},{name:"$graphLookup",value:"$graphLookup",label:"$graphLookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a recursive search on a collection.",comment:"/**\n * from: The target collection.\n * startWith: Expression to start.\n * connectFromField: Field to connect.\n * connectToField: Field to connect to.\n * as: Name of the array field.\n * maxDepth: Optional max recursion depth.\n * depthField: Optional Name of the depth field.\n * restrictSearchWithMatch: Optional query.\n */\n",snippet:"{\n from: '${1:string}',\n startWith: ${2:expression},\n connectFromField: '${3:string}',\n connectToField: '${4:string}',\n as: '${5:string}',\n maxDepth: ${6:number},\n depthField: '${7:string}',\n restrictSearchWithMatch: {${8}}\n}"},{name:"$group",value:"$group",label:"$group",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups documents by a specified expression.",comment:"/**\n * _id: The id of the group.\n * fieldN: The first field name.\n */\n",snippet:"{\n _id: ${1:expression},\n ${2:fieldN}: {\n ${3:accumulatorN}: ${4:expressionN}\n }\n}"},{name:"$indexStats",value:"$indexStats",label:"$indexStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[],namespaces:[...r.ANY_NAMESPACE],description:"Returns statistics regarding the use of each index for the collection.",comment:"/**\n * No parameters.\n */\n",snippet:"{}"},{name:"$limit",value:"$limit",label:"$limit",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Limits the number of documents that flow into subsequent stages.",comment:"/**\n * Provide the number of documents to limit.\n */\n",snippet:"${1:number}"},{name:"$listLocalSessions",value:"$listLocalSessions",label:"$listLocalSessions",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Lists the sessions cached in memory by the mongod or mongos instance.",comment:"/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n",snippet:"{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}"},{name:"$lookup",value:"$lookup",label:"$lookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a join between two collections.",comment:"/**\n * from: The target collection.\n * localField: The local join field.\n * foreignField: The target join field.\n * as: The name for the results.\n * pipeline: Optional pipeline to run on the foreign collection.\n * let: Optional variables to use in the pipeline field stages.\n */\n",snippet:"{\n from: ${1:collection},\n localField: ${2:field},\n foreignField: ${3:field},\n as: ${4:result}\n}"},{name:"$match",value:"$match",label:"$match",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Filters the document stream to allow only matching documents to pass through to subsequent stages.",comment:"/**\n * query: The query in MQL.\n */\n",snippet:"{\n ${1:query}\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.1.11",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * into: The target collection.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: '${1:string}',\n on: '${2:string}',\n let: '${3:specification(s)}',\n whenMatched: '${4:string}',\n whenNotMatched: '${5:string}'\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * atlas: Location to write the documents from the aggregation pipeline.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: {\n atlas: {\n clusterName: '${1:atlasClusterName}',\n db: '${2:database}',\n coll: '${3:collection}',\n projectId: '${4:optionalAtlasProjectId}'\n }\n },\n on: '${5:identifier}',\n let: { ${6:specification(s)} },\n whenMatched: '${7:string}',\n whenNotMatched: '${8:string}'\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to a new or existing collection.",comment:"/**\n * Provide the name of the output database and collection.\n */\n",snippet:"{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to an Atlas cluster, S3 bucket, or Azure Blob Storage.",comment:"/**\n * Use any one of the following:\n * s3: Parameters to save the data to S3.\n * atlas: Parameters to save the data to Atlas. Example:\n * {\n * atlas: {\n * db: 'string',\n * coll: 'string',\n * projectId: 'string',\n * clusterName: 'string'\n * }\n * },\n * azure: Parameters to save the data to Azure. Example:\n * {\n * azure: {\n * serviceURL: 'string',\n * containerName: 'string',\n * region: 'string,\n * filename: 'string',\n * format: {\n * name: 'string',\n * maxFileSize: 'string',\n * maxRowGroupSize: 'string',\n * columnCompression: 'string'\n * },\n * errorMode: 'string'\n * }\n * }\n */\n",snippet:"{\n s3: {\n bucket: '${1:string}',\n region: '${2:string}',\n filename: '${3:string}',\n format: {\n name: '${4:string}',\n maxFileSize: '${5:bytes}',\n maxRowGroupSize: '${6:string}',\n columnCompression: '${7:string}'\n },\n errorMode: '${8:string}'\n }\n}"},{name:"$project",value:"$project",label:"$project",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value. Unlike $addFields, $project can also remove fields.",comment:"/**\n * specifications: The fields to\n * include or exclude.\n */\n",snippet:"{\n ${1:specification(s)}\n}"},{name:"$rankFusion",value:"$rankFusion",label:"$rankFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.0.14",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using reciprocal rank fusion to create hybrid search results.",comment:'/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be a Ranked Selection Pipeline operating on the same collection. Minimum of one pipeline.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information in {$meta: "scoreDetails"} for debugging and tuning.\n */\n',snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n }\n },\n combination: {\n weights: {\n ${6:searchPipeline}: ${7:number},\n ${8:vectorPipeline}: ${9:number}\n }\n },\n scoreDetails: ${10:false}\n}"},{name:"$redact",value:"$redact",label:"$redact",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.6.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Restricts the content for each document based on information stored in the documents themselves",comment:"/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$replaceRoot",value:"$replaceRoot",label:"$replaceRoot",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newRoot: ${1:replacementDocument}\n}"},{name:"$replaceWith",value:"$replaceWith",label:"$replaceWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newWith: ${1:replacementDocument}\n}"},{name:"$sample",value:"$sample",label:"$sample",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Randomly selects the specified number of documents from its input.",comment:"/**\n * size: The number of documents to sample.\n */\n",snippet:"{\n size: ${1:number}\n}"},{name:"$scoreFusion",value:"$scoreFusion",label:"$scoreFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.2.0",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using relative score fusion to create hybrid search results.",comment:"/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be operating on the same collection. Minimum of one pipeline.\n * input.normalization: Required. Normalizes the score to the range 0 to 1 before combining the results. Value can be none, sigmoid or minMaxScaler.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * combination.method: Optional. Specifies method for combining scores. Value can be avg or expression. Default is avg.\n * combination.expression: Optional. This is the custom expression that is used when combination.method is set to expression.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information.\n */\n",snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n },\n normalization: '${6:none|sigmoid|minMaxScaler}'\n },\n combination: {\n weights: {\n ${7:searchPipeline}: ${8:number},\n ${9:vectorPipeline}: ${10:number}\n },\n method: '${11:avg|expression}',\n expression: '${12:expression}'\n },\n scoreDetails: ${13:false}\n}"},{name:"$search",value:"$search",label:"$search",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.1.11",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s).",comment:"/**\n * index: The name of the Search index.\n * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. Use matchCriteria to match 'any' or 'all' query terms.\n * compound: Combines ops.\n * span: Find in text field regions.\n * exists: Test for presence of a field.\n * near: Find near number or date.\n * range: Find in numeric or date range.\n */\n",snippet:"{\n index: '${1:string}',\n text: {\n query: '${2:string}',\n path: '${3:string}',\n matchCriteria: '${4:any}',\n }\n}"},{name:"$searchMeta",value:"$searchMeta",label:"$searchMeta",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.4.9",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.",comment:"/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n",snippet:"{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}"},{name:"$set",value:"$set",label:"$set",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.",comment:"/**\n * field: The field name\n * expression: The expression.\n */\n",snippet:"{\n ${1:field}: ${2:expression}\n}"},{name:"$setWindowFields",value:"$setWindowFields",label:"$setWindowFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Capable of partitioning incoming data, and can apply one or more functions to defined windows within each partition.",comment:"/**\n * partitionBy: partitioning of data.\n * sortBy: fields to sort by.\n * output: {\n * path: {\n * function: The window function to compute over the given window.\n * window: {\n * documents: A number of documents before and after the current document.\n * range: A range of possible values around the value in the current document's sortBy field.\n * unit: Specifies the units for the window bounds.\n * }\n * }\n * }\n */\n",snippet:"{\n partitionBy: ${1:expression},\n sortBy: ${2:sortSpec},\n output: {\n ${3:path}: {\n ${4:function}: ${5:functionArgs},\n window: {\n documents: [${6:lowerbound}, ${7:upperbound}],\n range: [${8:lowerbound}, ${9:upperbound}],\n unit: ${10:string}\n }\n },\n ${11:path2}: ...\n }\n}"},{name:"$skip",value:"$skip",label:"$skip",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Skips a specified number of documents before advancing to the next stage.",comment:"/**\n * Provide the number of documents to skip.\n */\n",snippet:"${1:number}"},{name:"$sort",value:"$sort",label:"$sort",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Reorders the document stream by a specified sort key and direction.",comment:"/**\n * Provide any number of field/order pairs.\n */\n",snippet:"{\n ${1:field1}: ${2:sortOrder}\n}"},{name:"$sortByCount",value:"$sortByCount",label:"$sortByCount",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.",comment:"/**\n * expression: Grouping expression or string.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$unionWith",value:"$unionWith",label:"$unionWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Perform a union with a pipeline on another collection.",comment:"/**\n * coll: The collection name.\n * pipeline: The pipeline on the other collection.\n */\n",snippet:"{\n coll: '${1:coll}',\n pipeline: [${2:pipeline}]\n}"},{name:"$unset",value:"$unset",label:"$unset",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Excludes fields from the result document.",comment:"/**\n * Provide the field name to exclude.\n * To exclude multiple fields, pass the field names in an array.\n */\n",snippet:"'${1:string}'"},{name:"$unwind",value:"$unwind",label:"$unwind",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Outputs a new document for each element in a specified array. ",comment:"/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n",snippet:"{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}"},{name:"$vectorSearch",value:"$vectorSearch",label:"$vectorSearch",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS],meta:"stage",version:">=6.0.10 <7.0.0 || >=7.0.2",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a kNN search on embeddings in the specified field(s)",comment:"/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n * exact: Choose between false for ANN (Approximate Nearest Neighbor) and true for ENN (Exact Nearest Neighbor). Defaults to false. (Optional)\n */\n",snippet:"{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}},\n exact: ${8:boolean}\n}"}];t.STAGE_OPERATORS=s;const i=s.map((e=>e.name));t.STAGE_OPERATOR_NAMES=i;const o=s.filter((e=>e.outputStage));t.OUT_STAGES=o;const l=s.filter((e=>e.fullScan));t.FULL_SCAN_STAGES=l;const u=s.filter((e=>e.firstStage));t.REQUIRED_AS_FIRST_STAGE=u},86912:(e,t,n)=>{const a=n(41694);e.exports=(e,t)=>new a(e,t).major},86987:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_VARIABLES=void 0,t.SYSTEM_VARIABLES=[{name:"$$NOW",value:"$$NOW",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current datetime value. NOW returns the same value for all members of the deployment and remains the same throughout all stages of the aggregation pipeline."},{name:"$$CLUSTER_TIME",value:"$$CLUSTER_TIME",score:1,meta:"variable:system",version:"4.2.0",description:"A variable that returns the current timestamp value. CLUSTER_TIME is only available on replica sets and sharded clusters. CLUSTER_TIME returns the same value for all members of the deployment and remains the same throughout all stages of the pipeline."},{name:"$$ROOT",value:"$$ROOT",score:1,meta:"variable:system",version:"2.4.0",description:"References the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage."},{name:"$$CURRENT",value:"$$CURRENT",score:1,meta:"variable:system",version:"2.4.0",description:"References the start of the field path being processed in the aggregation pipeline stage. Unless documented otherwise, all stages start with CURRENT the same as ROOT. CURRENT is modifiable. However, since `$<field>` is equivalent to `$$CURRENT.<field>`, rebinding CURRENT changes the meaning of `$` accesses."},{name:"$$REMOVE",value:"$$REMOVE",score:1,meta:"variable:system",version:"3.6.0",description:"A variable which evaluates to the missing value. Allows for the conditional exclusion of fields. In a `$project`, a field set to the variable REMOVE is excluded from the output."},{name:"$$DESCEND",value:"$$DESCEND",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$PRUNE",value:"$$PRUNE",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$KEEP",value:"$$KEEP",score:1,meta:"variable:system",version:"3.0.0",description:"One of the allowed results of a `$redact` expression."},{name:"$$SEARCH_META",value:"$$SEARCH_META",score:1,meta:"variable:system",version:"5.0.0",description:"A variable that stores the metadata results of an Atlas Search query. In all supported aggregation pipeline stages, a field set to the variable SEARCH_META returns the metadata results for the query. For an example of its usage, see Atlas Search facet and count."},{name:"$$USER_ROLES",value:"$$USER_ROLES",score:1,meta:"variable:system",version:"7.0.0",description:"A variable that stores the role names of the authenticated user running the command."}]},87225:(e,t,n)=>{const a=n(57544);e.exports=(e,t)=>new a(e,t).major},87257:(e,t,n)=>{function a(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}function r(e,t){return"bigint"==typeof t?t.toString():t}function s(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function i(e){return null==e}function o(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function l(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,r=n>a?n:a;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}function u(e,t,n){Object.defineProperty(e,t,{get(){{const a=n();return e[t]=a,a}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function c(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function p(e){return JSON.stringify(e)}n.d(t,{$f:()=>g,A2:()=>$,Gv:()=>m,LG:()=>l,NM:()=>b,OH:()=>I,PO:()=>s,QH:()=>T,Qd:()=>f,Rc:()=>R,UQ:()=>p,Up:()=>E,Vy:()=>c,X$:()=>S,cJ:()=>x,cl:()=>i,gJ:()=>u,gx:()=>d,h1:()=>A,hI:()=>h,iR:()=>k,k8:()=>r,lQ:()=>N,mw:()=>w,o8:()=>y,p6:()=>o,qQ:()=>v,sn:()=>C,w5:()=>a,zH:()=>_});const d=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function m(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const h=s((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function f(e){if(!1===m(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==m(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}const v=new Set(["string","number","symbol"]);function g(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y(e,t,n){const a=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(a._zod.parent=e),a}function $(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function b(e){return Object.keys(e).filter((t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout))}new Set(["string","number","bigint","boolean","symbol","undefined"]);const _={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function E(e,t){const n={},a=e._zod.def;for(const e in t){if(!(e in a.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=a.shape[e])}return y(e,{...e._zod.def,shape:n,checks:[]})}function x(e,t){const n={...e._zod.def.shape},a=e._zod.def;for(const e in t){if(!(e in a.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return y(e,{...e._zod.def,shape:n,checks:[]})}function S(e,t){if(!f(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return c(this,"shape",n),n},checks:[]};return y(e,n)}function A(e,t){return y(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return c(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function I(e,t,n){const a=t._zod.def.shape,r={...a};if(n)for(const t in n){if(!(t in a))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=e?new e({type:"optional",innerType:a[t]}):a[t])}else for(const t in a)r[t]=e?new e({type:"optional",innerType:a[t]}):a[t];return y(t,{...t._zod.def,shape:r,checks:[]})}function w(e,t,n){const a=t._zod.def.shape,r={...a};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=new e({type:"nonoptional",innerType:a[t]}))}else for(const t in a)r[t]=new e({type:"nonoptional",innerType:a[t]});return y(t,{...t._zod.def,shape:r,checks:[]})}function T(e,t=0){for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function N(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function O(e){return"string"==typeof e?e:e?.message}function k(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const r=O(e.inst?._zod.def?.error?.(e))??O(t?.error?.(e))??O(n.customError?.(e))??O(n.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function R(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function C(...e){const[t,n,a]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:a}:{...t}}},87391:(e,t,n)=>{const a=n(41694);e.exports=(e,t,n)=>{const r=new a(e,n),s=new a(t,n);return r.compare(s)||r.compareBuild(s)}},87494:e=>{const t=function(e){return e=e.toString(),this instanceof t?(this.ns=e,this.dotIndex=e.indexOf("."),-1===this.dotIndex?(this.database=e,this.collection=""):(this.database=e.slice(0,this.dotIndex),this.collection=e.slice(this.dotIndex+1)),this.system=/^(?:system(?!\.profile$).*|enxcol_)\./.test(this.collection),this.oplog=/local\.oplog\.(\$main|rs)/.test(e),this.command="$cmd"===this.collection||0===this.collection.indexOf("$cmd.sys"),this.special=this.oplog||this.command||this.system||"config"===this.database||/^__mdb_internal_\w/.test(this.database),this.specialish=this.special||["local","admin"].indexOf(this.database)>-1,this.normal=this.oplog||-1===this.ns.indexOf("$"),this.validDatabaseName=new RegExp('^[^\\\\/". ]*$').test(this.database)&&this.database.length<=t.MAX_DATABASE_NAME_LENGTH,this.validCollectionName=this.collection.length>0&&(this.oplog||/^[^\0$]*$/.test(this.collection)),this.databaseHash=7,this.ns.split("").every(((e,t)=>"."!==e&&(this.databaseHash+=11*this.ns.charCodeAt(t),this.databaseHash*=3,!0))),this):new t(e)};t.prototype.database="",t.prototype.databaseHash=0,t.prototype.collection="",t.prototype.command=!1,t.prototype.special=!1,t.prototype.system=!1,t.prototype.oplog=!1,t.prototype.normal=!1,t.prototype.specialish=!1,t.prototype.isCommand=function(){return this.command},t.prototype.isSpecial=function(){return this.special},t.prototype.isSystem=function(){return this.system},t.prototype.isNormal=function(){return this.normal},t.prototype.isOplog=function(){return this.oplog},t.prototype.isConf=function(){},t.prototype.toString=function(){return this.ns},t.MAX_DATABASE_NAME_LENGTH=128,t.sort=function(e){return e.sort((function(e,n){return new t(e).specialish&&new t(n).specialish?0:new t(e).specialish&&!new t(n).specialish?1:!new t(e).specialish&&new t(n).specialish?-1:e>n?1:-1})),e},e.exports=t},87866:(e,t,n)=>{const a=n(88825),r=n(67105),{ANY:s}=r,i=n(20360),o=n(72849),l=n(51269),u=n(18082),c=n(71851),p=n(54838);e.exports=(e,t,n,d)=>{let m,h,f,v,g;switch(e=new a(e,d),t=new i(t,d),n){case">":m=l,h=c,f=u,v=">",g=">=";break;case"<":m=u,h=p,f=l,v="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){const a=t.set[n];let i=null,o=null;if(a.forEach((e=>{e.semver===s&&(e=new r(">=0.0.0")),i=i||e,o=o||e,m(e.semver,i.semver,d)?i=e:f(e.semver,o.semver,d)&&(o=e)})),i.operator===v||i.operator===g)return!1;if((!o.operator||o.operator===v)&&h(e,o.semver))return!1;if(o.operator===g&&f(e,o.semver))return!1}return!0}},88099:(e,t,n)=>{const a=n(9350),r=n(33629),s=n(42734);e.exports=(e,t)=>{e=new r(e,t);let n=new a("0.0.0");if(e.test(n))return n;if(n=new a("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new a(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!s(n,i)||(n=i)}return n&&e.test(n)?n:null}},88108:(e,t,n)=>{const a=n(45160),r=n(25812),s=n(58809),i=n(54506),o=n(20038),l=n(66239);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a(e,n,u);case"!=":return r(e,n,u);case">":return s(e,n,u);case">=":return i(e,n,u);case"<":return o(e,n,u);case"<=":return l(e,n,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},88345:(e,t,n)=>{const a=n(38366);e.exports=(e,t,n)=>(e=new a(e,n),t=new a(t,n),e.intersects(t,n))},88769:(e,t,n)=>{const a=n(25522),r=n(66078),s=n(57544),i=n(40383),o=n(12196),l=n(46970),u=n(78970),c=n(67171),p=n(80196),d=n(87225),m=n(50418),h=n(54737),f=n(62893),v=n(70692),g=n(78462),y=n(68303),$=n(75265),b=n(11451),_=n(11249),E=n(72608),x=n(86391),S=n(35229),A=n(67531),I=n(70509),w=n(75092),T=n(77043),N=n(36326),O=n(75732),k=n(95323),R=n(67338),C=n(1451),P=n(14e3),L=n(37354),j=n(59934),M=n(97830),D=n(43143),Y=n(37391),F=n(57578),q=n(71080),U=n(28553),V=n(94916);e.exports={parse:o,valid:l,clean:u,inc:c,diff:p,major:d,minor:m,patch:h,prerelease:f,compare:v,rcompare:g,compareLoose:y,compareBuild:$,sort:b,rsort:_,gt:E,lt:x,eq:S,neq:A,gte:I,lte:w,cmp:T,coerce:N,Comparator:O,Range:k,satisfies:R,toComparators:C,maxSatisfying:P,minSatisfying:L,minVersion:j,validRange:M,outside:D,gtr:Y,ltr:F,intersects:q,simplifyRange:U,subset:V,SemVer:s,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},88770:(e,t,n)=>{const a=n(47538);e.exports=(e,t)=>e.sort(((e,n)=>a(e,n,t)))},88825:(e,t,n)=>{const a=n(95869),{MAX_LENGTH:r,MAX_SAFE_INTEGER:s}=n(64136),{safeRe:i,t:o}=n(36165),l=n(40594),{compareIdentifiers:u}=n(67274);class c{constructor(e,t){if(t=l(t),e instanceof c){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);a("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[o.LOOSE]:i[o.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(a("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof c||(e=new c(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(a("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(a("build compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?i[o.PRERELEASELOOSE]:i[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let a=this.prerelease.length;for(;--a>=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let a=[t,e];!1===n&&(a=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},88834:(e,t,n)=>{const a=n(72849),r=n(25583);e.exports=(e,t,n)=>{const s=[];let i=null,o=null;const l=e.sort(((e,t)=>r(e,t,n)));for(const e of l)a(e,t,n)?(o=e,i||(i=e)):(o&&s.push([i,o]),o=null,i=null);i&&s.push([i,null]);const u=[];for(const[e,t]of s)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const c=u.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return c.length<p.length?c:t}},89065:(e,t,n)=>{const a=n(41694);e.exports=(e,t,n,r,s)=>{"string"==typeof n&&(s=r,r=n,n=void 0);try{return new a(e instanceof a?e.version:e,n).inc(t,r,s).version}catch(e){return null}}},89247:(e,t,n)=>{n.d(t,{nF:()=>r});var a=n(53354);a.ACCUMULATORS,a.ADL,a.ANY_COLLECTION_NAMESPACE,a.ANY_NAMESPACE,a.ATLAS,a.ATLAS_SEARCH_TEMPLATES,a.ATLAS_VECTOR_SEARCH_TEMPLATE,a.BSON_TYPES,a.BSON_TYPE_ALIASES,a.COLLECTION,a.CONVERSION_OPERATORS,a.DATABASE,a.ENVS,a.EXPRESSION_OPERATORS,a.FULL_SCAN_STAGES,a.JSON_SCHEMA,a.ON_PREM,a.OUT_STAGES,a.QUERY_OPERATORS,a.REQUIRED_AS_FIRST_STAGE,a.STAGE_OPERATORS,a.STAGE_OPERATOR_NAMES,a.SYSTEM_VARIABLES,a.TIME_SERIES;const r=a.VALIDATION_TEMPLATE;a.VIEW,a.VIEW_PIPELINE_UTILS,a.getFilteredCompletions,a.wrapField},89295:(e,t,n)=>{var a=n(40811);e.exports=new a("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},89834:(e,t,n)=>{const a=n(33629);e.exports=(e,t,n)=>(e=new a(e,n),t=new a(t,n),e.intersects(t,n))},89975:(e,t,n)=>{const a=n(32910);e.exports=(e,t,n)=>a(e,t,"<",n)},90216:(e,t,n)=>{const a=n(9350);e.exports=(e,t)=>new a(e,t).major},90733:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const a=t.test(e),r=t.test(n);return a&&r&&(e=+e,n=+n),e===n?0:a&&!r?-1:r&&!a?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},90898:(e,t,n)=>{const a=n(99430);e.exports=(e,t,n)=>a(e,t,n)<=0},91030:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENVS=t.ON_PREM=t.ADL=t.ATLAS=void 0;const n="atlas";t.ATLAS=n,t.ADL="adl";const a="on-prem";t.ON_PREM=a;const r=[n,"adl",a];t.ENVS=r},91152:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>a(e,t,n)<0},91597:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ATLAS_VECTOR_SEARCH_TEMPLATE=t.ATLAS_SEARCH_TEMPLATES=void 0,t.ATLAS_SEARCH_TEMPLATES=[{name:"Dynamic field mappings",snippet:'{\n "mappings": {\n "dynamic": true\n }\n}',version:"4.4.0"},{name:"Static field mappings",snippet:'{\n "mappings": {\n "dynamic": false,\n "fields": {\n ${1:<string field name>}: {\n "type": "string"\n },\n ${2:<number field name>}: {\n "type": "number"\n },\n ${3:<date field name>}: {\n "type": "date"\n },\n ${4:<geo field name>}: {\n "type": "geo"\n },\n } \n }\n}',version:"4.4.0"},{name:"Text field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<string field name>}: [\n {\n // Enables text queries\n "type": "string"\n },\n {\n // Enables autocomplete queries\n "type": "autocomplete"\n \n },\n {\n // Enables sorting\n "type": "token"\n }\n ] \n } \n }\n}',version:"4.4.0"},{name:"Facet field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<number field name for faceting>}: [\n {\n "type": "numberFacet"\n },\n {\n "type": "number"\n },\n ],\n ${2:<date field name for faceting>}: [\n {\n "type": "dateFacet"\n }\n {\n "type": "date"\n }\n ],\n ${3:<string field name for faceting>}: [\n {\n "type": "stringFacet"\n },\n {\n "type": "string",\n "analyzer": "lucene.keyword"\n },\n ],\n } \n }\n}',version:"4.4.0"},{name:"KNN Vector field mapping",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<vector embedding field name>}: [\n {\n "type": "knnVector",\n "dimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n } \n ] \n } \n }\n}',version:"4.4.0"}],t.ATLAS_VECTOR_SEARCH_TEMPLATE={name:"Vector Search default template",snippet:'{\n "fields": [{\n "type": "vector",\n "path": "${1:<field name to index>}",\n "numDimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n }]\n}',version:"4.4.0"}},91714:(e,t,n)=>{var a=n(54420);e.exports=new a({explicit:[n(75459),n(98727),n(1726)]})},91716:(e,t,n)=>{const a=n(66283);e.exports=(e,t)=>new a(e,t).patch},91871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPE_ALIASES=void 0,t.BSON_TYPE_ALIASES=[{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"string",value:"string",label:"string",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"object",value:"object",label:"object",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"array",value:"array",label:"array",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"binData",value:"binData",label:"binData",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"objectId",value:"objectId",label:"objectId",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"bool",value:"bool",label:"bool",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"date",value:"date",label:"date",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"null",value:"null",label:"null",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"regex",value:"regex",label:"regex",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascript",value:"javascript",label:"javascript",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascriptWithScope",value:"javascriptWithScope",label:"javascriptWithScope",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"int",value:"int",label:"int",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"timestamp",value:"timestamp",label:"timestamp",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"long",value:"long",label:"long",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"decimal",value:"decimal",label:"decimal",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"minKey",value:"minKey",label:"minKey",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"maxKey",value:"maxKey",label:"maxKey",score:1,meta:"bson-type-aliases",version:"3.6.0"}]},91934:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JSON_SCHEMA=void 0,t.JSON_SCHEMA=[{name:"bsonType",value:"bsonType",label:"bsonType",score:1,meta:"json-schema",version:"3.6.0",description:"Accepts same string aliases used for the $type operator"},{name:"enum",value:"enum",label:"enum",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates all possible values of the field"},{name:"type",value:"type",label:"type",score:1,meta:"json-schema",version:"3.6.0",description:"Enumerates the possible JSON types of the field"},{name:"allOf",value:"allOf",label:"allOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match all specified schemas"},{name:"anyOf",value:"anyOf",label:"anyOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match at least one of the specified schemas"},{name:"oneOf",value:"oneOf",label:"oneOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match exactly one of the specified schemas"},{name:"not",value:"not",label:"not",score:1,meta:"json-schema",version:"3.6.0",description:"Field must not match the schema"},{name:"multipleOf",value:"multipleOf",label:"multipleOf",score:1,meta:"json-schema",version:"3.6.0",description:"Field must be a multiple of this value"},{name:"maximum",value:"maximum",label:"maximum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum value of the field"},{name:"exclusiveMaximum",value:"exclusiveMaximum",label:"exclusiveMaximum",score:1,meta:"json-schema",version:"3.6.0",description:"If true and field is a number, maximum is an exclusive maximum"},{name:"minimum",value:"minimum",label:"minimum",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum value of the field"},{name:"exclusiveMinimum",value:"exclusiveMinimum",label:"exclusiveMinimum",score:1,meta:"json-schema",version:"3.6.0",description:"If true, minimum is an exclusive minimum"},{name:"maxLength",value:"maxLength",label:"maxLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of the field"},{name:"minLength",value:"minLength",label:"minLength",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of the field"},{name:"pattern",value:"pattern",label:"pattern",score:1,meta:"json-schema",version:"3.6.0",description:"Field must match the regular expression"},{name:"maxProperties",value:"maxProperties",label:"maxProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s maximum number of properties"},{name:"minProperties",value:"minProperties",label:"minProperties",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the field’s minimum number of properties"},{name:"required",value:"required",label:"required",score:1,meta:"json-schema",version:"3.6.0",description:"Object’s property set must contain all the specified elements in the array"},{name:"additionalProperties",value:"additionalProperties",label:"additionalProperties",score:1,meta:"json-schema",version:"3.6.0",description:"If true, additional fields are allowed"},{name:"properties",value:"properties",label:"properties",score:1,meta:"json-schema",version:"3.6.0",description:"A valid JSON Schema where each value is also a valid JSON Schema object"},{name:"patternProperties",value:"patternProperties",label:"patternProperties",score:1,meta:"json-schema",version:"3.6.0",description:"In addition to properties requirements, each property name of this object must be a valid regular expression"},{name:"dependencies",value:"dependencies",label:"dependencies",score:1,meta:"json-schema",version:"3.6.0",description:"Describes field or schema dependencies"},{name:"additionalItems",value:"additionalItems",label:"additionalItems",score:1,meta:"json-schema",version:"3.6.0",description:"If an object, must be a valid JSON Schema"},{name:"items",value:"items",label:"items",score:1,meta:"json-schema",version:"3.6.0",description:"Must be either a valid JSON Schema, or an array of valid JSON Schemas"},{name:"maxItems",value:"maxItems",label:"maxItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the maximum length of array"},{name:"minItems",value:"minItems",label:"minItems",score:1,meta:"json-schema",version:"3.6.0",description:"Indicates the minimum length of array"},{name:"uniqueItems",value:"uniqueItems",label:"uniqueItems",score:1,meta:"json-schema",version:"3.6.0",description:"If true, each item in the array must be unique"},{name:"title",value:"title",label:"title",score:1,meta:"json-schema",version:"3.6.0",description:"A descriptive title string with no effect"},{name:"description",value:"description",label:"description",score:1,meta:"json-schema",version:"3.6.0",description:"A string that describes the schema and has no effect."}]},92133:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENVS=t.ON_PREM=t.ADL=t.ATLAS=void 0;const n="atlas";t.ATLAS=n,t.ADL="adl";const a="on-prem";t.ON_PREM=a;const r=[n,"adl",a];t.ENVS=r},92222:(e,t,n)=>{const a=n(50066),r=n(72857);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},92625:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:s}=n(24159),i=n(29385),o=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],p=t.t={};let d=0;const m="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[m,r]],f=(e,t,n)=>{const a=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=d++;i(e,r,t),p[e]=r,u[r]=t,c[r]=a,o[r]=new RegExp(t,n?"g":void 0),l[r]=new RegExp(a,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),f("MAINVERSION",`(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})\\.(${u[p.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})\\.(${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${u[p.NONNUMERICIDENTIFIER]}|${u[p.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASE",`(?:-(${u[p.PRERELEASEIDENTIFIER]}(?:\\.${u[p.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${u[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[p.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${m}+`),f("BUILD",`(?:\\+(${u[p.BUILDIDENTIFIER]}(?:\\.${u[p.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${u[p.MAINVERSION]}${u[p.PRERELEASE]}?${u[p.BUILD]}?`),f("FULL",`^${u[p.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${u[p.MAINVERSIONLOOSE]}${u[p.PRERELEASELOOSE]}?${u[p.BUILD]}?`),f("LOOSE",`^${u[p.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${u[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${u[p.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:\\.(${u[p.XRANGEIDENTIFIER]})(?:${u[p.PRERELEASE]})?${u[p.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[p.XRANGEIDENTIFIERLOOSE]})(?:${u[p.PRERELEASELOOSE]})?${u[p.BUILD]}?)?)?`),f("XRANGE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${u[p.GTLT]}\\s*${u[p.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),f("COERCE",`${u[p.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",u[p.COERCEPLAIN]+`(?:${u[p.PRERELEASE]})?`+`(?:${u[p.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",u[p.COERCE],!0),f("COERCERTLFULL",u[p.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${u[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${u[p.LONETILDE]}${u[p.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${u[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${u[p.LONECARET]}${u[p.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${u[p.LONECARET]}${u[p.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${u[p.GTLT]}\\s*(${u[p.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${u[p.GTLT]}\\s*(${u[p.LOOSEPLAIN]}|${u[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${u[p.XRANGEPLAIN]})\\s+-\\s+(${u[p.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${u[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[p.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},92660:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},92721:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},92926:e=>{e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var a=n.css,r=n.media,s=n.sourceMap;r?e.setAttribute("media",r):e.removeAttribute("media"),s&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(a,e)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},92945:(e,t,n)=>{const a=n(38366);e.exports=(e,t)=>{try{return new a(e,t).range||"*"}catch(e){return null}}},93555:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ANY_NAMESPACE=t.ANY_COLLECTION_NAMESPACE=t.TIME_SERIES=t.VIEW=t.COLLECTION=t.DATABASE=void 0,t.DATABASE="db";const n="coll";t.COLLECTION=n;const a="view";t.VIEW=a;const r="timeseries";t.TIME_SERIES=r;const s=[n,a,r];t.ANY_COLLECTION_NAMESPACE=s;const i=["db",...s];t.ANY_NAMESPACE=i},93575:(e,t,n)=>{n.d(t,{vl:()=>ta,ut:()=>Hn,Sd:()=>na,gM:()=>Wn});var a,r,s,i,o,l,u,c,p,d,m,h,f,v,g=n(7774),y=n(12240),$=n(94893),b=n(39889),_=n(9606).URL,E=n(67787).Buffer,x=Symbol.for("vercel.ai.gateway.error"),S=class e extends(r=Error,a=x,r){constructor({message:e,statusCode:t=500,cause:n}){super(e),this[a]=!0,this.statusCode=t,this.cause=n}static isInstance(t){return e.hasMarker(t)}static hasMarker(e){return"object"==typeof e&&null!==e&&x in e&&!0===e[x]}},A="GatewayAuthenticationError",I=`vercel.ai.gateway.error.${A}`,w=Symbol.for(I),T=class e extends(i=S,s=w,i){constructor({message:e="Authentication failed",statusCode:t=401,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[s]=!0,this.name=A,this.type="authentication_error"}static isInstance(e){return S.hasMarker(e)&&w in e}static createContextualError({apiKeyProvided:t,oidcTokenProvided:n,message:a="Authentication failed",statusCode:r=401,cause:s}){let i;return i=t?"AI Gateway authentication failed: Invalid API key.\n\nCreate a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys\n\nProvide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.":n?"AI Gateway authentication failed: Invalid OIDC token.\n\nRun 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.\n\nAlternatively, use an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys":"AI Gateway authentication failed: No authentication provided.\n\nOption 1 - API key:\nCreate an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys\nProvide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.\n\nOption 2 - OIDC token:\nRun 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.",new e({message:i,statusCode:r,cause:s})}},N="GatewayInvalidRequestError",O=`vercel.ai.gateway.error.${N}`,k=Symbol.for(O),R=class extends(l=S,o=k,l){constructor({message:e="Invalid request",statusCode:t=400,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[o]=!0,this.name=N,this.type="invalid_request_error"}static isInstance(e){return S.hasMarker(e)&&k in e}},C="GatewayRateLimitError",P=`vercel.ai.gateway.error.${C}`,L=Symbol.for(P),j=class extends(c=S,u=L,c){constructor({message:e="Rate limit exceeded",statusCode:t=429,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[u]=!0,this.name=C,this.type="rate_limit_exceeded"}static isInstance(e){return S.hasMarker(e)&&L in e}},M="GatewayModelNotFoundError",D=`vercel.ai.gateway.error.${M}`,Y=Symbol.for(D),F=(0,g.ID)((()=>(0,g.jN)($.Ik({modelId:$.Yj()})))),q=class extends(d=S,p=Y,d){constructor({message:e="Model not found",statusCode:t=404,modelId:n,cause:a}={}){super({message:e,statusCode:t,cause:a}),this[p]=!0,this.name=M,this.type="model_not_found",this.modelId=n}static isInstance(e){return S.hasMarker(e)&&Y in e}},U="GatewayInternalServerError",V=`vercel.ai.gateway.error.${U}`,z=Symbol.for(V),Z=class extends(h=S,m=z,h){constructor({message:e="Internal server error",statusCode:t=500,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[m]=!0,this.name=U,this.type="internal_server_error"}static isInstance(e){return S.hasMarker(e)&&z in e}},B="GatewayResponseError",G=`vercel.ai.gateway.error.${B}`,W=Symbol.for(G),K=class extends(v=S,f=W,v){constructor({message:e="Invalid response from Gateway",statusCode:t=502,response:n,validationError:a,cause:r}={}){super({message:e,statusCode:t,cause:r}),this[f]=!0,this.name=B,this.type="response_error",this.response=n,this.validationError=a}static isInstance(e){return S.hasMarker(e)&&W in e}};async function H({response:e,statusCode:t,defaultMessage:n="Gateway request failed",cause:a,authMethod:r}){const s=await(0,g.ZZ)({value:e,schema:J});if(!s.success)return new K({message:`Invalid error response format: ${n}`,statusCode:t,response:e,validationError:s.error,cause:a});const i=s.value,o=i.error.type,l=i.error.message;switch(o){case"authentication_error":return T.createContextualError({apiKeyProvided:"api-key"===r,oidcTokenProvided:"oidc"===r,statusCode:t,cause:a});case"invalid_request_error":return new R({message:l,statusCode:t,cause:a});case"rate_limit_exceeded":return new j({message:l,statusCode:t,cause:a});case"model_not_found":{const e=await(0,g.ZZ)({value:i.error.param,schema:F});return new q({message:l,statusCode:t,modelId:e.success?e.value.modelId:void 0,cause:a})}default:return new Z({message:l,statusCode:t,cause:a})}}var J=(0,g.ID)((()=>(0,g.jN)($.Ik({error:$.Ik({message:$.Yj(),type:$.Yj().nullish(),param:$.L5().nullish(),code:$.KC([$.Yj(),$.ai()]).nullish()})}))));function X(e,t){var n;return S.isInstance(e)?e:y.hL.isInstance(e)?H({response:Q(e),statusCode:null!=(n=e.statusCode)?n:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):H({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}function Q(e){if(void 0!==e.data)return e.data;if(null!=e.responseBody)try{return JSON.parse(e.responseBody)}catch(t){return e.responseBody}return{}}var ee="ai-gateway-auth-method";async function te(e){const t=await(0,g.ZZ)({value:e[ee],schema:ne});return t.success?t.value:void 0}var ne=(0,g.ID)((()=>(0,g.jN)($.KC([$.eu("api-key"),$.eu("oidc")])))),ae=class{constructor(e){this.config=e}async getAvailableModels(){try{const{value:e}=await(0,g.$b)({url:`${this.config.baseURL}/config`,headers:await(0,g.hd)(this.config.headers()),successfulResponseHandler:(0,g.cV)(re),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),fetch:this.config.fetch});return e}catch(e){throw await X(e)}}async getCredits(){try{const e=new _(this.config.baseURL),{value:t}=await(0,g.$b)({url:`${e.origin}/v1/credits`,headers:await(0,g.hd)(this.config.headers()),successfulResponseHandler:(0,g.cV)(se),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),fetch:this.config.fetch});return t}catch(e){throw await X(e)}}},re=(0,g.ID)((()=>(0,g.jN)($.Ik({models:$.YO($.Ik({id:$.Yj(),name:$.Yj(),description:$.Yj().nullish(),pricing:$.Ik({input:$.Yj(),output:$.Yj(),input_cache_read:$.Yj().nullish(),input_cache_write:$.Yj().nullish()}).transform((({input:e,output:t,input_cache_read:n,input_cache_write:a})=>({input:e,output:t,...n?{cachedInputTokens:n}:{},...a?{cacheCreationInputTokens:a}:{}}))).nullish(),specification:$.Ik({specificationVersion:$.eu("v3"),provider:$.Yj(),modelId:$.Yj()}),modelType:$.k5(["language","embedding","image"]).nullish()}))})))),se=(0,g.ID)((()=>(0,g.jN)($.Ik({balance:$.Yj(),total_used:$.Yj()}).transform((({balance:e,total_used:t})=>({balance:e,totalUsed:t})))))),ie=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(e){const{abortSignal:t,...n}=e;return{args:this.maybeEncodeFileParts(n),warnings:[]}}async doGenerate(e){const{args:t,warnings:n}=await this.getArgs(e),{abortSignal:a}=e,r=await(0,g.hd)(this.config.headers());try{const{responseHeaders:s,value:i,rawValue:o}=await(0,g.GU)({url:this.getUrl(),headers:(0,g.m2)(r,e.headers,this.getModelConfigHeaders(this.modelId,!1),await(0,g.hd)(this.config.o11yHeaders)),body:t,successfulResponseHandler:(0,g.cV)($.bz()),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),...a&&{abortSignal:a},fetch:this.config.fetch});return{...i,request:{body:t},response:{headers:s,body:o},warnings:n}}catch(e){throw await X(e,await te(r))}}async doStream(e){const{args:t,warnings:n}=await this.getArgs(e),{abortSignal:a}=e,r=await(0,g.hd)(this.config.headers());try{const{value:s,responseHeaders:i}=await(0,g.GU)({url:this.getUrl(),headers:(0,g.m2)(r,e.headers,this.getModelConfigHeaders(this.modelId,!0),await(0,g.hd)(this.config.o11yHeaders)),body:t,successfulResponseHandler:(0,g.Ds)($.bz()),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),...a&&{abortSignal:a},fetch:this.config.fetch});return{stream:s.pipeThrough(new TransformStream({start(e){n.length>0&&e.enqueue({type:"stream-start",warnings:n})},transform(t,n){if(t.success){const a=t.value;if("raw"===a.type&&!e.includeRawChunks)return;"response-metadata"===a.type&&a.timestamp&&"string"==typeof a.timestamp&&(a.timestamp=new Date(a.timestamp)),n.enqueue(a)}else n.error(t.error)}})),request:{body:t},response:{headers:i}}}catch(e){throw await X(e,await te(r))}}isFilePart(e){return e&&"object"==typeof e&&"type"in e&&"file"===e.type}maybeEncodeFileParts(e){for(const t of e.prompt)for(const e of t.content)if(this.isFilePart(e)){const t=e;if(t.data instanceof Uint8Array){const e=Uint8Array.from(t.data),n=E.from(e).toString("base64");t.data=new _(`data:${t.mediaType||"application/octet-stream"};base64,${n}`)}}return e}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(e,t){return{"ai-language-model-specification-version":"2","ai-language-model-id":e,"ai-language-model-streaming":String(t)}}},oe=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:a}){var r;const s=await(0,g.hd)(this.config.headers());try{const{responseHeaders:i,value:o,rawValue:l}=await(0,g.GU)({url:this.getUrl(),headers:(0,g.m2)(s,null!=t?t:{},this.getModelConfigHeaders(),await(0,g.hd)(this.config.o11yHeaders)),body:{input:1===e.length?e[0]:e,...a?{providerOptions:a}:{}},successfulResponseHandler:(0,g.cV)(le),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),...n&&{abortSignal:n},fetch:this.config.fetch});return{embeddings:o.embeddings,usage:null!=(r=o.usage)?r:void 0,providerMetadata:o.providerMetadata,response:{headers:i,body:l},warnings:[]}}catch(e){throw await X(e,await te(s))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"2","ai-model-id":this.modelId}}},le=(0,g.ID)((()=>(0,g.jN)($.Ik({embeddings:$.YO($.YO($.ai())),usage:$.Ik({tokens:$.ai()}).nullish(),providerMetadata:$.g1($.Yj(),$.g1($.Yj(),$.L5())).optional()})))),ue=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxImagesPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:n,aspectRatio:a,seed:r,providerOptions:s,headers:i,abortSignal:o}){var l;const u=await(0,g.hd)(this.config.headers());try{const{responseHeaders:c,value:p,rawValue:d}=await(0,g.GU)({url:this.getUrl(),headers:(0,g.m2)(u,null!=i?i:{},this.getModelConfigHeaders(),await(0,g.hd)(this.config.o11yHeaders)),body:{prompt:e,n:t,...n&&{size:n},...a&&{aspectRatio:a},...r&&{seed:r},...s&&{providerOptions:s}},successfulResponseHandler:(0,g.cV)(pe),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),...o&&{abortSignal:o},fetch:this.config.fetch});return{images:p.images,warnings:null!=(l=p.warnings)?l:[],providerMetadata:p.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:c}}}catch(e){throw X(e,await te(u))}}getUrl(){return`${this.config.baseURL}/image-model`}getModelConfigHeaders(){return{"ai-image-model-specification-version":"2","ai-model-id":this.modelId}}},ce=$.Ik({images:$.YO($.L5()).optional()}).catchall($.L5()),pe=$.Ik({images:$.YO($.Yj()),warnings:$.YO($.Ik({type:$.eu("other"),message:$.Yj()})).optional(),providerMetadata:$.g1($.Yj(),ce).optional()}),de=function(e={}){var t,n;let a=null,r=null;const s=null!=(t=e.metadataCacheRefreshMillis)?t:3e5;let i=0;const o=null!=(n=(0,g.ae)(e.baseURL))?n:"https://ai-gateway.vercel.sh/v1/ai",l=async()=>{const t=await async function(e){const t=(0,g.x3)({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});if(t)return{token:t,authMethod:"api-key"};try{return{token:await(0,b.getVercelOidcToken)(),authMethod:"oidc"}}catch(e){return null}}(e);if(t)return(0,g.WZ)({Authorization:`Bearer ${t.token}`,"ai-gateway-protocol-version":"0.0.1",[ee]:t.authMethod,...e.headers},"ai-sdk/gateway/2.0.0-beta.78");throw T.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401})},u=()=>{const e=(0,g.x3)({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),t=(0,g.x3)({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),n=(0,g.x3)({settingValue:void 0,environmentVariableName:"VERCEL_REGION"});return async()=>{const a=await async function(){var e;return null==(e=(0,b.getContext)().headers)?void 0:e["x-vercel-id"]}();return{...e&&{"ai-o11y-deployment-id":e},...t&&{"ai-o11y-environment":t},...n&&{"ai-o11y-region":n},...a&&{"ai-o11y-request-id":a}}}},c=t=>new ie(t,{provider:"gateway",baseURL:o,headers:l,fetch:e.fetch,o11yHeaders:u()}),p=function(e){if(new.target)throw new Error("The Gateway Provider model function cannot be called with the new keyword.");return c(e)};return p.specificationVersion="v3",p.getAvailableModels=async()=>{var t,n,u;const c=null!=(u=null==(n=null==(t=e._internal)?void 0:t.currentDate)?void 0:n.call(t).getTime())?u:Date.now();return(!a||c-i>s)&&(i=c,a=new ae({baseURL:o,headers:l,fetch:e.fetch}).getAvailableModels().then((e=>(r=e,e))).catch((async e=>{throw await X(e,await te(await l()))}))),r?Promise.resolve(r):a},p.getCredits=async()=>new ae({baseURL:o,headers:l,fetch:e.fetch}).getCredits().catch((async e=>{throw await X(e,await te(await l()))})),p.imageModel=t=>new ue(t,{provider:"gateway",baseURL:o,headers:l,fetch:e.fetch,o11yHeaders:u()}),p.languageModel=c,p.embeddingModel=t=>new oe(t,{provider:"gateway",baseURL:o,headers:l,fetch:e.fetch,o11yHeaders:u()}),p}(),me=n(26767),he=n(19917),fe=n(9606).URL,ve=n(65994).e,ge=Object.defineProperty;function ye({warning:e,provider:t,model:n}){const a=`AI SDK Warning (${t} / ${n}):`;switch(e.type){case"unsupported":{let t=`${a} The feature "${e.feature}" is not supported.`;return e.details&&(t+=` ${e.details}`),t}case"compatibility":{let t=`${a} The feature "${e.feature}" is used in a compatibility mode.`;return e.details&&(t+=` ${e.details}`),t}case"other":return`${a} ${e.message}`;default:return`${a} ${JSON.stringify(e,null,2)}`}}var $e,be=!1,_e=e=>{if(0===e.warnings.length)return;const t=globalThis.AI_SDK_LOG_WARNINGS;if(!1!==t)if("function"!=typeof t){be||(be=!0,console.info("AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false."));for(const t of e.warnings)console.warn(ye({warning:t,provider:e.provider,model:e.model}))}else t(e)},Ee="AI_InvalidArgumentError",xe=`vercel.ai.error.${Ee}`,Se=Symbol.for(xe),Ae=class extends y.bD{constructor({parameter:e,value:t,message:n}){super({name:Ee,message:`Invalid argument for parameter ${e}: ${n}`}),this[$e]=!0,this.parameter=e,this.value=t}static isInstance(e){return y.bD.hasMarker(e,xe)}};$e=Se;var Ie=Symbol.for("vercel.ai.error.AI_InvalidStreamPartError");y.bD;var we,Te="AI_InvalidToolInputError",Ne=`vercel.ai.error.${Te}`,Oe=Symbol.for(Ne),ke=class extends y.bD{constructor({toolInput:e,toolName:t,cause:n,message:a=`Invalid input for tool ${t}: ${(0,y.u1)(n)}`}){super({name:Te,message:a,cause:n}),this[we]=!0,this.toolInput=e,this.toolName=t}static isInstance(e){return y.bD.hasMarker(e,Ne)}};we=Oe;var Re=Symbol.for("vercel.ai.error.AI_NoImageGeneratedError");y.bD;var Ce,Pe="AI_NoObjectGeneratedError",Le=`vercel.ai.error.${Pe}`,je=Symbol.for(Le),Me=class extends y.bD{constructor({message:e="No object generated.",cause:t,text:n,response:a,usage:r,finishReason:s}){super({name:Pe,message:e,cause:t}),this[Ce]=!0,this.text=n,this.response=a,this.usage=r,this.finishReason=s}static isInstance(e){return y.bD.hasMarker(e,Le)}};Ce=je;var De,Ye="AI_NoOutputGeneratedError",Fe=`vercel.ai.error.${Ye}`,qe=Symbol.for(Fe),Ue=class extends y.bD{constructor({message:e="No output generated.",cause:t}={}){super({name:Ye,message:e,cause:t}),this[De]=!0}static isInstance(e){return y.bD.hasMarker(e,Fe)}};De=qe,y.bD;var Ve,ze="AI_NoSuchToolError",Ze=`vercel.ai.error.${ze}`,Be=Symbol.for(Ze),Ge=class extends y.bD{constructor({toolName:e,availableTools:t,message:n=`Model tried to call unavailable tool '${e}'. ${void 0===t?"No tools are available.":`Available tools: ${t.join(", ")}.`}`}){super({name:ze,message:n}),this[Ve]=!0,this.toolName=e,this.availableTools=t}static isInstance(e){return y.bD.hasMarker(e,Ze)}};Ve=Be;var We,Ke="AI_ToolCallRepairError",He=`vercel.ai.error.${Ke}`,Je=Symbol.for(He),Xe=class extends y.bD{constructor({cause:e,originalError:t,message:n=`Error repairing tool call: ${(0,y.u1)(e)}`}){super({name:Ke,message:n,cause:e}),this[We]=!0,this.originalError=t}static isInstance(e){return y.bD.hasMarker(e,He)}};We=Je;var Qe=class extends y.bD{constructor(e){super({name:"AI_UnsupportedModelVersionError",message:`Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`}),this.version=e.version,this.provider=e.provider,this.modelId=e.modelId}},et=Symbol.for("vercel.ai.error.AI_InvalidDataContentError");y.bD;var tt,nt="AI_InvalidMessageRoleError",at=`vercel.ai.error.${nt}`,rt=Symbol.for(at),st=class extends y.bD{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super({name:nt,message:t}),this[tt]=!0,this.role=e}static isInstance(e){return y.bD.hasMarker(e,at)}};tt=rt;var it,ot="AI_MessageConversionError",lt=`vercel.ai.error.${ot}`,ut=Symbol.for(lt),ct=class extends y.bD{constructor({originalMessage:e,message:t}){super({name:ot,message:t}),this[it]=!0,this.originalMessage=e}static isInstance(e){return y.bD.hasMarker(e,lt)}};it=ut;var pt,dt="AI_DownloadError",mt=`vercel.ai.error.${dt}`,ht=Symbol.for(mt),ft=class extends y.bD{constructor({url:e,statusCode:t,statusText:n,cause:a,message:r=(null==a?`Failed to download ${e}: ${t} ${n}`:`Failed to download ${e}: ${a}`)}){super({name:dt,message:r,cause:a}),this[pt]=!0,this.url=e,this.statusCode=t,this.statusText=n}static isInstance(e){return y.bD.hasMarker(e,mt)}};pt=ht;var vt,gt="AI_RetryError",yt=`vercel.ai.error.${gt}`,$t=Symbol.for(yt),bt=class extends y.bD{constructor({message:e,reason:t,errors:n}){super({name:gt,message:e}),this[vt]=!0,this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isInstance(e){return y.bD.hasMarker(e,yt)}};function _t(e){return"v3"===e.specificationVersion?e:(function({provider:e,modelId:t}){_e({warnings:[{type:"compatibility",feature:"specificationVersion",details:"Using v2 specification compatibility mode. Some features may not be available."}],provider:e,model:t})}({provider:e.provider,modelId:e.modelId}),new Proxy(e,{get(e,t){switch(t){case"specificationVersion":return"v3";case"doGenerate":return async(...t)=>{const n=await e.doGenerate(...t);return{...n,usage:Et(n.usage)}};case"doStream":return async(...t)=>{const n=await e.doStream(...t);return{...n,stream:(a=n.stream,a.pipeThrough(new TransformStream({transform(e,t){"finish"===e.type?t.enqueue({...e,usage:Et(e.usage)}):t.enqueue(e)}})))};var a};default:return e[t]}}}))}function Et(e){return{inputTokens:{total:e.inputTokens,noCache:void 0,cacheRead:e.cachedInputTokens,cacheWrite:void 0},outputTokens:{total:e.outputTokens,text:void 0,reasoning:e.reasoningTokens}}}function xt(e){if("string"!=typeof e){if("v3"!==e.specificationVersion&&"v2"!==e.specificationVersion){const t=e;throw new Qe({version:t.specificationVersion,provider:t.provider,modelId:t.modelId})}return _t(e)}return(null!=(t=globalThis.AI_SDK_DEFAULT_PROVIDER)?t:de).languageModel(e);var t}vt=$t;var St=[{mediaType:"image/gif",bytesPrefix:[71,73,70]},{mediaType:"image/png",bytesPrefix:[137,80,78,71]},{mediaType:"image/jpeg",bytesPrefix:[255,216]},{mediaType:"image/webp",bytesPrefix:[82,73,70,70,null,null,null,null,87,69,66,80]},{mediaType:"image/bmp",bytesPrefix:[66,77]},{mediaType:"image/tiff",bytesPrefix:[73,73,42,0]},{mediaType:"image/tiff",bytesPrefix:[77,77,0,42]},{mediaType:"image/avif",bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102]},{mediaType:"image/heic",bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99]}],At=e=>{const t="string"==typeof e?(0,g.Z9)(e):e,n=(127&t[6])<<21|(127&t[7])<<14|(127&t[8])<<7|127&t[9];return t.slice(n+10)};var It="6.0.0-beta.151",wt=async({url:e})=>{var t;const n=e.toString();try{const e=await fetch(n,{headers:(0,g.WZ)({},`ai-sdk/${It}`,(0,g.G1)())});if(!e.ok)throw new ft({url:n,statusCode:e.status,statusText:e.statusText});return{data:new Uint8Array(await e.arrayBuffer()),mediaType:null!=(t=e.headers.get("content-type"))?t:void 0}}catch(e){if(ft.isInstance(e))throw e;throw new ft({url:n,cause:e})}},Tt=(e=wt)=>t=>Promise.all(t.map((async t=>t.isUrlSupportedByModel?null:e(t)))),Nt=$.KC([$.Yj(),$.Nl(Uint8Array),$.Nl(ArrayBuffer),$.Ie((e=>{var t,n;return null!=(n=null==(t=globalThis.Buffer)?void 0:t.isBuffer(e))&&n}),{message:"Must be a Buffer"})]);function Ot(e){if(e instanceof Uint8Array)return{data:e,mediaType:void 0};if(e instanceof ArrayBuffer)return{data:new Uint8Array(e),mediaType:void 0};if("string"==typeof e)try{e=new fe(e)}catch(e){}if(e instanceof fe&&"data:"===e.protocol){const{mediaType:t,base64Content:n}=function(e){try{const[t,n]=e.split(",");return{mediaType:t.split(";")[0].split(":")[1],base64Content:n}}catch(e){return{mediaType:void 0,base64Content:void 0}}}(e.toString());if(null==t||null==n)throw new y.bD({name:"InvalidDataContentError",message:`Invalid data URL format in content ${e.toString()}`});return{data:n,mediaType:t}}return{data:e,mediaType:void 0}}function kt(e){return void 0===e?[]:Array.isArray(e)?e:[e]}async function Rt({prompt:e,supportedUrls:t,download:n=Tt()}){const a=await async function(e,t,n){const a=e.filter((e=>"user"===e.role)).map((e=>e.content)).filter((e=>Array.isArray(e))).flat().filter((e=>"image"===e.type||"file"===e.type)).map((e=>{var t;const n=null!=(t=e.mediaType)?t:"image"===e.type?"image/*":void 0;let a="image"===e.type?e.image:e.data;if("string"==typeof a)try{a=new fe(a)}catch(e){}return{mediaType:n,data:a}})).filter((e=>e.data instanceof fe)).map((e=>({url:e.data,isUrlSupportedByModel:null!=e.mediaType&&(0,g.qs)({url:e.data.toString(),mediaType:e.mediaType,supportedUrls:n})}))),r=await t(a);return Object.fromEntries(r.map(((e,t)=>null==e?null:[a[t].url.toString(),{data:e.data,mediaType:e.mediaType}])).filter((e=>null!=e)))}(e.messages,n,t),r=[...null!=e.system?"string"==typeof e.system?[{role:"system",content:e.system}]:kt(e.system).map((e=>({role:"system",content:e.content,providerOptions:e.providerOptions}))):[],...e.messages.map((e=>function({message:e,downloadedAssets:t}){const n=e.role;switch(n){case"system":return{role:"system",content:e.content,providerOptions:e.providerOptions};case"user":return"string"==typeof e.content?{role:"user",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"user",content:e.content.map((e=>function(e,t){var n;if("text"===e.type)return{type:"text",text:e.text,providerOptions:e.providerOptions};let a;const r=e.type;switch(r){case"image":a=e.image;break;case"file":a=e.data;break;default:throw new Error(`Unsupported part type: ${r}`)}const{data:s,mediaType:i}=Ot(a);let o=null!=i?i:e.mediaType,l=s;if(l instanceof fe){const e=t[l.toString()];e&&(l=e.data,null!=o||(o=e.mediaType))}switch(r){case"image":return(l instanceof Uint8Array||"string"==typeof l)&&(o=null!=(n=function({data:e,signatures:t}){const n=function(e){return"string"==typeof e&&e.startsWith("SUQz")||"string"!=typeof e&&e.length>10&&73===e[0]&&68===e[1]&&51===e[2]?At(e):e}(e),a="string"==typeof n?(0,g.Z9)(n.substring(0,Math.min(n.length,24))):n;for(const e of t)if(a.length>=e.bytesPrefix.length&&e.bytesPrefix.every(((e,t)=>null===e||a[t]===e)))return e.mediaType}({data:l,signatures:St}))?n:o),{type:"file",mediaType:null!=o?o:"image/*",filename:void 0,data:l,providerOptions:e.providerOptions};case"file":if(null==o)throw new Error("Media type is missing for file part");return{type:"file",mediaType:o,filename:e.filename,data:l,providerOptions:e.providerOptions}}}(e,t))).filter((e=>"text"!==e.type||""!==e.text)),providerOptions:e.providerOptions};case"assistant":return"string"==typeof e.content?{role:"assistant",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"assistant",content:e.content.filter((e=>"text"!==e.type||""!==e.text||null!=e.providerOptions)).filter((e=>"tool-approval-request"!==e.type)).map((e=>{const t=e.providerOptions;switch(e.type){case"file":{const{data:n,mediaType:a}=Ot(e.data);return{type:"file",data:n,filename:e.filename,mediaType:null!=a?a:e.mediaType,providerOptions:t}}case"reasoning":return{type:"reasoning",text:e.text,providerOptions:t};case"text":return{type:"text",text:e.text,providerOptions:t};case"tool-call":return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input,providerExecuted:e.providerExecuted,providerOptions:t};case"tool-result":return{type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Ct(e.output),providerOptions:t}}})),providerOptions:e.providerOptions};case"tool":return{role:"tool",content:e.content.filter((e=>"tool-approval-response"!==e.type)).map((e=>({type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Ct(e.output),providerOptions:e.providerOptions}))),providerOptions:e.providerOptions};default:throw new st({role:n})}}({message:e,downloadedAssets:a})))],s=[];for(const e of r){if("tool"!==e.role){s.push(e);continue}const t=s.at(-1);"tool"===(null==t?void 0:t.role)?t.content.push(...e.content):s.push(e)}return s}function Ct(e){return"content"!==e.type?e:{type:"content",value:e.value.map((e=>"media"!==e.type?e:e.mediaType.startsWith("image/")?{type:"image-data",data:e.data,mediaType:e.mediaType}:{type:"file-data",data:e.data,mediaType:e.mediaType}))}}function Pt({output:e,tool:t,errorMode:n}){return"text"===n?{type:"error-text",value:(0,y.u1)(e)}:"json"===n?{type:"error-json",value:Lt(e)}:(null==t?void 0:t.toModelOutput)?t.toModelOutput(e):"string"==typeof e?{type:"text",value:e}:{type:"json",value:Lt(e)}}function Lt(e){return void 0===e?null:e}var jt=$.RZ((()=>$.KC([$.ch(),$.Yj(),$.ai(),$.zM(),$.g1($.Yj(),jt.optional()),$.YO(jt)]))),Mt=$.g1($.Yj(),$.g1($.Yj(),jt.optional())),Dt=$.Ik({type:$.eu("text"),text:$.Yj(),providerOptions:Mt.optional()}),Yt=$.Ik({type:$.eu("image"),image:$.KC([Nt,$.Nl(fe)]),mediaType:$.Yj().optional(),providerOptions:Mt.optional()}),Ft=$.Ik({type:$.eu("file"),data:$.KC([Nt,$.Nl(fe)]),filename:$.Yj().optional(),mediaType:$.Yj(),providerOptions:Mt.optional()}),qt=$.Ik({type:$.eu("reasoning"),text:$.Yj(),providerOptions:Mt.optional()}),Ut=$.Ik({type:$.eu("tool-call"),toolCallId:$.Yj(),toolName:$.Yj(),input:$.L5(),providerOptions:Mt.optional(),providerExecuted:$.zM().optional()}),Vt=$.gM("type",[$.Ik({type:$.eu("text"),value:$.Yj(),providerOptions:Mt.optional()}),$.Ik({type:$.eu("json"),value:jt,providerOptions:Mt.optional()}),$.Ik({type:$.eu("execution-denied"),reason:$.Yj().optional(),providerOptions:Mt.optional()}),$.Ik({type:$.eu("error-text"),value:$.Yj(),providerOptions:Mt.optional()}),$.Ik({type:$.eu("error-json"),value:jt,providerOptions:Mt.optional()}),$.Ik({type:$.eu("content"),value:$.YO($.KC([$.Ik({type:$.eu("text"),text:$.Yj(),providerOptions:Mt.optional()}),$.Ik({type:$.eu("media"),data:$.Yj(),mediaType:$.Yj()}),$.Ik({type:$.eu("file-data"),data:$.Yj(),mediaType:$.Yj(),filename:$.Yj().optional(),providerOptions:Mt.optional()}),$.Ik({type:$.eu("file-url"),url:$.Yj(),providerOptions:Mt.optional()}),$.Ik({type:$.eu("file-id"),fileId:$.KC([$.Yj(),$.g1($.Yj(),$.Yj())]),providerOptions:Mt.optional()}),$.Ik({type:$.eu("image-data"),data:$.Yj(),mediaType:$.Yj(),providerOptions:Mt.optional()}),$.Ik({type:$.eu("image-url"),url:$.Yj(),providerOptions:Mt.optional()}),$.Ik({type:$.eu("image-file-id"),fileId:$.KC([$.Yj(),$.g1($.Yj(),$.Yj())]),providerOptions:Mt.optional()}),$.Ik({type:$.eu("custom"),providerOptions:Mt.optional()})]))})]),zt=$.Ik({type:$.eu("tool-result"),toolCallId:$.Yj(),toolName:$.Yj(),output:Vt,providerOptions:Mt.optional()}),Zt=$.Ik({type:$.eu("tool-approval-request"),approvalId:$.Yj(),toolCallId:$.Yj()}),Bt=$.Ik({type:$.eu("tool-approval-response"),approvalId:$.Yj(),approved:$.zM(),reason:$.Yj().optional()}),Gt=$.Ik({role:$.eu("system"),content:$.Yj(),providerOptions:Mt.optional()}),Wt=$.Ik({role:$.eu("user"),content:$.KC([$.Yj(),$.YO($.KC([Dt,Yt,Ft]))]),providerOptions:Mt.optional()}),Kt=$.Ik({role:$.eu("assistant"),content:$.KC([$.Yj(),$.YO($.KC([Dt,Ft,qt,Ut,zt,Zt]))]),providerOptions:Mt.optional()}),Ht=$.Ik({role:$.eu("tool"),content:$.YO($.KC([zt,Bt])),providerOptions:Mt.optional()}),Jt=$.KC([Gt,Wt,Kt,Ht]);function Xt(e){if(!T.isInstance(e))return e;const t="https://v6.ai-sdk.dev/unauthenticated-ai-gateway";return"production"===(null==ve?void 0:"production")?new y.bD({name:"GatewayError",message:`Unauthenticated. Configure AI_GATEWAY_API_KEY or use a provider module. Learn more: ${t}`}):Object.assign(new Error(`[1m[31mUnauthenticated request to AI Gateway.[0m\n\nTo authenticate, set the [33mAI_GATEWAY_API_KEY[0m environment variable with your API key.\n\nAlternatively, you can use a provider module instead of the AI Gateway.\n\nLearn more: [34m${t}[0m\n\n`),{name:"GatewayAuthenticationError"})}function Qt({operationId:e,telemetry:t}){return{"operation.name":`${e}${null!=(null==t?void 0:t.functionId)?` ${t.functionId}`:""}`,"resource.name":null==t?void 0:t.functionId,"ai.operationId":e,"ai.telemetry.functionId":null==t?void 0:t.functionId}}var en={startSpan:()=>tn,startActiveSpan:(e,t,n,a)=>"function"==typeof t?t(tn):"function"==typeof n?n(tn):"function"==typeof a?a(tn):void 0},tn={spanContext:()=>nn,setAttribute(){return this},setAttributes(){return this},addEvent(){return this},addLink(){return this},addLinks(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording:()=>!1,recordException(){return this}},nn={traceId:"",spanId:"",traceFlags:0};async function an({name:e,tracer:t,attributes:n,fn:a,endWhenDone:r=!0}){return t.startActiveSpan(e,{attributes:await n},(async e=>{try{const t=await a(e);return r&&e.end(),t}catch(t){try{rn(e,t)}finally{e.end()}throw t}}))}function rn(e,t){t instanceof Error?(e.recordException({name:t.name,message:t.message,stack:t.stack}),e.setStatus({code:he.s.ERROR,message:t.message})):e.setStatus({code:he.s.ERROR})}async function sn({telemetry:e,attributes:t}){if(!0!==(null==e?void 0:e.isEnabled))return{};const n={};for(const[a,r]of Object.entries(t))if(null!=r)if("object"==typeof r&&"input"in r&&"function"==typeof r.input){if(!1===(null==e?void 0:e.recordInputs))continue;const t=await r.input();null!=t&&(n[a]=t)}else if("object"==typeof r&&"output"in r&&"function"==typeof r.output){if(!1===(null==e?void 0:e.recordOutputs))continue;const t=await r.output();null!=t&&(n[a]=t)}else n[a]=r;return n}function on(e){return{inputTokens:e.inputTokens.total,inputTokenDetails:{noCacheTokens:e.inputTokens.noCache,cacheReadTokens:e.inputTokens.cacheRead,cacheWriteTokens:e.inputTokens.cacheWrite},outputTokens:e.outputTokens.total,outputTokenDetails:{textTokens:e.outputTokens.text,reasoningTokens:e.outputTokens.reasoning},totalTokens:ln(e.inputTokens.total,e.outputTokens.total),raw:e.raw,reasoningTokens:e.outputTokens.reasoning,cachedInputTokens:e.inputTokens.cacheRead}}function ln(e,t){return null==e&&null==t?void 0:(null!=e?e:0)+(null!=t?t:0)}var un=({maxRetries:e=2,initialDelayInMs:t=2e3,backoffFactor:n=2,abortSignal:a}={})=>async r=>cn(r,{maxRetries:e,delayInMs:t,backoffFactor:n,abortSignal:a});async function cn(e,{maxRetries:t,delayInMs:n,backoffFactor:a,abortSignal:r},s=[]){try{return await e()}catch(i){if((0,g.zf)(i))throw i;if(0===t)throw i;const o=(0,g.u1)(i),l=[...s,i],u=l.length;if(u>t)throw new bt({message:`Failed after ${u} attempts. Last error: ${o}`,reason:"maxRetriesExceeded",errors:l});if(i instanceof Error&&y.hL.isInstance(i)&&!0===i.isRetryable&&u<=t)return await(0,g.cb)(function({error:e,exponentialBackoffDelay:t}){const n=e.responseHeaders;if(!n)return t;let a;const r=n["retry-after-ms"];if(r){const e=parseFloat(r);Number.isNaN(e)||(a=e)}const s=n["retry-after"];if(s&&void 0===a){const e=parseFloat(s);a=Number.isNaN(e)?Date.parse(s)-Date.now():1e3*e}return null!=a&&!Number.isNaN(a)&&0<=a&&(a<6e4||a<t)?a:t}({error:i,exponentialBackoffDelay:n}),{abortSignal:r}),cn(e,{maxRetries:t,delayInMs:a*n,backoffFactor:a,abortSignal:r},l);if(1===u)throw i;throw new bt({message:`Failed after ${u} attempts with non-retryable error: '${o}'`,reason:"errorNotRetryable",errors:l})}}async function pn({toolCall:e,tools:t,tracer:n,telemetry:a,messages:r,abortSignal:s,experimental_context:i,onPreliminaryToolResult:o}){const{toolName:l,toolCallId:u,input:c}=e,p=null==t?void 0:t[l];if(null!=(null==p?void 0:p.execute))return an({name:"ai.toolCall",attributes:sn({telemetry:a,attributes:{...Qt({operationId:"ai.toolCall",telemetry:a}),"ai.toolCall.name":l,"ai.toolCall.id":u,"ai.toolCall.args":{output:()=>JSON.stringify(c)}}}),tracer:n,fn:async t=>{let n;try{const t=(0,g.o8)({execute:p.execute.bind(p),input:c,options:{toolCallId:u,messages:r,abortSignal:s,experimental_context:i}});for await(const a of t)"preliminary"===a.type?null==o||o({...e,type:"tool-result",output:a.output,preliminary:!0}):n=a.output}catch(n){return rn(t,n),{type:"tool-error",toolCallId:u,toolName:l,input:c,error:n,dynamic:"dynamic"===p.type,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}}try{t.setAttributes(await sn({telemetry:a,attributes:{"ai.toolCall.result":{output:()=>JSON.stringify(n)}}}))}catch(e){}return{type:"tool-result",toolCallId:u,toolName:l,input:c,output:n,dynamic:"dynamic"===p.type,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}}})}var dn=class{constructor({data:e,mediaType:t}){const n=e instanceof Uint8Array;this.base64Data=n?void 0:e,this.uint8ArrayData=n?e:void 0,this.mediaType=t}get base64(){return null==this.base64Data&&(this.base64Data=(0,g.n_)(this.uint8ArrayData)),this.base64Data}get uint8Array(){return null==this.uint8ArrayData&&(this.uint8ArrayData=(0,g.Z9)(this.base64Data)),this.uint8ArrayData}},mn=class extends dn{constructor(e){super(e),this.type="file"}};function hn(e){const t=["ROOT"];let n=-1,a=null;function r(e,r,s){switch(e){case'"':n=r,t.pop(),t.push(s),t.push("INSIDE_STRING");break;case"f":case"t":case"n":n=r,a=r,t.pop(),t.push(s),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(s),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=r,t.pop(),t.push(s),t.push("INSIDE_NUMBER");break;case"{":n=r,t.pop(),t.push(s),t.push("INSIDE_OBJECT_START");break;case"[":n=r,t.pop(),t.push(s),t.push("INSIDE_ARRAY_START")}}function s(e,a){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=a,t.pop()}}function i(e,a){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=a,t.pop()}}for(let o=0;o<e.length;o++){const l=e[o];switch(t[t.length-1]){case"ROOT":r(l,o,"FINISH");break;case"INSIDE_OBJECT_START":switch(l){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":n=o,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break;case"INSIDE_OBJECT_KEY":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break;case"INSIDE_OBJECT_AFTER_KEY":":"===l&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":r(l,o,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":s(l,o);break;case"INSIDE_STRING":switch(l){case'"':t.pop(),n=o;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:n=o}break;case"INSIDE_ARRAY_START":"]"===l?(n=o,t.pop()):(n=o,r(l,o,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(l){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=o,t.pop();break;default:n=o}break;case"INSIDE_ARRAY_AFTER_COMMA":r(l,o,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),n=o;break;case"INSIDE_NUMBER":switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=o;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(l,o),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&s(l,o);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&s(l,o);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(l,o);break;default:t.pop()}break;case"INSIDE_LITERAL":{const r=e.substring(a,o+1);"false".startsWith(r)||"true".startsWith(r)||"null".startsWith(r)?n=o:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?s(l,o):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(l,o));break}}}let o=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case"INSIDE_STRING":o+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":o+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":o+="]";break;case"INSIDE_LITERAL":{const t=e.substring(a,e.length);"true".startsWith(t)?o+="true".slice(t.length):"false".startsWith(t)?o+="false".slice(t.length):"null".startsWith(t)&&(o+="null".slice(t.length))}}return o}async function fn(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=await(0,g.N8)({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await(0,g.N8)({text:hn(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}((e,t)=>{for(var n in t)ge(e,n,{get:t[n],enumerable:!0})})({},{array:()=>yn,choice:()=>$n,json:()=>bn,object:()=>gn,text:()=>vn});var vn=()=>({responseFormat:Promise.resolve({type:"text"}),parseCompleteOutput:async({text:e})=>e,parsePartialOutput:async({text:e})=>({partial:e})}),gn=({schema:e,name:t,description:n})=>{const a=(0,g.mD)(e);return{responseFormat:(0,g.hd)(a.jsonSchema).then((e=>({type:"json",schema:e,...null!=t&&{name:t},...null!=n&&{description:n}}))),async parseCompleteOutput({text:e},t){const n=await(0,g.N8)({text:e});if(!n.success)throw new Me({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});const r=await(0,g.ZZ)({value:n.value,schema:a});if(!r.success)throw new Me({message:"No object generated: response did not match schema.",cause:r.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return r.value},async parsePartialOutput({text:e}){const t=await fn(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:t.value}}}}},yn=({element:e,name:t,description:n})=>{const a=(0,g.mD)(e);return{responseFormat:(0,g.hd)(a.jsonSchema).then((e=>{const{$schema:a,...r}=e;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:r}},required:["elements"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}})),async parseCompleteOutput({text:e},t){const n=await(0,g.N8)({text:e});if(!n.success)throw new Me({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});const r=n.value;if(null==r||"object"!=typeof r||!("elements"in r)||!Array.isArray(r.elements))throw new Me({message:"No object generated: response did not match schema.",cause:new y.iM({value:r,cause:"response must be an object with an elements array"}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});for(const n of r.elements){const r=await(0,g.ZZ)({value:n,schema:a});if(!r.success)throw new Me({message:"No object generated: response did not match schema.",cause:r.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason})}return r.elements},async parsePartialOutput({text:e}){const t=await fn(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const e=t.value;if(null==e||"object"!=typeof e||!("elements"in e)||!Array.isArray(e.elements))return;const n="repaired-parse"===t.state&&e.elements.length>0?e.elements.slice(0,-1):e.elements,r=[];for(const e of n){const t=await(0,g.ZZ)({value:e,schema:a});t.success&&r.push(t.value)}return{partial:r}}}}}},$n=({options:e,name:t,description:n})=>({responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}),async parseCompleteOutput({text:t},n){const a=await(0,g.N8)({text:t});if(!a.success)throw new Me({message:"No object generated: could not parse the response.",cause:a.error,text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});const r=a.value;if(null==r||"object"!=typeof r||!("result"in r)||"string"!=typeof r.result||!e.includes(r.result))throw new Me({message:"No object generated: response did not match schema.",cause:new y.iM({value:r,cause:"response must be an object that contains a choice value."}),text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});return r.result},async parsePartialOutput({text:t}){const n=await fn(t);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const t=n.value;if(null==t||"object"!=typeof t||!("result"in t)||"string"!=typeof t.result)return;const a=e.filter((e=>e.startsWith(t.result)));return"successful-parse"===n.state?a.includes(t.result)?{partial:t.result}:void 0:1===a.length?{partial:a[0]}:void 0}}}}),bn=({name:e,description:t}={})=>({responseFormat:Promise.resolve({type:"json",...null!=e&&{name:e},...null!=t&&{description:t}}),async parseCompleteOutput({text:e},t){const n=await(0,g.N8)({text:e});if(!n.success)throw new Me({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return n.value},async parsePartialOutput({text:e}){const t=await fn(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return void 0===t.value?void 0:{partial:t.value}}}});async function _n(e){const t=""===e.input.trim()?{success:!0,value:{}}:await(0,g.N8)({text:e.input});if(!1===t.success)throw new ke({toolName:e.toolName,toolInput:e.input,cause:t.error});return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:t.value,providerExecuted:!0,dynamic:!0,providerMetadata:e.providerMetadata}}async function En({toolCall:e,tools:t}){const n=e.toolName,a=t[n];if(null==a){if(e.providerExecuted&&e.dynamic)return await _n(e);throw new Ge({toolName:e.toolName,availableTools:Object.keys(t)})}const r=(0,g.mD)(a.inputSchema),s=""===e.input.trim()?await(0,g.ZZ)({value:{},schema:r}):await(0,g.N8)({text:e.input,schema:r});if(!1===s.success)throw new ke({toolName:n,toolInput:e.input,cause:s.error});return"dynamic"===a.type?{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:s.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,dynamic:!0,title:a.title}:{type:"tool-call",toolCallId:e.toolCallId,toolName:n,input:s.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:a.title}}var xn=class{constructor({content:e,finishReason:t,usage:n,warnings:a,request:r,response:s,providerMetadata:i}){this.content=e,this.finishReason=t,this.usage=n,this.warnings=a,this.request=r,this.response=s,this.providerMetadata=i}get text(){return this.content.filter((e=>"text"===e.type)).map((e=>e.text)).join("")}get reasoning(){return this.content.filter((e=>"reasoning"===e.type))}get reasoningText(){return 0===this.reasoning.length?void 0:this.reasoning.map((e=>e.text)).join("")}get files(){return this.content.filter((e=>"file"===e.type)).map((e=>e.file))}get sources(){return this.content.filter((e=>"source"===e.type))}get toolCalls(){return this.content.filter((e=>"tool-call"===e.type))}get staticToolCalls(){return this.toolCalls.filter((e=>!0!==e.dynamic))}get dynamicToolCalls(){return this.toolCalls.filter((e=>!0===e.dynamic))}get toolResults(){return this.content.filter((e=>"tool-result"===e.type))}get staticToolResults(){return this.toolResults.filter((e=>!0!==e.dynamic))}get dynamicToolResults(){return this.toolResults.filter((e=>!0===e.dynamic))}};function Sn(e){return({steps:t})=>t.length===e}function An({content:e,tools:t}){const n=[],a=e.filter((e=>"source"!==e.type)).filter((e=>("tool-result"!==e.type||e.providerExecuted)&&("tool-error"!==e.type||e.providerExecuted))).filter((e=>"text"!==e.type||e.text.length>0)).map((e=>{switch(e.type){case"text":return{type:"text",text:e.text,providerOptions:e.providerMetadata};case"reasoning":return{type:"reasoning",text:e.text,providerOptions:e.providerMetadata};case"file":return{type:"file",data:e.file.base64,mediaType:e.file.mediaType,providerOptions:e.providerMetadata};case"tool-call":return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input,providerExecuted:e.providerExecuted,providerOptions:e.providerMetadata};case"tool-result":return{type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Pt({tool:null==t?void 0:t[e.toolName],output:e.output,errorMode:"none"}),providerExecuted:!0,providerOptions:e.providerMetadata};case"tool-error":return{type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Pt({tool:null==t?void 0:t[e.toolName],output:e.error,errorMode:"json"}),providerOptions:e.providerMetadata};case"tool-approval-request":return{type:"tool-approval-request",approvalId:e.approvalId,toolCallId:e.toolCall.toolCallId}}}));a.length>0&&n.push({role:"assistant",content:a});const r=e.filter((e=>"tool-result"===e.type||"tool-error"===e.type)).filter((e=>!e.providerExecuted)).map((e=>({type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Pt({tool:null==t?void 0:t[e.toolName],output:"tool-result"===e.type?e.output:e.error,errorMode:"tool-error"===e.type?"text":"none"}),...null!=e.providerMetadata?{providerOptions:e.providerMetadata}:{}})));return r.length>0&&n.push({role:"tool",content:r}),n}function In(e,t){const n=new Headers(null!=e?e:{});for(const[e,a]of Object.entries(t))n.has(e)||n.set(e,a);return n}function wn({response:e,status:t,statusText:n,headers:a,stream:r}){e.writeHead(null!=t?t:200,n,a);const s=r.getReader();(async()=>{try{for(;;){const{done:t,value:n}=await s.read();if(t)break;e.write(n)||await new Promise((t=>{e.once("drain",t)}))}}catch(e){throw e}finally{e.end()}})()}(0,g.hK)({prefix:"aitxt",size:24});var Tn=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}\n\n`)},flush(e){e.enqueue("data: [DONE]\n\n")}})}},Nn={"content-type":"text/event-stream","cache-control":"no-cache",connection:"keep-alive","x-vercel-ai-ui-message-stream":"v1","x-accel-buffering":"no"};var On=(0,g.ID)((()=>(0,g.jN)($.KC([$.re({type:$.eu("text-start"),id:$.Yj(),providerMetadata:Mt.optional()}),$.re({type:$.eu("text-delta"),id:$.Yj(),delta:$.Yj(),providerMetadata:Mt.optional()}),$.re({type:$.eu("text-end"),id:$.Yj(),providerMetadata:Mt.optional()}),$.re({type:$.eu("error"),errorText:$.Yj()}),$.re({type:$.eu("tool-input-start"),toolCallId:$.Yj(),toolName:$.Yj(),providerExecuted:$.zM().optional(),dynamic:$.zM().optional(),title:$.Yj().optional()}),$.re({type:$.eu("tool-input-delta"),toolCallId:$.Yj(),inputTextDelta:$.Yj()}),$.re({type:$.eu("tool-input-available"),toolCallId:$.Yj(),toolName:$.Yj(),input:$.L5(),providerExecuted:$.zM().optional(),providerMetadata:Mt.optional(),dynamic:$.zM().optional(),title:$.Yj().optional()}),$.re({type:$.eu("tool-input-error"),toolCallId:$.Yj(),toolName:$.Yj(),input:$.L5(),providerExecuted:$.zM().optional(),providerMetadata:Mt.optional(),dynamic:$.zM().optional(),errorText:$.Yj(),title:$.Yj().optional()}),$.re({type:$.eu("tool-approval-request"),approvalId:$.Yj(),toolCallId:$.Yj()}),$.re({type:$.eu("tool-output-available"),toolCallId:$.Yj(),output:$.L5(),providerExecuted:$.zM().optional(),dynamic:$.zM().optional(),preliminary:$.zM().optional()}),$.re({type:$.eu("tool-output-error"),toolCallId:$.Yj(),errorText:$.Yj(),providerExecuted:$.zM().optional(),dynamic:$.zM().optional()}),$.re({type:$.eu("tool-output-denied"),toolCallId:$.Yj()}),$.re({type:$.eu("reasoning-start"),id:$.Yj(),providerMetadata:Mt.optional()}),$.re({type:$.eu("reasoning-delta"),id:$.Yj(),delta:$.Yj(),providerMetadata:Mt.optional()}),$.re({type:$.eu("reasoning-end"),id:$.Yj(),providerMetadata:Mt.optional()}),$.re({type:$.eu("source-url"),sourceId:$.Yj(),url:$.Yj(),title:$.Yj().optional(),providerMetadata:Mt.optional()}),$.re({type:$.eu("source-document"),sourceId:$.Yj(),mediaType:$.Yj(),title:$.Yj(),filename:$.Yj().optional(),providerMetadata:Mt.optional()}),$.re({type:$.eu("file"),url:$.Yj(),mediaType:$.Yj(),providerMetadata:Mt.optional()}),$.re({type:$.Ie((e=>"string"==typeof e&&e.startsWith("data-")),{message:'Type must start with "data-"'}),id:$.Yj().optional(),data:$.L5(),transient:$.zM().optional()}),$.re({type:$.eu("start-step")}),$.re({type:$.eu("finish-step")}),$.re({type:$.eu("start"),messageId:$.Yj().optional(),messageMetadata:$.L5().optional()}),$.re({type:$.eu("finish"),finishReason:$.k5(["stop","length","content-filter","tool-calls","error","other","unknown"]).optional(),messageMetadata:$.L5().optional()}),$.re({type:$.eu("abort")}),$.re({type:$.eu("message-metadata"),messageMetadata:$.L5()})]))));function kn(e,t){if(void 0===e&&void 0===t)return;if(void 0===e)return t;if(void 0===t)return e;const n={...e};for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)){const r=t[a];if(void 0===r)continue;const s=a in e?e[a]:void 0,i=!(null===r||"object"!=typeof r||Array.isArray(r)||r instanceof Date||r instanceof RegExp),o=!(null==s||"object"!=typeof s||Array.isArray(s)||s instanceof Date||s instanceof RegExp);n[a]=i&&o?kn(s,r):r}return n}function Rn(e){return e.type.startsWith("data-")}function Cn(e){return"text"===e.type}function Pn(e){return"file"===e.type}function Ln(e){return"reasoning"===e.type}function jn(e){return e.type.startsWith("tool-")}function Mn(e){return"dynamic-tool"===e.type}function Dn(e){return jn(e)||Mn(e)}function Yn(e){return e.type.split("-").slice(1).join("-")}function Fn(e){return Mn(e)?e.toolName:Yn(e)}function qn({lastMessage:e,messageId:t}){return{message:"assistant"===(null==e?void 0:e.role)?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function Un({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:a,onError:r,onToolCall:s,onData:i}){return e.pipeThrough(new TransformStream({async transform(e,o){await a((async({state:a,write:l})=>{var u,c,p,d;function m(e){const t=a.message.parts.filter(Dn).find((t=>t.toolCallId===e));if(null==t)throw new Error(`no tool invocation found for tool call ${e}`);return t}function h(e){var t;const n=a.message.parts.find((t=>jn(t)&&t.toolCallId===e.toolCallId)),r=e,s=n;null!=n?(n.state=e.state,s.input=r.input,s.output=r.output,s.errorText=r.errorText,s.rawInput=r.rawInput,s.preliminary=r.preliminary,void 0!==e.title&&(s.title=e.title),s.providerExecuted=null!=(t=r.providerExecuted)?t:n.providerExecuted,null!=r.providerMetadata&&"input-available"===n.state&&(n.callProviderMetadata=r.providerMetadata)):a.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title,input:r.input,output:r.output,rawInput:r.rawInput,errorText:r.errorText,providerExecuted:r.providerExecuted,preliminary:r.preliminary,...null!=r.providerMetadata?{callProviderMetadata:r.providerMetadata}:{}})}function f(e){var t,n;const r=a.message.parts.find((t=>"dynamic-tool"===t.type&&t.toolCallId===e.toolCallId)),s=e,i=r;null!=r?(r.state=e.state,i.toolName=e.toolName,i.input=s.input,i.output=s.output,i.errorText=s.errorText,i.rawInput=null!=(t=s.rawInput)?t:i.rawInput,i.preliminary=s.preliminary,void 0!==e.title&&(i.title=e.title),i.providerExecuted=null!=(n=s.providerExecuted)?n:r.providerExecuted,null!=s.providerMetadata&&"input-available"===r.state&&(r.callProviderMetadata=s.providerMetadata)):a.message.parts.push({type:"dynamic-tool",toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:s.input,output:s.output,errorText:s.errorText,preliminary:s.preliminary,providerExecuted:s.providerExecuted,title:e.title,...null!=s.providerMetadata?{callProviderMetadata:s.providerMetadata}:{}})}async function v(e){if(null!=e){const n=null!=a.message.metadata?kn(a.message.metadata,e):e;null!=t&&await(0,g.k5)({value:n,schema:t}),a.message.metadata=n}}switch(e.type){case"text-start":{const t={type:"text",text:"",providerMetadata:e.providerMetadata,state:"streaming"};a.activeTextParts[e.id]=t,a.message.parts.push(t),l();break}case"text-delta":{const t=a.activeTextParts[e.id];t.text+=e.delta,t.providerMetadata=null!=(u=e.providerMetadata)?u:t.providerMetadata,l();break}case"text-end":{const t=a.activeTextParts[e.id];t.state="done",t.providerMetadata=null!=(c=e.providerMetadata)?c:t.providerMetadata,delete a.activeTextParts[e.id],l();break}case"reasoning-start":{const t={type:"reasoning",text:"",providerMetadata:e.providerMetadata,state:"streaming"};a.activeReasoningParts[e.id]=t,a.message.parts.push(t),l();break}case"reasoning-delta":{const t=a.activeReasoningParts[e.id];t.text+=e.delta,t.providerMetadata=null!=(p=e.providerMetadata)?p:t.providerMetadata,l();break}case"reasoning-end":{const t=a.activeReasoningParts[e.id];t.providerMetadata=null!=(d=e.providerMetadata)?d:t.providerMetadata,t.state="done",delete a.activeReasoningParts[e.id],l();break}case"file":a.message.parts.push({type:"file",mediaType:e.mediaType,url:e.url}),l();break;case"source-url":a.message.parts.push({type:"source-url",sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),l();break;case"source-document":a.message.parts.push({type:"source-document",sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),l();break;case"tool-input-start":{const t=a.message.parts.filter(jn);a.partialToolCalls[e.toolCallId]={text:"",toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title},e.dynamic?f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title}),l();break}case"tool-input-delta":{const t=a.partialToolCalls[e.toolCallId];t.text+=e.inputTextDelta;const{value:n}=await fn(t.text);t.dynamic?f({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title}):h({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title}),l();break}case"tool-input-available":e.dynamic?f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}),l(),s&&!e.providerExecuted&&await s({toolCall:e});break;case"tool-input-error":e.dynamic?f({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),l();break;case"tool-approval-request":{const t=m(e.toolCallId);t.state="approval-requested",t.approval={id:e.approvalId},l();break}case"tool-output-denied":m(e.toolCallId).state="output-denied",l();break;case"tool-output-available":{const t=m(e.toolCallId);"dynamic-tool"===t.type?f({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-available",input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,title:t.title}):h({toolCallId:e.toolCallId,toolName:Yn(t),state:"output-available",input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,title:t.title}),l();break}case"tool-output-error":{const t=m(e.toolCallId);"dynamic-tool"===t.type?f({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-error",input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,title:t.title}):h({toolCallId:e.toolCallId,toolName:Yn(t),state:"output-error",input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,title:t.title}),l();break}case"start-step":a.message.parts.push({type:"step-start"});break;case"finish-step":a.activeTextParts={},a.activeReasoningParts={};break;case"start":null!=e.messageId&&(a.message.id=e.messageId),await v(e.messageMetadata),null==e.messageId&&null==e.messageMetadata||l();break;case"finish":null!=e.finishReason&&(a.finishReason=e.finishReason),await v(e.messageMetadata),null!=e.messageMetadata&&l();break;case"message-metadata":await v(e.messageMetadata),null!=e.messageMetadata&&l();break;case"error":null==r||r(new Error(e.errorText));break;default:if(function(e){return e.type.startsWith("data-")}(e)){null!=(null==n?void 0:n[e.type])&&await(0,g.k5)({value:e.data,schema:n[e.type]});const t=e;if(t.transient){null==i||i(t);break}const r=null!=t.id?a.message.parts.find((e=>t.type===e.type&&t.id===e.id)):void 0;null!=r?r.data=t.data:a.message.parts.push(t),null==i||i(t),l()}}o.enqueue(e)}))}}))}function Vn(e){const t=e.pipeThrough(new TransformStream);return t[Symbol.asyncIterator]=function(){const e=this.getReader();let t=!1;async function n(n){var a;t=!0;try{n&&await(null==(a=e.cancel)?void 0:a.call(e))}finally{try{e.releaseLock()}catch(e){}}}return{async next(){if(t)return{done:!0,value:void 0};const{done:a,value:r}=await e.read();return a?(await n(!0),{done:!0,value:void 0}):{done:!1,value:r}},return:async()=>(await n(!0),{done:!0,value:void 0}),async throw(e){throw await n(!0),e}}},t}async function zn({stream:e,onError:t}){const n=e.getReader();try{for(;;){const{done:e}=await n.read();if(e)break}}catch(e){null==t||t(e)}finally{n.releaseLock()}}function Zn(){let e,t;return{promise:new Promise(((n,a)=>{e=n,t=a})),resolve:e,reject:t}}function Bn(){var e,t;return null!=(t=null==(e=null==globalThis?void 0:globalThis.performance)?void 0:e.now())?t:Date.now()}var Gn=(0,g.hK)({prefix:"aitxt",size:24});function Wn({model:e,tools:t,toolChoice:n,system:a,prompt:r,messages:s,maxRetries:i,abortSignal:o,headers:l,stopWhen:u=Sn(1),experimental_output:c,output:p=c,experimental_telemetry:d,prepareStep:m,providerOptions:h,experimental_activeTools:f,activeTools:v=f,experimental_repairToolCall:g,experimental_transform:y,experimental_download:$,includeRawChunks:b=!1,onChunk:_,onError:E=({error:e})=>{console.error(e)},onFinish:x,onAbort:S,onStepFinish:A,experimental_context:I,_internal:{now:w=Bn,generateId:T=Gn,currentDate:N=()=>new Date}={},...O}){return new Kn({model:xt(e),telemetry:d,headers:l,settings:O,maxRetries:i,abortSignal:o,system:a,prompt:r,messages:s,tools:t,toolChoice:n,transforms:kt(y),activeTools:v,repairToolCall:g,stopConditions:kt(u),output:p,providerOptions:h,prepareStep:m,includeRawChunks:b,onChunk:_,onError:E,onFinish:x,onAbort:S,onStepFinish:A,now:w,currentDate:N,generateId:T,experimental_context:I,download:$})}var Kn=class{constructor({model:e,telemetry:t,headers:n,settings:a,maxRetries:r,abortSignal:s,system:i,prompt:o,messages:l,tools:u,toolChoice:c,transforms:p,activeTools:d,repairToolCall:m,stopConditions:h,output:f,providerOptions:v,prepareStep:b,includeRawChunks:_,now:E,currentDate:x,generateId:S,onChunk:A,onError:I,onFinish:w,onAbort:T,onStepFinish:N,experimental_context:O,download:k}){let R;this._totalUsage=new g.e1,this._finishReason=new g.e1,this._steps=new g.e1,this.outputSpecification=f,this.includeRawChunks=_,this.tools=u;let C=[];const P=[];let L,j,M={},D=[];const Y=[];let F,q={},U={};const V=new TransformStream({async transform(t,n){var a,r,s,i;n.enqueue(t);const{part:o}=t;if("text-delta"!==o.type&&"reasoning-delta"!==o.type&&"source"!==o.type&&"tool-call"!==o.type&&"tool-result"!==o.type&&"tool-input-start"!==o.type&&"tool-input-delta"!==o.type&&"raw"!==o.type||await(null==A?void 0:A({chunk:o})),"error"===o.type&&await I({error:Xt(o.error)}),"text-start"===o.type&&(q[o.id]={type:"text",text:"",providerMetadata:o.providerMetadata},C.push(q[o.id])),"text-delta"===o.type){const e=q[o.id];if(null==e)return void n.enqueue({part:{type:"error",error:`text part ${o.id} not found`},partialOutput:void 0});e.text+=o.text,e.providerMetadata=null!=(a=o.providerMetadata)?a:e.providerMetadata}if("text-end"===o.type){const e=q[o.id];if(null==e)return void n.enqueue({part:{type:"error",error:`text part ${o.id} not found`},partialOutput:void 0});e.providerMetadata=null!=(r=o.providerMetadata)?r:e.providerMetadata,delete q[o.id]}if("reasoning-start"===o.type&&(U[o.id]={type:"reasoning",text:"",providerMetadata:o.providerMetadata},C.push(U[o.id])),"reasoning-delta"===o.type){const e=U[o.id];if(null==e)return void n.enqueue({part:{type:"error",error:`reasoning part ${o.id} not found`},partialOutput:void 0});e.text+=o.text,e.providerMetadata=null!=(s=o.providerMetadata)?s:e.providerMetadata}if("reasoning-end"===o.type){const e=U[o.id];if(null==e)return void n.enqueue({part:{type:"error",error:`reasoning part ${o.id} not found`},partialOutput:void 0});e.providerMetadata=null!=(i=o.providerMetadata)?i:e.providerMetadata,delete U[o.id]}if("file"===o.type&&C.push({type:"file",file:o.file}),"source"===o.type&&C.push(o),"tool-call"===o.type&&C.push(o),"tool-result"!==o.type||o.preliminary||C.push(o),"tool-approval-request"===o.type&&C.push(o),"tool-error"===o.type&&C.push(o),"start-step"===o.type&&(C=[],U={},q={},M=o.request,D=o.warnings),"finish-step"===o.type){const t=An({content:C,tools:u}),n=new xn({content:C,finishReason:o.finishReason,usage:o.usage,warnings:D,request:M,response:{...o.response,messages:[...P,...t]},providerMetadata:o.providerMetadata});await(null==N?void 0:N(n)),_e({warnings:D,provider:e.provider,model:e.modelId}),Y.push(n),P.push(...t),R.resolve()}"finish"===o.type&&(j=o.totalUsage,L=o.finishReason)},async flush(e){try{if(0===Y.length){const e=new Ue({message:"No output generated. Check the stream for errors."});return X._finishReason.reject(e),X._totalUsage.reject(e),void X._steps.reject(e)}const e=null!=L?L:"unknown",n=null!=j?j:{inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0,raw:void 0};X._finishReason.resolve(e),X._totalUsage.resolve(n),X._steps.resolve(Y);const a=Y[Y.length-1];await(null==w?void 0:w({finishReason:e,totalUsage:n,usage:a.usage,content:a.content,text:a.text,reasoningText:a.reasoningText,reasoning:a.reasoning,files:a.files,sources:a.sources,toolCalls:a.toolCalls,staticToolCalls:a.staticToolCalls,dynamicToolCalls:a.dynamicToolCalls,toolResults:a.toolResults,staticToolResults:a.staticToolResults,dynamicToolResults:a.dynamicToolResults,request:a.request,response:a.response,warnings:a.warnings,providerMetadata:a.providerMetadata,steps:Y,experimental_context:O})),F.setAttributes(await sn({telemetry:t,attributes:{"ai.response.finishReason":e,"ai.response.text":{output:()=>a.text},"ai.response.toolCalls":{output:()=>{var e;return(null==(e=a.toolCalls)?void 0:e.length)?JSON.stringify(a.toolCalls):void 0}},"ai.response.providerMetadata":JSON.stringify(a.providerMetadata),"ai.usage.inputTokens":n.inputTokens,"ai.usage.outputTokens":n.outputTokens,"ai.usage.totalTokens":n.totalTokens,"ai.usage.reasoningTokens":n.reasoningTokens,"ai.usage.cachedInputTokens":n.cachedInputTokens}}))}catch(t){e.error(t)}finally{F.end()}}}),z=function(){let e=[],t=null,n=!1,a=Zn();const r=()=>{n=!0,a.resolve(),e.forEach((e=>e.cancel())),e=[],null==t||t.close()},s=async()=>{if(n&&0===e.length)null==t||t.close();else{if(0===e.length)return a=Zn(),await a.promise,s();try{const{value:a,done:r}=await e[0].read();r?(e.shift(),0===e.length&&n?null==t||t.close():await s()):null==t||t.enqueue(a)}catch(n){null==t||t.error(n),e.shift(),r()}}};return{stream:new ReadableStream({start(e){t=e},pull:s,async cancel(){for(const t of e)await t.cancel();e=[],n=!0}}),addStream:t=>{if(n)throw new Error("Cannot add inner stream: outer stream is closed");e.push(t.getReader()),a.resolve()},close:()=>{n=!0,a.resolve(),0===e.length&&(null==t||t.close())},terminate:r}}();this.addStream=z.addStream,this.closeStream=z.close;const Z=z.stream.getReader();let B=new ReadableStream({async start(e){e.enqueue({type:"start"})},async pull(e){function t(){null==T||T({steps:Y}),e.enqueue({type:"abort"}),e.close()}try{const{done:n,value:a}=await Z.read();if(n)return void e.close();if(null==s?void 0:s.aborted)return void t();e.enqueue(a)}catch(n){(0,g.zf)(n)&&(null==s?void 0:s.aborted)?t():e.error(n)}},cancel:e=>z.stream.cancel(e)});for(const e of p)B=B.pipeThrough(e({tools:u,stopStream(){z.terminate()}}));this.baseStream=B.pipeThrough(function(e){let t,n,a="",r="",s="";function i({controller:e,partialOutput:a}){e.enqueue({part:{type:"text-delta",id:t,text:r,providerMetadata:n},partialOutput:a}),r=""}return new TransformStream({async transform(o,l){var u;if("finish-step"===o.type&&r.length>0&&i({controller:l}),"text-delta"!==o.type&&"text-start"!==o.type&&"text-end"!==o.type)return void l.enqueue({part:o,partialOutput:void 0});if(null==t)t=o.id;else if(o.id!==t)return void l.enqueue({part:o,partialOutput:void 0});if("text-start"===o.type)return void l.enqueue({part:o,partialOutput:void 0});if("text-end"===o.type)return r.length>0&&i({controller:l}),void l.enqueue({part:o,partialOutput:void 0});a+=o.text,r+=o.text,n=null!=(u=o.providerMetadata)?u:n;const c=await e.parsePartialOutput({text:a});if(void 0!==c){const e=JSON.stringify(c.partial);e!==s&&(i({controller:l,partialOutput:c.partial}),s=e)}}})}(null!=f?f:vn())).pipeThrough(V);const{maxRetries:G,retry:W}=function({maxRetries:e,abortSignal:t}){if(null!=e){if(!Number.isInteger(e))throw new Ae({parameter:"maxRetries",value:e,message:"maxRetries must be an integer"});if(e<0)throw new Ae({parameter:"maxRetries",value:e,message:"maxRetries must be >= 0"})}const n=null!=e?e:2;return{maxRetries:n,retry:un({maxRetries:n,abortSignal:t})}}({maxRetries:r,abortSignal:s}),K=function({isEnabled:e=!1,tracer:t}={}){return e?t||me.u.getTracer("ai"):en}(t),H=function({maxOutputTokens:e,temperature:t,topP:n,topK:a,presencePenalty:r,frequencyPenalty:s,seed:i,stopSequences:o}){if(null!=e){if(!Number.isInteger(e))throw new Ae({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be an integer"});if(e<1)throw new Ae({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be >= 1"})}if(null!=t&&"number"!=typeof t)throw new Ae({parameter:"temperature",value:t,message:"temperature must be a number"});if(null!=n&&"number"!=typeof n)throw new Ae({parameter:"topP",value:n,message:"topP must be a number"});if(null!=a&&"number"!=typeof a)throw new Ae({parameter:"topK",value:a,message:"topK must be a number"});if(null!=r&&"number"!=typeof r)throw new Ae({parameter:"presencePenalty",value:r,message:"presencePenalty must be a number"});if(null!=s&&"number"!=typeof s)throw new Ae({parameter:"frequencyPenalty",value:s,message:"frequencyPenalty must be a number"});if(null!=i&&!Number.isInteger(i))throw new Ae({parameter:"seed",value:i,message:"seed must be an integer"});return{maxOutputTokens:e,temperature:t,topP:n,topK:a,presencePenalty:r,frequencyPenalty:s,stopSequences:o,seed:i}}(a),J=function({model:e,settings:t,telemetry:n,headers:a}){var r;return{"ai.model.provider":e.provider,"ai.model.id":e.modelId,...Object.entries(t).reduce(((e,[t,n])=>(e[`ai.settings.${t}`]=n,e)),{}),...Object.entries(null!=(r=null==n?void 0:n.metadata)?r:{}).reduce(((e,[t,n])=>(e[`ai.telemetry.metadata.${t}`]=n,e)),{}),...Object.entries(null!=a?a:{}).reduce(((e,[t,n])=>(void 0!==n&&(e[`ai.request.headers.${t}`]=n),e)),{})}}({model:e,telemetry:t,headers:n,settings:{...H,maxRetries:G}}),X=this;an({name:"ai.streamText",attributes:sn({telemetry:t,attributes:{...Qt({operationId:"ai.streamText",telemetry:t}),...J,"ai.prompt":{input:()=>JSON.stringify({system:i,prompt:o,messages:l})}}}),tracer:K,endWhenDone:!1,fn:async a=>{F=a;const r=await async function(e){if(null==e.prompt&&null==e.messages)throw new y.M3({prompt:e,message:"prompt or messages must be defined"});if(null!=e.prompt&&null!=e.messages)throw new y.M3({prompt:e,message:"prompt and messages cannot be defined at the same time"});if(null!=e.system&&"string"!=typeof e.system&&!kt(e.system).every((e=>"object"==typeof e&&null!==e&&"role"in e&&"system"===e.role)))throw new y.M3({prompt:e,message:"system must be a string, SystemModelMessage, or array of SystemModelMessage"});let t;if(null!=e.prompt&&"string"==typeof e.prompt)t=[{role:"user",content:e.prompt}];else if(null!=e.prompt&&Array.isArray(e.prompt))t=e.prompt;else{if(null==e.messages)throw new y.M3({prompt:e,message:"prompt or messages must be defined"});t=e.messages}if(0===t.length)throw new y.M3({prompt:e,message:"messages must not be empty"});const n=await(0,g.ZZ)({value:t,schema:$.YO(Jt)});if(!n.success)throw new y.M3({prompt:e,message:"The messages do not match the ModelMessage[] schema.",cause:n.error});return{messages:t,system:e.system}}({system:i,prompt:o,messages:l}),p=r.messages,_=[],{approvedToolApprovals:A,deniedToolApprovals:I}=function({messages:e}){const t=e.at(-1);if("tool"!=(null==t?void 0:t.role))return{approvedToolApprovals:[],deniedToolApprovals:[]};const n={};for(const t of e)if("assistant"===t.role&&"string"!=typeof t.content){const e=t.content;for(const t of e)"tool-call"===t.type&&(n[t.toolCallId]=t)}const a={};for(const t of e)if("assistant"===t.role&&"string"!=typeof t.content){const e=t.content;for(const t of e)"tool-approval-request"===t.type&&(a[t.approvalId]=t)}const r={};for(const e of t.content)"tool-result"===e.type&&(r[e.toolCallId]=e);const s=[],i=[],o=t.content.filter((e=>"tool-approval-response"===e.type));for(const e of o){const t=a[e.approvalId];if(null!=r[t.toolCallId])continue;const o={approvalRequest:t,approvalResponse:e,toolCall:n[t.toolCallId]};e.approved?s.push(o):i.push(o)}return{approvedToolApprovals:s,deniedToolApprovals:i}}({messages:p});if(I.length>0||A.length>0){let e;const n=new ReadableStream({start(t){e=t}});X.addStream(n);try{for(const t of I)null==e||e.enqueue({type:"tool-output-denied",toolCallId:t.toolCall.toolCallId,toolName:t.toolCall.toolName});const n=[];await Promise.all(A.map((async a=>{const r=await pn({toolCall:a.toolCall,tools:u,tracer:K,telemetry:t,messages:p,abortSignal:s,experimental_context:O,onPreliminaryToolResult:t=>{null==e||e.enqueue(t)}});null!=r&&(null==e||e.enqueue(r),n.push(r))}))),_.push({role:"tool",content:[...n.map((e=>({type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Pt({tool:null==u?void 0:u[e.toolName],output:"tool-result"===e.type?e.output:e.error,errorMode:"tool-error"===e.type?"json":"none"})}))),...I.map((e=>({type:"tool-result",toolCallId:e.toolCall.toolCallId,toolName:e.toolCall.toolName,output:{type:"execution-denied",reason:e.approvalResponse.reason}})))]})}finally{null==e||e.close()}}P.push(..._),await async function a({currentStep:o,responseMessages:l,usage:y}){var $,_,A,I,w,T;const N=X.includeRawChunks;R=new g.e1;const C=[...p,...l],P=await(null==b?void 0:b({model:e,steps:Y,stepNumber:Y.length,messages:C,experimental_context:O})),L=xt(null!=($=null==P?void 0:P.model)?$:e),j=await Rt({prompt:{system:null!=(_=null==P?void 0:P.system)?_:r.system,messages:null!=(A=null==P?void 0:P.messages)?A:C},supportedUrls:await L.supportedUrls,download:k}),{toolChoice:M,tools:D}=await async function({tools:e,toolChoice:t,activeTools:n}){if(!(null!=(a=e)&&Object.keys(a).length>0))return{tools:void 0,toolChoice:void 0};var a;const r=null!=n?Object.entries(e).filter((([e])=>n.includes(e))):Object.entries(e),s=[];for(const[e,t]of r){const n=t.type;switch(n){case void 0:case"dynamic":case"function":s.push({type:"function",name:e,description:t.description,inputSchema:await(0,g.mD)(t.inputSchema).jsonSchema,...null!=t.inputExamples?{inputExamples:t.inputExamples}:{},providerOptions:t.providerOptions,...null!=t.strict?{strict:t.strict}:{}});break;case"provider":s.push({type:"provider",name:e,id:t.id,args:t.args});break;default:throw new Error(`Unsupported tool type: ${n}`)}}return{tools:s,toolChoice:null==t?{type:"auto"}:"string"==typeof t?{type:t}:{type:"tool",toolName:t.toolName}}}({tools:u,toolChoice:null!=(I=null==P?void 0:P.toolChoice)?I:c,activeTools:null!=(w=null==P?void 0:P.activeTools)?w:d});O=null!=(T=null==P?void 0:P.experimental_context)?T:O;const{result:{stream:F,response:q,request:U},doStreamSpan:V,startTimestampMs:z}=await W((()=>an({name:"ai.streamText.doStream",attributes:sn({telemetry:t,attributes:{...Qt({operationId:"ai.streamText.doStream",telemetry:t}),...J,"ai.model.provider":L.provider,"ai.model.id":L.modelId,"ai.prompt.messages":{input:()=>function(e){return JSON.stringify(e.map((e=>({...e,content:"string"==typeof e.content?e.content:e.content.map((e=>{return"file"===e.type?{...e,data:e.data instanceof Uint8Array?(t=e.data,"string"==typeof t?t:t instanceof ArrayBuffer?(0,g.n_)(new Uint8Array(t)):(0,g.n_)(t)):e.data}:e;var t}))}))))}(j)},"ai.prompt.tools":{input:()=>null==D?void 0:D.map((e=>JSON.stringify(e)))},"ai.prompt.toolChoice":{input:()=>null!=M?JSON.stringify(M):void 0},"gen_ai.system":L.provider,"gen_ai.request.model":L.modelId,"gen_ai.request.frequency_penalty":H.frequencyPenalty,"gen_ai.request.max_tokens":H.maxOutputTokens,"gen_ai.request.presence_penalty":H.presencePenalty,"gen_ai.request.stop_sequences":H.stopSequences,"gen_ai.request.temperature":H.temperature,"gen_ai.request.top_k":H.topK,"gen_ai.request.top_p":H.topP}}),tracer:K,endWhenDone:!1,fn:async e=>({startTimestampMs:E(),doStreamSpan:e,result:await L.doStream({...H,tools:D,toolChoice:M,responseFormat:await(null==f?void 0:f.responseFormat),prompt:j,providerOptions:v,abortSignal:s,headers:n,includeRawChunks:N})})}))),Z=function({tools:e,generatorStream:t,tracer:n,telemetry:a,system:r,messages:s,abortSignal:i,repairToolCall:o,experimental_context:l,generateId:u}){let c=null;const p=new ReadableStream({start(e){c=e}}),d=new Set,m=new Map;let h,f=!1;function v(){f&&0===d.size&&(null!=h&&c.enqueue(h),c.close())}const y=new TransformStream({async transform(t,p){const f=t.type;switch(f){case"stream-start":case"text-start":case"text-delta":case"text-end":case"reasoning-start":case"reasoning-delta":case"reasoning-end":case"tool-input-start":case"tool-input-delta":case"tool-input-end":case"source":case"response-metadata":case"error":case"raw":p.enqueue(t);break;case"file":p.enqueue({type:"file",file:new mn({data:t.data,mediaType:t.mediaType})});break;case"finish":h={type:"finish",finishReason:t.finishReason,usage:on(t.usage),providerMetadata:t.providerMetadata};break;case"tool-call":try{const h=await async function({toolCall:e,tools:t,repairToolCall:n,system:a,messages:r}){var s;try{if(null==t){if(e.providerExecuted&&e.dynamic)return await _n(e);throw new Ge({toolName:e.toolName})}try{return await En({toolCall:e,tools:t})}catch(s){if(null==n||!Ge.isInstance(s)&&!ke.isInstance(s))throw s;let i=null;try{i=await n({toolCall:e,tools:t,inputSchema:async({toolName:e})=>{const{inputSchema:n}=t[e];return await(0,g.mD)(n).jsonSchema},system:a,messages:r,error:s})}catch(e){throw new Xe({cause:e,originalError:s})}if(null==i)throw s;return await En({toolCall:i,tools:t})}}catch(n){const a=await(0,g.N8)({text:e.input}),r=a.success?a.value:e.input;return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:r,dynamic:!0,invalid:!0,error:n,title:null==(s=null==t?void 0:t[e.toolName])?void 0:s.title,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}}}({toolCall:t,tools:e,repairToolCall:o,system:r,messages:s});if(p.enqueue(h),h.invalid){c.enqueue({type:"tool-error",toolCallId:h.toolCallId,toolName:h.toolName,input:h.input,error:(0,g.u1)(h.error),dynamic:!0,title:h.title});break}const f=null==e?void 0:e[h.toolName];if(null==f)break;if(null!=f.onInputAvailable&&await f.onInputAvailable({input:h.input,toolCallId:h.toolCallId,messages:s,abortSignal:i,experimental_context:l}),await async function({tool:e,toolCall:t,messages:n,experimental_context:a}){return null!=e.needsApproval&&("boolean"==typeof e.needsApproval?e.needsApproval:await e.needsApproval(t.input,{toolCallId:t.toolCallId,messages:n,experimental_context:a}))}({tool:f,toolCall:h,messages:s,experimental_context:l})){c.enqueue({type:"tool-approval-request",approvalId:u(),toolCall:h});break}if(m.set(h.toolCallId,h.input),null!=f.execute&&!0!==h.providerExecuted){const t=u();d.add(t),pn({toolCall:h,tools:e,tracer:n,telemetry:a,messages:s,abortSignal:i,experimental_context:l,onPreliminaryToolResult:e=>{c.enqueue(e)}}).then((e=>{c.enqueue(e),d.delete(t),v()}))}}catch(e){c.enqueue({type:"error",error:e})}break;case"tool-result":{const e=t.toolName;t.isError?c.enqueue({type:"tool-error",toolCallId:t.toolCallId,toolName:e,input:m.get(t.toolCallId),providerExecuted:!0,error:t.result,dynamic:t.dynamic}):p.enqueue({type:"tool-result",toolCallId:t.toolCallId,toolName:e,input:m.get(t.toolCallId),output:t.result,providerExecuted:!0,dynamic:t.dynamic});break}default:throw new Error(`Unhandled chunk type: ${f}`)}},flush(){f=!0,v()}});return new ReadableStream({start:async e=>Promise.all([t.pipeThrough(y).pipeTo(new WritableStream({write(t){e.enqueue(t)},close(){}})),p.pipeTo(new WritableStream({write(t){e.enqueue(t)},close(){e.close()}}))])})}({tools:u,generatorStream:F,tracer:K,telemetry:t,system:i,messages:C,repairToolCall:m,abortSignal:s,experimental_context:O,generateId:S}),B=null!=U?U:{},G=[],Q=[];let ee;const te={};let ne,ae="unknown",re={inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0,raw:void 0},se=!0,ie={id:S(),timestamp:x(),modelId:e.modelId},oe="";X.addStream(Z.pipeThrough(new TransformStream({async transform(e,t){var n,a,r,i,o;if("stream-start"===e.type)return void(ee=e.warnings);if(se){const e=E()-z;se=!1,V.addEvent("ai.stream.firstChunk",{"ai.response.msToFirstChunk":e}),V.setAttributes({"ai.response.msToFirstChunk":e}),t.enqueue({type:"start-step",request:B,warnings:null!=ee?ee:[]})}const l=e.type;switch(l){case"tool-approval-request":case"text-start":case"text-end":case"reasoning-start":case"reasoning-end":case"file":case"source":t.enqueue(e);break;case"text-delta":e.delta.length>0&&(t.enqueue({type:"text-delta",id:e.id,text:e.delta,providerMetadata:e.providerMetadata}),oe+=e.delta);break;case"reasoning-delta":t.enqueue({type:"reasoning-delta",id:e.id,text:e.delta,providerMetadata:e.providerMetadata});break;case"tool-call":t.enqueue(e),G.push(e);break;case"tool-result":t.enqueue(e),e.preliminary||Q.push(e);break;case"tool-error":t.enqueue(e),Q.push(e);break;case"response-metadata":ie={id:null!=(n=e.id)?n:ie.id,timestamp:null!=(a=e.timestamp)?a:ie.timestamp,modelId:null!=(r=e.modelId)?r:ie.modelId};break;case"finish":{re=e.usage,ae=e.finishReason,ne=e.providerMetadata;const t=E()-z;V.addEvent("ai.stream.finish"),V.setAttributes({"ai.response.msToFinish":t,"ai.response.avgOutputTokensPerSecond":1e3*(null!=(i=re.outputTokens)?i:0)/t});break}case"tool-input-start":{te[e.id]=e.toolName;const n=null==u?void 0:u[e.toolName];null!=(null==n?void 0:n.onInputStart)&&await n.onInputStart({toolCallId:e.id,messages:C,abortSignal:s,experimental_context:O}),t.enqueue({...e,dynamic:null!=(o=e.dynamic)?o:"dynamic"===(null==n?void 0:n.type),title:null==n?void 0:n.title});break}case"tool-input-end":delete te[e.id],t.enqueue(e);break;case"tool-input-delta":{const n=te[e.id],a=null==u?void 0:u[n];null!=(null==a?void 0:a.onInputDelta)&&await a.onInputDelta({inputTextDelta:e.delta,toolCallId:e.id,messages:C,abortSignal:s,experimental_context:O}),t.enqueue(e);break}case"error":t.enqueue(e),ae="error";break;case"raw":N&&t.enqueue(e);break;default:throw new Error(`Unknown chunk type: ${l}`)}},async flush(e){const n=G.length>0?JSON.stringify(G):void 0;try{V.setAttributes(await sn({telemetry:t,attributes:{"ai.response.finishReason":ae,"ai.response.text":{output:()=>oe},"ai.response.toolCalls":{output:()=>n},"ai.response.id":ie.id,"ai.response.model":ie.modelId,"ai.response.timestamp":ie.timestamp.toISOString(),"ai.response.providerMetadata":JSON.stringify(ne),"ai.usage.inputTokens":re.inputTokens,"ai.usage.outputTokens":re.outputTokens,"ai.usage.totalTokens":re.totalTokens,"ai.usage.reasoningTokens":re.reasoningTokens,"ai.usage.cachedInputTokens":re.cachedInputTokens,"gen_ai.response.finish_reasons":[ae],"gen_ai.response.id":ie.id,"gen_ai.response.model":ie.modelId,"gen_ai.usage.input_tokens":re.inputTokens,"gen_ai.usage.output_tokens":re.outputTokens}}))}catch(e){}finally{V.end()}e.enqueue({type:"finish-step",finishReason:ae,usage:re,providerMetadata:ne,response:{...ie,headers:null==q?void 0:q.headers}});const r=function(e,t){var n,a,r,s,i,o,l,u,c,p;return{inputTokens:ln(e.inputTokens,t.inputTokens),inputTokenDetails:{noCacheTokens:ln(null==(n=e.inputTokenDetails)?void 0:n.noCacheTokens,null==(a=t.inputTokenDetails)?void 0:a.noCacheTokens),cacheReadTokens:ln(null==(r=e.inputTokenDetails)?void 0:r.cacheReadTokens,null==(s=t.inputTokenDetails)?void 0:s.cacheReadTokens),cacheWriteTokens:ln(null==(i=e.inputTokenDetails)?void 0:i.cacheWriteTokens,null==(o=t.inputTokenDetails)?void 0:o.cacheWriteTokens)},outputTokens:ln(e.outputTokens,t.outputTokens),outputTokenDetails:{textTokens:ln(null==(l=e.outputTokenDetails)?void 0:l.textTokens,null==(u=t.outputTokenDetails)?void 0:u.textTokens),reasoningTokens:ln(null==(c=e.outputTokenDetails)?void 0:c.reasoningTokens,null==(p=t.outputTokenDetails)?void 0:p.reasoningTokens)},totalTokens:ln(e.totalTokens,t.totalTokens),reasoningTokens:ln(e.reasoningTokens,t.reasoningTokens),cachedInputTokens:ln(e.cachedInputTokens,t.cachedInputTokens)}}(y,re);await R.promise;const s=G.filter((e=>!0!==e.providerExecuted)),i=Q.filter((e=>!0!==e.providerExecuted));if(s.length>0&&i.length===s.length&&!await async function({stopConditions:e,steps:t}){return(await Promise.all(e.map((e=>e({steps:t}))))).some((e=>e))}({stopConditions:h,steps:Y})){l.push(...An({content:Y[Y.length-1].content,tools:u}));try{await a({currentStep:o+1,responseMessages:l,usage:r})}catch(t){e.enqueue({type:"error",error:t}),X.closeStream()}}else e.enqueue({type:"finish",finishReason:ae,totalUsage:r}),X.closeStream()}})))}({currentStep:0,responseMessages:_,usage:{inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0,raw:void 0}})}}).catch((e=>{X.addStream(new ReadableStream({start(t){t.enqueue({type:"error",error:e}),t.close()}})),X.closeStream()}))}get steps(){return this.consumeStream(),this._steps.promise}get finalStep(){return this.steps.then((e=>e[e.length-1]))}get content(){return this.finalStep.then((e=>e.content))}get warnings(){return this.finalStep.then((e=>e.warnings))}get providerMetadata(){return this.finalStep.then((e=>e.providerMetadata))}get text(){return this.finalStep.then((e=>e.text))}get reasoningText(){return this.finalStep.then((e=>e.reasoningText))}get reasoning(){return this.finalStep.then((e=>e.reasoning))}get sources(){return this.finalStep.then((e=>e.sources))}get files(){return this.finalStep.then((e=>e.files))}get toolCalls(){return this.finalStep.then((e=>e.toolCalls))}get staticToolCalls(){return this.finalStep.then((e=>e.staticToolCalls))}get dynamicToolCalls(){return this.finalStep.then((e=>e.dynamicToolCalls))}get toolResults(){return this.finalStep.then((e=>e.toolResults))}get staticToolResults(){return this.finalStep.then((e=>e.staticToolResults))}get dynamicToolResults(){return this.finalStep.then((e=>e.dynamicToolResults))}get usage(){return this.finalStep.then((e=>e.usage))}get request(){return this.finalStep.then((e=>e.request))}get response(){return this.finalStep.then((e=>e.response))}get totalUsage(){return this.consumeStream(),this._totalUsage.promise}get finishReason(){return this.consumeStream(),this._finishReason.promise}teeStream(){const[e,t]=this.baseStream.tee();return this.baseStream=t,e}get textStream(){return Vn(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){"text-delta"===e.type&&t.enqueue(e.text)}})))}get fullStream(){return Vn(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){t.enqueue(e)}})))}async consumeStream(e){var t;try{await zn({stream:this.fullStream,onError:null==e?void 0:e.onError})}catch(n){null==(t=null==e?void 0:e.onError)||t.call(e,n)}}get experimental_partialOutputStream(){return this.partialOutputStream}get partialOutputStream(){return Vn(this.teeStream().pipeThrough(new TransformStream({transform({partialOutput:e},t){null!=e&&t.enqueue(e)}})))}get output(){return this.finalStep.then((e=>{var t;return(null!=(t=this.outputSpecification)?t:vn()).parseCompleteOutput({text:e.text},{response:e.response,usage:e.usage,finishReason:e.finishReason})}))}toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:a,sendReasoning:r=!0,sendSources:s=!1,sendStart:i=!0,sendFinish:o=!0,onError:l=y.u1}={}){const u=null!=t?function({originalMessages:e,responseMessageId:t}){if(null==e)return;const n=e[e.length-1];return"assistant"===(null==n?void 0:n.role)?n.id:"function"==typeof t?t():t}({originalMessages:e,responseMessageId:t}):void 0,c=e=>{var t;const n=null==(t=this.tools)?void 0:t[e.toolName];return null==n?e.dynamic:"dynamic"===(null==n?void 0:n.type)||void 0};return Vn(function({messageId:e,originalMessages:t=[],onFinish:n,onError:a,stream:r}){let s=null==t?void 0:t[t.length-1];"assistant"!==(null==s?void 0:s.role)?s=void 0:e=s.id;let i=!1;const o=r.pipeThrough(new TransformStream({transform(t,n){if("start"===t.type){const n=t;null==n.messageId&&null!=e&&(n.messageId=e)}"abort"===t.type&&(i=!0),n.enqueue(t)}}));if(null==n)return o;const l=qn({lastMessage:s?structuredClone(s):void 0,messageId:null!=e?e:""});let u=!1;const c=async()=>{if(u||!n)return;u=!0;const e=l.message.id===(null==s?void 0:s.id);await n({isAborted:i,isContinuation:e,responseMessage:l.message,messages:[...e?t.slice(0,-1):t,l.message],finishReason:l.finishReason})};return Un({stream:o,runUpdateMessageJob:async e=>{await e({state:l,write:()=>{}})},onError:a}).pipeThrough(new TransformStream({transform(e,t){t.enqueue(e)},async cancel(){await c()},async flush(){await c()}}))}({stream:this.fullStream.pipeThrough(new TransformStream({transform:async(e,t)=>{const n=null==a?void 0:a({part:e}),p=e.type;switch(p){case"text-start":t.enqueue({type:"text-start",id:e.id,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"text-delta":t.enqueue({type:"text-delta",id:e.id,delta:e.text,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"text-end":t.enqueue({type:"text-end",id:e.id,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"reasoning-start":t.enqueue({type:"reasoning-start",id:e.id,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"reasoning-delta":r&&t.enqueue({type:"reasoning-delta",id:e.id,delta:e.text,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"reasoning-end":t.enqueue({type:"reasoning-end",id:e.id,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"file":t.enqueue({type:"file",mediaType:e.file.mediaType,url:`data:${e.file.mediaType};base64,${e.file.base64}`});break;case"source":s&&"url"===e.sourceType&&t.enqueue({type:"source-url",sourceId:e.id,url:e.url,title:e.title,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}),s&&"document"===e.sourceType&&t.enqueue({type:"source-document",sourceId:e.id,mediaType:e.mediaType,title:e.title,filename:e.filename,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"tool-input-start":{const n=c(e);t.enqueue({type:"tool-input-start",toolCallId:e.id,toolName:e.toolName,...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=n?{dynamic:n}:{},...null!=e.title?{title:e.title}:{}});break}case"tool-input-delta":t.enqueue({type:"tool-input-delta",toolCallId:e.id,inputTextDelta:e.delta});break;case"tool-call":{const n=c(e);e.invalid?t.enqueue({type:"tool-input-error",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input,...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{},...null!=n?{dynamic:n}:{},errorText:l(e.error),...null!=e.title?{title:e.title}:{}}):t.enqueue({type:"tool-input-available",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input,...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{},...null!=n?{dynamic:n}:{},...null!=e.title?{title:e.title}:{}});break}case"tool-approval-request":t.enqueue({type:"tool-approval-request",approvalId:e.approvalId,toolCallId:e.toolCall.toolCallId});break;case"tool-result":{const n=c(e);t.enqueue({type:"tool-output-available",toolCallId:e.toolCallId,output:e.output,...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=e.preliminary?{preliminary:e.preliminary}:{},...null!=n?{dynamic:n}:{}});break}case"tool-error":{const n=c(e);t.enqueue({type:"tool-output-error",toolCallId:e.toolCallId,errorText:l(e.error),...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=n?{dynamic:n}:{}});break}case"tool-output-denied":t.enqueue({type:"tool-output-denied",toolCallId:e.toolCallId});break;case"error":t.enqueue({type:"error",errorText:l(e.error)});break;case"start-step":t.enqueue({type:"start-step"});break;case"finish-step":t.enqueue({type:"finish-step"});break;case"start":i&&t.enqueue({type:"start",...null!=n?{messageMetadata:n}:{},...null!=u?{messageId:u}:{}});break;case"finish":o&&t.enqueue({type:"finish",finishReason:e.finishReason,...null!=n?{messageMetadata:n}:{}});break;case"abort":t.enqueue(e);break;case"tool-input-end":case"raw":break;default:throw new Error(`Unknown chunk type: ${p}`)}null!=n&&"start"!==p&&"finish"!==p&&t.enqueue({type:"message-metadata",messageMetadata:n})}})),messageId:null!=u?u:null==t?void 0:t(),originalMessages:e,onFinish:n,onError:l}))}pipeUIMessageStreamToResponse(e,{originalMessages:t,generateMessageId:n,onFinish:a,messageMetadata:r,sendReasoning:s,sendSources:i,sendFinish:o,sendStart:l,onError:u,...c}={}){!function({response:e,status:t,statusText:n,headers:a,stream:r,consumeSseStream:s}){let i=r.pipeThrough(new Tn);if(s){const[e,t]=i.tee();i=e,s({stream:t})}wn({response:e,status:t,statusText:n,headers:Object.fromEntries(In(a,Nn).entries()),stream:i.pipeThrough(new TextEncoderStream)})}({response:e,stream:this.toUIMessageStream({originalMessages:t,generateMessageId:n,onFinish:a,messageMetadata:r,sendReasoning:s,sendSources:i,sendFinish:o,sendStart:l,onError:u}),...c})}pipeTextStreamToResponse(e,t){!function({response:e,status:t,statusText:n,headers:a,textStream:r}){wn({response:e,status:t,statusText:n,headers:Object.fromEntries(In(a,{"content-type":"text/plain; charset=utf-8"}).entries()),stream:r.pipeThrough(new TextEncoderStream)})}({response:e,textStream:this.textStream,...t})}toUIMessageStreamResponse({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:a,sendReasoning:r,sendSources:s,sendFinish:i,sendStart:o,onError:l,...u}={}){return function({status:e,statusText:t,headers:n,stream:a,consumeSseStream:r}){let s=a.pipeThrough(new Tn);if(r){const[e,t]=s.tee();s=e,r({stream:t})}return new Response(s.pipeThrough(new TextEncoderStream),{status:e,statusText:t,headers:In(n,Nn)})}({stream:this.toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:a,sendReasoning:r,sendSources:s,sendFinish:i,sendStart:o,onError:l}),...u})}toTextStreamResponse(e){return function({status:e,statusText:t,headers:n,textStream:a}){return new Response(a.pipeThrough(new TextEncoderStream),{status:null!=e?e:200,statusText:t,headers:In(n,{"content-type":"text/plain; charset=utf-8"})})}({textStream:this.textStream,...e})}};function Hn(e,t){const n=[];(null==t?void 0:t.ignoreIncompleteToolCalls)&&(e=e.map((e=>({...e,parts:e.parts.filter((e=>!Dn(e)||"input-streaming"!==e.state&&"input-available"!==e.state))}))));for(const a of e)switch(a.role){case"system":{const e=a.parts.filter((e=>"text"===e.type)),t=e.reduce(((e,t)=>null!=t.providerMetadata?{...e,...t.providerMetadata}:e),{});n.push({role:"system",content:e.map((e=>e.text)).join(""),...Object.keys(t).length>0?{providerOptions:t}:{}});break}case"user":n.push({role:"user",content:a.parts.map((e=>{var n;return Cn(e)?{type:"text",text:e.text,...null!=e.providerMetadata?{providerOptions:e.providerMetadata}:{}}:Pn(e)?{type:"file",mediaType:e.mediaType,filename:e.filename,data:e.url,...null!=e.providerMetadata?{providerOptions:e.providerMetadata}:{}}:Rn(e)?null==(n=null==t?void 0:t.convertDataPart)?void 0:n.call(t,e):void 0})).filter(g.R)});break;case"assistant":if(null!=a.parts){let e=function(){var e,a,s;if(0===r.length)return;const i=[];for(const n of r)if(Cn(n))i.push({type:"text",text:n.text,...null!=n.providerMetadata?{providerOptions:n.providerMetadata}:{}});else if(Pn(n))i.push({type:"file",mediaType:n.mediaType,filename:n.filename,data:n.url});else if(Ln(n))i.push({type:"reasoning",text:n.text,providerOptions:n.providerMetadata});else if(Dn(n)){const r=Fn(n);"input-streaming"!==n.state&&(i.push({type:"tool-call",toolCallId:n.toolCallId,toolName:r,input:"output-error"===n.state?null!=(e=n.input)?e:"rawInput"in n?n.rawInput:void 0:n.input,providerExecuted:n.providerExecuted,...null!=n.callProviderMetadata?{providerOptions:n.callProviderMetadata}:{}}),null!=n.approval&&i.push({type:"tool-approval-request",approvalId:n.approval.id,toolCallId:n.toolCallId}),!0!==n.providerExecuted||"output-available"!==n.state&&"output-error"!==n.state||i.push({type:"tool-result",toolCallId:n.toolCallId,toolName:r,output:Pt({output:"output-error"===n.state?n.errorText:n.output,tool:null==(a=null==t?void 0:t.tools)?void 0:a[r],errorMode:"output-error"===n.state?"json":"none"}),...null!=n.callProviderMetadata?{providerOptions:n.callProviderMetadata}:{}}))}else{if(!Rn(n))throw new Error(`Unsupported part: ${n}`);{const e=null==(s=null==t?void 0:t.convertDataPart)?void 0:s.call(t,n);null!=e&&i.push(e)}}n.push({role:"assistant",content:i});const o=r.filter((e=>Dn(e)&&!0!==e.providerExecuted));o.length>0&&n.push({role:"tool",content:o.flatMap((e=>{var n,a,r;const s=[];switch(null!=(null==(n=e.approval)?void 0:n.approved)&&s.push({type:"tool-approval-response",approvalId:e.approval.id,approved:e.approval.approved,reason:e.approval.reason}),e.state){case"output-denied":s.push({type:"tool-result",toolCallId:e.toolCallId,toolName:Fn(e),output:{type:"error-text",value:null!=(a=e.approval.reason)?a:"Tool execution denied."},...null!=e.callProviderMetadata?{providerOptions:e.callProviderMetadata}:{}});break;case"output-error":case"output-available":{const n=Fn(e);s.push({type:"tool-result",toolCallId:e.toolCallId,toolName:n,output:Pt({output:"output-error"===e.state?e.errorText:e.output,tool:null==(r=null==t?void 0:t.tools)?void 0:r[n],errorMode:"output-error"===e.state?"text":"none"}),...null!=e.callProviderMetadata?{providerOptions:e.callProviderMetadata}:{}});break}}return s}))}),r=[]},r=[];for(const t of a.parts)Cn(t)||Ln(t)||Pn(t)||Dn(t)||Rn(t)?r.push(t):"step-start"===t.type&&e();e();break}break;default:{const e=a.role;throw new ct({originalMessage:a,message:`Unsupported role: ${e}`})}}return n}(0,g.ID)((()=>(0,g.jN)($.YO($.Ik({id:$.Yj(),role:$.k5(["system","user","assistant"]),metadata:$.L5().optional(),parts:$.YO($.KC([$.Ik({type:$.eu("text"),text:$.Yj(),state:$.k5(["streaming","done"]).optional(),providerMetadata:Mt.optional()}),$.Ik({type:$.eu("reasoning"),text:$.Yj(),state:$.k5(["streaming","done"]).optional(),providerMetadata:Mt.optional()}),$.Ik({type:$.eu("source-url"),sourceId:$.Yj(),url:$.Yj(),title:$.Yj().optional(),providerMetadata:Mt.optional()}),$.Ik({type:$.eu("source-document"),sourceId:$.Yj(),mediaType:$.Yj(),title:$.Yj(),filename:$.Yj().optional(),providerMetadata:Mt.optional()}),$.Ik({type:$.eu("file"),mediaType:$.Yj(),filename:$.Yj().optional(),url:$.Yj(),providerMetadata:Mt.optional()}),$.Ik({type:$.eu("step-start")}),$.Ik({type:$.Yj().startsWith("data-"),id:$.Yj().optional(),data:$.L5()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("input-streaming"),input:$.L5().optional(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),approval:$.Zm().optional()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("input-available"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Mt.optional(),approval:$.Zm().optional()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("approval-requested"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Mt.optional(),approval:$.Ik({id:$.Yj(),approved:$.Zm().optional(),reason:$.Zm().optional()})}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("approval-responded"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Mt.optional(),approval:$.Ik({id:$.Yj(),approved:$.zM(),reason:$.Yj().optional()})}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("output-available"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.L5(),errorText:$.Zm().optional(),callProviderMetadata:Mt.optional(),preliminary:$.zM().optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!0),reason:$.Yj().optional()}).optional()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("output-error"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Yj(),callProviderMetadata:Mt.optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!0),reason:$.Yj().optional()}).optional()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("output-denied"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Mt.optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!1),reason:$.Yj().optional()})}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("input-streaming"),providerExecuted:$.zM().optional(),input:$.L5().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),approval:$.Zm().optional()}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("input-available"),providerExecuted:$.zM().optional(),input:$.L5(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Mt.optional(),approval:$.Zm().optional()}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("approval-requested"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Mt.optional(),approval:$.Ik({id:$.Yj(),approved:$.Zm().optional(),reason:$.Zm().optional()})}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("approval-responded"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Mt.optional(),approval:$.Ik({id:$.Yj(),approved:$.zM(),reason:$.Yj().optional()})}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("output-available"),providerExecuted:$.zM().optional(),input:$.L5(),output:$.L5(),errorText:$.Zm().optional(),callProviderMetadata:Mt.optional(),preliminary:$.zM().optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!0),reason:$.Yj().optional()}).optional()}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("output-error"),providerExecuted:$.zM().optional(),input:$.L5(),output:$.Zm().optional(),errorText:$.Yj(),callProviderMetadata:Mt.optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!0),reason:$.Yj().optional()}).optional()}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("output-denied"),providerExecuted:$.zM().optional(),input:$.L5(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Mt.optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!1),reason:$.Yj().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")))),(0,g.hK)({prefix:"aiobj",size:24});var Jn=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise(((t,n)=>{this.queue.push((async()=>{try{await e(),t()}catch(e){n(e)}})),this.processQueue()}))}};(0,g.hK)({prefix:"aiobj",size:24});var Xn=Symbol.for("vercel.ai.error.AI_NoSuchProviderError");y.eM,y.bD;var Qn=class{constructor({api:e="/api/chat",credentials:t,headers:n,body:a,fetch:r,prepareSendMessagesRequest:s,prepareReconnectToStreamRequest:i}){this.api=e,this.credentials=t,this.headers=n,this.body=a,this.fetch=r,this.prepareSendMessagesRequest=s,this.prepareReconnectToStreamRequest=i}async sendMessages({abortSignal:e,...t}){var n,a,r,s,i;const o=await(0,g.hd)(this.body),l=await(0,g.hd)(this.headers),u=await(0,g.hd)(this.credentials),c={...(0,g.qx)(l),...(0,g.qx)(t.headers)},p=await(null==(n=this.prepareSendMessagesRequest)?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...o,...t.body},headers:c,credentials:u,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),d=null!=(a=null==p?void 0:p.api)?a:this.api,m=void 0!==(null==p?void 0:p.headers)?(0,g.qx)(p.headers):c,h=void 0!==(null==p?void 0:p.body)?p.body:{...o,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},f=null!=(r=null==p?void 0:p.credentials)?r:u,v=null!=(s=this.fetch)?s:globalThis.fetch,y=await v(d,{method:"POST",headers:(0,g.WZ)({"Content-Type":"application/json",...m},`ai-sdk/${It}`,(0,g.G1)()),body:JSON.stringify(h),credentials:f,signal:e});if(!y.ok)throw new Error(null!=(i=await y.text())?i:"Failed to fetch the chat response.");if(!y.body)throw new Error("The response body is empty.");return this.processResponseStream(y.body)}async reconnectToStream(e){var t,n,a,r,s;const i=await(0,g.hd)(this.body),o=await(0,g.hd)(this.headers),l=await(0,g.hd)(this.credentials),u={...(0,g.qx)(o),...(0,g.qx)(e.headers)},c=await(null==(t=this.prepareReconnectToStreamRequest)?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...i,...e.body},headers:u,credentials:l,requestMetadata:e.metadata})),p=null!=(n=null==c?void 0:c.api)?n:`${this.api}/${e.chatId}/stream`,d=void 0!==(null==c?void 0:c.headers)?(0,g.qx)(c.headers):u,m=null!=(a=null==c?void 0:c.credentials)?a:l,h=null!=(r=this.fetch)?r:globalThis.fetch,f=await h(p,{method:"GET",headers:(0,g.WZ)(d,`ai-sdk/${It}`,(0,g.G1)()),credentials:m});if(204===f.status)return null;if(!f.ok)throw new Error(null!=(s=await f.text())?s:"Failed to fetch the chat response.");if(!f.body)throw new Error("The response body is empty.");return this.processResponseStream(f.body)}},ea=class extends Qn{constructor(e={}){super(e)}processResponseStream(e){return(0,g._Z)({stream:e,schema:On}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},ta=class{constructor({generateId:e=g.$C,id:t=e(),transport:n=new ea,messageMetadataSchema:a,dataPartSchemas:r,state:s,onError:i,onToolCall:o,onFinish:l,onData:u,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new Jn,this.sendMessage=async(e,t)=>{var n,a,r,s;if(null==e)return void await this.makeRequest({trigger:"submit-message",messageId:null==(n=this.lastMessage)?void 0:n.id,...t});let i;if("text"in e||"files"in e){const t=Array.isArray(e.files)?e.files:await async function(e){if(null==e)return[];if(!(globalThis.FileList&&e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map((async e=>{const{name:t,type:n}=e;return{type:"file",mediaType:n,filename:t,url:await new Promise(((t,n)=>{const a=new FileReader;a.onload=e=>{var n;t(null==(n=e.target)?void 0:n.result)},a.onerror=e=>n(e),a.readAsDataURL(e)}))}})))}(e.files);i={parts:[...t,..."text"in e&&null!=e.text?[{type:"text",text:e.text}]:[]]}}else i=e;if(null!=e.messageId){const t=this.state.messages.findIndex((t=>t.id===e.messageId));if(-1===t)throw new Error(`message with id ${e.messageId} not found`);if("user"!==this.state.messages[t].role)throw new Error(`message with id ${e.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,t+1),this.state.replaceMessage(t,{...i,id:e.messageId,role:null!=(a=i.role)?a:"user",metadata:e.metadata})}else this.state.pushMessage({...i,id:null!=(r=i.id)?r:this.generateId(),role:null!=(s=i.role)?s:"user",metadata:e.metadata});await this.makeRequest({trigger:"submit-message",messageId:e.messageId,...t})},this.regenerate=async({messageId:e,...t}={})=>{const n=null==e?this.state.messages.length-1:this.state.messages.findIndex((t=>t.id===e));if(-1===n)throw new Error(`message ${e} not found`);this.state.messages=this.state.messages.slice(0,"assistant"===this.messages[n].role?n:n+1),await this.makeRequest({trigger:"regenerate-message",messageId:e,...t})},this.resumeStream=async(e={})=>{await this.makeRequest({trigger:"resume-stream",...e})},this.clearError=()=>{"error"===this.status&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:e,approved:t,reason:n})=>this.jobExecutor.run((async()=>{var a,r;const s=this.state.messages,i=s[s.length-1],o=a=>Dn(a)&&"approval-requested"===a.state&&a.approval.id===e?{...a,state:"approval-responded",approval:{id:e,approved:t,reason:n}}:a;this.state.replaceMessage(s.length-1,{...i,parts:i.parts.map(o)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(o)),"streaming"!==this.status&&"submitted"!==this.status&&(null==(a=this.sendAutomaticallyWhen)?void 0:a.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:null==(r=this.lastMessage)?void 0:r.id})})),this.addToolOutput=async({state:e="output-available",tool:t,toolCallId:n,output:a,errorText:r})=>this.jobExecutor.run((async()=>{var t,s;const i=this.state.messages,o=i[i.length-1],l=t=>Dn(t)&&t.toolCallId===n?{...t,state:e,output:a,errorText:r}:t;this.state.replaceMessage(i.length-1,{...o,parts:o.parts.map(l)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(l)),"streaming"!==this.status&&"submitted"!==this.status&&(null==(t=this.sendAutomaticallyWhen)?void 0:t.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:null==(s=this.lastMessage)?void 0:s.id})})),this.addToolResult=this.addToolOutput,this.stop=async()=>{var e;"streaming"!==this.status&&"submitted"!==this.status||(null==(e=this.activeResponse)?void 0:e.abortController)&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=a,this.dataPartSchemas=r,this.state=s,this.onError=i,this.onToolCall=o,this.onFinish=l,this.onData=u,this.sendAutomaticallyWhen=c}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async makeRequest({trigger:e,metadata:t,headers:n,body:a,messageId:r}){var s,i,o,l;this.setStatus({status:"submitted",error:void 0});const u=this.lastMessage;let c=!1,p=!1,d=!1;try{const s={state:qn({lastMessage:this.state.snapshot(u),messageId:this.generateId()}),abortController:new AbortController};let i;if(s.abortController.signal.addEventListener("abort",(()=>{c=!0})),this.activeResponse=s,"resume-stream"===e){const e=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:a});if(null==e)return void this.setStatus({status:"ready"});i=e}else i=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:s.abortController.signal,metadata:t,headers:n,body:a,trigger:e,messageId:r});const o=e=>this.jobExecutor.run((()=>e({state:s.state,write:()=>{var e;this.setStatus({status:"streaming"}),s.state.message.id===(null==(e=this.lastMessage)?void 0:e.id)?this.state.replaceMessage(this.state.messages.length-1,s.state.message):this.state.pushMessage(s.state.message)}})));await zn({stream:Un({stream:i,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:o,onError:e=>{throw e}}),onError:e=>{throw e}}),this.setStatus({status:"ready"})}catch(e){if(c||"AbortError"===e.name)return c=!0,this.setStatus({status:"ready"}),null;d=!0,e instanceof TypeError&&(e.message.toLowerCase().includes("fetch")||e.message.toLowerCase().includes("network"))&&(p=!0),this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:"error",error:e})}finally{try{null==(i=this.onFinish)||i.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:p,isError:d,finishReason:null==(s=this.activeResponse)?void 0:s.state.finishReason})}catch(e){console.error(e)}this.activeResponse=void 0}(null==(o=this.sendAutomaticallyWhen)?void 0:o.call(this,{messages:this.state.messages}))&&!d&&await this.makeRequest({trigger:"submit-message",messageId:null==(l=this.lastMessage)?void 0:l.id,metadata:t,headers:n,body:a})}};function na({messages:e}){const t=e[e.length-1];if(!t)return!1;if("assistant"!==t.role)return!1;const n=t.parts.reduce(((e,t,n)=>"step-start"===t.type?n:e),-1),a=t.parts.slice(n+1).filter(Dn).filter((e=>!e.providerExecuted));return a.filter((e=>"approval-responded"===e.state)).length>0&&a.every((e=>"output-available"===e.state||"output-error"===e.state||"approval-responded"===e.state))}},93766:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BSON_TYPE_ALIASES=void 0,t.BSON_TYPE_ALIASES=[{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"string",value:"string",label:"string",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"object",value:"object",label:"object",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"array",value:"array",label:"array",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"binData",value:"binData",label:"binData",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"objectId",value:"objectId",label:"objectId",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"bool",value:"bool",label:"bool",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"date",value:"date",label:"date",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"null",value:"null",label:"null",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"double",value:"double",label:"double",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"regex",value:"regex",label:"regex",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascript",value:"javascript",label:"javascript",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"javascriptWithScope",value:"javascriptWithScope",label:"javascriptWithScope",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"int",value:"int",label:"int",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"timestamp",value:"timestamp",label:"timestamp",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"long",value:"long",label:"long",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"decimal",value:"decimal",label:"decimal",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"minKey",value:"minKey",label:"minKey",score:1,meta:"bson-type-aliases",version:"3.6.0"},{name:"maxKey",value:"maxKey",label:"maxKey",score:1,meta:"bson-type-aliases",version:"3.6.0"}]},94045:(e,t,n)=>{const a=n(24472);e.exports=(e,t,n)=>a(e,t,"<",n)},94463:(e,t,n)=>{const a=n(40289);e.exports=(e,t,n)=>0===a(e,t,n)},94706:(e,t,n)=>{const a=n(94463),r=n(36749),s=n(43334),i=n(47775),o=n(3449),l=n(9418);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a(e,n,u);case"!=":return r(e,n,u);case">":return s(e,n,u);case">=":return i(e,n,u);case"<":return o(e,n,u);case"<=":return l(e,n,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},94715:(e,t,n)=>{const a=n(17914);e.exports=(e,t)=>{const n=a(e,t);return n&&n.prerelease.length?n.prerelease:null}},94893:(e,t,n)=>{n.d(t,{rS:()=>Xe,EB:()=>Re,bz:()=>ot,YO:()=>mt,zM:()=>at,Ie:()=>Vt,gM:()=>bt,k5:()=>At,Nl:()=>zt,RZ:()=>qt,eu:()=>wt,Zm:()=>pt,ch:()=>st,ai:()=>Qe,Ik:()=>ft,g1:()=>xt,re:()=>vt,Yj:()=>ke,KC:()=>yt,L5:()=>ut});var a=n(49189),r=n(71295);class s{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),a=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of a)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}var i=n(84527),o=n(7263),l=n(72510);const u={major:4,minor:0,patch:0};var c=n(9606).URL;const p=a.xI("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=u;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let r,s=l.QH(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,o=i._zod.check(e);if(o instanceof Promise&&!1===n?.async)throw new a.GT;if(r||o instanceof Promise)r=(r??Promise.resolve()).then((async()=>{await o,e.issues.length!==t&&(s||(s=l.QH(e,t)))}));else{if(e.issues.length===t)continue;s||(s=l.QH(e,t))}}return r?r.then((()=>e)):e};e._zod.run=(n,s)=>{const i=e._zod.parse(n,s);if(i instanceof Promise){if(!1===s.async)throw new a.GT;return i.then((e=>t(e,r,s)))}return t(i,r,s)}}e["~standard"]={validate:t=>{try{const n=(0,i.xL)(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return(0,i.bp)(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),d=a.xI("$ZodString",((e,t)=>{p.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??o.Yj(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch(a){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),m=a.xI("$ZodStringFormat",((e,t)=>{r.ql.init(e,t),d.init(e,t)})),h=a.xI("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=o.Os),m.init(e,t)})),f=a.xI("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=o.uR(e))}else t.pattern??(t.pattern=o.uR());m.init(e,t)})),v=a.xI("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=o.Rp),m.init(e,t)})),g=a.xI("$ZodURL",((e,t)=>{m.init(e,t),e._zod.check=n=>{try{const a=n.value,r=new c(a),s=r.href;return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:o.OI.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(!a.endsWith("/")&&s.endsWith("/")?n.value=s.slice(0,-1):n.value=s)}catch(a){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),y=a.xI("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=o.Zg()),m.init(e,t)})),$=a.xI("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=o.Ak),m.init(e,t)})),b=a.xI("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=o.gF),m.init(e,t)})),_=a.xI("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=o.Gl),m.init(e,t)})),E=a.xI("$ZodULID",((e,t)=>{t.pattern??(t.pattern=o.Z0),m.init(e,t)})),x=a.xI("$ZodXID",((e,t)=>{t.pattern??(t.pattern=o.kM),m.init(e,t)})),S=a.xI("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=o.fO),m.init(e,t)})),A=a.xI("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=o.w$(t)),m.init(e,t)})),I=a.xI("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=o.p6),m.init(e,t)})),w=a.xI("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=o.kB(t)),m.init(e,t)})),T=a.xI("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=o.p0),m.init(e,t)})),N=a.xI("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=o.uX),m.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),O=a.xI("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=o.ug),m.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv6"})),e._zod.check=n=>{try{new c(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),k=a.xI("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=o.zr),m.init(e,t)})),R=a.xI("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=o.l7),m.init(e,t),e._zod.check=n=>{const[a,r]=n.value.split("/");try{if(!r)throw new Error;const e=Number(r);if(`${e}`!==r)throw new Error;if(e<0||e>128)throw new Error;new c(`http://[${a}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function C(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const P=a.xI("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=o.K3),m.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{C(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),L=a.xI("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=o.r0),m.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!o.r0.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return C(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),j=a.xI("$ZodE164",((e,t)=>{t.pattern??(t.pattern=o.hQ),m.init(e,t)})),M=a.xI("$ZodJWT",((e,t)=>{m.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[a]=n;if(!a)return!1;const r=JSON.parse(atob(a));return!("typ"in r&&"JWT"!==r?.typ||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),D=a.xI("$ZodNumber",((e,t)=>{p.init(e,t),e._zod.pattern=e._zod.bag.pattern??o.ai,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const r=n.value;if("number"==typeof r&&!Number.isNaN(r)&&Number.isFinite(r))return n;const s="number"==typeof r?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...s?{received:s}:{}}),n}})),Y=a.xI("$ZodNumber",((e,t)=>{r.KH.init(e,t),D.init(e,t)})),F=a.xI("$ZodBoolean",((e,t)=>{p.init(e,t),e._zod.pattern=o.zM,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const r=n.value;return"boolean"==typeof r||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}})),q=a.xI("$ZodNull",((e,t)=>{p.init(e,t),e._zod.pattern=o.ch,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{const a=t.value;return null===a||t.issues.push({expected:"null",code:"invalid_type",input:a,inst:e}),t}})),U=a.xI("$ZodAny",((e,t)=>{p.init(e,t),e._zod.parse=e=>e})),V=a.xI("$ZodUnknown",((e,t)=>{p.init(e,t),e._zod.parse=e=>e})),z=a.xI("$ZodNever",((e,t)=>{p.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}));function Z(e,t,n){e.issues.length&&t.issues.push(...l.lQ(n,e.issues)),t.value[n]=e.value}const B=a.xI("$ZodArray",((e,t)=>{p.init(e,t),e._zod.parse=(n,a)=>{const r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);const s=[];for(let e=0;e<r.length;e++){const i=r[e],o=t.element._zod.run({value:i,issues:[]},a);o instanceof Promise?s.push(o.then((t=>Z(t,n,e)))):Z(o,n,e)}return s.length?Promise.all(s).then((()=>n)):n}}));function G(e,t,n){e.issues.length&&t.issues.push(...l.lQ(n,e.issues)),t.value[n]=e.value}function W(e,t,n,a){e.issues.length?void 0===a[n]?t.value[n]=n in a?void 0:e.value:t.issues.push(...l.lQ(n,e.issues)):void 0===e.value?n in a&&(t.value[n]=void 0):t.value[n]=e.value}const K=a.xI("$ZodObject",((e,t)=>{p.init(e,t);const n=l.PO((()=>{const e=Object.keys(t.shape);for(const n of e)if(!(t.shape[n]instanceof p))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=l.NM(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}));let r;l.gJ(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const a=e[t]._zod;if(a.values){n[t]??(n[t]=new Set);for(const e of a.values)n[t].add(e)}}return n}));const i=l.Gv,o=!a.cr.jitless,u=l.hI,c=o&&u.value,d=t.catchall;let m;e._zod.parse=(a,u)=>{m??(m=n.value);const p=a.value;if(!i(p))return a.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),a;const h=[];if(o&&c&&!1===u?.async&&!0!==u.jitless)r||(r=(e=>{const t=new s(["shape","payload","ctx"]),a=n.value,r=e=>{const t=l.UQ(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let o=0;for(const e of a.keys)i[e]="key_"+o++;t.write("const newResult = {}");for(const e of a.keys)if(a.optionalKeys.has(e)){const n=i[e];t.write(`const ${n} = ${r(e)};`);const a=l.UQ(e);t.write(`\n if (${n}.issues.length) {\n if (input[${a}] === undefined) {\n if (${a} in input) {\n newResult[${a}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${n}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${a}, ...iss.path] : [${a}],\n }))\n );\n }\n } else if (${n}.value === undefined) {\n if (${a} in input) newResult[${a}] = undefined;\n } else {\n newResult[${a}] = ${n}.value;\n }\n `)}else{const n=i[e];t.write(`const ${n} = ${r(e)};`),t.write(`\n if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${l.UQ(e)}, ...iss.path] : [${l.UQ(e)}]\n })));`),t.write(`newResult[${l.UQ(e)}] = ${n}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");const u=t.compile();return(t,n)=>u(e,t,n)})(t.shape)),a=r(a,u);else{a.value={};const e=m.shape;for(const t of m.keys){const n=e[t],r=n._zod.run({value:p[t],issues:[]},u),s="optional"===n._zod.optin&&"optional"===n._zod.optout;r instanceof Promise?h.push(r.then((e=>s?W(e,a,t,p):G(e,a,t)))):s?W(r,a,t,p):G(r,a,t)}}if(!d)return h.length?Promise.all(h).then((()=>a)):a;const f=[],v=m.keySet,g=d._zod,y=g.def.type;for(const e of Object.keys(p)){if(v.has(e))continue;if("never"===y){f.push(e);continue}const t=g.run({value:p[e],issues:[]},u);t instanceof Promise?h.push(t.then((t=>G(t,a,e)))):G(t,a,e)}return f.length&&a.issues.push({code:"unrecognized_keys",keys:f,input:p,inst:e}),h.length?Promise.all(h).then((()=>a)):a}}));function H(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>l.iR(e,r,a.$W())))))}),t}const J=a.xI("$ZodUnion",((e,t)=>{p.init(e,t),l.gJ(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),l.gJ(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),l.gJ(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),l.gJ(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>l.p6(e.source))).join("|")})$`)}})),e._zod.parse=(n,a)=>{let r=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:n.value,issues:[]},a);if(t instanceof Promise)s.push(t),r=!0;else{if(0===t.issues.length)return t;s.push(t)}}return r?Promise.all(s).then((t=>H(t,n,e,a))):H(s,n,e,a)}})),X=a.xI("$ZodDiscriminatedUnion",((e,t)=>{J.init(e,t);const n=e._zod.parse;l.gJ(e._zod,"propValues",(()=>{const e={};for(const n of t.options){const a=n._zod.propValues;if(!a||0===Object.keys(a).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(a)){e[t]||(e[t]=new Set);for(const a of n)e[t].add(a)}}return e}));const a=l.PO((()=>{const e=t.options,n=new Map;for(const a of e){const e=a._zod.propValues[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,a)}}return n}));e._zod.parse=(r,s)=>{const i=r.value;if(!l.Gv(i))return r.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),r;const o=a.value.get(i?.[t.discriminator]);return o?o._zod.run(r,s):t.unionFallback?n(r,s):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:i,path:[t.discriminator],inst:e}),r)}})),Q=a.xI("$ZodIntersection",((e,t)=>{p.init(e,t),e._zod.parse=(e,n)=>{const a=e.value,r=t.left._zod.run({value:a,issues:[]},n),s=t.right._zod.run({value:a,issues:[]},n);return r instanceof Promise||s instanceof Promise?Promise.all([r,s]).then((([t,n])=>te(e,t,n))):te(e,r,s)}}));function ee(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(l.Qd(e)&&l.Qd(t)){const n=Object.keys(t),a=Object.keys(e).filter((e=>-1!==n.indexOf(e))),r={...e,...t};for(const n of a){const a=ee(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r[n]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const r=ee(e[a],t[a]);if(!r.valid)return{valid:!1,mergeErrorPath:[a,...r.mergeErrorPath]};n.push(r.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function te(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),l.QH(e))return e;const a=ee(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const ne=a.xI("$ZodRecord",((e,t)=>{p.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!l.Qd(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[];if(t.keyType._zod.values){const a=t.keyType._zod.values;n.value={};for(const e of a)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const a=t.valueType._zod.run({value:s[e],issues:[]},r);a instanceof Promise?i.push(a.then((t=>{t.issues.length&&n.issues.push(...l.lQ(e,t.issues)),n.value[e]=t.value}))):(a.issues.length&&n.issues.push(...l.lQ(e,a.issues)),n.value[e]=a.value)}let o;for(const e in s)a.has(e)||(o=o??[],o.push(e));o&&o.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:o})}else{n.value={};for(const o of Reflect.ownKeys(s)){if("__proto__"===o)continue;const u=t.keyType._zod.run({value:o,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:u.issues.map((e=>l.iR(e,r,a.$W()))),input:o,path:[o],inst:e}),n.value[u.value]=u.value;continue}const c=t.valueType._zod.run({value:s[o],issues:[]},r);c instanceof Promise?i.push(c.then((e=>{e.issues.length&&n.issues.push(...l.lQ(o,e.issues)),n.value[u.value]=e.value}))):(c.issues.length&&n.issues.push(...l.lQ(o,c.issues)),n.value[u.value]=c.value)}}return i.length?Promise.all(i).then((()=>n)):n}})),ae=a.xI("$ZodEnum",((e,t)=>{p.init(e,t);const n=l.w5(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter((e=>l.qQ.has(typeof e))).map((e=>"string"==typeof e?l.$f(e):e.toString())).join("|")})$`),e._zod.parse=(t,a)=>{const r=t.value;return e._zod.values.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),re=a.xI("$ZodLiteral",((e,t)=>{p.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map((e=>"string"==typeof e?l.$f(e):e?e.toString():String(e))).join("|")})$`),e._zod.parse=(n,a)=>{const r=n.value;return e._zod.values.has(r)||n.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),n}})),se=a.xI("$ZodTransform",((e,t)=>{p.init(e,t),e._zod.parse=(e,n)=>{const r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then((t=>(e.value=t,e)));if(r instanceof Promise)throw new a.GT;return e.value=r,e}})),ie=a.xI("$ZodOptional",((e,t)=>{p.init(e,t),e._zod.optin="optional",e._zod.optout="optional",l.gJ(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),l.gJ(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${l.p6(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,n):void 0===e.value?e:t.innerType._zod.run(e,n)})),oe=a.xI("$ZodNullable",((e,t)=>{p.init(e,t),l.gJ(e._zod,"optin",(()=>t.innerType._zod.optin)),l.gJ(e._zod,"optout",(()=>t.innerType._zod.optout)),l.gJ(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${l.p6(e.source)}|null)$`):void 0})),l.gJ(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),le=a.xI("$ZodDefault",((e,t)=>{p.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if(void 0===e.value)return e.value=t.defaultValue,e;const a=t.innerType._zod.run(e,n);return a instanceof Promise?a.then((e=>ue(e,t))):ue(a,t)}}));function ue(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const ce=a.xI("$ZodPrefault",((e,t)=>{p.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),pe=a.xI("$ZodNonOptional",((e,t)=>{p.init(e,t),l.gJ(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,a)=>{const r=t.innerType._zod.run(n,a);return r instanceof Promise?r.then((t=>de(t,e))):de(r,e)}}));function de(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const me=a.xI("$ZodCatch",((e,t)=>{p.init(e,t),e._zod.optin="optional",l.gJ(e._zod,"optout",(()=>t.innerType._zod.optout)),l.gJ(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then((r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map((e=>l.iR(e,n,a.$W())))},input:e.value}),e.issues=[]),e))):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map((e=>l.iR(e,n,a.$W())))},input:e.value}),e.issues=[]),e)}})),he=a.xI("$ZodPipe",((e,t)=>{p.init(e,t),l.gJ(e._zod,"values",(()=>t.in._zod.values)),l.gJ(e._zod,"optin",(()=>t.in._zod.optin)),l.gJ(e._zod,"optout",(()=>t.out._zod.optout)),e._zod.parse=(e,n)=>{const a=t.in._zod.run(e,n);return a instanceof Promise?a.then((e=>fe(e,t,n))):fe(a,t,n)}}));function fe(e,t,n){return l.QH(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const ve=a.xI("$ZodReadonly",((e,t)=>{p.init(e,t),l.gJ(e._zod,"propValues",(()=>t.innerType._zod.propValues)),l.gJ(e._zod,"values",(()=>t.innerType._zod.values)),l.gJ(e._zod,"optin",(()=>t.innerType._zod.optin)),l.gJ(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{const a=t.innerType._zod.run(e,n);return a instanceof Promise?a.then(ge):ge(a)}}));function ge(e){return e.value=Object.freeze(e.value),e}const ye=a.xI("$ZodLazy",((e,t)=>{p.init(e,t),l.gJ(e._zod,"innerType",(()=>t.getter())),l.gJ(e._zod,"pattern",(()=>e._zod.innerType._zod.pattern)),l.gJ(e._zod,"propValues",(()=>e._zod.innerType._zod.propValues)),l.gJ(e._zod,"optin",(()=>e._zod.innerType._zod.optin)),l.gJ(e._zod,"optout",(()=>e._zod.innerType._zod.optout)),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)})),$e=a.xI("$ZodCustom",((e,t)=>{r.QP.init(e,t),p.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const a=n.value,r=t.fn(a);if(r instanceof Promise)return r.then((t=>be(t,n,a,e)));be(r,n,a,e)}}));function be(e,t,n,a){if(!e){const e={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(e.params=a._zod.def.params),t.issues.push(l.sn(e))}}var _e=n(39581),Ee=n(1280);const xe=a.xI("ZodISODateTime",((e,t)=>{A.init(e,t),Re.init(e,t)})),Se=a.xI("ZodISODate",((e,t)=>{I.init(e,t),Re.init(e,t)})),Ae=a.xI("ZodISOTime",((e,t)=>{w.init(e,t),Re.init(e,t)})),Ie=a.xI("ZodISODuration",((e,t)=>{T.init(e,t),Re.init(e,t)}));var we=n(2420);const Te=a.xI("ZodType",((e,t)=>(p.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>l.o8(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>we.qg(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>we.xL(e,t,n),e.parseAsync=async(t,n)=>we.EJ(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>we.bp(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(function(e,t={}){return Ee.fU(Ut,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e){const t=new r.QP({check:"custom"});return t._zod.check=e,t}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(l.sn(e,n.value,t._zod.def));else{const a=e;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!t._zod.def.abort),n.issues.push(l.sn(a))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Ee.bS(t)),e.optional=()=>Ot(e),e.nullable=()=>Rt(e),e.nullish=()=>Ot(Rt(e)),e.nonoptional=t=>function(e,t){return new Lt({type:"nonoptional",innerType:e,...l.A2(t)})}(e,t),e.array=()=>mt(e),e.or=t=>yt([e,t]),e.and=t=>new _t({type:"intersection",left:e,right:t}),e.transform=t=>Dt(e,new Tt({type:"transform",transform:t})),e.default=t=>{return n=t,new Ct({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.prefault=t=>{return n=t,new Pt({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.catch=t=>{return new jt({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>Dt(e,t),e.readonly=()=>new Yt({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return _e.fd.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>_e.fd.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return _e.fd.get(e);const n=e.clone();return _e.fd.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),Ne=a.xI("_ZodString",((e,t)=>{d.init(e,t),Te.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Ee.Fk(...t)),e.includes=(...t)=>e.check(Ee.dR(...t)),e.startsWith=(...t)=>e.check(Ee.$S(...t)),e.endsWith=(...t)=>e.check(Ee.ER(...t)),e.min=(...t)=>e.check(Ee.m9(...t)),e.max=(...t)=>e.check(Ee.Eb(...t)),e.length=(...t)=>e.check(Ee.YA(...t)),e.nonempty=(...t)=>e.check(Ee.m9(1,...t)),e.lowercase=t=>e.check(Ee.hH(t)),e.uppercase=t=>e.check(Ee.qF(t)),e.trim=()=>e.check(Ee.WN()),e.normalize=(...t)=>e.check(Ee.lo(...t)),e.toLowerCase=()=>e.check(Ee.Il()),e.toUpperCase=()=>e.check(Ee.xY())})),Oe=a.xI("ZodString",((e,t)=>{d.init(e,t),Ne.init(e,t),e.email=t=>e.check(Ee.Mu(Ce,t)),e.url=t=>e.check(Ee.Fn(je,t)),e.jwt=t=>e.check(Ee.rk(Je,t)),e.emoji=t=>e.check(Ee.aC(Me,t)),e.guid=t=>e.check(Ee.tB(Pe,t)),e.uuid=t=>e.check(Ee.Be(Le,t)),e.uuidv4=t=>e.check(Ee.nA(Le,t)),e.uuidv6=t=>e.check(Ee.pY(Le,t)),e.uuidv7=t=>e.check(Ee.wA(Le,t)),e.nanoid=t=>e.check(Ee.Dl(De,t)),e.guid=t=>e.check(Ee.tB(Pe,t)),e.cuid=t=>e.check(Ee.fs(Ye,t)),e.cuid2=t=>e.check(Ee.Bj(Fe,t)),e.ulid=t=>e.check(Ee.Ct(qe,t)),e.base64=t=>e.check(Ee.rt(We,t)),e.base64url=t=>e.check(Ee.cU(Ke,t)),e.xid=t=>e.check(Ee.Pw(Ue,t)),e.ksuid=t=>e.check(Ee._z(Ve,t)),e.ipv4=t=>e.check(Ee.Ny(ze,t)),e.ipv6=t=>e.check(Ee.$O(Ze,t)),e.cidrv4=t=>e.check(Ee.Uy(Be,t)),e.cidrv6=t=>e.check(Ee.gP(Ge,t)),e.e164=t=>e.check(Ee.KB(He,t)),e.datetime=t=>e.check(function(e){return Ee.G1(xe,e)}(t)),e.date=t=>e.check(function(e){return Ee.db(Se,e)}(t)),e.time=t=>e.check(function(e){return Ee.Kn(Ae,e)}(t)),e.duration=t=>e.check(function(e){return Ee.f2(Ie,e)}(t))}));function ke(e){return Ee.Rl(Oe,e)}const Re=a.xI("ZodStringFormat",((e,t)=>{m.init(e,t),Ne.init(e,t)})),Ce=a.xI("ZodEmail",((e,t)=>{v.init(e,t),Re.init(e,t)})),Pe=a.xI("ZodGUID",((e,t)=>{h.init(e,t),Re.init(e,t)})),Le=a.xI("ZodUUID",((e,t)=>{f.init(e,t),Re.init(e,t)})),je=a.xI("ZodURL",((e,t)=>{g.init(e,t),Re.init(e,t)})),Me=a.xI("ZodEmoji",((e,t)=>{y.init(e,t),Re.init(e,t)})),De=a.xI("ZodNanoID",((e,t)=>{$.init(e,t),Re.init(e,t)})),Ye=a.xI("ZodCUID",((e,t)=>{b.init(e,t),Re.init(e,t)})),Fe=a.xI("ZodCUID2",((e,t)=>{_.init(e,t),Re.init(e,t)})),qe=a.xI("ZodULID",((e,t)=>{E.init(e,t),Re.init(e,t)})),Ue=a.xI("ZodXID",((e,t)=>{x.init(e,t),Re.init(e,t)})),Ve=a.xI("ZodKSUID",((e,t)=>{S.init(e,t),Re.init(e,t)})),ze=a.xI("ZodIPv4",((e,t)=>{N.init(e,t),Re.init(e,t)})),Ze=a.xI("ZodIPv6",((e,t)=>{O.init(e,t),Re.init(e,t)})),Be=a.xI("ZodCIDRv4",((e,t)=>{k.init(e,t),Re.init(e,t)})),Ge=a.xI("ZodCIDRv6",((e,t)=>{R.init(e,t),Re.init(e,t)})),We=a.xI("ZodBase64",((e,t)=>{P.init(e,t),Re.init(e,t)})),Ke=a.xI("ZodBase64URL",((e,t)=>{L.init(e,t),Re.init(e,t)})),He=a.xI("ZodE164",((e,t)=>{j.init(e,t),Re.init(e,t)})),Je=a.xI("ZodJWT",((e,t)=>{M.init(e,t),Re.init(e,t)})),Xe=a.xI("ZodNumber",((e,t)=>{D.init(e,t),Te.init(e,t),e.gt=(t,n)=>e.check(Ee.Tx(t,n)),e.gte=(t,n)=>e.check(Ee.qm(t,n)),e.min=(t,n)=>e.check(Ee.qm(t,n)),e.lt=(t,n)=>e.check(Ee.Au(t,n)),e.lte=(t,n)=>e.check(Ee.Zm(t,n)),e.max=(t,n)=>e.check(Ee.Zm(t,n)),e.int=t=>e.check(tt(t)),e.safe=t=>e.check(tt(t)),e.positive=t=>e.check(Ee.Tx(0,t)),e.nonnegative=t=>e.check(Ee.qm(0,t)),e.negative=t=>e.check(Ee.Au(0,t)),e.nonpositive=t=>e.check(Ee.Zm(0,t)),e.multipleOf=(t,n)=>e.check(Ee.Hi(t,n)),e.step=(t,n)=>e.check(Ee.Hi(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Qe(e){return Ee.F7(Xe,e)}const et=a.xI("ZodNumberFormat",((e,t)=>{Y.init(e,t),Xe.init(e,t)}));function tt(e){return Ee.LK(et,e)}const nt=a.xI("ZodBoolean",((e,t)=>{F.init(e,t),Te.init(e,t)}));function at(e){return Ee._L(nt,e)}const rt=a.xI("ZodNull",((e,t)=>{q.init(e,t),Te.init(e,t)}));function st(e){return Ee.jw(rt,e)}const it=a.xI("ZodAny",((e,t)=>{U.init(e,t),Te.init(e,t)}));function ot(){return Ee.KA(it)}const lt=a.xI("ZodUnknown",((e,t)=>{V.init(e,t),Te.init(e,t)}));function ut(){return Ee.em(lt)}const ct=a.xI("ZodNever",((e,t)=>{z.init(e,t),Te.init(e,t)}));function pt(e){return Ee.G8(ct,e)}const dt=a.xI("ZodArray",((e,t)=>{B.init(e,t),Te.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Ee.m9(t,n)),e.nonempty=t=>e.check(Ee.m9(1,t)),e.max=(t,n)=>e.check(Ee.Eb(t,n)),e.length=(t,n)=>e.check(Ee.YA(t,n)),e.unwrap=()=>e.element}));function mt(e,t){return Ee.dZ(dt,e,t)}const ht=a.xI("ZodObject",((e,t)=>{K.init(e,t),Te.init(e,t),l.gJ(e,"shape",(()=>t.shape)),e.keyof=()=>At(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ut()}),e.loose=()=>e.clone({...e._zod.def,catchall:ut()}),e.strict=()=>e.clone({...e._zod.def,catchall:pt()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>l.X$(e,t),e.merge=t=>l.h1(e,t),e.pick=t=>l.Up(e,t),e.omit=t=>l.cJ(e,t),e.partial=(...t)=>l.OH(Nt,e,t[0]),e.required=(...t)=>l.mw(Lt,e,t[0])}));function ft(e,t){const n={type:"object",get shape(){return l.Vy(this,"shape",{...e}),this.shape},...l.A2(t)};return new ht(n)}function vt(e,t){return new ht({type:"object",get shape(){return l.Vy(this,"shape",{...e}),this.shape},catchall:pt(),...l.A2(t)})}const gt=a.xI("ZodUnion",((e,t)=>{J.init(e,t),Te.init(e,t),e.options=t.options}));function yt(e,t){return new gt({type:"union",options:e,...l.A2(t)})}const $t=a.xI("ZodDiscriminatedUnion",((e,t)=>{gt.init(e,t),X.init(e,t)}));function bt(e,t,n){return new $t({type:"union",options:t,discriminator:e,...l.A2(n)})}const _t=a.xI("ZodIntersection",((e,t)=>{Q.init(e,t),Te.init(e,t)})),Et=a.xI("ZodRecord",((e,t)=>{ne.init(e,t),Te.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}));function xt(e,t,n){return new Et({type:"record",keyType:e,valueType:t,...l.A2(n)})}const St=a.xI("ZodEnum",((e,t)=>{ae.init(e,t),Te.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,a)=>{const r={};for(const a of e){if(!n.has(a))throw new Error(`Key ${a} not found in enum`);r[a]=t.entries[a]}return new St({...t,checks:[],...l.A2(a),entries:r})},e.exclude=(e,a)=>{const r={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete r[t]}return new St({...t,checks:[],...l.A2(a),entries:r})}}));function At(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new St({type:"enum",entries:n,...l.A2(t)})}const It=a.xI("ZodLiteral",((e,t)=>{re.init(e,t),Te.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}));function wt(e,t){return new It({type:"literal",values:Array.isArray(e)?e:[e],...l.A2(t)})}const Tt=a.xI("ZodTransform",((e,t)=>{se.init(e,t),Te.init(e,t),e._zod.parse=(n,a)=>{n.addIssue=a=>{if("string"==typeof a)n.issues.push(l.sn(a,n.value,t));else{const t=a;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),t.continue??(t.continue=!0),n.issues.push(l.sn(t))}};const r=t.transform(n.value,n);return r instanceof Promise?r.then((e=>(n.value=e,n))):(n.value=r,n)}}));const Nt=a.xI("ZodOptional",((e,t)=>{ie.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Ot(e){return new Nt({type:"optional",innerType:e})}const kt=a.xI("ZodNullable",((e,t)=>{oe.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Rt(e){return new kt({type:"nullable",innerType:e})}const Ct=a.xI("ZodDefault",((e,t)=>{le.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Pt=a.xI("ZodPrefault",((e,t)=>{ce.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Lt=a.xI("ZodNonOptional",((e,t)=>{pe.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.innerType})),jt=a.xI("ZodCatch",((e,t)=>{me.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),Mt=a.xI("ZodPipe",((e,t)=>{he.init(e,t),Te.init(e,t),e.in=t.in,e.out=t.out}));function Dt(e,t){return new Mt({type:"pipe",in:e,out:t})}const Yt=a.xI("ZodReadonly",((e,t)=>{ve.init(e,t),Te.init(e,t)})),Ft=a.xI("ZodLazy",((e,t)=>{ye.init(e,t),Te.init(e,t),e.unwrap=()=>e._zod.def.getter()}));function qt(e){return new Ft({type:"lazy",getter:e})}const Ut=a.xI("ZodCustom",((e,t)=>{$e.init(e,t),Te.init(e,t)}));function Vt(e,t){return Ee.FO(Ut,e??(()=>!0),t)}function zt(e,t={error:`Input not instance of ${e.name}`}){const n=new Ut({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...l.A2(t)});return n._zod.bag.Class=e,n}},94916:(e,t,n)=>{const a=n(95323),r=n(75732),{ANY:s}=r,i=n(67338),o=n(70692),l=[new r(">=0.0.0-0")],u=[new r(">=0.0.0")],c=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=n.includePrerelease?l:u}if(1===t.length&&t[0].semver===s){if(n.includePrerelease)return!0;t=u}const a=new Set;let r,c,m,h,f,v,g;for(const t of e)">"===t.operator||">="===t.operator?r=p(r,t,n):"<"===t.operator||"<="===t.operator?c=d(c,t,n):a.add(t.semver);if(a.size>1)return null;if(r&&c){if(m=o(r.semver,c.semver,n),m>0)return null;if(0===m&&(">="!==r.operator||"<="!==c.operator))return null}for(const e of a){if(r&&!i(e,String(r),n))return null;if(c&&!i(e,String(c),n))return null;for(const a of t)if(!i(e,String(a),n))return!1;return!0}let y=!(!c||n.includePrerelease||!c.semver.prerelease.length)&&c.semver,$=!(!r||n.includePrerelease||!r.semver.prerelease.length)&&r.semver;y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,v=v||"<"===e.operator||"<="===e.operator,r)if($&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===$.major&&e.semver.minor===$.minor&&e.semver.patch===$.patch&&($=!1),">"===e.operator||">="===e.operator){if(h=p(r,e,n),h===e&&h!==r)return!1}else if(">="===r.operator&&!i(r.semver,String(e),n))return!1;if(c)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(f=d(c,e,n),f===e&&f!==c)return!1}else if("<="===c.operator&&!i(c.semver,String(e),n))return!1;if(!e.operator&&(c||r)&&0!==m)return!1}return!(r&&v&&!c&&0!==m||c&&g&&!r&&0!==m||$||y)},p=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a>0?e:a<0||">"===t.operator&&">="===e.operator?t:e},d=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a<0?e:a>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new a(e,n),t=new a(t,n);let r=!1;e:for(const a of e.set){for(const e of t.set){const t=c(a,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},95153:function(e,t,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_PIPELINE_UTILS=void 0;const r=a(n(51699)),s="8.0.0",i="8.1.0";t.VIEW_PIPELINE_UTILS={MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_DE:s,MIN_VERSION_FOR_VIEW_SEARCH_COMPATIBILITY_COMPASS:i,isPipelineSearchQueryable:e=>{for(const t of e){const e=Object.keys(t)[0];if("$addFields"!==e&&"$set"!==e&&"$match"!==e)return!1;if("$match"===e){const e=t.$match,n=Object.keys(e||{});if(1!==n.length||!n.includes("$expr"))return!1}}return!0},isVersionSearchCompatibleForViewsDataExplorer:e=>{try{return r.default.gte(e,s)}catch{return!1}},isVersionSearchCompatibleForViewsCompass:e=>{try{return r.default.gte(e,i)}catch{return!1}}}},95323:(e,t,n)=>{const a=/\s+/g;class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(a," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&v))+":"+e,n=s.get(t);if(n)return n;const a=this.options.loose,r=a?c[p.HYPHENRANGELOOSE]:c[p.HYPHENRANGE];e=e.replace(r,O(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(c[p.COMPARATORTRIM],d),l("comparator trim",e),e=e.replace(c[p.TILDETRIM],m),l("tilde trim",e),e=e.replace(c[p.CARETTRIM],h),l("caret trim",e);let i=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>N(e,this.options)));a&&(i=i.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(c[p.COMPARATORLOOSE]))))),l("range list",i);const u=new Map,y=i.map((e=>new o(e,this.options)));for(const e of y){if(g(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");const $=[...u.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>$(n,t)&&e.set.some((e=>$(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const s=new(n(97382)),i=n(43639),o=n(75732),l=n(49764),u=n(57544),{safeRe:c,t:p,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:h}=n(25522),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:v}=n(66078),g=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,$=(e,t)=>{let n=!0;const a=e.slice();let r=a.pop();for(;n&&a.length;)n=a.every((e=>r.intersects(e,t))),r=a.pop();return n},b=(e,t)=>(l("comp",e,t),e=S(e,t),l("caret",e),e=E(e,t),l("tildes",e),e=I(e,t),l("xrange",e),e=T(e,t),l("stars",e),e),_=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{const n=t.loose?c[p.TILDELOOSE]:c[p.TILDE];return e.replace(n,((t,n,a,r,s)=>{let i;return l("tilde",e,t,n,a,r,s),_(n)?i="":_(a)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:_(r)?i=`>=${n}.${a}.0 <${n}.${+a+1}.0-0`:s?(l("replaceTilde pr",s),i=`>=${n}.${a}.${r}-${s} <${n}.${+a+1}.0-0`):i=`>=${n}.${a}.${r} <${n}.${+a+1}.0-0`,l("tilde return",i),i}))},S=(e,t)=>e.trim().split(/\s+/).map((e=>A(e,t))).join(" "),A=(e,t)=>{l("caret",e,t);const n=t.loose?c[p.CARETLOOSE]:c[p.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,((t,n,r,s,i)=>{let o;return l("caret",e,t,n,r,s,i),_(n)?o="":_(r)?o=`>=${n}.0.0${a} <${+n+1}.0.0-0`:_(s)?o="0"===n?`>=${n}.${r}.0${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${a} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),o="0"===n?"0"===r?`>=${n}.${r}.${s}-${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${i} <${+n+1}.0.0-0`):(l("no pr"),o="0"===n?"0"===r?`>=${n}.${r}.${s}${a} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${a} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),l("caret return",o),o}))},I=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>w(e,t))).join(" ")),w=(e,t)=>{e=e.trim();const n=t.loose?c[p.XRANGELOOSE]:c[p.XRANGE];return e.replace(n,((n,a,r,s,i,o)=>{l("xRange",e,n,a,r,s,i,o);const u=_(r),c=u||_(s),p=c||_(i),d=p;return"="===a&&d&&(a=""),o=t.includePrerelease?"-0":"",u?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&d?(c&&(s=0),i=0,">"===a?(a=">=",c?(r=+r+1,s=0,i=0):(s=+s+1,i=0)):"<="===a&&(a="<",c?r=+r+1:s=+s+1),"<"===a&&(o="-0"),n=`${a+r}.${s}.${i}${o}`):c?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:p&&(n=`>=${r}.${s}.0${o} <${r}.${+s+1}.0-0`),l("xRange return",n),n}))},T=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[p.STAR],"")),N=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),O=e=>(t,n,a,r,s,i,o,l,u,c,p,d)=>`${n=_(a)?"":_(r)?`>=${a}.0.0${e?"-0":""}`:_(s)?`>=${a}.${r}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=_(u)?"":_(c)?`<${+u+1}.0.0-0`:_(p)?`<${u}.${+c+1}.0-0`:d?`<=${u}.${c}.${p}-${d}`:e?`<${u}.${c}.${+p+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const a=e[n].semver;if(a.major===t.major&&a.minor===t.minor&&a.patch===t.patch)return!0}return!1}return!0}},95593:e=>{var t=[];function n(e){for(var n=-1,a=0;a<t.length;a++)if(t[a].identifier===e){n=a;break}return n}function a(e,a){for(var s={},i=[],o=0;o<e.length;o++){var l=e[o],u=a.base?l[0]+a.base:l[0],c=s[u]||0,p="".concat(u," ").concat(c);s[u]=c+1;var d=n(p),m={css:l[1],media:l[2],sourceMap:l[3]};-1!==d?(t[d].references++,t[d].updater(m)):t.push({identifier:p,updater:r(m,a),references:1}),i.push(p)}return i}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var s=a(e=e||[],r=r||{});return function(e){e=e||[];for(var i=0;i<s.length;i++){var o=n(s[i]);t[o].references--}for(var l=a(e,r),u=0;u<s.length;u++){var c=n(s[u]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}s=l}}},95831:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VALIDATION_TEMPLATE=void 0,t.VALIDATION_TEMPLATE='/**\n * This is a starter template for a schema validation rule for a collection.\n * More information on schema validation rules can be found at:\n * https://www.mongodb.com/docs/manual/core/schema-validation/\n */\n{\n $jsonSchema: {\n title: "Library.books",\n bsonType: "object",\n required: ["fieldname1", "fieldname2"],\n properties: {\n fieldname1: {\n bsonType: "string",\n description: "Fieldname1 must be a string",\n },\n fieldname2: {\n bsonType: "int",\n description: "Fieldname2 must be an integer",\n },\n arrayFieldName: {\n bsonType: "array",\n items: {\n bsonType: "string"\n },\n description: "arrayFieldName must be an array of strings"\n },\n }\n }\n}'},95869:(e,t,n)=>{var a=n(65994).e;const r="object"==typeof a&&a.env&&a.env.NODE_DEBUG&&/\bsemver\b/i.test(a.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},96082:(e,t,n)=>{const a=Symbol("SemVer ANY");class r{static get ANY(){return a}constructor(e,t){if(t=s(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===a?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new c(n[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=s(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=r;const s=n(8573),{safeRe:i,t:o}=n(18104),l=n(94706),u=n(72082),c=n(41694),p=n(71333)},96506:(e,t,n)=>{const a=Symbol("SemVer ANY");class r{static get ANY(){return a}constructor(e,t){if(t=s(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===a?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new c(n[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=s(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=r;const s=n(34773),{safeRe:i,t:o}=n(68752),l=n(39149),u=n(52378),c=n(9350),p=n(33629)},96651:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EXPRESSION_OPERATORS=void 0,t.EXPRESSION_OPERATORS=[{name:"$abs",value:"$abs",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$accumulator",value:"$accumulator",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$add",value:"$add",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$allElementsTrue",value:"$allElementsTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$and",value:"$and",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$anyElementTrue",value:"$anyElementTrue",score:1,meta:"expr:set",version:"2.6.0"},{name:"$arrayElemAt",value:"$arrayElemAt",score:1,meta:"expr:array",version:"3.2.0"},{name:"$arrayToObject",value:"$arrayToObject",score:1,meta:"expr:array",version:"3.4.4"},{name:"$binarySize",value:"$binarySize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$bsonSize",value:"$bsonSize",score:1,meta:"expr:obj",version:"4.4.0"},{name:"$ceil",value:"$ceil",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$cmp",value:"$cmp",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$concat",value:"$concat",score:1,meta:"expr:string",version:"2.4.0"},{name:"$concatArrays",value:"$concatArrays",score:1,meta:"expr:array",version:"3.2.0"},{name:"$cond",value:"$cond",score:1,meta:"expr:cond",version:"2.6.0"},{name:"$dateAdd",value:"$dateAdd",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateDiff",value:"$dateDiff",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateFromParts",value:"$dateFromParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateFromString",value:"$dateFromString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateSubtract",value:"$dateSubtract",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dateToParts",value:"$dateToParts",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.6.0"},{name:"$dateTrunc",value:"$dateTrunc",score:1,meta:"expr:date",version:"5.0.0"},{name:"$dayOfMonth",value:"$dayOfMonth",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfWeek",value:"$dayOfWeek",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dayOfYear",value:"$dayOfYear",score:1,meta:"expr:date",version:"2.2.0"},{name:"$dateToString",value:"$dateToString",score:1,meta:"expr:date",version:"3.0.0"},{name:"$divide",value:"$divide",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$eq",value:"$eq",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$exp",value:"$exp",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$filter",value:"$filter",score:1,meta:"expr:array",version:"3.2.0"},{name:"$first",value:"$first",score:1,meta:"expr:array",version:"4.4.0"},{name:"$floor",value:"$floor",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$function",value:"$function",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$getField",value:"$getField",score:1,meta:"expr:get",version:"5.0.0"},{name:"$gt",value:"$gt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$gte",value:"$gte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$hour",value:"$hour",score:1,meta:"expr:date",version:"2.2.0"},{name:"$ifNull",value:"$ifNull",score:1,meta:"expr:cond",version:"2.2.0"},{name:"$in",value:"$in",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfArray",value:"$indexOfArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$indexOfBytes",value:"$indexOfBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$indexOfCP",value:"$indexOfCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$isArray",value:"$isArray",score:1,meta:"expr:array",version:"3.2.0"},{name:"$isNumber",value:"$isNumber",score:1,meta:"expr:arith",version:"4.4.0"},{name:"$isoDayOfWeek",value:"$isoDayOfWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeek",value:"$isoWeek",score:1,meta:"expr:date",version:"3.4.0"},{name:"$isoWeekYear",value:"$isoWeekYear",score:1,meta:"expr:date",version:"3.4.0"},{name:"$last",value:"$last",score:1,meta:"expr:array",version:"4.4.0"},{name:"$let",value:"$let",score:1,meta:"expr:var",version:"2.6.0"},{name:"$literal",value:"$literal",score:1,meta:"expr:literal",version:"2.6.0"},{name:"$lt",value:"$lt",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$lt",value:"$lte",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$ln",value:"$ln",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log",value:"$log",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$log10",value:"$log10",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$map",value:"$map",score:1,meta:"expr:array",version:"2.6.0"},{name:"$mergeObjects",value:"$mergeObjects",score:1,meta:"expr:obj",version:"3.6.0"},{name:"$meta",value:"$meta",score:1,meta:"expr:text",version:"2.6.0"},{name:"$millisecond",value:"$millisecond",score:1,meta:"expr:date",version:"2.4.0"},{name:"$minute",value:"$minute",score:1,meta:"expr:date",version:"2.2.0"},{name:"$mod",value:"$mod",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$month",value:"$month",score:1,meta:"expr:date",version:"2.2.0"},{name:"$multiply",value:"$multiply",score:1,meta:"expr:arith",version:"2.2.0"},{name:"$new",value:"$new",score:1,meta:"expr:comp",version:"2.2.0"},{name:"$not",value:"$not",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$objectToArray",value:"$objectToArray",score:1,meta:"expr:array",version:"3.4.4"},{name:"$or",value:"$or",score:1,meta:"expr:bool",version:"2.2.0"},{name:"$pow",value:"$pow",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$range",value:"$range",score:1,meta:"expr:array",version:"3.4.0"},{name:"$reduce",value:"$reduce",score:1,meta:"expr:array",version:"3.4.0"},{name:"$regexFind",value:"$regexFind",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexFindAll",value:"$regexFindAll",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$regexMatch",value:"$regexMatch",score:1,meta:"expr:regex",version:"4.1.11"},{name:"$replaceAll",value:"$replaceAll",score:1,meta:"expr:string",version:"4.4.0"},{name:"$replaceOne",value:"$replaceOne",score:1,meta:"expr:string",version:"4.4.0"},{name:"$reverseArray",value:"$reverseArray",score:1,meta:"expr:array",version:"3.4.0"},{name:"$second",value:"$second",score:1,meta:"expr:date",version:"2.2.0"},{name:"$setDifference",value:"$setDifference",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setEquals",value:"$setEquals",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIntersection",value:"$setIntersection",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setIsSubset",value:"$setIsSubset",score:1,meta:"expr:set",version:"2.6.0"},{name:"$setUnion",value:"$setUnion",score:1,meta:"expr:set",version:"2.6.0"},{name:"$similarityCosine",value:"$similarityCosine",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityDotProduct",value:"$similarityDotProduct",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$similarityEuclidean",value:"$similarityEuclidean",score:1,meta:"expr:arith",version:"8.2.0"},{name:"$size",value:"$size",score:1,meta:"expr:array",version:"2.6.0"},{name:"$slice",value:"$slice",score:1,meta:"expr:array",version:"3.2.0"},{name:"$sortArray",value:"$sortArray",score:1,meta:"expr:array",version:"5.2.0"},{name:"$split",value:"$split",score:1,meta:"expr:string",version:"3.4.0"},{name:"$sqrt",value:"$sqrt",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$strcasecmp",value:"$strcasecmp",score:1,meta:"expr:string",version:"2.2.0"},{name:"$strLenBytes",value:"$strLenBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$strLenCP",value:"$strLenCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substr",value:"$substr",score:1,meta:"expr:string",version:"2.2.0",deprecated:"3.4.0",replacement:"$substrBytes"},{name:"$substrBytes",value:"$substrBytes",score:1,meta:"expr:string",version:"3.4.0"},{name:"$substrCP",value:"$substrCP",score:1,meta:"expr:string",version:"3.4.0"},{name:"$subtract",value:"$subtract",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$switch",value:"$switch",score:1,meta:"expr:cond",version:"3.4.0"},{name:"$toHashedIndexKey",value:"$toHashedIndexKey",score:1,meta:"expr:arith",version:"4.2.24"},{name:"$toLower",value:"$toLower",score:1,meta:"expr:string",version:"2.2.0"},{name:"$toUpper",value:"$toUpper",score:1,meta:"expr:string",version:"2.2.0"},{name:"$tsSecond",value:"$tsSecond",score:1,meta:"expr:date",version:"5.1.0"},{name:"$tsIncrement",value:"$tsIncrement",score:1,meta:"expr:date",version:"5.1.0"},{name:"$trunc",value:"$trunc",score:1,meta:"expr:arith",version:"3.2.0"},{name:"$type",value:"$type",score:1,meta:"expr:type",version:"3.4.0"},{name:"$week",value:"$week",score:1,meta:"expr:date",version:"2.2.0"},{name:"$year",value:"$year",score:1,meta:"expr:date",version:"2.2.0"},{name:"$zip",value:"$zip",score:1,meta:"expr:array",version:"3.4.0"},{name:"$bitAnd",value:"$bitAnd",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitOr",value:"$bitOr",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitXor",value:"$bitXor",score:1,meta:"expr:bit",version:"7.0.0"},{name:"$bitNot",value:"$bitNot",score:1,meta:"expr:bit",version:"7.0.0"}]},96675:(e,t,n)=>{const a=n(66283),r=n(38366);e.exports=(e,t,n)=>{let s=null,i=null,o=null;try{o=new r(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new a(s,n)))})),s}},96775:(e,t,n)=>{const a=n(9480),r=n(40289);e.exports=(e,t,n)=>{const s=[];let i=null,o=null;const l=e.sort(((e,t)=>r(e,t,n)));for(const e of l)a(e,t,n)?(o=e,i||(i=e)):(o&&s.push([i,o]),o=null,i=null);i&&s.push([i,null]);const u=[];for(const[e,t]of s)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const c=u.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return c.length<p.length?c:t}},96807:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ATLAS_VECTOR_SEARCH_TEMPLATE=t.ATLAS_SEARCH_TEMPLATES=void 0,t.ATLAS_SEARCH_TEMPLATES=[{name:"Dynamic field mappings",snippet:'{\n "mappings": {\n "dynamic": true\n }\n}',version:"4.4.0"},{name:"Static field mappings",snippet:'{\n "mappings": {\n "dynamic": false,\n "fields": {\n ${1:<string field name>}: {\n "type": "string"\n },\n ${2:<number field name>}: {\n "type": "number"\n },\n ${3:<date field name>}: {\n "type": "date"\n },\n ${4:<geo field name>}: {\n "type": "geo"\n },\n } \n }\n}',version:"4.4.0"},{name:"Text field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<string field name>}: [\n {\n // Enables text queries\n "type": "string"\n },\n {\n // Enables autocomplete queries\n "type": "autocomplete"\n \n },\n {\n // Enables sorting\n "type": "token"\n }\n ] \n } \n }\n}',version:"4.4.0"},{name:"Facet field mappings",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<number field name for faceting>}: [\n {\n "type": "numberFacet"\n },\n {\n "type": "number"\n },\n ],\n ${2:<date field name for faceting>}: [\n {\n "type": "dateFacet"\n }\n {\n "type": "date"\n }\n ],\n ${3:<string field name for faceting>}: [\n {\n "type": "stringFacet"\n },\n {\n "type": "string",\n "analyzer": "lucene.keyword"\n },\n ],\n } \n }\n}',version:"4.4.0"},{name:"KNN Vector field mapping",snippet:'{\n "mappings": {\n "dynamic": true,\n "fields": {\n ${1:<vector embedding field name>}: [\n {\n "type": "knnVector",\n "dimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n } \n ] \n } \n }\n}',version:"4.4.0"}],t.ATLAS_VECTOR_SEARCH_TEMPLATE={name:"Vector Search default template",snippet:'{\n "fields": [{\n "type": "vector",\n "path": "${1:<field name to index>}",\n "numDimensions": ${2:<number of dimensions>},\n "similarity": "${3:<euclidean | cosine | dotProduct>}"\n }]\n}',version:"4.4.0"}},97008:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENVS=t.ON_PREM=t.ADL=t.ATLAS=void 0;const n="atlas";t.ATLAS=n,t.ADL="adl";const a="on-prem";t.ON_PREM=a;const r=[n,"adl",a];t.ENVS=r},97369:(e,t,n)=>{const a=n(32674);e.exports=(e,t,n)=>0!==a(e,t,n)},97382:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},97660:(e,t,n)=>{const a=n(38358);e.exports=(e,t)=>{const n=a(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},97830:(e,t,n)=>{const a=n(95323);e.exports=(e,t)=>{try{return new a(e,t).range||"*"}catch(e){return null}}},98010:(e,t,n)=>{n.d(t,{rv:()=>r});var a=n(9895);a.ACCUMULATORS,a.ADL,a.ANY_COLLECTION_NAMESPACE,a.ANY_NAMESPACE,a.ATLAS,a.ATLAS_SEARCH_TEMPLATES,a.ATLAS_VECTOR_SEARCH_TEMPLATE,a.BSON_TYPES,a.BSON_TYPE_ALIASES,a.COLLECTION,a.CONVERSION_OPERATORS,a.DATABASE,a.ENVS,a.EXPRESSION_OPERATORS,a.FULL_SCAN_STAGES,a.JSON_SCHEMA,a.ON_PREM,a.OUT_STAGES;const r=a.QUERY_OPERATORS;a.REQUIRED_AS_FIRST_STAGE,a.STAGE_OPERATORS,a.STAGE_OPERATOR_NAMES,a.SYSTEM_VARIABLES,a.TIME_SERIES,a.VALIDATION_TEMPLATE,a.VIEW,a.VIEW_PIPELINE_UTILS,a.getFilteredCompletions,a.wrapField},98249:(e,t,n)=>{const a=n(41755),r=n(97369),s=n(18106),i=n(74227),o=n(28141),l=n(24078);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a(e,n,u);case"!=":return r(e,n,u);case">":return s(e,n,u);case">=":return i(e,n,u);case"<":return o(e,n,u);case"<=":return l(e,n,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},98582:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ACCUMULATORS=void 0,t.ACCUMULATORS=[{name:"$accumulator",value:"$accumulator",score:1,meta:"accumulator",version:"4.4.0"},{name:"$addToSet",value:"$addToSet",score:1,meta:"accumulator",version:"2.2.0"},{name:"$avg",value:"$avg",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$bottom",value:"$bottom",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$bottomN",value:"$bottomN",score:1,meta:"accumulator:bottom-n",version:"5.2.0"},{name:"$covariancePop",value:"$covariancePop",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$covarianceSamp",value:"$covarianceSamp",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$count",value:"$count",score:1,meta:"accumulator",version:"5.0.0"},{name:"$derivative",value:"$derivative",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$denseRank",value:"$denseRank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$documentNumber",value:"$documentNumber",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$expMovingAvg",value:"$expMovingAvg",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$first",value:"$first",score:1,meta:"accumulator",version:"2.2.0"},{name:"$firstN",value:"$firstN",score:1,meta:"accumulator",version:"5.1.0"},{name:"$integral",value:"$integral",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$last",value:"$last",score:1,meta:"accumulator",version:"2.2.0"},{name:"$lastN",value:"$lastN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$max",value:"$max",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$maxN",value:"$maxN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$median",value:"$median",score:1,meta:"accumulator",version:"7.0.0"},{name:"$min",value:"$min",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$minN",value:"$minN",score:1,meta:"accumulator",version:"5.2.0"},{name:"$percentile",value:"$percentile",score:1,meta:"accumulator",version:"7.0.0"},{name:"$push",value:"$push",score:1,meta:"accumulator",version:"2.2.0"},{name:"$rank",value:"$rank",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$stdDevPop",value:"$stdDevPop",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$stdDevSamp",value:"$stdDevSamp",score:1,meta:"accumulator",version:"3.2.0",projectVersion:"3.2.0"},{name:"$shift",value:"$shift",score:1,meta:"accumulator:window",version:"5.0.0"},{name:"$sum",value:"$sum",score:1,meta:"accumulator",version:"2.2.0",projectVersion:"3.2.0"},{name:"$top",value:"$top",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$topN",value:"$topN",score:1,meta:"accumulator:top-n",version:"5.2.0"},{name:"$locf",value:"$locf",score:1,meta:"accumulator:window",version:"5.3.0"},{name:"$linearFill",value:"$linearFill",score:1,meta:"accumulator:window",version:"5.3.0"}]},98696:(e,t,n)=>{const a=n(48381),r=n(20332),s=n(58809);e.exports=(e,t)=>{e=new r(e,t);let n=new a("0.0.0");if(e.test(n))return n;if(n=new a("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new a(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!s(n,i)||(n=i)}return n&&e.test(n)?n:null}},98727:(e,t,n)=>{var a=n(40811);e.exports=new a("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},98736:(e,t,n)=>{const a=n(25583);e.exports=(e,t)=>a(e,t,!0)},98746:(e,t,n)=>{const a=n(60501);e.exports=(e,t,n)=>0===a(e,t,n)},98855:(e,t,n)=>{const a=n(88825);e.exports=(e,t,n=!1)=>{if(e instanceof a)return e;try{return new a(e,t)}catch(e){if(!n)return null;throw e}}},99174:e=>{function t(e){return null==e}e.exports.isNothing=t,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:t(e)?[]:[e]},e.exports.repeat=function(e,t){var n,a="";for(n=0;n<t;n+=1)a+=e;return a},e.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},e.exports.extend=function(e,t){var n,a,r,s;if(t)for(n=0,a=(s=Object.keys(t)).length;n<a;n+=1)e[r=s[n]]=t[r];return e}},99352:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENVS=t.ON_PREM=t.ADL=t.ATLAS=void 0;const n="atlas";t.ATLAS=n,t.ADL="adl";const a="on-prem";t.ON_PREM=a;const r=[n,"adl",a];t.ENVS=r},99385:(e,t,n)=>{const a=n(41694),r=n(96082),{ANY:s}=r,i=n(71333),o=n(9480),l=n(43334),u=n(3449),c=n(9418),p=n(47775);e.exports=(e,t,n,d)=>{let m,h,f,v,g;switch(e=new a(e,d),t=new i(t,d),n){case">":m=l,h=c,f=u,v=">",g=">=";break;case"<":m=u,h=p,f=l,v="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){const a=t.set[n];let i=null,o=null;if(a.forEach((e=>{e.semver===s&&(e=new r(">=0.0.0")),i=i||e,o=o||e,m(e.semver,i.semver,d)?i=e:f(e.semver,o.semver,d)&&(o=e)})),i.operator===v||i.operator===g)return!1;if((!o.operator||o.operator===v)&&h(e,o.semver))return!1;if(o.operator===g&&f(e,o.semver))return!1}return!0}},99430:(e,t,n)=>{const a=n(9350);e.exports=(e,t,n)=>new a(e,n).compare(new a(t,n))},99451:(e,t,n)=>{const a=n(38358);e.exports=(e,t)=>{const n=a(e,t);return n?n.version:null}},99514:(e,t,n)=>{n.d(t,{gM:()=>Pn});var a,r,s,i,o,l,u,c,p,d,m,h,f,v,g=n(45890),y=n(12240),$=n(86224),b=n(39889),_=n(9606).URL,E=n(67787).Buffer,x=Symbol.for("vercel.ai.gateway.error"),S=class e extends(r=Error,a=x,r){constructor({message:e,statusCode:t=500,cause:n}){super(e),this[a]=!0,this.statusCode=t,this.cause=n}static isInstance(t){return e.hasMarker(t)}static hasMarker(e){return"object"==typeof e&&null!==e&&x in e&&!0===e[x]}},A="GatewayAuthenticationError",I=`vercel.ai.gateway.error.${A}`,w=Symbol.for(I),T=class e extends(i=S,s=w,i){constructor({message:e="Authentication failed",statusCode:t=401,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[s]=!0,this.name=A,this.type="authentication_error"}static isInstance(e){return S.hasMarker(e)&&w in e}static createContextualError({apiKeyProvided:t,oidcTokenProvided:n,message:a="Authentication failed",statusCode:r=401,cause:s}){let i;return i=t?"AI Gateway authentication failed: Invalid API key.\n\nCreate a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys\n\nProvide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.":n?"AI Gateway authentication failed: Invalid OIDC token.\n\nRun 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.\n\nAlternatively, use an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys":"AI Gateway authentication failed: No authentication provided.\n\nOption 1 - API key:\nCreate an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys\nProvide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.\n\nOption 2 - OIDC token:\nRun 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.",new e({message:i,statusCode:r,cause:s})}},N="GatewayInvalidRequestError",O=`vercel.ai.gateway.error.${N}`,k=Symbol.for(O),R=class extends(l=S,o=k,l){constructor({message:e="Invalid request",statusCode:t=400,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[o]=!0,this.name=N,this.type="invalid_request_error"}static isInstance(e){return S.hasMarker(e)&&k in e}},C="GatewayRateLimitError",P=`vercel.ai.gateway.error.${C}`,L=Symbol.for(P),j=class extends(c=S,u=L,c){constructor({message:e="Rate limit exceeded",statusCode:t=429,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[u]=!0,this.name=C,this.type="rate_limit_exceeded"}static isInstance(e){return S.hasMarker(e)&&L in e}},M="GatewayModelNotFoundError",D=`vercel.ai.gateway.error.${M}`,Y=Symbol.for(D),F=(0,g.ID)((()=>(0,g.jN)($.Ik({modelId:$.Yj()})))),q=class extends(d=S,p=Y,d){constructor({message:e="Model not found",statusCode:t=404,modelId:n,cause:a}={}){super({message:e,statusCode:t,cause:a}),this[p]=!0,this.name=M,this.type="model_not_found",this.modelId=n}static isInstance(e){return S.hasMarker(e)&&Y in e}},U="GatewayInternalServerError",V=`vercel.ai.gateway.error.${U}`,z=Symbol.for(V),Z=class extends(h=S,m=z,h){constructor({message:e="Internal server error",statusCode:t=500,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[m]=!0,this.name=U,this.type="internal_server_error"}static isInstance(e){return S.hasMarker(e)&&z in e}},B="GatewayResponseError",G=`vercel.ai.gateway.error.${B}`,W=Symbol.for(G),K=class extends(v=S,f=W,v){constructor({message:e="Invalid response from Gateway",statusCode:t=502,response:n,validationError:a,cause:r}={}){super({message:e,statusCode:t,cause:r}),this[f]=!0,this.name=B,this.type="response_error",this.response=n,this.validationError=a}static isInstance(e){return S.hasMarker(e)&&W in e}};async function H({response:e,statusCode:t,defaultMessage:n="Gateway request failed",cause:a,authMethod:r}){const s=await(0,g.ZZ)({value:e,schema:J});if(!s.success)return new K({message:`Invalid error response format: ${n}`,statusCode:t,response:e,validationError:s.error,cause:a});const i=s.value,o=i.error.type,l=i.error.message;switch(o){case"authentication_error":return T.createContextualError({apiKeyProvided:"api-key"===r,oidcTokenProvided:"oidc"===r,statusCode:t,cause:a});case"invalid_request_error":return new R({message:l,statusCode:t,cause:a});case"rate_limit_exceeded":return new j({message:l,statusCode:t,cause:a});case"model_not_found":{const e=await(0,g.ZZ)({value:i.error.param,schema:F});return new q({message:l,statusCode:t,modelId:e.success?e.value.modelId:void 0,cause:a})}default:return new Z({message:l,statusCode:t,cause:a})}}var J=(0,g.ID)((()=>(0,g.jN)($.Ik({error:$.Ik({message:$.Yj(),type:$.Yj().nullish(),param:$.L5().nullish(),code:$.KC([$.Yj(),$.ai()]).nullish()})}))));function X(e,t){var n;return S.isInstance(e)?e:y.hL.isInstance(e)?H({response:Q(e),statusCode:null!=(n=e.statusCode)?n:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):H({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}function Q(e){if(void 0!==e.data)return e.data;if(null!=e.responseBody)try{return JSON.parse(e.responseBody)}catch(t){return e.responseBody}return{}}var ee="ai-gateway-auth-method";async function te(e){const t=await(0,g.ZZ)({value:e[ee],schema:ne});return t.success?t.value:void 0}var ne=(0,g.ID)((()=>(0,g.jN)($.KC([$.eu("api-key"),$.eu("oidc")])))),ae=class{constructor(e){this.config=e}async getAvailableModels(){try{const{value:e}=await(0,g.$b)({url:`${this.config.baseURL}/config`,headers:await(0,g.hd)(this.config.headers()),successfulResponseHandler:(0,g.cV)(re),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),fetch:this.config.fetch});return e}catch(e){throw await X(e)}}async getCredits(){try{const e=new _(this.config.baseURL),{value:t}=await(0,g.$b)({url:`${e.origin}/v1/credits`,headers:await(0,g.hd)(this.config.headers()),successfulResponseHandler:(0,g.cV)(se),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),fetch:this.config.fetch});return t}catch(e){throw await X(e)}}},re=(0,g.ID)((()=>(0,g.jN)($.Ik({models:$.YO($.Ik({id:$.Yj(),name:$.Yj(),description:$.Yj().nullish(),pricing:$.Ik({input:$.Yj(),output:$.Yj(),input_cache_read:$.Yj().nullish(),input_cache_write:$.Yj().nullish()}).transform((({input:e,output:t,input_cache_read:n,input_cache_write:a})=>({input:e,output:t,...n?{cachedInputTokens:n}:{},...a?{cacheCreationInputTokens:a}:{}}))).nullish(),specification:$.Ik({specificationVersion:$.eu("v3"),provider:$.Yj(),modelId:$.Yj()}),modelType:$.k5(["language","embedding","image"]).nullish()}))})))),se=(0,g.ID)((()=>(0,g.jN)($.Ik({balance:$.Yj(),total_used:$.Yj()}).transform((({balance:e,total_used:t})=>({balance:e,totalUsed:t})))))),ie=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(e){const{abortSignal:t,...n}=e;return{args:this.maybeEncodeFileParts(n),warnings:[]}}async doGenerate(e){const{args:t,warnings:n}=await this.getArgs(e),{abortSignal:a}=e,r=await(0,g.hd)(this.config.headers());try{const{responseHeaders:s,value:i,rawValue:o}=await(0,g.GU)({url:this.getUrl(),headers:(0,g.m2)(r,e.headers,this.getModelConfigHeaders(this.modelId,!1),await(0,g.hd)(this.config.o11yHeaders)),body:t,successfulResponseHandler:(0,g.cV)($.bz()),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),...a&&{abortSignal:a},fetch:this.config.fetch});return{...i,request:{body:t},response:{headers:s,body:o},warnings:n}}catch(e){throw await X(e,await te(r))}}async doStream(e){const{args:t,warnings:n}=await this.getArgs(e),{abortSignal:a}=e,r=await(0,g.hd)(this.config.headers());try{const{value:s,responseHeaders:i}=await(0,g.GU)({url:this.getUrl(),headers:(0,g.m2)(r,e.headers,this.getModelConfigHeaders(this.modelId,!0),await(0,g.hd)(this.config.o11yHeaders)),body:t,successfulResponseHandler:(0,g.Ds)($.bz()),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),...a&&{abortSignal:a},fetch:this.config.fetch});return{stream:s.pipeThrough(new TransformStream({start(e){n.length>0&&e.enqueue({type:"stream-start",warnings:n})},transform(t,n){if(t.success){const a=t.value;if("raw"===a.type&&!e.includeRawChunks)return;"response-metadata"===a.type&&a.timestamp&&"string"==typeof a.timestamp&&(a.timestamp=new Date(a.timestamp)),n.enqueue(a)}else n.error(t.error)}})),request:{body:t},response:{headers:i}}}catch(e){throw await X(e,await te(r))}}isFilePart(e){return e&&"object"==typeof e&&"type"in e&&"file"===e.type}maybeEncodeFileParts(e){for(const t of e.prompt)for(const e of t.content)if(this.isFilePart(e)){const t=e;if(t.data instanceof Uint8Array){const e=Uint8Array.from(t.data),n=E.from(e).toString("base64");t.data=new _(`data:${t.mediaType||"application/octet-stream"};base64,${n}`)}}return e}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(e,t){return{"ai-language-model-specification-version":"2","ai-language-model-id":e,"ai-language-model-streaming":String(t)}}},oe=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:a}){var r;const s=await(0,g.hd)(this.config.headers());try{const{responseHeaders:i,value:o,rawValue:l}=await(0,g.GU)({url:this.getUrl(),headers:(0,g.m2)(s,null!=t?t:{},this.getModelConfigHeaders(),await(0,g.hd)(this.config.o11yHeaders)),body:{input:1===e.length?e[0]:e,...a?{providerOptions:a}:{}},successfulResponseHandler:(0,g.cV)(le),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),...n&&{abortSignal:n},fetch:this.config.fetch});return{embeddings:o.embeddings,usage:null!=(r=o.usage)?r:void 0,providerMetadata:o.providerMetadata,response:{headers:i,body:l},warnings:[]}}catch(e){throw await X(e,await te(s))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"2","ai-model-id":this.modelId}}},le=(0,g.ID)((()=>(0,g.jN)($.Ik({embeddings:$.YO($.YO($.ai())),usage:$.Ik({tokens:$.ai()}).nullish(),providerMetadata:$.g1($.Yj(),$.g1($.Yj(),$.L5())).optional()})))),ue=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxImagesPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:n,aspectRatio:a,seed:r,providerOptions:s,headers:i,abortSignal:o}){var l;const u=await(0,g.hd)(this.config.headers());try{const{responseHeaders:c,value:p,rawValue:d}=await(0,g.GU)({url:this.getUrl(),headers:(0,g.m2)(u,null!=i?i:{},this.getModelConfigHeaders(),await(0,g.hd)(this.config.o11yHeaders)),body:{prompt:e,n:t,...n&&{size:n},...a&&{aspectRatio:a},...r&&{seed:r},...s&&{providerOptions:s}},successfulResponseHandler:(0,g.cV)(pe),failedResponseHandler:(0,g.sl)({errorSchema:$.bz(),errorToMessage:e=>e}),...o&&{abortSignal:o},fetch:this.config.fetch});return{images:p.images,warnings:null!=(l=p.warnings)?l:[],providerMetadata:p.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:c}}}catch(e){throw X(e,await te(u))}}getUrl(){return`${this.config.baseURL}/image-model`}getModelConfigHeaders(){return{"ai-image-model-specification-version":"2","ai-model-id":this.modelId}}},ce=$.Ik({images:$.YO($.L5()).optional()}).catchall($.L5()),pe=$.Ik({images:$.YO($.Yj()),warnings:$.YO($.Ik({type:$.eu("other"),message:$.Yj()})).optional(),providerMetadata:$.g1($.Yj(),ce).optional()}),de=function(e={}){var t,n;let a=null,r=null;const s=null!=(t=e.metadataCacheRefreshMillis)?t:3e5;let i=0;const o=null!=(n=(0,g.ae)(e.baseURL))?n:"https://ai-gateway.vercel.sh/v1/ai",l=async()=>{const t=await async function(e){const t=(0,g.x3)({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});if(t)return{token:t,authMethod:"api-key"};try{return{token:await(0,b.getVercelOidcToken)(),authMethod:"oidc"}}catch(e){return null}}(e);if(t)return(0,g.WZ)({Authorization:`Bearer ${t.token}`,"ai-gateway-protocol-version":"0.0.1",[ee]:t.authMethod,...e.headers},"ai-sdk/gateway/2.0.0-beta.78");throw T.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401})},u=()=>{const e=(0,g.x3)({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),t=(0,g.x3)({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),n=(0,g.x3)({settingValue:void 0,environmentVariableName:"VERCEL_REGION"});return async()=>{const a=await async function(){var e;return null==(e=(0,b.getContext)().headers)?void 0:e["x-vercel-id"]}();return{...e&&{"ai-o11y-deployment-id":e},...t&&{"ai-o11y-environment":t},...n&&{"ai-o11y-region":n},...a&&{"ai-o11y-request-id":a}}}},c=t=>new ie(t,{provider:"gateway",baseURL:o,headers:l,fetch:e.fetch,o11yHeaders:u()}),p=function(e){if(new.target)throw new Error("The Gateway Provider model function cannot be called with the new keyword.");return c(e)};return p.specificationVersion="v3",p.getAvailableModels=async()=>{var t,n,u;const c=null!=(u=null==(n=null==(t=e._internal)?void 0:t.currentDate)?void 0:n.call(t).getTime())?u:Date.now();return(!a||c-i>s)&&(i=c,a=new ae({baseURL:o,headers:l,fetch:e.fetch}).getAvailableModels().then((e=>(r=e,e))).catch((async e=>{throw await X(e,await te(await l()))}))),r?Promise.resolve(r):a},p.getCredits=async()=>new ae({baseURL:o,headers:l,fetch:e.fetch}).getCredits().catch((async e=>{throw await X(e,await te(await l()))})),p.imageModel=t=>new ue(t,{provider:"gateway",baseURL:o,headers:l,fetch:e.fetch,o11yHeaders:u()}),p.languageModel=c,p.embeddingModel=t=>new oe(t,{provider:"gateway",baseURL:o,headers:l,fetch:e.fetch,o11yHeaders:u()}),p}(),me=n(26767),he=n(19917),fe=n(9606).URL,ve=n(65994).e,ge=Object.defineProperty;function ye({warning:e,provider:t,model:n}){const a=`AI SDK Warning (${t} / ${n}):`;switch(e.type){case"unsupported":{let t=`${a} The feature "${e.feature}" is not supported.`;return e.details&&(t+=` ${e.details}`),t}case"compatibility":{let t=`${a} The feature "${e.feature}" is used in a compatibility mode.`;return e.details&&(t+=` ${e.details}`),t}case"other":return`${a} ${e.message}`;default:return`${a} ${JSON.stringify(e,null,2)}`}}var $e,be=!1,_e=e=>{if(0===e.warnings.length)return;const t=globalThis.AI_SDK_LOG_WARNINGS;if(!1!==t)if("function"!=typeof t){be||(be=!0,console.info("AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false."));for(const t of e.warnings)console.warn(ye({warning:t,provider:e.provider,model:e.model}))}else t(e)},Ee="AI_InvalidArgumentError",xe=`vercel.ai.error.${Ee}`,Se=Symbol.for(xe),Ae=class extends y.bD{constructor({parameter:e,value:t,message:n}){super({name:Ee,message:`Invalid argument for parameter ${e}: ${n}`}),this[$e]=!0,this.parameter=e,this.value=t}static isInstance(e){return y.bD.hasMarker(e,xe)}};$e=Se;var Ie=Symbol.for("vercel.ai.error.AI_InvalidStreamPartError");y.bD;var we,Te="AI_InvalidToolInputError",Ne=`vercel.ai.error.${Te}`,Oe=Symbol.for(Ne),ke=class extends y.bD{constructor({toolInput:e,toolName:t,cause:n,message:a=`Invalid input for tool ${t}: ${(0,y.u1)(n)}`}){super({name:Te,message:a,cause:n}),this[we]=!0,this.toolInput=e,this.toolName=t}static isInstance(e){return y.bD.hasMarker(e,Ne)}};we=Oe;var Re=Symbol.for("vercel.ai.error.AI_NoImageGeneratedError");y.bD;var Ce,Pe="AI_NoObjectGeneratedError",Le=`vercel.ai.error.${Pe}`,je=Symbol.for(Le),Me=class extends y.bD{constructor({message:e="No object generated.",cause:t,text:n,response:a,usage:r,finishReason:s}){super({name:Pe,message:e,cause:t}),this[Ce]=!0,this.text=n,this.response=a,this.usage=r,this.finishReason=s}static isInstance(e){return y.bD.hasMarker(e,Le)}};Ce=je;var De,Ye="AI_NoOutputGeneratedError",Fe=`vercel.ai.error.${Ye}`,qe=Symbol.for(Fe),Ue=class extends y.bD{constructor({message:e="No output generated.",cause:t}={}){super({name:Ye,message:e,cause:t}),this[De]=!0}static isInstance(e){return y.bD.hasMarker(e,Fe)}};De=qe,y.bD;var Ve,ze="AI_NoSuchToolError",Ze=`vercel.ai.error.${ze}`,Be=Symbol.for(Ze),Ge=class extends y.bD{constructor({toolName:e,availableTools:t,message:n=`Model tried to call unavailable tool '${e}'. ${void 0===t?"No tools are available.":`Available tools: ${t.join(", ")}.`}`}){super({name:ze,message:n}),this[Ve]=!0,this.toolName=e,this.availableTools=t}static isInstance(e){return y.bD.hasMarker(e,Ze)}};Ve=Be;var We,Ke="AI_ToolCallRepairError",He=`vercel.ai.error.${Ke}`,Je=Symbol.for(He),Xe=class extends y.bD{constructor({cause:e,originalError:t,message:n=`Error repairing tool call: ${(0,y.u1)(e)}`}){super({name:Ke,message:n,cause:e}),this[We]=!0,this.originalError=t}static isInstance(e){return y.bD.hasMarker(e,He)}};We=Je;var Qe=class extends y.bD{constructor(e){super({name:"AI_UnsupportedModelVersionError",message:`Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`}),this.version=e.version,this.provider=e.provider,this.modelId=e.modelId}},et=Symbol.for("vercel.ai.error.AI_InvalidDataContentError");y.bD;var tt,nt="AI_InvalidMessageRoleError",at=`vercel.ai.error.${nt}`,rt=Symbol.for(at),st=class extends y.bD{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super({name:nt,message:t}),this[tt]=!0,this.role=e}static isInstance(e){return y.bD.hasMarker(e,at)}};tt=rt;var it=Symbol.for("vercel.ai.error.AI_MessageConversionError");y.bD;var ot,lt="AI_DownloadError",ut=`vercel.ai.error.${lt}`,ct=Symbol.for(ut),pt=class extends y.bD{constructor({url:e,statusCode:t,statusText:n,cause:a,message:r=(null==a?`Failed to download ${e}: ${t} ${n}`:`Failed to download ${e}: ${a}`)}){super({name:lt,message:r,cause:a}),this[ot]=!0,this.url=e,this.statusCode=t,this.statusText=n}static isInstance(e){return y.bD.hasMarker(e,ut)}};ot=ct;var dt,mt="AI_RetryError",ht=`vercel.ai.error.${mt}`,ft=Symbol.for(ht),vt=class extends y.bD{constructor({message:e,reason:t,errors:n}){super({name:mt,message:e}),this[dt]=!0,this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isInstance(e){return y.bD.hasMarker(e,ht)}};function gt(e){return"v3"===e.specificationVersion?e:(function({provider:e,modelId:t}){_e({warnings:[{type:"compatibility",feature:"specificationVersion",details:"Using v2 specification compatibility mode. Some features may not be available."}],provider:e,model:t})}({provider:e.provider,modelId:e.modelId}),new Proxy(e,{get(e,t){switch(t){case"specificationVersion":return"v3";case"doGenerate":return async(...t)=>{const n=await e.doGenerate(...t);return{...n,usage:yt(n.usage)}};case"doStream":return async(...t)=>{const n=await e.doStream(...t);return{...n,stream:(a=n.stream,a.pipeThrough(new TransformStream({transform(e,t){"finish"===e.type?t.enqueue({...e,usage:yt(e.usage)}):t.enqueue(e)}})))};var a};default:return e[t]}}}))}function yt(e){return{inputTokens:{total:e.inputTokens,noCache:void 0,cacheRead:e.cachedInputTokens,cacheWrite:void 0},outputTokens:{total:e.outputTokens,text:void 0,reasoning:e.reasoningTokens}}}function $t(e){if("string"!=typeof e){if("v3"!==e.specificationVersion&&"v2"!==e.specificationVersion){const t=e;throw new Qe({version:t.specificationVersion,provider:t.provider,modelId:t.modelId})}return gt(e)}return(null!=(t=globalThis.AI_SDK_DEFAULT_PROVIDER)?t:de).languageModel(e);var t}dt=ft;var bt=[{mediaType:"image/gif",bytesPrefix:[71,73,70]},{mediaType:"image/png",bytesPrefix:[137,80,78,71]},{mediaType:"image/jpeg",bytesPrefix:[255,216]},{mediaType:"image/webp",bytesPrefix:[82,73,70,70,null,null,null,null,87,69,66,80]},{mediaType:"image/bmp",bytesPrefix:[66,77]},{mediaType:"image/tiff",bytesPrefix:[73,73,42,0]},{mediaType:"image/tiff",bytesPrefix:[77,77,0,42]},{mediaType:"image/avif",bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102]},{mediaType:"image/heic",bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99]}],_t=e=>{const t="string"==typeof e?(0,g.Z9)(e):e,n=(127&t[6])<<21|(127&t[7])<<14|(127&t[8])<<7|127&t[9];return t.slice(n+10)};var Et=async({url:e})=>{var t;const n=e.toString();try{const e=await fetch(n,{headers:(0,g.WZ)({},"ai-sdk/6.0.0-beta.151",(0,g.G1)())});if(!e.ok)throw new pt({url:n,statusCode:e.status,statusText:e.statusText});return{data:new Uint8Array(await e.arrayBuffer()),mediaType:null!=(t=e.headers.get("content-type"))?t:void 0}}catch(e){if(pt.isInstance(e))throw e;throw new pt({url:n,cause:e})}},xt=(e=Et)=>t=>Promise.all(t.map((async t=>t.isUrlSupportedByModel?null:e(t)))),St=$.KC([$.Yj(),$.Nl(Uint8Array),$.Nl(ArrayBuffer),$.Ie((e=>{var t,n;return null!=(n=null==(t=globalThis.Buffer)?void 0:t.isBuffer(e))&&n}),{message:"Must be a Buffer"})]);function At(e){if(e instanceof Uint8Array)return{data:e,mediaType:void 0};if(e instanceof ArrayBuffer)return{data:new Uint8Array(e),mediaType:void 0};if("string"==typeof e)try{e=new fe(e)}catch(e){}if(e instanceof fe&&"data:"===e.protocol){const{mediaType:t,base64Content:n}=function(e){try{const[t,n]=e.split(",");return{mediaType:t.split(";")[0].split(":")[1],base64Content:n}}catch(e){return{mediaType:void 0,base64Content:void 0}}}(e.toString());if(null==t||null==n)throw new y.bD({name:"InvalidDataContentError",message:`Invalid data URL format in content ${e.toString()}`});return{data:n,mediaType:t}}return{data:e,mediaType:void 0}}function It(e){return void 0===e?[]:Array.isArray(e)?e:[e]}async function wt({prompt:e,supportedUrls:t,download:n=xt()}){const a=await async function(e,t,n){const a=e.filter((e=>"user"===e.role)).map((e=>e.content)).filter((e=>Array.isArray(e))).flat().filter((e=>"image"===e.type||"file"===e.type)).map((e=>{var t;const n=null!=(t=e.mediaType)?t:"image"===e.type?"image/*":void 0;let a="image"===e.type?e.image:e.data;if("string"==typeof a)try{a=new fe(a)}catch(e){}return{mediaType:n,data:a}})).filter((e=>e.data instanceof fe)).map((e=>({url:e.data,isUrlSupportedByModel:null!=e.mediaType&&(0,g.qs)({url:e.data.toString(),mediaType:e.mediaType,supportedUrls:n})}))),r=await t(a);return Object.fromEntries(r.map(((e,t)=>null==e?null:[a[t].url.toString(),{data:e.data,mediaType:e.mediaType}])).filter((e=>null!=e)))}(e.messages,n,t),r=[...null!=e.system?"string"==typeof e.system?[{role:"system",content:e.system}]:It(e.system).map((e=>({role:"system",content:e.content,providerOptions:e.providerOptions}))):[],...e.messages.map((e=>function({message:e,downloadedAssets:t}){const n=e.role;switch(n){case"system":return{role:"system",content:e.content,providerOptions:e.providerOptions};case"user":return"string"==typeof e.content?{role:"user",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"user",content:e.content.map((e=>function(e,t){var n;if("text"===e.type)return{type:"text",text:e.text,providerOptions:e.providerOptions};let a;const r=e.type;switch(r){case"image":a=e.image;break;case"file":a=e.data;break;default:throw new Error(`Unsupported part type: ${r}`)}const{data:s,mediaType:i}=At(a);let o=null!=i?i:e.mediaType,l=s;if(l instanceof fe){const e=t[l.toString()];e&&(l=e.data,null!=o||(o=e.mediaType))}switch(r){case"image":return(l instanceof Uint8Array||"string"==typeof l)&&(o=null!=(n=function({data:e,signatures:t}){const n=function(e){return"string"==typeof e&&e.startsWith("SUQz")||"string"!=typeof e&&e.length>10&&73===e[0]&&68===e[1]&&51===e[2]?_t(e):e}(e),a="string"==typeof n?(0,g.Z9)(n.substring(0,Math.min(n.length,24))):n;for(const e of t)if(a.length>=e.bytesPrefix.length&&e.bytesPrefix.every(((e,t)=>null===e||a[t]===e)))return e.mediaType}({data:l,signatures:bt}))?n:o),{type:"file",mediaType:null!=o?o:"image/*",filename:void 0,data:l,providerOptions:e.providerOptions};case"file":if(null==o)throw new Error("Media type is missing for file part");return{type:"file",mediaType:o,filename:e.filename,data:l,providerOptions:e.providerOptions}}}(e,t))).filter((e=>"text"!==e.type||""!==e.text)),providerOptions:e.providerOptions};case"assistant":return"string"==typeof e.content?{role:"assistant",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"assistant",content:e.content.filter((e=>"text"!==e.type||""!==e.text||null!=e.providerOptions)).filter((e=>"tool-approval-request"!==e.type)).map((e=>{const t=e.providerOptions;switch(e.type){case"file":{const{data:n,mediaType:a}=At(e.data);return{type:"file",data:n,filename:e.filename,mediaType:null!=a?a:e.mediaType,providerOptions:t}}case"reasoning":return{type:"reasoning",text:e.text,providerOptions:t};case"text":return{type:"text",text:e.text,providerOptions:t};case"tool-call":return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input,providerExecuted:e.providerExecuted,providerOptions:t};case"tool-result":return{type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Tt(e.output),providerOptions:t}}})),providerOptions:e.providerOptions};case"tool":return{role:"tool",content:e.content.filter((e=>"tool-approval-response"!==e.type)).map((e=>({type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Tt(e.output),providerOptions:e.providerOptions}))),providerOptions:e.providerOptions};default:throw new st({role:n})}}({message:e,downloadedAssets:a})))],s=[];for(const e of r){if("tool"!==e.role){s.push(e);continue}const t=s.at(-1);"tool"===(null==t?void 0:t.role)?t.content.push(...e.content):s.push(e)}return s}function Tt(e){return"content"!==e.type?e:{type:"content",value:e.value.map((e=>"media"!==e.type?e:e.mediaType.startsWith("image/")?{type:"image-data",data:e.data,mediaType:e.mediaType}:{type:"file-data",data:e.data,mediaType:e.mediaType}))}}function Nt({output:e,tool:t,errorMode:n}){return"text"===n?{type:"error-text",value:(0,y.u1)(e)}:"json"===n?{type:"error-json",value:Ot(e)}:(null==t?void 0:t.toModelOutput)?t.toModelOutput(e):"string"==typeof e?{type:"text",value:e}:{type:"json",value:Ot(e)}}function Ot(e){return void 0===e?null:e}var kt=$.RZ((()=>$.KC([$.ch(),$.Yj(),$.ai(),$.zM(),$.g1($.Yj(),kt.optional()),$.YO(kt)]))),Rt=$.g1($.Yj(),$.g1($.Yj(),kt.optional())),Ct=$.Ik({type:$.eu("text"),text:$.Yj(),providerOptions:Rt.optional()}),Pt=$.Ik({type:$.eu("image"),image:$.KC([St,$.Nl(fe)]),mediaType:$.Yj().optional(),providerOptions:Rt.optional()}),Lt=$.Ik({type:$.eu("file"),data:$.KC([St,$.Nl(fe)]),filename:$.Yj().optional(),mediaType:$.Yj(),providerOptions:Rt.optional()}),jt=$.Ik({type:$.eu("reasoning"),text:$.Yj(),providerOptions:Rt.optional()}),Mt=$.Ik({type:$.eu("tool-call"),toolCallId:$.Yj(),toolName:$.Yj(),input:$.L5(),providerOptions:Rt.optional(),providerExecuted:$.zM().optional()}),Dt=$.gM("type",[$.Ik({type:$.eu("text"),value:$.Yj(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("json"),value:kt,providerOptions:Rt.optional()}),$.Ik({type:$.eu("execution-denied"),reason:$.Yj().optional(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("error-text"),value:$.Yj(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("error-json"),value:kt,providerOptions:Rt.optional()}),$.Ik({type:$.eu("content"),value:$.YO($.KC([$.Ik({type:$.eu("text"),text:$.Yj(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("media"),data:$.Yj(),mediaType:$.Yj()}),$.Ik({type:$.eu("file-data"),data:$.Yj(),mediaType:$.Yj(),filename:$.Yj().optional(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("file-url"),url:$.Yj(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("file-id"),fileId:$.KC([$.Yj(),$.g1($.Yj(),$.Yj())]),providerOptions:Rt.optional()}),$.Ik({type:$.eu("image-data"),data:$.Yj(),mediaType:$.Yj(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("image-url"),url:$.Yj(),providerOptions:Rt.optional()}),$.Ik({type:$.eu("image-file-id"),fileId:$.KC([$.Yj(),$.g1($.Yj(),$.Yj())]),providerOptions:Rt.optional()}),$.Ik({type:$.eu("custom"),providerOptions:Rt.optional()})]))})]),Yt=$.Ik({type:$.eu("tool-result"),toolCallId:$.Yj(),toolName:$.Yj(),output:Dt,providerOptions:Rt.optional()}),Ft=$.Ik({type:$.eu("tool-approval-request"),approvalId:$.Yj(),toolCallId:$.Yj()}),qt=$.Ik({type:$.eu("tool-approval-response"),approvalId:$.Yj(),approved:$.zM(),reason:$.Yj().optional()}),Ut=$.Ik({role:$.eu("system"),content:$.Yj(),providerOptions:Rt.optional()}),Vt=$.Ik({role:$.eu("user"),content:$.KC([$.Yj(),$.YO($.KC([Ct,Pt,Lt]))]),providerOptions:Rt.optional()}),zt=$.Ik({role:$.eu("assistant"),content:$.KC([$.Yj(),$.YO($.KC([Ct,Lt,jt,Mt,Yt,Ft]))]),providerOptions:Rt.optional()}),Zt=$.Ik({role:$.eu("tool"),content:$.YO($.KC([Yt,qt])),providerOptions:Rt.optional()}),Bt=$.KC([Ut,Vt,zt,Zt]);function Gt(e){if(!T.isInstance(e))return e;const t="https://v6.ai-sdk.dev/unauthenticated-ai-gateway";return"production"===(null==ve?void 0:"production")?new y.bD({name:"GatewayError",message:`Unauthenticated. Configure AI_GATEWAY_API_KEY or use a provider module. Learn more: ${t}`}):Object.assign(new Error(`[1m[31mUnauthenticated request to AI Gateway.[0m\n\nTo authenticate, set the [33mAI_GATEWAY_API_KEY[0m environment variable with your API key.\n\nAlternatively, you can use a provider module instead of the AI Gateway.\n\nLearn more: [34m${t}[0m\n\n`),{name:"GatewayAuthenticationError"})}function Wt({operationId:e,telemetry:t}){return{"operation.name":`${e}${null!=(null==t?void 0:t.functionId)?` ${t.functionId}`:""}`,"resource.name":null==t?void 0:t.functionId,"ai.operationId":e,"ai.telemetry.functionId":null==t?void 0:t.functionId}}var Kt={startSpan:()=>Ht,startActiveSpan:(e,t,n,a)=>"function"==typeof t?t(Ht):"function"==typeof n?n(Ht):"function"==typeof a?a(Ht):void 0},Ht={spanContext:()=>Jt,setAttribute(){return this},setAttributes(){return this},addEvent(){return this},addLink(){return this},addLinks(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording:()=>!1,recordException(){return this}},Jt={traceId:"",spanId:"",traceFlags:0};async function Xt({name:e,tracer:t,attributes:n,fn:a,endWhenDone:r=!0}){return t.startActiveSpan(e,{attributes:await n},(async e=>{try{const t=await a(e);return r&&e.end(),t}catch(t){try{Qt(e,t)}finally{e.end()}throw t}}))}function Qt(e,t){t instanceof Error?(e.recordException({name:t.name,message:t.message,stack:t.stack}),e.setStatus({code:he.s.ERROR,message:t.message})):e.setStatus({code:he.s.ERROR})}async function en({telemetry:e,attributes:t}){if(!0!==(null==e?void 0:e.isEnabled))return{};const n={};for(const[a,r]of Object.entries(t))if(null!=r)if("object"==typeof r&&"input"in r&&"function"==typeof r.input){if(!1===(null==e?void 0:e.recordInputs))continue;const t=await r.input();null!=t&&(n[a]=t)}else if("object"==typeof r&&"output"in r&&"function"==typeof r.output){if(!1===(null==e?void 0:e.recordOutputs))continue;const t=await r.output();null!=t&&(n[a]=t)}else n[a]=r;return n}function tn(e){return{inputTokens:e.inputTokens.total,inputTokenDetails:{noCacheTokens:e.inputTokens.noCache,cacheReadTokens:e.inputTokens.cacheRead,cacheWriteTokens:e.inputTokens.cacheWrite},outputTokens:e.outputTokens.total,outputTokenDetails:{textTokens:e.outputTokens.text,reasoningTokens:e.outputTokens.reasoning},totalTokens:nn(e.inputTokens.total,e.outputTokens.total),raw:e.raw,reasoningTokens:e.outputTokens.reasoning,cachedInputTokens:e.inputTokens.cacheRead}}function nn(e,t){return null==e&&null==t?void 0:(null!=e?e:0)+(null!=t?t:0)}var an=({maxRetries:e=2,initialDelayInMs:t=2e3,backoffFactor:n=2,abortSignal:a}={})=>async r=>rn(r,{maxRetries:e,delayInMs:t,backoffFactor:n,abortSignal:a});async function rn(e,{maxRetries:t,delayInMs:n,backoffFactor:a,abortSignal:r},s=[]){try{return await e()}catch(i){if((0,g.zf)(i))throw i;if(0===t)throw i;const o=(0,g.u1)(i),l=[...s,i],u=l.length;if(u>t)throw new vt({message:`Failed after ${u} attempts. Last error: ${o}`,reason:"maxRetriesExceeded",errors:l});if(i instanceof Error&&y.hL.isInstance(i)&&!0===i.isRetryable&&u<=t)return await(0,g.cb)(function({error:e,exponentialBackoffDelay:t}){const n=e.responseHeaders;if(!n)return t;let a;const r=n["retry-after-ms"];if(r){const e=parseFloat(r);Number.isNaN(e)||(a=e)}const s=n["retry-after"];if(s&&void 0===a){const e=parseFloat(s);a=Number.isNaN(e)?Date.parse(s)-Date.now():1e3*e}return null!=a&&!Number.isNaN(a)&&0<=a&&(a<6e4||a<t)?a:t}({error:i,exponentialBackoffDelay:n}),{abortSignal:r}),rn(e,{maxRetries:t,delayInMs:a*n,backoffFactor:a,abortSignal:r},l);if(1===u)throw i;throw new vt({message:`Failed after ${u} attempts with non-retryable error: '${o}'`,reason:"errorNotRetryable",errors:l})}}async function sn({toolCall:e,tools:t,tracer:n,telemetry:a,messages:r,abortSignal:s,experimental_context:i,onPreliminaryToolResult:o}){const{toolName:l,toolCallId:u,input:c}=e,p=null==t?void 0:t[l];if(null!=(null==p?void 0:p.execute))return Xt({name:"ai.toolCall",attributes:en({telemetry:a,attributes:{...Wt({operationId:"ai.toolCall",telemetry:a}),"ai.toolCall.name":l,"ai.toolCall.id":u,"ai.toolCall.args":{output:()=>JSON.stringify(c)}}}),tracer:n,fn:async t=>{let n;try{const t=(0,g.o8)({execute:p.execute.bind(p),input:c,options:{toolCallId:u,messages:r,abortSignal:s,experimental_context:i}});for await(const a of t)"preliminary"===a.type?null==o||o({...e,type:"tool-result",output:a.output,preliminary:!0}):n=a.output}catch(n){return Qt(t,n),{type:"tool-error",toolCallId:u,toolName:l,input:c,error:n,dynamic:"dynamic"===p.type,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}}try{t.setAttributes(await en({telemetry:a,attributes:{"ai.toolCall.result":{output:()=>JSON.stringify(n)}}}))}catch(e){}return{type:"tool-result",toolCallId:u,toolName:l,input:c,output:n,dynamic:"dynamic"===p.type,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}}})}var on=class{constructor({data:e,mediaType:t}){const n=e instanceof Uint8Array;this.base64Data=n?void 0:e,this.uint8ArrayData=n?e:void 0,this.mediaType=t}get base64(){return null==this.base64Data&&(this.base64Data=(0,g.n_)(this.uint8ArrayData)),this.base64Data}get uint8Array(){return null==this.uint8ArrayData&&(this.uint8ArrayData=(0,g.Z9)(this.base64Data)),this.uint8ArrayData}},ln=class extends on{constructor(e){super(e),this.type="file"}};function un(e){const t=["ROOT"];let n=-1,a=null;function r(e,r,s){switch(e){case'"':n=r,t.pop(),t.push(s),t.push("INSIDE_STRING");break;case"f":case"t":case"n":n=r,a=r,t.pop(),t.push(s),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(s),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=r,t.pop(),t.push(s),t.push("INSIDE_NUMBER");break;case"{":n=r,t.pop(),t.push(s),t.push("INSIDE_OBJECT_START");break;case"[":n=r,t.pop(),t.push(s),t.push("INSIDE_ARRAY_START")}}function s(e,a){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=a,t.pop()}}function i(e,a){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=a,t.pop()}}for(let o=0;o<e.length;o++){const l=e[o];switch(t[t.length-1]){case"ROOT":r(l,o,"FINISH");break;case"INSIDE_OBJECT_START":switch(l){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":n=o,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break;case"INSIDE_OBJECT_KEY":'"'===l&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break;case"INSIDE_OBJECT_AFTER_KEY":":"===l&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":r(l,o,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":s(l,o);break;case"INSIDE_STRING":switch(l){case'"':t.pop(),n=o;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:n=o}break;case"INSIDE_ARRAY_START":"]"===l?(n=o,t.pop()):(n=o,r(l,o,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(l){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=o,t.pop();break;default:n=o}break;case"INSIDE_ARRAY_AFTER_COMMA":r(l,o,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),n=o;break;case"INSIDE_NUMBER":switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=o;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(l,o),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&s(l,o);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&s(l,o);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(l,o);break;default:t.pop()}break;case"INSIDE_LITERAL":{const r=e.substring(a,o+1);"false".startsWith(r)||"true".startsWith(r)||"null".startsWith(r)?n=o:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?s(l,o):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&i(l,o));break}}}let o=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case"INSIDE_STRING":o+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":o+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":o+="]";break;case"INSIDE_LITERAL":{const t=e.substring(a,e.length);"true".startsWith(t)?o+="true".slice(t.length):"false".startsWith(t)?o+="false".slice(t.length):"null".startsWith(t)&&(o+="null".slice(t.length))}}return o}async function cn(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=await(0,g.N8)({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await(0,g.N8)({text:un(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}((e,t)=>{for(var n in t)ge(e,n,{get:t[n],enumerable:!0})})({},{array:()=>mn,choice:()=>hn,json:()=>fn,object:()=>dn,text:()=>pn});var pn=()=>({responseFormat:Promise.resolve({type:"text"}),parseCompleteOutput:async({text:e})=>e,parsePartialOutput:async({text:e})=>({partial:e})}),dn=({schema:e,name:t,description:n})=>{const a=(0,g.mD)(e);return{responseFormat:(0,g.hd)(a.jsonSchema).then((e=>({type:"json",schema:e,...null!=t&&{name:t},...null!=n&&{description:n}}))),async parseCompleteOutput({text:e},t){const n=await(0,g.N8)({text:e});if(!n.success)throw new Me({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});const r=await(0,g.ZZ)({value:n.value,schema:a});if(!r.success)throw new Me({message:"No object generated: response did not match schema.",cause:r.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return r.value},async parsePartialOutput({text:e}){const t=await cn(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:t.value}}}}},mn=({element:e,name:t,description:n})=>{const a=(0,g.mD)(e);return{responseFormat:(0,g.hd)(a.jsonSchema).then((e=>{const{$schema:a,...r}=e;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:r}},required:["elements"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}})),async parseCompleteOutput({text:e},t){const n=await(0,g.N8)({text:e});if(!n.success)throw new Me({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});const r=n.value;if(null==r||"object"!=typeof r||!("elements"in r)||!Array.isArray(r.elements))throw new Me({message:"No object generated: response did not match schema.",cause:new y.iM({value:r,cause:"response must be an object with an elements array"}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});for(const n of r.elements){const r=await(0,g.ZZ)({value:n,schema:a});if(!r.success)throw new Me({message:"No object generated: response did not match schema.",cause:r.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason})}return r.elements},async parsePartialOutput({text:e}){const t=await cn(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const e=t.value;if(null==e||"object"!=typeof e||!("elements"in e)||!Array.isArray(e.elements))return;const n="repaired-parse"===t.state&&e.elements.length>0?e.elements.slice(0,-1):e.elements,r=[];for(const e of n){const t=await(0,g.ZZ)({value:e,schema:a});t.success&&r.push(t.value)}return{partial:r}}}}}},hn=({options:e,name:t,description:n})=>({responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}),async parseCompleteOutput({text:t},n){const a=await(0,g.N8)({text:t});if(!a.success)throw new Me({message:"No object generated: could not parse the response.",cause:a.error,text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});const r=a.value;if(null==r||"object"!=typeof r||!("result"in r)||"string"!=typeof r.result||!e.includes(r.result))throw new Me({message:"No object generated: response did not match schema.",cause:new y.iM({value:r,cause:"response must be an object that contains a choice value."}),text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});return r.result},async parsePartialOutput({text:t}){const n=await cn(t);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const t=n.value;if(null==t||"object"!=typeof t||!("result"in t)||"string"!=typeof t.result)return;const a=e.filter((e=>e.startsWith(t.result)));return"successful-parse"===n.state?a.includes(t.result)?{partial:t.result}:void 0:1===a.length?{partial:a[0]}:void 0}}}}),fn=({name:e,description:t}={})=>({responseFormat:Promise.resolve({type:"json",...null!=e&&{name:e},...null!=t&&{description:t}}),async parseCompleteOutput({text:e},t){const n=await(0,g.N8)({text:e});if(!n.success)throw new Me({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return n.value},async parsePartialOutput({text:e}){const t=await cn(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return void 0===t.value?void 0:{partial:t.value}}}});async function vn(e){const t=""===e.input.trim()?{success:!0,value:{}}:await(0,g.N8)({text:e.input});if(!1===t.success)throw new ke({toolName:e.toolName,toolInput:e.input,cause:t.error});return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:t.value,providerExecuted:!0,dynamic:!0,providerMetadata:e.providerMetadata}}async function gn({toolCall:e,tools:t}){const n=e.toolName,a=t[n];if(null==a){if(e.providerExecuted&&e.dynamic)return await vn(e);throw new Ge({toolName:e.toolName,availableTools:Object.keys(t)})}const r=(0,g.mD)(a.inputSchema),s=""===e.input.trim()?await(0,g.ZZ)({value:{},schema:r}):await(0,g.N8)({text:e.input,schema:r});if(!1===s.success)throw new ke({toolName:n,toolInput:e.input,cause:s.error});return"dynamic"===a.type?{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:s.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,dynamic:!0,title:a.title}:{type:"tool-call",toolCallId:e.toolCallId,toolName:n,input:s.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:a.title}}var yn=class{constructor({content:e,finishReason:t,usage:n,warnings:a,request:r,response:s,providerMetadata:i}){this.content=e,this.finishReason=t,this.usage=n,this.warnings=a,this.request=r,this.response=s,this.providerMetadata=i}get text(){return this.content.filter((e=>"text"===e.type)).map((e=>e.text)).join("")}get reasoning(){return this.content.filter((e=>"reasoning"===e.type))}get reasoningText(){return 0===this.reasoning.length?void 0:this.reasoning.map((e=>e.text)).join("")}get files(){return this.content.filter((e=>"file"===e.type)).map((e=>e.file))}get sources(){return this.content.filter((e=>"source"===e.type))}get toolCalls(){return this.content.filter((e=>"tool-call"===e.type))}get staticToolCalls(){return this.toolCalls.filter((e=>!0!==e.dynamic))}get dynamicToolCalls(){return this.toolCalls.filter((e=>!0===e.dynamic))}get toolResults(){return this.content.filter((e=>"tool-result"===e.type))}get staticToolResults(){return this.toolResults.filter((e=>!0!==e.dynamic))}get dynamicToolResults(){return this.toolResults.filter((e=>!0===e.dynamic))}};function $n(e){return({steps:t})=>t.length===e}function bn({content:e,tools:t}){const n=[],a=e.filter((e=>"source"!==e.type)).filter((e=>("tool-result"!==e.type||e.providerExecuted)&&("tool-error"!==e.type||e.providerExecuted))).filter((e=>"text"!==e.type||e.text.length>0)).map((e=>{switch(e.type){case"text":return{type:"text",text:e.text,providerOptions:e.providerMetadata};case"reasoning":return{type:"reasoning",text:e.text,providerOptions:e.providerMetadata};case"file":return{type:"file",data:e.file.base64,mediaType:e.file.mediaType,providerOptions:e.providerMetadata};case"tool-call":return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input,providerExecuted:e.providerExecuted,providerOptions:e.providerMetadata};case"tool-result":return{type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Nt({tool:null==t?void 0:t[e.toolName],output:e.output,errorMode:"none"}),providerExecuted:!0,providerOptions:e.providerMetadata};case"tool-error":return{type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Nt({tool:null==t?void 0:t[e.toolName],output:e.error,errorMode:"json"}),providerOptions:e.providerMetadata};case"tool-approval-request":return{type:"tool-approval-request",approvalId:e.approvalId,toolCallId:e.toolCall.toolCallId}}}));a.length>0&&n.push({role:"assistant",content:a});const r=e.filter((e=>"tool-result"===e.type||"tool-error"===e.type)).filter((e=>!e.providerExecuted)).map((e=>({type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Nt({tool:null==t?void 0:t[e.toolName],output:"tool-result"===e.type?e.output:e.error,errorMode:"tool-error"===e.type?"text":"none"}),...null!=e.providerMetadata?{providerOptions:e.providerMetadata}:{}})));return r.length>0&&n.push({role:"tool",content:r}),n}function _n(e,t){const n=new Headers(null!=e?e:{});for(const[e,a]of Object.entries(t))n.has(e)||n.set(e,a);return n}function En({response:e,status:t,statusText:n,headers:a,stream:r}){e.writeHead(null!=t?t:200,n,a);const s=r.getReader();(async()=>{try{for(;;){const{done:t,value:n}=await s.read();if(t)break;e.write(n)||await new Promise((t=>{e.once("drain",t)}))}}catch(e){throw e}finally{e.end()}})()}(0,g.hK)({prefix:"aitxt",size:24});var xn=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}\n\n`)},flush(e){e.enqueue("data: [DONE]\n\n")}})}},Sn={"content-type":"text/event-stream","cache-control":"no-cache",connection:"keep-alive","x-vercel-ai-ui-message-stream":"v1","x-accel-buffering":"no"};function An(e,t){if(void 0===e&&void 0===t)return;if(void 0===e)return t;if(void 0===t)return e;const n={...e};for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)){const r=t[a];if(void 0===r)continue;const s=a in e?e[a]:void 0,i=!(null===r||"object"!=typeof r||Array.isArray(r)||r instanceof Date||r instanceof RegExp),o=!(null==s||"object"!=typeof s||Array.isArray(s)||s instanceof Date||s instanceof RegExp);n[a]=i&&o?An(s,r):r}return n}function In(e){return e.type.startsWith("tool-")}function wn(e){return In(e)||function(e){return"dynamic-tool"===e.type}(e)}function Tn(e){return e.type.split("-").slice(1).join("-")}function Nn({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:a,onError:r,onToolCall:s,onData:i}){return e.pipeThrough(new TransformStream({async transform(e,o){await a((async({state:a,write:l})=>{var u,c,p,d;function m(e){const t=a.message.parts.filter(wn).find((t=>t.toolCallId===e));if(null==t)throw new Error(`no tool invocation found for tool call ${e}`);return t}function h(e){var t;const n=a.message.parts.find((t=>In(t)&&t.toolCallId===e.toolCallId)),r=e,s=n;null!=n?(n.state=e.state,s.input=r.input,s.output=r.output,s.errorText=r.errorText,s.rawInput=r.rawInput,s.preliminary=r.preliminary,void 0!==e.title&&(s.title=e.title),s.providerExecuted=null!=(t=r.providerExecuted)?t:n.providerExecuted,null!=r.providerMetadata&&"input-available"===n.state&&(n.callProviderMetadata=r.providerMetadata)):a.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title,input:r.input,output:r.output,rawInput:r.rawInput,errorText:r.errorText,providerExecuted:r.providerExecuted,preliminary:r.preliminary,...null!=r.providerMetadata?{callProviderMetadata:r.providerMetadata}:{}})}function f(e){var t,n;const r=a.message.parts.find((t=>"dynamic-tool"===t.type&&t.toolCallId===e.toolCallId)),s=e,i=r;null!=r?(r.state=e.state,i.toolName=e.toolName,i.input=s.input,i.output=s.output,i.errorText=s.errorText,i.rawInput=null!=(t=s.rawInput)?t:i.rawInput,i.preliminary=s.preliminary,void 0!==e.title&&(i.title=e.title),i.providerExecuted=null!=(n=s.providerExecuted)?n:r.providerExecuted,null!=s.providerMetadata&&"input-available"===r.state&&(r.callProviderMetadata=s.providerMetadata)):a.message.parts.push({type:"dynamic-tool",toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:s.input,output:s.output,errorText:s.errorText,preliminary:s.preliminary,providerExecuted:s.providerExecuted,title:e.title,...null!=s.providerMetadata?{callProviderMetadata:s.providerMetadata}:{}})}async function v(e){if(null!=e){const n=null!=a.message.metadata?An(a.message.metadata,e):e;null!=t&&await(0,g.k5)({value:n,schema:t}),a.message.metadata=n}}switch(e.type){case"text-start":{const t={type:"text",text:"",providerMetadata:e.providerMetadata,state:"streaming"};a.activeTextParts[e.id]=t,a.message.parts.push(t),l();break}case"text-delta":{const t=a.activeTextParts[e.id];t.text+=e.delta,t.providerMetadata=null!=(u=e.providerMetadata)?u:t.providerMetadata,l();break}case"text-end":{const t=a.activeTextParts[e.id];t.state="done",t.providerMetadata=null!=(c=e.providerMetadata)?c:t.providerMetadata,delete a.activeTextParts[e.id],l();break}case"reasoning-start":{const t={type:"reasoning",text:"",providerMetadata:e.providerMetadata,state:"streaming"};a.activeReasoningParts[e.id]=t,a.message.parts.push(t),l();break}case"reasoning-delta":{const t=a.activeReasoningParts[e.id];t.text+=e.delta,t.providerMetadata=null!=(p=e.providerMetadata)?p:t.providerMetadata,l();break}case"reasoning-end":{const t=a.activeReasoningParts[e.id];t.providerMetadata=null!=(d=e.providerMetadata)?d:t.providerMetadata,t.state="done",delete a.activeReasoningParts[e.id],l();break}case"file":a.message.parts.push({type:"file",mediaType:e.mediaType,url:e.url}),l();break;case"source-url":a.message.parts.push({type:"source-url",sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),l();break;case"source-document":a.message.parts.push({type:"source-document",sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),l();break;case"tool-input-start":{const t=a.message.parts.filter(In);a.partialToolCalls[e.toolCallId]={text:"",toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title},e.dynamic?f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title}),l();break}case"tool-input-delta":{const t=a.partialToolCalls[e.toolCallId];t.text+=e.inputTextDelta;const{value:n}=await cn(t.text);t.dynamic?f({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title}):h({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title}),l();break}case"tool-input-available":e.dynamic?f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}),l(),s&&!e.providerExecuted&&await s({toolCall:e});break;case"tool-input-error":e.dynamic?f({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),l();break;case"tool-approval-request":{const t=m(e.toolCallId);t.state="approval-requested",t.approval={id:e.approvalId},l();break}case"tool-output-denied":m(e.toolCallId).state="output-denied",l();break;case"tool-output-available":{const t=m(e.toolCallId);"dynamic-tool"===t.type?f({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-available",input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,title:t.title}):h({toolCallId:e.toolCallId,toolName:Tn(t),state:"output-available",input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,title:t.title}),l();break}case"tool-output-error":{const t=m(e.toolCallId);"dynamic-tool"===t.type?f({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-error",input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,title:t.title}):h({toolCallId:e.toolCallId,toolName:Tn(t),state:"output-error",input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,title:t.title}),l();break}case"start-step":a.message.parts.push({type:"step-start"});break;case"finish-step":a.activeTextParts={},a.activeReasoningParts={};break;case"start":null!=e.messageId&&(a.message.id=e.messageId),await v(e.messageMetadata),null==e.messageId&&null==e.messageMetadata||l();break;case"finish":null!=e.finishReason&&(a.finishReason=e.finishReason),await v(e.messageMetadata),null!=e.messageMetadata&&l();break;case"message-metadata":await v(e.messageMetadata),null!=e.messageMetadata&&l();break;case"error":null==r||r(new Error(e.errorText));break;default:if(function(e){return e.type.startsWith("data-")}(e)){null!=(null==n?void 0:n[e.type])&&await(0,g.k5)({value:e.data,schema:n[e.type]});const t=e;if(t.transient){null==i||i(t);break}const r=null!=t.id?a.message.parts.find((e=>t.type===e.type&&t.id===e.id)):void 0;null!=r?r.data=t.data:a.message.parts.push(t),null==i||i(t),l()}}o.enqueue(e)}))}}))}function On(e){const t=e.pipeThrough(new TransformStream);return t[Symbol.asyncIterator]=function(){const e=this.getReader();let t=!1;async function n(n){var a;t=!0;try{n&&await(null==(a=e.cancel)?void 0:a.call(e))}finally{try{e.releaseLock()}catch(e){}}}return{async next(){if(t)return{done:!0,value:void 0};const{done:a,value:r}=await e.read();return a?(await n(!0),{done:!0,value:void 0}):{done:!1,value:r}},return:async()=>(await n(!0),{done:!0,value:void 0}),async throw(e){throw await n(!0),e}}},t}function kn(){let e,t;return{promise:new Promise(((n,a)=>{e=n,t=a})),resolve:e,reject:t}}function Rn(){var e,t;return null!=(t=null==(e=null==globalThis?void 0:globalThis.performance)?void 0:e.now())?t:Date.now()}(0,g.ID)((()=>(0,g.jN)($.KC([$.re({type:$.eu("text-start"),id:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.eu("text-delta"),id:$.Yj(),delta:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.eu("text-end"),id:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.eu("error"),errorText:$.Yj()}),$.re({type:$.eu("tool-input-start"),toolCallId:$.Yj(),toolName:$.Yj(),providerExecuted:$.zM().optional(),dynamic:$.zM().optional(),title:$.Yj().optional()}),$.re({type:$.eu("tool-input-delta"),toolCallId:$.Yj(),inputTextDelta:$.Yj()}),$.re({type:$.eu("tool-input-available"),toolCallId:$.Yj(),toolName:$.Yj(),input:$.L5(),providerExecuted:$.zM().optional(),providerMetadata:Rt.optional(),dynamic:$.zM().optional(),title:$.Yj().optional()}),$.re({type:$.eu("tool-input-error"),toolCallId:$.Yj(),toolName:$.Yj(),input:$.L5(),providerExecuted:$.zM().optional(),providerMetadata:Rt.optional(),dynamic:$.zM().optional(),errorText:$.Yj(),title:$.Yj().optional()}),$.re({type:$.eu("tool-approval-request"),approvalId:$.Yj(),toolCallId:$.Yj()}),$.re({type:$.eu("tool-output-available"),toolCallId:$.Yj(),output:$.L5(),providerExecuted:$.zM().optional(),dynamic:$.zM().optional(),preliminary:$.zM().optional()}),$.re({type:$.eu("tool-output-error"),toolCallId:$.Yj(),errorText:$.Yj(),providerExecuted:$.zM().optional(),dynamic:$.zM().optional()}),$.re({type:$.eu("tool-output-denied"),toolCallId:$.Yj()}),$.re({type:$.eu("reasoning-start"),id:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.eu("reasoning-delta"),id:$.Yj(),delta:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.eu("reasoning-end"),id:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.eu("source-url"),sourceId:$.Yj(),url:$.Yj(),title:$.Yj().optional(),providerMetadata:Rt.optional()}),$.re({type:$.eu("source-document"),sourceId:$.Yj(),mediaType:$.Yj(),title:$.Yj(),filename:$.Yj().optional(),providerMetadata:Rt.optional()}),$.re({type:$.eu("file"),url:$.Yj(),mediaType:$.Yj(),providerMetadata:Rt.optional()}),$.re({type:$.Ie((e=>"string"==typeof e&&e.startsWith("data-")),{message:'Type must start with "data-"'}),id:$.Yj().optional(),data:$.L5(),transient:$.zM().optional()}),$.re({type:$.eu("start-step")}),$.re({type:$.eu("finish-step")}),$.re({type:$.eu("start"),messageId:$.Yj().optional(),messageMetadata:$.L5().optional()}),$.re({type:$.eu("finish"),finishReason:$.k5(["stop","length","content-filter","tool-calls","error","other","unknown"]).optional(),messageMetadata:$.L5().optional()}),$.re({type:$.eu("abort")}),$.re({type:$.eu("message-metadata"),messageMetadata:$.L5()})]))));var Cn=(0,g.hK)({prefix:"aitxt",size:24});function Pn({model:e,tools:t,toolChoice:n,system:a,prompt:r,messages:s,maxRetries:i,abortSignal:o,headers:l,stopWhen:u=$n(1),experimental_output:c,output:p=c,experimental_telemetry:d,prepareStep:m,providerOptions:h,experimental_activeTools:f,activeTools:v=f,experimental_repairToolCall:g,experimental_transform:y,experimental_download:$,includeRawChunks:b=!1,onChunk:_,onError:E=({error:e})=>{console.error(e)},onFinish:x,onAbort:S,onStepFinish:A,experimental_context:I,_internal:{now:w=Rn,generateId:T=Cn,currentDate:N=()=>new Date}={},...O}){return new Ln({model:$t(e),telemetry:d,headers:l,settings:O,maxRetries:i,abortSignal:o,system:a,prompt:r,messages:s,tools:t,toolChoice:n,transforms:It(y),activeTools:v,repairToolCall:g,stopConditions:It(u),output:p,providerOptions:h,prepareStep:m,includeRawChunks:b,onChunk:_,onError:E,onFinish:x,onAbort:S,onStepFinish:A,now:w,currentDate:N,generateId:T,experimental_context:I,download:$})}var Ln=class{constructor({model:e,telemetry:t,headers:n,settings:a,maxRetries:r,abortSignal:s,system:i,prompt:o,messages:l,tools:u,toolChoice:c,transforms:p,activeTools:d,repairToolCall:m,stopConditions:h,output:f,providerOptions:v,prepareStep:b,includeRawChunks:_,now:E,currentDate:x,generateId:S,onChunk:A,onError:I,onFinish:w,onAbort:T,onStepFinish:N,experimental_context:O,download:k}){let R;this._totalUsage=new g.e1,this._finishReason=new g.e1,this._steps=new g.e1,this.outputSpecification=f,this.includeRawChunks=_,this.tools=u;let C=[];const P=[];let L,j,M={},D=[];const Y=[];let F,q={},U={};const V=new TransformStream({async transform(t,n){var a,r,s,i;n.enqueue(t);const{part:o}=t;if("text-delta"!==o.type&&"reasoning-delta"!==o.type&&"source"!==o.type&&"tool-call"!==o.type&&"tool-result"!==o.type&&"tool-input-start"!==o.type&&"tool-input-delta"!==o.type&&"raw"!==o.type||await(null==A?void 0:A({chunk:o})),"error"===o.type&&await I({error:Gt(o.error)}),"text-start"===o.type&&(q[o.id]={type:"text",text:"",providerMetadata:o.providerMetadata},C.push(q[o.id])),"text-delta"===o.type){const e=q[o.id];if(null==e)return void n.enqueue({part:{type:"error",error:`text part ${o.id} not found`},partialOutput:void 0});e.text+=o.text,e.providerMetadata=null!=(a=o.providerMetadata)?a:e.providerMetadata}if("text-end"===o.type){const e=q[o.id];if(null==e)return void n.enqueue({part:{type:"error",error:`text part ${o.id} not found`},partialOutput:void 0});e.providerMetadata=null!=(r=o.providerMetadata)?r:e.providerMetadata,delete q[o.id]}if("reasoning-start"===o.type&&(U[o.id]={type:"reasoning",text:"",providerMetadata:o.providerMetadata},C.push(U[o.id])),"reasoning-delta"===o.type){const e=U[o.id];if(null==e)return void n.enqueue({part:{type:"error",error:`reasoning part ${o.id} not found`},partialOutput:void 0});e.text+=o.text,e.providerMetadata=null!=(s=o.providerMetadata)?s:e.providerMetadata}if("reasoning-end"===o.type){const e=U[o.id];if(null==e)return void n.enqueue({part:{type:"error",error:`reasoning part ${o.id} not found`},partialOutput:void 0});e.providerMetadata=null!=(i=o.providerMetadata)?i:e.providerMetadata,delete U[o.id]}if("file"===o.type&&C.push({type:"file",file:o.file}),"source"===o.type&&C.push(o),"tool-call"===o.type&&C.push(o),"tool-result"!==o.type||o.preliminary||C.push(o),"tool-approval-request"===o.type&&C.push(o),"tool-error"===o.type&&C.push(o),"start-step"===o.type&&(C=[],U={},q={},M=o.request,D=o.warnings),"finish-step"===o.type){const t=bn({content:C,tools:u}),n=new yn({content:C,finishReason:o.finishReason,usage:o.usage,warnings:D,request:M,response:{...o.response,messages:[...P,...t]},providerMetadata:o.providerMetadata});await(null==N?void 0:N(n)),_e({warnings:D,provider:e.provider,model:e.modelId}),Y.push(n),P.push(...t),R.resolve()}"finish"===o.type&&(j=o.totalUsage,L=o.finishReason)},async flush(e){try{if(0===Y.length){const e=new Ue({message:"No output generated. Check the stream for errors."});return X._finishReason.reject(e),X._totalUsage.reject(e),void X._steps.reject(e)}const e=null!=L?L:"unknown",n=null!=j?j:{inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0,raw:void 0};X._finishReason.resolve(e),X._totalUsage.resolve(n),X._steps.resolve(Y);const a=Y[Y.length-1];await(null==w?void 0:w({finishReason:e,totalUsage:n,usage:a.usage,content:a.content,text:a.text,reasoningText:a.reasoningText,reasoning:a.reasoning,files:a.files,sources:a.sources,toolCalls:a.toolCalls,staticToolCalls:a.staticToolCalls,dynamicToolCalls:a.dynamicToolCalls,toolResults:a.toolResults,staticToolResults:a.staticToolResults,dynamicToolResults:a.dynamicToolResults,request:a.request,response:a.response,warnings:a.warnings,providerMetadata:a.providerMetadata,steps:Y,experimental_context:O})),F.setAttributes(await en({telemetry:t,attributes:{"ai.response.finishReason":e,"ai.response.text":{output:()=>a.text},"ai.response.toolCalls":{output:()=>{var e;return(null==(e=a.toolCalls)?void 0:e.length)?JSON.stringify(a.toolCalls):void 0}},"ai.response.providerMetadata":JSON.stringify(a.providerMetadata),"ai.usage.inputTokens":n.inputTokens,"ai.usage.outputTokens":n.outputTokens,"ai.usage.totalTokens":n.totalTokens,"ai.usage.reasoningTokens":n.reasoningTokens,"ai.usage.cachedInputTokens":n.cachedInputTokens}}))}catch(t){e.error(t)}finally{F.end()}}}),z=function(){let e=[],t=null,n=!1,a=kn();const r=()=>{n=!0,a.resolve(),e.forEach((e=>e.cancel())),e=[],null==t||t.close()},s=async()=>{if(n&&0===e.length)null==t||t.close();else{if(0===e.length)return a=kn(),await a.promise,s();try{const{value:a,done:r}=await e[0].read();r?(e.shift(),0===e.length&&n?null==t||t.close():await s()):null==t||t.enqueue(a)}catch(n){null==t||t.error(n),e.shift(),r()}}};return{stream:new ReadableStream({start(e){t=e},pull:s,async cancel(){for(const t of e)await t.cancel();e=[],n=!0}}),addStream:t=>{if(n)throw new Error("Cannot add inner stream: outer stream is closed");e.push(t.getReader()),a.resolve()},close:()=>{n=!0,a.resolve(),0===e.length&&(null==t||t.close())},terminate:r}}();this.addStream=z.addStream,this.closeStream=z.close;const Z=z.stream.getReader();let B=new ReadableStream({async start(e){e.enqueue({type:"start"})},async pull(e){function t(){null==T||T({steps:Y}),e.enqueue({type:"abort"}),e.close()}try{const{done:n,value:a}=await Z.read();if(n)return void e.close();if(null==s?void 0:s.aborted)return void t();e.enqueue(a)}catch(n){(0,g.zf)(n)&&(null==s?void 0:s.aborted)?t():e.error(n)}},cancel:e=>z.stream.cancel(e)});for(const e of p)B=B.pipeThrough(e({tools:u,stopStream(){z.terminate()}}));this.baseStream=B.pipeThrough(function(e){let t,n,a="",r="",s="";function i({controller:e,partialOutput:a}){e.enqueue({part:{type:"text-delta",id:t,text:r,providerMetadata:n},partialOutput:a}),r=""}return new TransformStream({async transform(o,l){var u;if("finish-step"===o.type&&r.length>0&&i({controller:l}),"text-delta"!==o.type&&"text-start"!==o.type&&"text-end"!==o.type)return void l.enqueue({part:o,partialOutput:void 0});if(null==t)t=o.id;else if(o.id!==t)return void l.enqueue({part:o,partialOutput:void 0});if("text-start"===o.type)return void l.enqueue({part:o,partialOutput:void 0});if("text-end"===o.type)return r.length>0&&i({controller:l}),void l.enqueue({part:o,partialOutput:void 0});a+=o.text,r+=o.text,n=null!=(u=o.providerMetadata)?u:n;const c=await e.parsePartialOutput({text:a});if(void 0!==c){const e=JSON.stringify(c.partial);e!==s&&(i({controller:l,partialOutput:c.partial}),s=e)}}})}(null!=f?f:pn())).pipeThrough(V);const{maxRetries:G,retry:W}=function({maxRetries:e,abortSignal:t}){if(null!=e){if(!Number.isInteger(e))throw new Ae({parameter:"maxRetries",value:e,message:"maxRetries must be an integer"});if(e<0)throw new Ae({parameter:"maxRetries",value:e,message:"maxRetries must be >= 0"})}const n=null!=e?e:2;return{maxRetries:n,retry:an({maxRetries:n,abortSignal:t})}}({maxRetries:r,abortSignal:s}),K=function({isEnabled:e=!1,tracer:t}={}){return e?t||me.u.getTracer("ai"):Kt}(t),H=function({maxOutputTokens:e,temperature:t,topP:n,topK:a,presencePenalty:r,frequencyPenalty:s,seed:i,stopSequences:o}){if(null!=e){if(!Number.isInteger(e))throw new Ae({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be an integer"});if(e<1)throw new Ae({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be >= 1"})}if(null!=t&&"number"!=typeof t)throw new Ae({parameter:"temperature",value:t,message:"temperature must be a number"});if(null!=n&&"number"!=typeof n)throw new Ae({parameter:"topP",value:n,message:"topP must be a number"});if(null!=a&&"number"!=typeof a)throw new Ae({parameter:"topK",value:a,message:"topK must be a number"});if(null!=r&&"number"!=typeof r)throw new Ae({parameter:"presencePenalty",value:r,message:"presencePenalty must be a number"});if(null!=s&&"number"!=typeof s)throw new Ae({parameter:"frequencyPenalty",value:s,message:"frequencyPenalty must be a number"});if(null!=i&&!Number.isInteger(i))throw new Ae({parameter:"seed",value:i,message:"seed must be an integer"});return{maxOutputTokens:e,temperature:t,topP:n,topK:a,presencePenalty:r,frequencyPenalty:s,stopSequences:o,seed:i}}(a),J=function({model:e,settings:t,telemetry:n,headers:a}){var r;return{"ai.model.provider":e.provider,"ai.model.id":e.modelId,...Object.entries(t).reduce(((e,[t,n])=>(e[`ai.settings.${t}`]=n,e)),{}),...Object.entries(null!=(r=null==n?void 0:n.metadata)?r:{}).reduce(((e,[t,n])=>(e[`ai.telemetry.metadata.${t}`]=n,e)),{}),...Object.entries(null!=a?a:{}).reduce(((e,[t,n])=>(void 0!==n&&(e[`ai.request.headers.${t}`]=n),e)),{})}}({model:e,telemetry:t,headers:n,settings:{...H,maxRetries:G}}),X=this;Xt({name:"ai.streamText",attributes:en({telemetry:t,attributes:{...Wt({operationId:"ai.streamText",telemetry:t}),...J,"ai.prompt":{input:()=>JSON.stringify({system:i,prompt:o,messages:l})}}}),tracer:K,endWhenDone:!1,fn:async a=>{F=a;const r=await async function(e){if(null==e.prompt&&null==e.messages)throw new y.M3({prompt:e,message:"prompt or messages must be defined"});if(null!=e.prompt&&null!=e.messages)throw new y.M3({prompt:e,message:"prompt and messages cannot be defined at the same time"});if(null!=e.system&&"string"!=typeof e.system&&!It(e.system).every((e=>"object"==typeof e&&null!==e&&"role"in e&&"system"===e.role)))throw new y.M3({prompt:e,message:"system must be a string, SystemModelMessage, or array of SystemModelMessage"});let t;if(null!=e.prompt&&"string"==typeof e.prompt)t=[{role:"user",content:e.prompt}];else if(null!=e.prompt&&Array.isArray(e.prompt))t=e.prompt;else{if(null==e.messages)throw new y.M3({prompt:e,message:"prompt or messages must be defined"});t=e.messages}if(0===t.length)throw new y.M3({prompt:e,message:"messages must not be empty"});const n=await(0,g.ZZ)({value:t,schema:$.YO(Bt)});if(!n.success)throw new y.M3({prompt:e,message:"The messages do not match the ModelMessage[] schema.",cause:n.error});return{messages:t,system:e.system}}({system:i,prompt:o,messages:l}),p=r.messages,_=[],{approvedToolApprovals:A,deniedToolApprovals:I}=function({messages:e}){const t=e.at(-1);if("tool"!=(null==t?void 0:t.role))return{approvedToolApprovals:[],deniedToolApprovals:[]};const n={};for(const t of e)if("assistant"===t.role&&"string"!=typeof t.content){const e=t.content;for(const t of e)"tool-call"===t.type&&(n[t.toolCallId]=t)}const a={};for(const t of e)if("assistant"===t.role&&"string"!=typeof t.content){const e=t.content;for(const t of e)"tool-approval-request"===t.type&&(a[t.approvalId]=t)}const r={};for(const e of t.content)"tool-result"===e.type&&(r[e.toolCallId]=e);const s=[],i=[],o=t.content.filter((e=>"tool-approval-response"===e.type));for(const e of o){const t=a[e.approvalId];if(null!=r[t.toolCallId])continue;const o={approvalRequest:t,approvalResponse:e,toolCall:n[t.toolCallId]};e.approved?s.push(o):i.push(o)}return{approvedToolApprovals:s,deniedToolApprovals:i}}({messages:p});if(I.length>0||A.length>0){let e;const n=new ReadableStream({start(t){e=t}});X.addStream(n);try{for(const t of I)null==e||e.enqueue({type:"tool-output-denied",toolCallId:t.toolCall.toolCallId,toolName:t.toolCall.toolName});const n=[];await Promise.all(A.map((async a=>{const r=await sn({toolCall:a.toolCall,tools:u,tracer:K,telemetry:t,messages:p,abortSignal:s,experimental_context:O,onPreliminaryToolResult:t=>{null==e||e.enqueue(t)}});null!=r&&(null==e||e.enqueue(r),n.push(r))}))),_.push({role:"tool",content:[...n.map((e=>({type:"tool-result",toolCallId:e.toolCallId,toolName:e.toolName,output:Nt({tool:null==u?void 0:u[e.toolName],output:"tool-result"===e.type?e.output:e.error,errorMode:"tool-error"===e.type?"json":"none"})}))),...I.map((e=>({type:"tool-result",toolCallId:e.toolCall.toolCallId,toolName:e.toolCall.toolName,output:{type:"execution-denied",reason:e.approvalResponse.reason}})))]})}finally{null==e||e.close()}}P.push(..._),await async function a({currentStep:o,responseMessages:l,usage:y}){var $,_,A,I,w,T;const N=X.includeRawChunks;R=new g.e1;const C=[...p,...l],P=await(null==b?void 0:b({model:e,steps:Y,stepNumber:Y.length,messages:C,experimental_context:O})),L=$t(null!=($=null==P?void 0:P.model)?$:e),j=await wt({prompt:{system:null!=(_=null==P?void 0:P.system)?_:r.system,messages:null!=(A=null==P?void 0:P.messages)?A:C},supportedUrls:await L.supportedUrls,download:k}),{toolChoice:M,tools:D}=await async function({tools:e,toolChoice:t,activeTools:n}){if(!(null!=(a=e)&&Object.keys(a).length>0))return{tools:void 0,toolChoice:void 0};var a;const r=null!=n?Object.entries(e).filter((([e])=>n.includes(e))):Object.entries(e),s=[];for(const[e,t]of r){const n=t.type;switch(n){case void 0:case"dynamic":case"function":s.push({type:"function",name:e,description:t.description,inputSchema:await(0,g.mD)(t.inputSchema).jsonSchema,...null!=t.inputExamples?{inputExamples:t.inputExamples}:{},providerOptions:t.providerOptions,...null!=t.strict?{strict:t.strict}:{}});break;case"provider":s.push({type:"provider",name:e,id:t.id,args:t.args});break;default:throw new Error(`Unsupported tool type: ${n}`)}}return{tools:s,toolChoice:null==t?{type:"auto"}:"string"==typeof t?{type:t}:{type:"tool",toolName:t.toolName}}}({tools:u,toolChoice:null!=(I=null==P?void 0:P.toolChoice)?I:c,activeTools:null!=(w=null==P?void 0:P.activeTools)?w:d});O=null!=(T=null==P?void 0:P.experimental_context)?T:O;const{result:{stream:F,response:q,request:U},doStreamSpan:V,startTimestampMs:z}=await W((()=>Xt({name:"ai.streamText.doStream",attributes:en({telemetry:t,attributes:{...Wt({operationId:"ai.streamText.doStream",telemetry:t}),...J,"ai.model.provider":L.provider,"ai.model.id":L.modelId,"ai.prompt.messages":{input:()=>function(e){return JSON.stringify(e.map((e=>({...e,content:"string"==typeof e.content?e.content:e.content.map((e=>{return"file"===e.type?{...e,data:e.data instanceof Uint8Array?(t=e.data,"string"==typeof t?t:t instanceof ArrayBuffer?(0,g.n_)(new Uint8Array(t)):(0,g.n_)(t)):e.data}:e;var t}))}))))}(j)},"ai.prompt.tools":{input:()=>null==D?void 0:D.map((e=>JSON.stringify(e)))},"ai.prompt.toolChoice":{input:()=>null!=M?JSON.stringify(M):void 0},"gen_ai.system":L.provider,"gen_ai.request.model":L.modelId,"gen_ai.request.frequency_penalty":H.frequencyPenalty,"gen_ai.request.max_tokens":H.maxOutputTokens,"gen_ai.request.presence_penalty":H.presencePenalty,"gen_ai.request.stop_sequences":H.stopSequences,"gen_ai.request.temperature":H.temperature,"gen_ai.request.top_k":H.topK,"gen_ai.request.top_p":H.topP}}),tracer:K,endWhenDone:!1,fn:async e=>({startTimestampMs:E(),doStreamSpan:e,result:await L.doStream({...H,tools:D,toolChoice:M,responseFormat:await(null==f?void 0:f.responseFormat),prompt:j,providerOptions:v,abortSignal:s,headers:n,includeRawChunks:N})})}))),Z=function({tools:e,generatorStream:t,tracer:n,telemetry:a,system:r,messages:s,abortSignal:i,repairToolCall:o,experimental_context:l,generateId:u}){let c=null;const p=new ReadableStream({start(e){c=e}}),d=new Set,m=new Map;let h,f=!1;function v(){f&&0===d.size&&(null!=h&&c.enqueue(h),c.close())}const y=new TransformStream({async transform(t,p){const f=t.type;switch(f){case"stream-start":case"text-start":case"text-delta":case"text-end":case"reasoning-start":case"reasoning-delta":case"reasoning-end":case"tool-input-start":case"tool-input-delta":case"tool-input-end":case"source":case"response-metadata":case"error":case"raw":p.enqueue(t);break;case"file":p.enqueue({type:"file",file:new ln({data:t.data,mediaType:t.mediaType})});break;case"finish":h={type:"finish",finishReason:t.finishReason,usage:tn(t.usage),providerMetadata:t.providerMetadata};break;case"tool-call":try{const h=await async function({toolCall:e,tools:t,repairToolCall:n,system:a,messages:r}){var s;try{if(null==t){if(e.providerExecuted&&e.dynamic)return await vn(e);throw new Ge({toolName:e.toolName})}try{return await gn({toolCall:e,tools:t})}catch(s){if(null==n||!Ge.isInstance(s)&&!ke.isInstance(s))throw s;let i=null;try{i=await n({toolCall:e,tools:t,inputSchema:async({toolName:e})=>{const{inputSchema:n}=t[e];return await(0,g.mD)(n).jsonSchema},system:a,messages:r,error:s})}catch(e){throw new Xe({cause:e,originalError:s})}if(null==i)throw s;return await gn({toolCall:i,tools:t})}}catch(n){const a=await(0,g.N8)({text:e.input}),r=a.success?a.value:e.input;return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:r,dynamic:!0,invalid:!0,error:n,title:null==(s=null==t?void 0:t[e.toolName])?void 0:s.title,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}}}({toolCall:t,tools:e,repairToolCall:o,system:r,messages:s});if(p.enqueue(h),h.invalid){c.enqueue({type:"tool-error",toolCallId:h.toolCallId,toolName:h.toolName,input:h.input,error:(0,g.u1)(h.error),dynamic:!0,title:h.title});break}const f=null==e?void 0:e[h.toolName];if(null==f)break;if(null!=f.onInputAvailable&&await f.onInputAvailable({input:h.input,toolCallId:h.toolCallId,messages:s,abortSignal:i,experimental_context:l}),await async function({tool:e,toolCall:t,messages:n,experimental_context:a}){return null!=e.needsApproval&&("boolean"==typeof e.needsApproval?e.needsApproval:await e.needsApproval(t.input,{toolCallId:t.toolCallId,messages:n,experimental_context:a}))}({tool:f,toolCall:h,messages:s,experimental_context:l})){c.enqueue({type:"tool-approval-request",approvalId:u(),toolCall:h});break}if(m.set(h.toolCallId,h.input),null!=f.execute&&!0!==h.providerExecuted){const t=u();d.add(t),sn({toolCall:h,tools:e,tracer:n,telemetry:a,messages:s,abortSignal:i,experimental_context:l,onPreliminaryToolResult:e=>{c.enqueue(e)}}).then((e=>{c.enqueue(e),d.delete(t),v()}))}}catch(e){c.enqueue({type:"error",error:e})}break;case"tool-result":{const e=t.toolName;t.isError?c.enqueue({type:"tool-error",toolCallId:t.toolCallId,toolName:e,input:m.get(t.toolCallId),providerExecuted:!0,error:t.result,dynamic:t.dynamic}):p.enqueue({type:"tool-result",toolCallId:t.toolCallId,toolName:e,input:m.get(t.toolCallId),output:t.result,providerExecuted:!0,dynamic:t.dynamic});break}default:throw new Error(`Unhandled chunk type: ${f}`)}},flush(){f=!0,v()}});return new ReadableStream({start:async e=>Promise.all([t.pipeThrough(y).pipeTo(new WritableStream({write(t){e.enqueue(t)},close(){}})),p.pipeTo(new WritableStream({write(t){e.enqueue(t)},close(){e.close()}}))])})}({tools:u,generatorStream:F,tracer:K,telemetry:t,system:i,messages:C,repairToolCall:m,abortSignal:s,experimental_context:O,generateId:S}),B=null!=U?U:{},G=[],Q=[];let ee;const te={};let ne,ae="unknown",re={inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0,raw:void 0},se=!0,ie={id:S(),timestamp:x(),modelId:e.modelId},oe="";X.addStream(Z.pipeThrough(new TransformStream({async transform(e,t){var n,a,r,i,o;if("stream-start"===e.type)return void(ee=e.warnings);if(se){const e=E()-z;se=!1,V.addEvent("ai.stream.firstChunk",{"ai.response.msToFirstChunk":e}),V.setAttributes({"ai.response.msToFirstChunk":e}),t.enqueue({type:"start-step",request:B,warnings:null!=ee?ee:[]})}const l=e.type;switch(l){case"tool-approval-request":case"text-start":case"text-end":case"reasoning-start":case"reasoning-end":case"file":case"source":t.enqueue(e);break;case"text-delta":e.delta.length>0&&(t.enqueue({type:"text-delta",id:e.id,text:e.delta,providerMetadata:e.providerMetadata}),oe+=e.delta);break;case"reasoning-delta":t.enqueue({type:"reasoning-delta",id:e.id,text:e.delta,providerMetadata:e.providerMetadata});break;case"tool-call":t.enqueue(e),G.push(e);break;case"tool-result":t.enqueue(e),e.preliminary||Q.push(e);break;case"tool-error":t.enqueue(e),Q.push(e);break;case"response-metadata":ie={id:null!=(n=e.id)?n:ie.id,timestamp:null!=(a=e.timestamp)?a:ie.timestamp,modelId:null!=(r=e.modelId)?r:ie.modelId};break;case"finish":{re=e.usage,ae=e.finishReason,ne=e.providerMetadata;const t=E()-z;V.addEvent("ai.stream.finish"),V.setAttributes({"ai.response.msToFinish":t,"ai.response.avgOutputTokensPerSecond":1e3*(null!=(i=re.outputTokens)?i:0)/t});break}case"tool-input-start":{te[e.id]=e.toolName;const n=null==u?void 0:u[e.toolName];null!=(null==n?void 0:n.onInputStart)&&await n.onInputStart({toolCallId:e.id,messages:C,abortSignal:s,experimental_context:O}),t.enqueue({...e,dynamic:null!=(o=e.dynamic)?o:"dynamic"===(null==n?void 0:n.type),title:null==n?void 0:n.title});break}case"tool-input-end":delete te[e.id],t.enqueue(e);break;case"tool-input-delta":{const n=te[e.id],a=null==u?void 0:u[n];null!=(null==a?void 0:a.onInputDelta)&&await a.onInputDelta({inputTextDelta:e.delta,toolCallId:e.id,messages:C,abortSignal:s,experimental_context:O}),t.enqueue(e);break}case"error":t.enqueue(e),ae="error";break;case"raw":N&&t.enqueue(e);break;default:throw new Error(`Unknown chunk type: ${l}`)}},async flush(e){const n=G.length>0?JSON.stringify(G):void 0;try{V.setAttributes(await en({telemetry:t,attributes:{"ai.response.finishReason":ae,"ai.response.text":{output:()=>oe},"ai.response.toolCalls":{output:()=>n},"ai.response.id":ie.id,"ai.response.model":ie.modelId,"ai.response.timestamp":ie.timestamp.toISOString(),"ai.response.providerMetadata":JSON.stringify(ne),"ai.usage.inputTokens":re.inputTokens,"ai.usage.outputTokens":re.outputTokens,"ai.usage.totalTokens":re.totalTokens,"ai.usage.reasoningTokens":re.reasoningTokens,"ai.usage.cachedInputTokens":re.cachedInputTokens,"gen_ai.response.finish_reasons":[ae],"gen_ai.response.id":ie.id,"gen_ai.response.model":ie.modelId,"gen_ai.usage.input_tokens":re.inputTokens,"gen_ai.usage.output_tokens":re.outputTokens}}))}catch(e){}finally{V.end()}e.enqueue({type:"finish-step",finishReason:ae,usage:re,providerMetadata:ne,response:{...ie,headers:null==q?void 0:q.headers}});const r=function(e,t){var n,a,r,s,i,o,l,u,c,p;return{inputTokens:nn(e.inputTokens,t.inputTokens),inputTokenDetails:{noCacheTokens:nn(null==(n=e.inputTokenDetails)?void 0:n.noCacheTokens,null==(a=t.inputTokenDetails)?void 0:a.noCacheTokens),cacheReadTokens:nn(null==(r=e.inputTokenDetails)?void 0:r.cacheReadTokens,null==(s=t.inputTokenDetails)?void 0:s.cacheReadTokens),cacheWriteTokens:nn(null==(i=e.inputTokenDetails)?void 0:i.cacheWriteTokens,null==(o=t.inputTokenDetails)?void 0:o.cacheWriteTokens)},outputTokens:nn(e.outputTokens,t.outputTokens),outputTokenDetails:{textTokens:nn(null==(l=e.outputTokenDetails)?void 0:l.textTokens,null==(u=t.outputTokenDetails)?void 0:u.textTokens),reasoningTokens:nn(null==(c=e.outputTokenDetails)?void 0:c.reasoningTokens,null==(p=t.outputTokenDetails)?void 0:p.reasoningTokens)},totalTokens:nn(e.totalTokens,t.totalTokens),reasoningTokens:nn(e.reasoningTokens,t.reasoningTokens),cachedInputTokens:nn(e.cachedInputTokens,t.cachedInputTokens)}}(y,re);await R.promise;const s=G.filter((e=>!0!==e.providerExecuted)),i=Q.filter((e=>!0!==e.providerExecuted));if(s.length>0&&i.length===s.length&&!await async function({stopConditions:e,steps:t}){return(await Promise.all(e.map((e=>e({steps:t}))))).some((e=>e))}({stopConditions:h,steps:Y})){l.push(...bn({content:Y[Y.length-1].content,tools:u}));try{await a({currentStep:o+1,responseMessages:l,usage:r})}catch(t){e.enqueue({type:"error",error:t}),X.closeStream()}}else e.enqueue({type:"finish",finishReason:ae,totalUsage:r}),X.closeStream()}})))}({currentStep:0,responseMessages:_,usage:{inputTokens:void 0,inputTokenDetails:{noCacheTokens:void 0,cacheReadTokens:void 0,cacheWriteTokens:void 0},outputTokens:void 0,outputTokenDetails:{textTokens:void 0,reasoningTokens:void 0},totalTokens:void 0,raw:void 0}})}}).catch((e=>{X.addStream(new ReadableStream({start(t){t.enqueue({type:"error",error:e}),t.close()}})),X.closeStream()}))}get steps(){return this.consumeStream(),this._steps.promise}get finalStep(){return this.steps.then((e=>e[e.length-1]))}get content(){return this.finalStep.then((e=>e.content))}get warnings(){return this.finalStep.then((e=>e.warnings))}get providerMetadata(){return this.finalStep.then((e=>e.providerMetadata))}get text(){return this.finalStep.then((e=>e.text))}get reasoningText(){return this.finalStep.then((e=>e.reasoningText))}get reasoning(){return this.finalStep.then((e=>e.reasoning))}get sources(){return this.finalStep.then((e=>e.sources))}get files(){return this.finalStep.then((e=>e.files))}get toolCalls(){return this.finalStep.then((e=>e.toolCalls))}get staticToolCalls(){return this.finalStep.then((e=>e.staticToolCalls))}get dynamicToolCalls(){return this.finalStep.then((e=>e.dynamicToolCalls))}get toolResults(){return this.finalStep.then((e=>e.toolResults))}get staticToolResults(){return this.finalStep.then((e=>e.staticToolResults))}get dynamicToolResults(){return this.finalStep.then((e=>e.dynamicToolResults))}get usage(){return this.finalStep.then((e=>e.usage))}get request(){return this.finalStep.then((e=>e.request))}get response(){return this.finalStep.then((e=>e.response))}get totalUsage(){return this.consumeStream(),this._totalUsage.promise}get finishReason(){return this.consumeStream(),this._finishReason.promise}teeStream(){const[e,t]=this.baseStream.tee();return this.baseStream=t,e}get textStream(){return On(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){"text-delta"===e.type&&t.enqueue(e.text)}})))}get fullStream(){return On(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){t.enqueue(e)}})))}async consumeStream(e){var t;try{await async function({stream:e,onError:t}){const n=e.getReader();try{for(;;){const{done:e}=await n.read();if(e)break}}catch(e){null==t||t(e)}finally{n.releaseLock()}}({stream:this.fullStream,onError:null==e?void 0:e.onError})}catch(n){null==(t=null==e?void 0:e.onError)||t.call(e,n)}}get experimental_partialOutputStream(){return this.partialOutputStream}get partialOutputStream(){return On(this.teeStream().pipeThrough(new TransformStream({transform({partialOutput:e},t){null!=e&&t.enqueue(e)}})))}get output(){return this.finalStep.then((e=>{var t;return(null!=(t=this.outputSpecification)?t:pn()).parseCompleteOutput({text:e.text},{response:e.response,usage:e.usage,finishReason:e.finishReason})}))}toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:a,sendReasoning:r=!0,sendSources:s=!1,sendStart:i=!0,sendFinish:o=!0,onError:l=y.u1}={}){const u=null!=t?function({originalMessages:e,responseMessageId:t}){if(null==e)return;const n=e[e.length-1];return"assistant"===(null==n?void 0:n.role)?n.id:"function"==typeof t?t():t}({originalMessages:e,responseMessageId:t}):void 0,c=e=>{var t;const n=null==(t=this.tools)?void 0:t[e.toolName];return null==n?e.dynamic:"dynamic"===(null==n?void 0:n.type)||void 0};return On(function({messageId:e,originalMessages:t=[],onFinish:n,onError:a,stream:r}){let s=null==t?void 0:t[t.length-1];"assistant"!==(null==s?void 0:s.role)?s=void 0:e=s.id;let i=!1;const o=r.pipeThrough(new TransformStream({transform(t,n){if("start"===t.type){const n=t;null==n.messageId&&null!=e&&(n.messageId=e)}"abort"===t.type&&(i=!0),n.enqueue(t)}}));if(null==n)return o;const l=function({lastMessage:e,messageId:t}){return{message:"assistant"===(null==e?void 0:e.role)?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}({lastMessage:s?structuredClone(s):void 0,messageId:null!=e?e:""});let u=!1;const c=async()=>{if(u||!n)return;u=!0;const e=l.message.id===(null==s?void 0:s.id);await n({isAborted:i,isContinuation:e,responseMessage:l.message,messages:[...e?t.slice(0,-1):t,l.message],finishReason:l.finishReason})};return Nn({stream:o,runUpdateMessageJob:async e=>{await e({state:l,write:()=>{}})},onError:a}).pipeThrough(new TransformStream({transform(e,t){t.enqueue(e)},async cancel(){await c()},async flush(){await c()}}))}({stream:this.fullStream.pipeThrough(new TransformStream({transform:async(e,t)=>{const n=null==a?void 0:a({part:e}),p=e.type;switch(p){case"text-start":t.enqueue({type:"text-start",id:e.id,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"text-delta":t.enqueue({type:"text-delta",id:e.id,delta:e.text,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"text-end":t.enqueue({type:"text-end",id:e.id,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"reasoning-start":t.enqueue({type:"reasoning-start",id:e.id,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"reasoning-delta":r&&t.enqueue({type:"reasoning-delta",id:e.id,delta:e.text,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"reasoning-end":t.enqueue({type:"reasoning-end",id:e.id,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"file":t.enqueue({type:"file",mediaType:e.file.mediaType,url:`data:${e.file.mediaType};base64,${e.file.base64}`});break;case"source":s&&"url"===e.sourceType&&t.enqueue({type:"source-url",sourceId:e.id,url:e.url,title:e.title,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}),s&&"document"===e.sourceType&&t.enqueue({type:"source-document",sourceId:e.id,mediaType:e.mediaType,title:e.title,filename:e.filename,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}});break;case"tool-input-start":{const n=c(e);t.enqueue({type:"tool-input-start",toolCallId:e.id,toolName:e.toolName,...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=n?{dynamic:n}:{},...null!=e.title?{title:e.title}:{}});break}case"tool-input-delta":t.enqueue({type:"tool-input-delta",toolCallId:e.id,inputTextDelta:e.delta});break;case"tool-call":{const n=c(e);e.invalid?t.enqueue({type:"tool-input-error",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input,...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{},...null!=n?{dynamic:n}:{},errorText:l(e.error),...null!=e.title?{title:e.title}:{}}):t.enqueue({type:"tool-input-available",toolCallId:e.toolCallId,toolName:e.toolName,input:e.input,...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{},...null!=n?{dynamic:n}:{},...null!=e.title?{title:e.title}:{}});break}case"tool-approval-request":t.enqueue({type:"tool-approval-request",approvalId:e.approvalId,toolCallId:e.toolCall.toolCallId});break;case"tool-result":{const n=c(e);t.enqueue({type:"tool-output-available",toolCallId:e.toolCallId,output:e.output,...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=e.preliminary?{preliminary:e.preliminary}:{},...null!=n?{dynamic:n}:{}});break}case"tool-error":{const n=c(e);t.enqueue({type:"tool-output-error",toolCallId:e.toolCallId,errorText:l(e.error),...null!=e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...null!=n?{dynamic:n}:{}});break}case"tool-output-denied":t.enqueue({type:"tool-output-denied",toolCallId:e.toolCallId});break;case"error":t.enqueue({type:"error",errorText:l(e.error)});break;case"start-step":t.enqueue({type:"start-step"});break;case"finish-step":t.enqueue({type:"finish-step"});break;case"start":i&&t.enqueue({type:"start",...null!=n?{messageMetadata:n}:{},...null!=u?{messageId:u}:{}});break;case"finish":o&&t.enqueue({type:"finish",finishReason:e.finishReason,...null!=n?{messageMetadata:n}:{}});break;case"abort":t.enqueue(e);break;case"tool-input-end":case"raw":break;default:throw new Error(`Unknown chunk type: ${p}`)}null!=n&&"start"!==p&&"finish"!==p&&t.enqueue({type:"message-metadata",messageMetadata:n})}})),messageId:null!=u?u:null==t?void 0:t(),originalMessages:e,onFinish:n,onError:l}))}pipeUIMessageStreamToResponse(e,{originalMessages:t,generateMessageId:n,onFinish:a,messageMetadata:r,sendReasoning:s,sendSources:i,sendFinish:o,sendStart:l,onError:u,...c}={}){!function({response:e,status:t,statusText:n,headers:a,stream:r,consumeSseStream:s}){let i=r.pipeThrough(new xn);if(s){const[e,t]=i.tee();i=e,s({stream:t})}En({response:e,status:t,statusText:n,headers:Object.fromEntries(_n(a,Sn).entries()),stream:i.pipeThrough(new TextEncoderStream)})}({response:e,stream:this.toUIMessageStream({originalMessages:t,generateMessageId:n,onFinish:a,messageMetadata:r,sendReasoning:s,sendSources:i,sendFinish:o,sendStart:l,onError:u}),...c})}pipeTextStreamToResponse(e,t){!function({response:e,status:t,statusText:n,headers:a,textStream:r}){En({response:e,status:t,statusText:n,headers:Object.fromEntries(_n(a,{"content-type":"text/plain; charset=utf-8"}).entries()),stream:r.pipeThrough(new TextEncoderStream)})}({response:e,textStream:this.textStream,...t})}toUIMessageStreamResponse({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:a,sendReasoning:r,sendSources:s,sendFinish:i,sendStart:o,onError:l,...u}={}){return function({status:e,statusText:t,headers:n,stream:a,consumeSseStream:r}){let s=a.pipeThrough(new xn);if(r){const[e,t]=s.tee();s=e,r({stream:t})}return new Response(s.pipeThrough(new TextEncoderStream),{status:e,statusText:t,headers:_n(n,Sn)})}({stream:this.toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:a,sendReasoning:r,sendSources:s,sendFinish:i,sendStart:o,onError:l}),...u})}toTextStreamResponse(e){return function({status:e,statusText:t,headers:n,textStream:a}){return new Response(a.pipeThrough(new TextEncoderStream),{status:null!=e?e:200,statusText:t,headers:_n(n,{"content-type":"text/plain; charset=utf-8"})})}({textStream:this.textStream,...e})}};(0,g.ID)((()=>(0,g.jN)($.YO($.Ik({id:$.Yj(),role:$.k5(["system","user","assistant"]),metadata:$.L5().optional(),parts:$.YO($.KC([$.Ik({type:$.eu("text"),text:$.Yj(),state:$.k5(["streaming","done"]).optional(),providerMetadata:Rt.optional()}),$.Ik({type:$.eu("reasoning"),text:$.Yj(),state:$.k5(["streaming","done"]).optional(),providerMetadata:Rt.optional()}),$.Ik({type:$.eu("source-url"),sourceId:$.Yj(),url:$.Yj(),title:$.Yj().optional(),providerMetadata:Rt.optional()}),$.Ik({type:$.eu("source-document"),sourceId:$.Yj(),mediaType:$.Yj(),title:$.Yj(),filename:$.Yj().optional(),providerMetadata:Rt.optional()}),$.Ik({type:$.eu("file"),mediaType:$.Yj(),filename:$.Yj().optional(),url:$.Yj(),providerMetadata:Rt.optional()}),$.Ik({type:$.eu("step-start")}),$.Ik({type:$.Yj().startsWith("data-"),id:$.Yj().optional(),data:$.L5()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("input-streaming"),input:$.L5().optional(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),approval:$.Zm().optional()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("input-available"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Zm().optional()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("approval-requested"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.Zm().optional(),reason:$.Zm().optional()})}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("approval-responded"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.zM(),reason:$.Yj().optional()})}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("output-available"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.L5(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),preliminary:$.zM().optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!0),reason:$.Yj().optional()}).optional()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("output-error"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Yj(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!0),reason:$.Yj().optional()}).optional()}),$.Ik({type:$.eu("dynamic-tool"),toolName:$.Yj(),toolCallId:$.Yj(),state:$.eu("output-denied"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!1),reason:$.Yj().optional()})}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("input-streaming"),providerExecuted:$.zM().optional(),input:$.L5().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),approval:$.Zm().optional()}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("input-available"),providerExecuted:$.zM().optional(),input:$.L5(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Zm().optional()}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("approval-requested"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.Zm().optional(),reason:$.Zm().optional()})}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("approval-responded"),input:$.L5(),providerExecuted:$.zM().optional(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.zM(),reason:$.Yj().optional()})}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("output-available"),providerExecuted:$.zM().optional(),input:$.L5(),output:$.L5(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),preliminary:$.zM().optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!0),reason:$.Yj().optional()}).optional()}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("output-error"),providerExecuted:$.zM().optional(),input:$.L5(),output:$.Zm().optional(),errorText:$.Yj(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!0),reason:$.Yj().optional()}).optional()}),$.Ik({type:$.Yj().startsWith("tool-"),toolCallId:$.Yj(),state:$.eu("output-denied"),providerExecuted:$.zM().optional(),input:$.L5(),output:$.Zm().optional(),errorText:$.Zm().optional(),callProviderMetadata:Rt.optional(),approval:$.Ik({id:$.Yj(),approved:$.eu(!1),reason:$.Yj().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty")))),(0,g.hK)({prefix:"aiobj",size:24}),(0,g.hK)({prefix:"aiobj",size:24});var jn=Symbol.for("vercel.ai.error.AI_NoSuchProviderError");y.eM,y.bD},99571:(e,t,n)=>{const a=n(20360),r=n(67105),{ANY:s}=r,i=n(72849),o=n(25583),l=[new r(">=0.0.0-0")],u=[new r(">=0.0.0")],c=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=n.includePrerelease?l:u}if(1===t.length&&t[0].semver===s){if(n.includePrerelease)return!0;t=u}const a=new Set;let r,c,m,h,f,v,g;for(const t of e)">"===t.operator||">="===t.operator?r=p(r,t,n):"<"===t.operator||"<="===t.operator?c=d(c,t,n):a.add(t.semver);if(a.size>1)return null;if(r&&c){if(m=o(r.semver,c.semver,n),m>0)return null;if(0===m&&(">="!==r.operator||"<="!==c.operator))return null}for(const e of a){if(r&&!i(e,String(r),n))return null;if(c&&!i(e,String(c),n))return null;for(const a of t)if(!i(e,String(a),n))return!1;return!0}let y=!(!c||n.includePrerelease||!c.semver.prerelease.length)&&c.semver,$=!(!r||n.includePrerelease||!r.semver.prerelease.length)&&r.semver;y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,v=v||"<"===e.operator||"<="===e.operator,r)if($&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===$.major&&e.semver.minor===$.minor&&e.semver.patch===$.patch&&($=!1),">"===e.operator||">="===e.operator){if(h=p(r,e,n),h===e&&h!==r)return!1}else if(">="===r.operator&&!i(r.semver,String(e),n))return!1;if(c)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(f=d(c,e,n),f===e&&f!==c)return!1}else if("<="===c.operator&&!i(c.semver,String(e),n))return!1;if(!e.operator&&(c||r)&&0!==m)return!1}return!(r&&v&&!c&&0!==m||c&&g&&!r&&0!==m||$||y)},p=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a>0?e:a<0||">"===t.operator&&">="===e.operator?t:e},d=(e,t,n)=>{if(!e)return t;const a=o(e.semver,t.semver,n);return a<0?e:a>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new a(e,n),t=new a(t,n);let r=!1;e:for(const a of e.set){for(const e of t.set){const t=c(a,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},99597:(e,t,n)=>{const a=n(50066),r=n(67094),{ANY:s}=r,i=n(72857),o=n(12876),l=n(18106),u=n(28141),c=n(24078),p=n(74227);e.exports=(e,t,n,d)=>{let m,h,f,v,g;switch(e=new a(e,d),t=new i(t,d),n){case">":m=l,h=c,f=u,v=">",g=">=";break;case"<":m=u,h=p,f=l,v="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,d))return!1;for(let n=0;n<t.set.length;++n){const a=t.set[n];let i=null,o=null;if(a.forEach((e=>{e.semver===s&&(e=new r(">=0.0.0")),i=i||e,o=o||e,m(e.semver,i.semver,d)?i=e:f(e.semver,o.semver,d)&&(o=e)})),i.operator===v||i.operator===g)return!1;if((!o.operator||o.operator===v)&&h(e,o.semver))return!1;if(o.operator===g&&f(e,o.semver))return!1}return!0}},99625:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.REQUIRED_AS_FIRST_STAGE=t.FULL_SCAN_STAGES=t.OUT_STAGES=t.STAGE_OPERATOR_NAMES=t.STAGE_OPERATORS=void 0;const a=n(1276),r=n(39560),s=[{name:"$addFields",value:"$addFields",label:"$addFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value.",comment:"/**\n * newField: The new field name.\n * expression: The new field expression.\n */\n",snippet:"{\n ${1:newField}: ${2:expression}, ${3:...}\n}"},{name:"$bucket",value:"$bucket",label:"$bucket",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Categorizes incoming documents into groups, called buckets, based on specified boundaries.",comment:"/**\n * groupBy: The expression to group by.\n * boundaries: An array of the lower boundaries for each bucket.\n * default: The bucket name for documents that do not fall within the specified boundaries\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n */\n",snippet:"{\n groupBy: ${1:expression},\n boundaries: [ ${2:lowerbound}, ${3:...} ],\n default: ${4:literal},\n output: {\n ${5:outputN}: { ${6:accumulator} }, ${7:...}\n }\n}"},{name:"$bucketAuto",value:"$bucketAuto",label:"$bucketAuto",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.",comment:"/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n",snippet:"{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}"},{name:"$changeStream",value:"$changeStream",label:"$changeStream",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a Change Stream cursor for the collection.",comment:"/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n",snippet:"{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}"},{name:"$collStats",value:"$collStats",label:"$collStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Returns statistics regarding a collection or view.",comment:"/**\n * histograms: Optional latency histograms.\n * storageStats: Optional storage stats.\n */\n",snippet:"{\n latencyStats: {\n histograms: ${1:boolean}\n },\n storageStats: {${2:}},\n}"},{name:"$count",value:"$count",label:"$count",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns a count of the number of documents at this stage of the aggregation pipeline.",comment:"/**\n * Provide the field name for the count.\n */\n",snippet:"'${1:string}'"},{name:"$currentOp",value:"$currentOp",label:"$currentOp",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.",comment:"/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n",snippet:"{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}"},{name:"$densify",value:"$densify",label:"$densify",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.1.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level.",comment:"/**\n * field: The required field to densify.\n * partitionByFields: The set of fields that acts as a compound key to define each partition.\n * range: {\n * step: The amount to increment the field value in each document.\n * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.\n * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.\n * }\n */\n",snippet:"{\n field: ${1:string},\n partitionByFields: [${2:string}, ${3:string}, ...],\n range: {\n step: ${4:number},\n unit: ${5:string},\n bounds: [${6:lowerbound}, ${7:upperbound}, ...]\n }\n}"},{name:"$documents",value:"$documents",label:"$documents",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.9",apiVersions:[1],namespaces:[r.DATABASE],description:"Returns literal documents from input values.",comment:"/**\n * expression: Any valid expression.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$facet",value:"$facet",label:"$facet",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Allows for multiple parellel aggregations to be specified.",comment:"/**\n * outputFieldN: The first output field.\n * stageN: The first aggregation stage.\n */\n",snippet:"{\n ${1:outputFieldN}: [ ${2:stageN}, ${3:...} ]\n}"},{name:"$fill",value:"$fill",label:"$fill",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.3.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Populates null and missing field values within documents.",comment:'/**\n * sortBy: Syntax is the same as $sort, required if "method" is used in at least one output spec otherwise optional\n * partitionBy: Optional, default is a single partition. Specification is the same as _id in $group (same as partitionBy in window functions).\n * partitionByFields: Optional, set of fields that acts as a compound key to define each partition.\n * output - Required, object for each field to fill in. For a single field, can be a single object.\n * output.<field> - A field to be filled with value, if missing or null in the current document.\n */\n',snippet:"{\n sortBy: ${1:sortSpec},\n partitionBy: ${2:expression},\n partitionByFields: [${3:string}, ${4:string}, ...],\n output: {\n field1: {value: ${5:expression}},\n field2: {method: ${6:string}},\n ...\n }\n}"},{name:"$geoNear",value:"$geoNear",label:"$geoNear",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Returns documents based on proximity to a geospatial point.",comment:"/**\n * near: The point to search near.\n * distanceField: The calculated distance.\n * maxDistance: The maximum distance, in meters, documents can be before being excluded from results.\n * query: Limits results that match the query\n * includeLocs: Optional. Labels and includes the point used to match the document.\n * num: Optional. The maximum number of documents to return.\n * spherical: Defaults to false. Specifies whether to use spherical geometry.\n */\n",snippet:"{\n near: { type: 'Point', coordinates: [ ${1:number}, ${2:number} ] },\n distanceField: '${3:string}',\n maxDistance: ${4:number},\n query: {${5}},\n includeLocs: '${6}',\n num: ${7:number},\n spherical: ${8:boolean}\n}"},{name:"$graphLookup",value:"$graphLookup",label:"$graphLookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a recursive search on a collection.",comment:"/**\n * from: The target collection.\n * startWith: Expression to start.\n * connectFromField: Field to connect.\n * connectToField: Field to connect to.\n * as: Name of the array field.\n * maxDepth: Optional max recursion depth.\n * depthField: Optional Name of the depth field.\n * restrictSearchWithMatch: Optional query.\n */\n",snippet:"{\n from: '${1:string}',\n startWith: ${2:expression},\n connectFromField: '${3:string}',\n connectToField: '${4:string}',\n as: '${5:string}',\n maxDepth: ${6:number},\n depthField: '${7:string}',\n restrictSearchWithMatch: {${8}}\n}"},{name:"$group",value:"$group",label:"$group",outputStage:!1,fullScan:!0,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups documents by a specified expression.",comment:"/**\n * _id: The id of the group.\n * fieldN: The first field name.\n */\n",snippet:"{\n _id: ${1:expression},\n ${2:fieldN}: {\n ${3:accumulatorN}: ${4:expressionN}\n }\n}"},{name:"$indexStats",value:"$indexStats",label:"$indexStats",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[],namespaces:[...r.ANY_NAMESPACE],description:"Returns statistics regarding the use of each index for the collection.",comment:"/**\n * No parameters.\n */\n",snippet:"{}"},{name:"$limit",value:"$limit",label:"$limit",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Limits the number of documents that flow into subsequent stages.",comment:"/**\n * Provide the number of documents to limit.\n */\n",snippet:"${1:number}"},{name:"$listLocalSessions",value:"$listLocalSessions",label:"$listLocalSessions",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"3.6.0",apiVersions:[1],namespaces:[r.DATABASE],description:"Lists the sessions cached in memory by the mongod or mongos instance.",comment:"/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n",snippet:"{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}"},{name:"$lookup",value:"$lookup",label:"$lookup",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Performs a join between two collections.",comment:"/**\n * from: The target collection.\n * localField: The local join field.\n * foreignField: The target join field.\n * as: The name for the results.\n * pipeline: Optional pipeline to run on the foreign collection.\n * let: Optional variables to use in the pipeline field stages.\n */\n",snippet:"{\n from: ${1:collection},\n localField: ${2:field},\n foreignField: ${3:field},\n as: ${4:result}\n}"},{name:"$match",value:"$match",label:"$match",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Filters the document stream to allow only matching documents to pass through to subsequent stages.",comment:"/**\n * query: The query in MQL.\n */\n",snippet:"{\n ${1:query}\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"4.1.11",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * into: The target collection.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: '${1:string}',\n on: '${2:string}',\n let: '${3:specification(s)}',\n whenMatched: '${4:string}',\n whenNotMatched: '${5:string}'\n}"},{name:"$merge",value:"$merge",label:"$merge",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Merges the resulting documents into a collection, optionally overriding existing documents.",comment:"/**\n * atlas: Location to write the documents from the aggregation pipeline.\n * on: Fields to identify.\n * let: Defined variables.\n * whenMatched: Action for matching docs.\n * whenNotMatched: Action for non-matching docs.\n */\n",snippet:"{\n into: {\n atlas: {\n clusterName: '${1:atlasClusterName}',\n db: '${2:database}',\n coll: '${3:collection}',\n projectId: '${4:optionalAtlasProjectId}'\n }\n },\n on: '${5:identifier}',\n let: { ${6:specification(s)} },\n whenMatched: '${7:string}',\n whenNotMatched: '${8:string}'\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to a new or existing collection.",comment:"/**\n * Provide the name of the output database and collection.\n */\n",snippet:"{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}"},{name:"$out",value:"$out",label:"$out",outputStage:!0,fullScan:!1,firstStage:!1,score:1,env:[a.ADL],meta:"stage",version:"4.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Writes the result of a pipeline to an Atlas cluster, S3 bucket, or Azure Blob Storage.",comment:"/**\n * Use any one of the following:\n * s3: Parameters to save the data to S3.\n * atlas: Parameters to save the data to Atlas. Example:\n * {\n * atlas: {\n * db: 'string',\n * coll: 'string',\n * projectId: 'string',\n * clusterName: 'string'\n * }\n * },\n * azure: Parameters to save the data to Azure. Example:\n * {\n * azure: {\n * serviceURL: 'string',\n * containerName: 'string',\n * region: 'string,\n * filename: 'string',\n * format: {\n * name: 'string',\n * maxFileSize: 'string',\n * maxRowGroupSize: 'string',\n * columnCompression: 'string'\n * },\n * errorMode: 'string'\n * }\n * }\n */\n",snippet:"{\n s3: {\n bucket: '${1:string}',\n region: '${2:string}',\n filename: '${3:string}',\n format: {\n name: '${4:string}',\n maxFileSize: '${5:bytes}',\n maxRowGroupSize: '${6:string}',\n columnCompression: '${7:string}'\n },\n errorMode: '${8:string}'\n }\n}"},{name:"$project",value:"$project",label:"$project",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value. Unlike $addFields, $project can also remove fields.",comment:"/**\n * specifications: The fields to\n * include or exclude.\n */\n",snippet:"{\n ${1:specification(s)}\n}"},{name:"$rankFusion",value:"$rankFusion",label:"$rankFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.0.14",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using reciprocal rank fusion to create hybrid search results.",comment:'/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be a Ranked Selection Pipeline operating on the same collection. Minimum of one pipeline.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information in {$meta: "scoreDetails"} for debugging and tuning.\n */\n',snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n }\n },\n combination: {\n weights: {\n ${6:searchPipeline}: ${7:number},\n ${8:vectorPipeline}: ${9:number}\n }\n },\n scoreDetails: ${10:false}\n}"},{name:"$redact",value:"$redact",label:"$redact",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.6.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Restricts the content for each document based on information stored in the documents themselves",comment:"/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$replaceRoot",value:"$replaceRoot",label:"$replaceRoot",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newRoot: ${1:replacementDocument}\n}"},{name:"$replaceWith",value:"$replaceWith",label:"$replaceWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Replaces a document with the specified embedded document.",comment:"/**\n * replacementDocument: A document or string.\n */\n",snippet:"{\n newWith: ${1:replacementDocument}\n}"},{name:"$sample",value:"$sample",label:"$sample",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.2.0",apiVersions:[1],namespaces:[...r.ANY_COLLECTION_NAMESPACE],description:"Randomly selects the specified number of documents from its input.",comment:"/**\n * size: The number of documents to sample.\n */\n",snippet:"{\n size: ${1:number}\n}"},{name:"$scoreFusion",value:"$scoreFusion",label:"$scoreFusion",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"8.2.0",apiVersions:[],namespaces:[r.COLLECTION],description:"Combines multiple pipelines using relative score fusion to create hybrid search results.",comment:"/**\n * input.pipelines: Required. Map from name to input pipeline. Each pipeline must be operating on the same collection. Minimum of one pipeline.\n * input.normalization: Required. Normalizes the score to the range 0 to 1 before combining the results. Value can be none, sigmoid or minMaxScaler.\n * combination.weights: Optional. Map from pipeline name to numbers (non-negative). If unspecified, default weight is 1 for each pipeline.\n * combination.method: Optional. Specifies method for combining scores. Value can be avg or expression. Default is avg.\n * combination.expression: Optional. This is the custom expression that is used when combination.method is set to expression.\n * scoreDetails: Optional. Default false. Set to true to include detailed scoring information.\n */\n",snippet:"{\n input: {\n pipelines: {\n ${1:searchPipeline}: [\n {$search: {${2:searchStage}}},\n {$limit: ${3:limit}}\n ],\n ${4:vectorPipeline}: [\n {$vectorSearch: {${5:vectorSearchStage}}}\n ]\n },\n normalization: '${6:none|sigmoid|minMaxScaler}'\n },\n combination: {\n weights: {\n ${7:searchPipeline}: ${8:number},\n ${9:vectorPipeline}: ${10:number}\n },\n method: '${11:avg|expression}',\n expression: '${12:expression}'\n },\n scoreDetails: ${13:false}\n}"},{name:"$search",value:"$search",label:"$search",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.1.11",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s).",comment:"/**\n * index: The name of the Search index.\n * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. Use matchCriteria to match 'any' or 'all' query terms.\n * compound: Combines ops.\n * span: Find in text field regions.\n * exists: Test for presence of a field.\n * near: Find near number or date.\n * range: Find in numeric or date range.\n */\n",snippet:"{\n index: '${1:string}',\n text: {\n query: '${2:string}',\n path: '${3:string}',\n matchCriteria: '${4:any}',\n }\n}"},{name:"$searchMeta",value:"$searchMeta",label:"$searchMeta",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS],meta:"stage",version:"4.4.9",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.",comment:"/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n",snippet:"{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}"},{name:"$set",value:"$set",label:"$set",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.",comment:"/**\n * field: The field name\n * expression: The expression.\n */\n",snippet:"{\n ${1:field}: ${2:expression}\n}"},{name:"$setWindowFields",value:"$setWindowFields",label:"$setWindowFields",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"5.0.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Capable of partitioning incoming data, and can apply one or more functions to defined windows within each partition.",comment:"/**\n * partitionBy: partitioning of data.\n * sortBy: fields to sort by.\n * output: {\n * path: {\n * function: The window function to compute over the given window.\n * window: {\n * documents: A number of documents before and after the current document.\n * range: A range of possible values around the value in the current document's sortBy field.\n * unit: Specifies the units for the window bounds.\n * }\n * }\n * }\n */\n",snippet:"{\n partitionBy: ${1:expression},\n sortBy: ${2:sortSpec},\n output: {\n ${3:path}: {\n ${4:function}: ${5:functionArgs},\n window: {\n documents: [${6:lowerbound}, ${7:upperbound}],\n range: [${8:lowerbound}, ${9:upperbound}],\n unit: ${10:string}\n }\n },\n ${11:path2}: ...\n }\n}"},{name:"$skip",value:"$skip",label:"$skip",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Skips a specified number of documents before advancing to the next stage.",comment:"/**\n * Provide the number of documents to skip.\n */\n",snippet:"${1:number}"},{name:"$sort",value:"$sort",label:"$sort",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Reorders the document stream by a specified sort key and direction.",comment:"/**\n * Provide any number of field/order pairs.\n */\n",snippet:"{\n ${1:field1}: ${2:sortOrder}\n}"},{name:"$sortByCount",value:"$sortByCount",label:"$sortByCount",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"3.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.",comment:"/**\n * expression: Grouping expression or string.\n */\n",snippet:"{\n ${1:expression}\n}"},{name:"$unionWith",value:"$unionWith",label:"$unionWith",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.4.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Perform a union with a pipeline on another collection.",comment:"/**\n * coll: The collection name.\n * pipeline: The pipeline on the other collection.\n */\n",snippet:"{\n coll: '${1:coll}',\n pipeline: [${2:pipeline}]\n}"},{name:"$unset",value:"$unset",label:"$unset",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"4.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Excludes fields from the result document.",comment:"/**\n * Provide the field name to exclude.\n * To exclude multiple fields, pass the field names in an array.\n */\n",snippet:"'${1:string}'"},{name:"$unwind",value:"$unwind",label:"$unwind",outputStage:!1,fullScan:!1,firstStage:!1,score:1,env:[a.ATLAS,a.ADL,a.ON_PREM],meta:"stage",version:"2.2.0",apiVersions:[1],namespaces:[...r.ANY_NAMESPACE],description:"Outputs a new document for each element in a specified array. ",comment:"/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n",snippet:"{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}"},{name:"$vectorSearch",value:"$vectorSearch",label:"$vectorSearch",outputStage:!1,fullScan:!1,firstStage:!0,score:1,env:[a.ATLAS],meta:"stage",version:">=6.0.10 <7.0.0 || >=7.0.2",apiVersions:[],namespaces:[r.COLLECTION,r.VIEW],description:"Performs a kNN search on embeddings in the specified field(s)",comment:"/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n * exact: Choose between false for ANN (Approximate Nearest Neighbor) and true for ENN (Exact Nearest Neighbor). Defaults to false. (Optional)\n */\n",snippet:"{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}},\n exact: ${8:boolean}\n}"}];t.STAGE_OPERATORS=s;const i=s.map((e=>e.name));t.STAGE_OPERATOR_NAMES=i;const o=s.filter((e=>e.outputStage));t.OUT_STAGES=o;const l=s.filter((e=>e.fullScan));t.FULL_SCAN_STAGES=l;const u=s.filter((e=>e.firstStage));t.REQUIRED_AS_FIRST_STAGE=u},99629:(e,t,n)=>{n.d(t,{JM:()=>l,Kd:()=>o,Wk:()=>u,a$:()=>i});var a=n(49189),r=n(72510);const s=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,r.k8,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},i=(0,a.xI)("$ZodError",s),o=(0,a.xI)("$ZodError",s,{Parent:Error});function l(e,t=e=>e.message){const n={},a=[];for(const r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:n}}function u(e,t){const n=t||function(e){return e.message},a={_errors:[]},r=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>r({issues:e})));else if("invalid_key"===t.code)r({issues:t.issues});else if("invalid_element"===t.code)r({issues:t.issues});else if(0===t.path.length)a._errors.push(n(t));else{let e=a,r=0;for(;r<t.path.length;){const a=t.path[r];r===t.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(n(t))):e[a]=e[a]||{_errors:[]},e=e[a],r++}}};return r(e),a}}};
|