eve 0.31.0 → 0.31.2
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/CHANGELOG.md +15 -0
- package/dist/src/channel/cross-channel-receive.d.ts +1 -1
- package/dist/src/compiled/.vendor-stamp.json +6 -6
- package/dist/src/compiled/@workflow/core/_quickjs-wasi.d.ts +8 -0
- package/dist/src/compiled/@workflow/core/correlation-id.d.ts +109 -0
- package/dist/src/compiled/@workflow/core/events-consumer.d.ts +1 -0
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/private.d.ts +17 -1
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +19 -0
- package/dist/src/compiled/@workflow/core/runtime/deployment-guard.d.ts +99 -0
- package/dist/src/compiled/@workflow/core/runtime/quickjs-assets.generated.d.ts +14 -0
- package/dist/src/compiled/@workflow/core/runtime/quickjs-entrypoint.d.ts +124 -0
- package/dist/src/compiled/@workflow/core/runtime/quickjs-runtime.d.ts +193 -0
- package/dist/src/compiled/@workflow/core/runtime/run.d.ts +2 -0
- package/dist/src/compiled/@workflow/core/runtime/runs.d.ts +18 -1
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +7 -0
- package/dist/src/compiled/@workflow/core/runtime/vm-mode.d.ts +44 -0
- package/dist/src/compiled/@workflow/core/runtime/vm-serde-bundle.generated.d.ts +14 -0
- package/dist/src/compiled/@workflow/core/runtime.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/core/serialization/codec-devalue-vm.d.ts +9 -0
- package/dist/src/compiled/@workflow/core/serialization/reducers/class-vm.d.ts +20 -0
- package/dist/src/compiled/@workflow/core/serialization/reducers/common-vm.d.ts +15 -0
- package/dist/src/compiled/@workflow/core/serialization/reducers/step-function-vm.d.ts +44 -0
- package/dist/src/compiled/@workflow/core/serialization/vm-bundle-entry.d.ts +12 -0
- package/dist/src/compiled/@workflow/core/serialization/workflow-vm.d.ts +24 -0
- package/dist/src/compiled/@workflow/core/serialization.d.ts +2 -1
- package/dist/src/compiled/@workflow/core/source-map.d.ts +20 -0
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +78 -0
- package/dist/src/compiled/@workflow/core/telemetry.d.ts +5 -0
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/error-codes.d.ts +2 -0
- package/dist/src/compiled/@workflow/errors/index.d.ts +24 -0
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/world/analytics.d.ts +2 -0
- package/dist/src/compiled/@workflow/world/events.d.ts +51 -1
- package/dist/src/compiled/@workflow/world/hooks.d.ts +1 -0
- package/dist/src/compiled/@workflow/world/index.d.ts +1 -1
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +28 -1
- package/dist/src/compiled/@workflow/world/queue.d.ts +8 -0
- package/dist/src/compiled/@workflow/world/runs.d.ts +83 -0
- package/dist/src/compiled/@workflow/world-local/index.js +5 -4
- package/dist/src/compiled/@workflow/world-vercel/index.js +15 -15
- package/dist/src/compiled/_chunks/workflow/_eve-core-quickjs-entrypoint-stub-qIV0OaFz.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-DROfGk6l.js → attribute-changes-Du5ztewf.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{dist-D5bR13zs.js → dist-CNXUKQCp.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/dist-CRTn4Sg8.js +3 -0
- package/dist/src/compiled/_chunks/workflow/dist-tJoQXAF6.js +1 -0
- package/dist/src/compiled/_chunks/workflow/functions-ClJbpZhR.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{private-BcwCGTV5.js → private-CiWVdS5v.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-CT0keOww.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-DBheaFhH.js +1 -0
- package/dist/src/compiled/_chunks/workflow/signal-exit-C8vsI6zj.js +1 -0
- package/dist/src/compiled/_chunks/workflow/sleep-BeH4B0Cd.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{token-hiUWkDKe.js → token-DtCUEpJs.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{token-util-DURSL1l8.js → token-util-DNwIAn_u.js} +9 -9
- package/dist/src/compiled/_chunks/workflow/undici-CUIybhQ2.js +95 -0
- package/dist/src/compiled/_chunks/workflow/wait-until-CMX5LUWJ.js +15 -0
- package/dist/src/compiler/extension-compatibility.d.ts +2 -2
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/context/container.d.ts +3 -0
- package/dist/src/context/container.js +1 -1
- package/dist/src/discover/filesystem.js +1 -1
- package/dist/src/execution/parked-delivery-wait.js +1 -1
- package/dist/src/execution/session-command-inbox.d.ts +11 -3
- package/dist/src/execution/session-command-wire.d.ts +24 -0
- package/dist/src/execution/session-command-wire.js +1 -0
- package/dist/src/execution/turn-control-receiver.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/authorization.d.ts +8 -0
- package/dist/src/harness/authorization.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot-copy.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/public/definitions/tool.d.ts +18 -14
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/framework-tools/connection-search-dynamic.js +2 -2
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/docs/guides/meta.json +2 -1
- package/docs/guides/remote-agents.md +6 -4
- package/docs/guides/ucp.mdx +181 -0
- package/package.json +6 -6
- package/dist/src/compiled/_chunks/workflow/dist-B-vbuNqP.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-dNxTT6nO.js +0 -3
- package/dist/src/compiled/_chunks/workflow/functions-CiVUVDNB.js +0 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-bc-OQVI0.js +0 -1
- package/dist/src/compiled/_chunks/workflow/run-DM3ouA3U.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-D5iWly6-.js +0 -1
- package/dist/src/compiled/_chunks/workflow/undici-DWL_MYmT.js +0 -95
- package/dist/src/compiled/_chunks/workflow/wait-until-DoW76jdb.js +0 -15
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import{i as e,n as t,o as n,r,t as i}from"../../_chunks/workflow/rolldown-runtime-DaDcL9Zw.js";import{D as a,T as o,_ as s,c,d as l,g as u,o as d,r as f}from"../../_chunks/workflow/dist-dNxTT6nO.js";import{$ as p,$a as m,$c as h,$i as g,$n as _,$o as v,$r as y,$s as b,$t as ee,Aa as te,Ac as ne,Ai as re,An as ie,Ao as ae,Ar as oe,As as se,At as ce,Ba as le,Bc as ue,Bi as de,Bn as fe,Bo as pe,Br as me,Bs as he,Bt as ge,C as _e,Ca as ve,Cc as ye,Ci as be,Cn as xe,Co as Se,Cr as Ce,Cs as we,Ct as Te,D as Ee,Da as De,Dc as Oe,Di as ke,Dn as Ae,Do as je,Dr as Me,Ds as Ne,Dt as Pe,Ea as Fe,Ec as Ie,Ei as Le,En as Re,Eo as ze,Er as Be,Es as Ve,Et as He,F as Ue,Fa as We,Fc as Ge,Fi as Ke,Fn as qe,Fo as Je,Fr as Ye,Fs as Xe,Ft as Ze,Ga as Qe,Gc as $e,Gi as et,Gn as tt,Go as nt,Gr as rt,Gs as it,Gt as at,H as ot,Ha as st,Hc as ct,Hi as lt,Hn as ut,Ho as dt,Hr as ft,Hs as pt,Ht as mt,Ia as ht,Ic as gt,Ii as _t,In as vt,Io as yt,Ir as bt,Is as xt,It as St,Ja as Ct,Jc as wt,Ji as Tt,Jn as Et,Jo as Dt,Jr as Ot,Js as kt,Jt as At,Ka as jt,Kc as Mt,Ki as Nt,Kn as Pt,Ko as Ft,Kr as It,Ks as Lt,Kt as Rt,L as zt,La as Bt,Lc as Vt,Li as Ht,Ln as Ut,Lo as Wt,Lr as Gt,Ls as Kt,Lt as qt,M as Jt,Ma as Yt,Mc as Xt,Mi as Zt,Mn as Qt,Mo as $t,Mr as en,Ms as tn,Mt as nn,N as rn,Na as an,Nc as on,Ni as sn,Nn as cn,No as ln,Nr as un,Ns as dn,Nt as fn,Oa as pn,Oc as mn,Oi as hn,On as gn,Oo as _n,Or as vn,Os as yn,Ot as bn,P as xn,Pa as Sn,Pc as Cn,Pi as wn,Pn as Tn,Po as En,Pr as Dn,Ps as On,Pt as kn,Q as An,Qa as jn,Qc as Mn,Qi as Nn,Qn as Pn,Qo as Fn,Qr as In,Qs as Ln,Qt as Rn,Ra as zn,Rc as Bn,Ri as Vn,Rn as Hn,Ro as Un,Rr as Wn,Rs as Gn,Rt as Kn,S as qn,Sa as Jn,Sc as Yn,Si as Xn,Sn as Zn,So as Qn,Sr as $n,Ss as er,St as tr,T as nr,Ta as rr,Tc as ir,Ti as ar,Tn as or,To as sr,Tr as cr,Ts as lr,Tt as ur,U as dr,Ua as fr,Uc as pr,Ui as mr,Un as hr,Uo as gr,Ur as _r,Us as vr,Ut as yr,Va as br,Vc as xr,Vi as Sr,Vn as Cr,Vo as wr,Vr as Tr,Vs as Er,Vt as Dr,Wa as Or,Wc as kr,Wi as Ar,Wn as jr,Wo as Mr,Wr as Nr,Ws as Pr,Wt as Fr,Xa as Ir,Xc as Lr,Xi as Rr,Xn as zr,Xo as Br,Xr as Vr,Xs as Hr,Xt as Ur,Y as Wr,Ya as Gr,Yc as Kr,Yi as qr,Yn as Jr,Yo as Yr,Yr as Xr,Ys as Zr,Yt as Qr,Z as $r,Za as ei,Zc as ti,Zi as ni,Zn as ri,Zo as ii,Zr as ai,Zs as oi,Zt as si,_a as ci,_c as li,_i as ui,_l as di,_n as fi,_o as pi,_r as mi,_s as hi,_t as gi,aa as _i,ac as vi,ai as yi,al as bi,an as xi,ao as Si,ar as Ci,as as wi,at as Ti,b as Ei,ba as Di,bc as Oi,bi as ki,bn as Ai,bo as ji,br as Mi,bs as Ni,bt as Pi,c as Fi,ca as Ii,cc as Li,ci as Ri,cl as zi,cn as Bi,co as Vi,cr as Hi,cs as Ui,ct as Wi,d as Gi,da as Ki,dc as qi,di as Ji,dl as x,dn as Yi,do as Xi,dr as Zi,ds as Qi,dt as $i,ea,ec as ta,ei as na,el as ra,en as ia,eo as aa,er as oa,es as sa,et as ca,fa as la,fc as ua,fi as da,fl as fa,fn as pa,fo as ma,fr as ha,fs as ga,ft as _a,ga as va,gc as ya,gi as ba,gl as xa,gn as Sa,go as Ca,gr as wa,gs as Ta,gt as Ea,h as Da,ha as Oa,hc as ka,hi as Aa,hl as ja,hn as Ma,ho as Na,hr as Pa,hs as Fa,ht as Ia,ia as La,ic as Ra,ii as za,il as Ba,in as Va,io as Ha,ir as Ua,is as Wa,it as Ga,ja as Ka,jc as qa,ji as Ja,jn as Ya,jo as Xa,jr as Za,js as Qa,jt as $a,k as eo,ka as to,kc as no,ki as ro,kn as io,ko as ao,kr as oo,ks as so,kt as co,l as lo,la as uo,lc as fo,li as po,ll as S,ln as mo,lo as ho,lr as go,ls as _o,lt as vo,m as yo,ma as bo,mc as xo,mi as So,ml as Co,mn as wo,mo as To,mr as Eo,ms as Do,mt as Oo,na as ko,nc as Ao,ni as jo,nl as Mo,nn as No,no as Po,nr as Fo,ns as Io,nt as Lo,o as Ro,oa as zo,oc as Bo,oi as Vo,ol as Ho,on as Uo,oo as Wo,or as Go,os as Ko,ot as qo,p as Jo,pa as Yo,pc as Xo,pi as Zo,pl as Qo,pn as $o,po as es,pr as ts,ps as ns,pt as rs,qa as is,qc as as,qi as os,qn as ss,qo as cs,qr as ls,qs as us,qt as ds,r as fs,ra as ps,rc as ms,ri as hs,rl as gs,rn as _s,ro as vs,rr as ys,rs as bs,rt as xs,sa as Ss,sc as Cs,si as ws,sl as Ts,sn as Es,so as Ds,sr as Os,ss as ks,st as As,ta as js,tc as Ms,ti as Ns,tl as Ps,tn as Fs,to as Is,tr as Ls,ts as Rs,tt as zs,ua as Bs,uc as Vs,ui as Hs,ul as C,un as Us,uo as Ws,ur as Gs,us as Ks,ut as qs,va as Js,vc as Ys,vi as Xs,vl as Zs,vn as Qs,vo as $s,vr as ec,vs as tc,vt as nc,w as rc,wa as ic,wc as ac,wi as oc,wn as sc,wo as cc,wr as lc,ws as uc,wt as dc,x as fc,xa as pc,xc as mc,xi as hc,xn as gc,xo as _c,xr as vc,xs as yc,xt as bc,ya as xc,yc as Sc,yi as Cc,yl as wc,yn as Tc,yo as Ec,yr as Dc,ys as Oc,yt as kc,za as Ac,zc as jc,zi as Mc,zn as Nc,zo as Pc,zr as Fc,zs as Ic,zt as Lc}from"../../_chunks/workflow/dist-D5bR13zs.js";import{t as Rc}from"../../_chunks/workflow/env-config-CYoX3muK.js";import{a as zc,i as Bc,n as Vc,o as Hc,r as Uc,s as Wc,t as Gc}from"../../_chunks/workflow/run-id-BdE0MZz9.js";import{t as Kc}from"../../_chunks/workflow/undici-DWL_MYmT.js";import{n as qc,r as Jc,t as Yc}from"../../_chunks/workflow/token-util-Ldar52H7.js";import{i as Xc,r as Zc,t as Qc}from"../../_chunks/workflow/token-util-DURSL1l8.js";import{createRequire as $c}from"module";import*as el from"path";import*as tl from"node:crypto";import{KeyObject as nl,constants as rl,createCipheriv as il,createDecipheriv as al,createHash as ol,createHmac as sl,createPrivateKey as cl,createPublicKey as ll,createSecretKey as ul,diffieHellman as dl,generateKeyPair as fl,getCiphers as pl,pbkdf2 as ml,privateDecrypt as hl,publicEncrypt as gl,randomFillSync as _l,timingSafeEqual as vl,webcrypto as yl}from"node:crypto";import*as bl from"node:util";import{deprecate as xl,inspect as Sl,promisify as Cl}from"node:util";import{AsyncLocalStorage as wl}from"node:async_hooks";import Tl from"node:os";import*as El from"node:http";import{once as Dl}from"node:events";import{Buffer as Ol}from"node:buffer";import*as kl from"fs";import*as Al from"net";import*as jl from"node:https";const Ml=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n={regex:`مدخل`,email:`بريد إلكتروني`,url:`رابط`,emoji:`إيموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاريخ ووقت بمعيار ISO`,date:`تاريخ بمعيار ISO`,time:`وقت بمعيار ISO`,duration:`مدة بمعيار ISO`,ipv4:`عنوان IPv4`,ipv6:`عنوان IPv6`,cidrv4:`مدى عناوين بصيغة IPv4`,cidrv6:`مدى عناوين بصيغة IPv6`,base64:`نَص بترميز base64-encoded`,base64url:`نَص بترميز base64url-encoded`,json_string:`نَص على هيئة JSON`,e164:`رقم هاتف بمعيار E.164`,jwt:`JWT`,template_literal:`مدخل`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${e.expected}، ولكن تم إدخال ${i}`:`مدخلات غير مقبولة: يفترض إدخال ${t}، ولكن تم إدخال ${i}`}case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${x(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${n[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${S(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}};function Nl(){return{localeError:Ml()}}const Pl=()=>{let e={string:{unit:`simvol`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`element`,verb:`olmalıdır`},set:{unit:`element`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Yanlış dəyər: gözlənilən instanceof ${e.expected}, daxil olan ${i}`:`Yanlış dəyər: gözlənilən ${t}, daxil olan ${i}`}case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${x(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${n[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}};function Fl(){return{localeError:Pl()}}function Il(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const Ll=()=>{let e={string:{unit:{one:`сімвал`,few:`сімвалы`,many:`сімвалаў`},verb:`мець`},array:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},set:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},file:{unit:{one:`байт`,few:`байты`,many:`байтаў`},verb:`мець`}};function t(t){return e[t]??null}let n={regex:`увод`,email:`email адрас`,url:`URL`,emoji:`эмодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата і час`,date:`ISO дата`,time:`ISO час`,duration:`ISO працягласць`,ipv4:`IPv4 адрас`,ipv6:`IPv6 адрас`,cidrv4:`IPv4 дыяпазон`,cidrv6:`IPv6 дыяпазон`,base64:`радок у фармаце base64`,base64url:`радок у фармаце base64url`,json_string:`JSON радок`,e164:`нумар E.164`,jwt:`JWT`,template_literal:`увод`},r={nan:`NaN`,number:`лік`,array:`масіў`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Няправільны ўвод: чакаўся instanceof ${e.expected}, атрымана ${i}`:`Няправільны ўвод: чакаўся ${t}, атрымана ${i}`}case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${x(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Il(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=Il(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з "${t.prefix}"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на "${t.suffix}"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць "${t.includes}"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${n[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}};function Rl(){return{localeError:Ll()}}const zl=()=>{let e={string:{unit:`символа`,verb:`да съдържа`},file:{unit:`байта`,verb:`да съдържа`},array:{unit:`елемента`,verb:`да съдържа`},set:{unit:`елемента`,verb:`да съдържа`}};function t(t){return e[t]??null}let n={regex:`вход`,email:`имейл адрес`,url:`URL`,emoji:`емоджи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO време`,date:`ISO дата`,time:`ISO време`,duration:`ISO продължителност`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`base64-кодиран низ`,base64url:`base64url-кодиран низ`,json_string:`JSON низ`,e164:`E.164 номер`,jwt:`JWT`,template_literal:`вход`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Невалиден вход: очакван instanceof ${e.expected}, получен ${i}`:`Невалиден вход: очакван ${t}, получен ${i}`}case`invalid_value`:return e.values.length===1?`Невалиден вход: очакван ${x(e.values[0])}`:`Невалидна опция: очаквано едно от ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Твърде голямо: очаква се ${e.origin??`стойност`} да съдържа ${n}${e.maximum.toString()} ${r.unit??`елемента`}`:`Твърде голямо: очаква се ${e.origin??`стойност`} да бъде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Твърде малко: очаква се ${e.origin} да съдържа ${n}${e.minimum.toString()} ${r.unit}`:`Твърде малко: очаква се ${e.origin} да бъде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;if(t.format===`starts_with`)return`Невалиден низ: трябва да започва с "${t.prefix}"`;if(t.format===`ends_with`)return`Невалиден низ: трябва да завършва с "${t.suffix}"`;if(t.format===`includes`)return`Невалиден низ: трябва да включва "${t.includes}"`;if(t.format===`regex`)return`Невалиден низ: трябва да съвпада с ${t.pattern}`;let r=`Невалиден`;return t.format===`emoji`&&(r=`Невалидно`),t.format===`datetime`&&(r=`Невалидно`),t.format===`date`&&(r=`Невалидна`),t.format===`time`&&(r=`Невалидно`),t.format===`duration`&&(r=`Невалидна`),`${r} ${n[t.format]??e.format}`}case`not_multiple_of`:return`Невалидно число: трябва да бъде кратно на ${e.divisor}`;case`unrecognized_keys`:return`Неразпознат${e.keys.length>1?`и`:``} ключ${e.keys.length>1?`ове`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Невалиден ключ в ${e.origin}`;case`invalid_union`:return`Невалиден вход`;case`invalid_element`:return`Невалидна стойност в ${e.origin}`;default:return`Невалиден вход`}}};function Bl(){return{localeError:zl()}}const Vl=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n={regex:`entrada`,email:`adreça electrònica`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`durada ISO`,ipv4:`adreça IPv4`,ipv6:`adreça IPv6`,cidrv4:`rang IPv4`,cidrv6:`rang IPv6`,base64:`cadena codificada en base64`,base64url:`cadena codificada en base64url`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipus invàlid: s'esperava instanceof ${e.expected}, s'ha rebut ${i}`:`Tipus invàlid: s'esperava ${t}, s'ha rebut ${i}`}case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${x(e.values[0])}`:`Opció invàlida: s'esperava una de ${S(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format===`includes`?`Format invàlid: ha d'incloure "${t.includes}"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}};function Hl(){return{localeError:Vl()}}const Ul=()=>{let e={string:{unit:`znaků`,verb:`mít`},file:{unit:`bajtů`,verb:`mít`},array:{unit:`prvků`,verb:`mít`},set:{unit:`prvků`,verb:`mít`}};function t(t){return e[t]??null}let n={regex:`regulární výraz`,email:`e-mailová adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`datum a čas ve formátu ISO`,date:`datum ve formátu ISO`,time:`čas ve formátu ISO`,duration:`doba trvání ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`řetězec zakódovaný ve formátu base64`,base64url:`řetězec zakódovaný ve formátu base64url`,json_string:`řetězec ve formátu JSON`,e164:`číslo E.164`,jwt:`JWT`,template_literal:`vstup`},r={nan:`NaN`,number:`číslo`,string:`řetězec`,function:`funkce`,array:`pole`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neplatný vstup: očekáváno instanceof ${e.expected}, obdrženo ${i}`:`Neplatný vstup: očekáváno ${t}, obdrženo ${i}`}case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${x(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${S(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}};function Wl(){return{localeError:Ul()}}const Gl=()=>{let e={string:{unit:`tegn`,verb:`havde`},file:{unit:`bytes`,verb:`havde`},array:{unit:`elementer`,verb:`indeholdt`},set:{unit:`elementer`,verb:`indeholdt`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-mailadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslæt`,date:`ISO-dato`,time:`ISO-klokkeslæt`,duration:`ISO-varighed`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodet streng`,base64url:`base64url-kodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,string:`streng`,number:`tal`,boolean:`boolean`,array:`liste`,object:`objekt`,set:`sæt`,file:`fil`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldigt input: forventede instanceof ${e.expected}, fik ${i}`:`Ugyldigt input: forventede ${t}, fik ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig værdi: forventede ${x(e.values[0])}`:`Ugyldigt valg: forventede en af følgende ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For stor: forventede ${a??`value`} ${i.verb} ${n} ${e.maximum.toString()} ${i.unit??`elementer`}`:`For stor: forventede ${a??`value`} havde ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For lille: forventede ${a} ${i.verb} ${n} ${e.minimum.toString()} ${i.unit}`:`For lille: forventede ${a} havde ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: skal starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: skal ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: skal indeholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: skal matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldigt tal: skal være deleligt med ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukendte nøgler`:`Ukendt nøgle`}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøgle i ${e.origin}`;case`invalid_union`:return`Ugyldigt input: matcher ingen af de tilladte typer`;case`invalid_element`:return`Ugyldig værdi i ${e.origin}`;default:return`Ugyldigt input`}}};function Kl(){return{localeError:Gl()}}const ql=()=>{let e={string:{unit:`Zeichen`,verb:`zu haben`},file:{unit:`Bytes`,verb:`zu haben`},array:{unit:`Elemente`,verb:`zu haben`},set:{unit:`Elemente`,verb:`zu haben`}};function t(t){return e[t]??null}let n={regex:`Eingabe`,email:`E-Mail-Adresse`,url:`URL`,emoji:`Emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-Datum und -Uhrzeit`,date:`ISO-Datum`,time:`ISO-Uhrzeit`,duration:`ISO-Dauer`,ipv4:`IPv4-Adresse`,ipv6:`IPv6-Adresse`,cidrv4:`IPv4-Bereich`,cidrv6:`IPv6-Bereich`,base64:`Base64-codierter String`,base64url:`Base64-URL-codierter String`,json_string:`JSON-String`,e164:`E.164-Nummer`,jwt:`JWT`,template_literal:`Eingabe`},r={nan:`NaN`,number:`Zahl`,array:`Array`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ungültige Eingabe: erwartet instanceof ${e.expected}, erhalten ${i}`:`Ungültige Eingabe: erwartet ${t}, erhalten ${i}`}case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${x(e.values[0])}`:`Ungültige Option: erwartet eine von ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format===`includes`?`Ungültiger String: muss "${t.includes}" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}};function Jl(){return{localeError:ql()}}const Yl=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${x(e.values[0])}`:`Invalid option: expected one of ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Xl(){return{localeError:Yl()}}const Zl=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let n={regex:`enigo`,email:`retadreso`,url:`URL`,emoji:`emoĝio`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datotempo`,date:`ISO-dato`,time:`ISO-tempo`,duration:`ISO-daŭro`,ipv4:`IPv4-adreso`,ipv6:`IPv6-adreso`,cidrv4:`IPv4-rango`,cidrv6:`IPv6-rango`,base64:`64-ume kodita karaktraro`,base64url:`URL-64-ume kodita karaktraro`,json_string:`JSON-karaktraro`,e164:`E.164-nombro`,jwt:`JWT`,template_literal:`enigo`},r={nan:`NaN`,number:`nombro`,array:`tabelo`,null:`senvalora`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nevalida enigo: atendiĝis instanceof ${e.expected}, riceviĝis ${i}`:`Nevalida enigo: atendiĝis ${t}, riceviĝis ${i}`}case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${x(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}};function Ql(){return{localeError:Zl()}}const $l=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}};function t(t){return e[t]??null}let n={regex:`entrada`,email:`dirección de correo electrónico`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`fecha y hora ISO`,date:`fecha ISO`,time:`hora ISO`,duration:`duración ISO`,ipv4:`dirección IPv4`,ipv6:`dirección IPv6`,cidrv4:`rango IPv4`,cidrv6:`rango IPv6`,base64:`cadena codificada en base64`,base64url:`URL codificada en base64`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`,string:`texto`,number:`número`,boolean:`booleano`,array:`arreglo`,object:`objeto`,set:`conjunto`,file:`archivo`,date:`fecha`,bigint:`número grande`,symbol:`símbolo`,undefined:`indefinido`,null:`nulo`,function:`función`,map:`mapa`,record:`registro`,tuple:`tupla`,enum:`enumeración`,union:`unión`,literal:`literal`,promise:`promesa`,void:`vacío`,never:`nunca`,unknown:`desconocido`,any:`cualquiera`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrada inválida: se esperaba instanceof ${e.expected}, recibido ${i}`:`Entrada inválida: se esperaba ${t}, recibido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${x(e.values[0])}`:`Opción inválida: se esperaba una de ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado grande: se esperaba que ${a??`valor`} tuviera ${n}${e.maximum.toString()} ${i.unit??`elementos`}`:`Demasiado grande: se esperaba que ${a??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado pequeño: se esperaba que ${a} tuviera ${n}${e.minimum.toString()} ${i.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format===`ends_with`?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format===`includes`?`Cadena inválida: debe incluir "${t.includes}"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${r[e.origin]??e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${r[e.origin]??e.origin}`;default:return`Entrada inválida`}}};function eu(){return{localeError:$l()}}const tu=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n={regex:`ورودی`,email:`آدرس ایمیل`,url:`URL`,emoji:`ایموجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاریخ و زمان ایزو`,date:`تاریخ ایزو`,time:`زمان ایزو`,duration:`مدت زمان ایزو`,ipv4:`IPv4 آدرس`,ipv6:`IPv6 آدرس`,cidrv4:`IPv4 دامنه`,cidrv6:`IPv6 دامنه`,base64:`base64-encoded رشته`,base64url:`base64url-encoded رشته`,json_string:`JSON رشته`,e164:`E.164 عدد`,jwt:`JWT`,template_literal:`ورودی`},r={nan:`NaN`,number:`عدد`,array:`آرایه`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ورودی نامعتبر: میبایست instanceof ${e.expected} میبود، ${i} دریافت شد`:`ورودی نامعتبر: میبایست ${t} میبود، ${i} دریافت شد`}case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: میبایست ${x(e.values[0])} میبود`:`گزینه نامعتبر: میبایست یکی از ${S(e.values,`|`)} میبود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${n[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${S(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}};function nu(){return{localeError:tu()}}const ru=()=>{let e={string:{unit:`merkkiä`,subject:`merkkijonon`},file:{unit:`tavua`,subject:`tiedoston`},array:{unit:`alkiota`,subject:`listan`},set:{unit:`alkiota`,subject:`joukon`},number:{unit:``,subject:`luvun`},bigint:{unit:``,subject:`suuren kokonaisluvun`},int:{unit:``,subject:`kokonaisluvun`},date:{unit:``,subject:`päivämäärän`}};function t(t){return e[t]??null}let n={regex:`säännöllinen lauseke`,email:`sähköpostiosoite`,url:`URL-osoite`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-aikaleima`,date:`ISO-päivämäärä`,time:`ISO-aika`,duration:`ISO-kesto`,ipv4:`IPv4-osoite`,ipv6:`IPv6-osoite`,cidrv4:`IPv4-alue`,cidrv6:`IPv6-alue`,base64:`base64-koodattu merkkijono`,base64url:`base64url-koodattu merkkijono`,json_string:`JSON-merkkijono`,e164:`E.164-luku`,jwt:`JWT`,template_literal:`templaattimerkkijono`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Virheellinen tyyppi: odotettiin instanceof ${e.expected}, oli ${i}`:`Virheellinen tyyppi: odotettiin ${t}, oli ${i}`}case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${x(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Virheellinen avain tietueessa`;case`invalid_union`:return`Virheellinen unioni`;case`invalid_element`:return`Virheellinen arvo joukossa`;default:return`Virheellinen syöte`}}};function iu(){return{localeError:ru()}}const au=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n={regex:`entrée`,email:`adresse e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date et heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`},r={nan:`NaN`,number:`nombre`,array:`tableau`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : instanceof ${e.expected} attendu, ${i} reçu`:`Entrée invalide : ${t} attendu, ${i} reçu`}case`invalid_value`:return e.values.length===1?`Entrée invalide : ${x(e.values[0])} attendu`:`Option invalide : une valeur parmi ${S(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Trop grand : ${e.origin??`valeur`} doit ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`élément(s)`}`:`Trop grand : ${e.origin??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Trop petit : ${e.origin} doit ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : ${e.origin} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${S(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function ou(){return{localeError:au()}}const su=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n={regex:`entrée`,email:`adresse courriel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date-heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : attendu instanceof ${e.expected}, reçu ${i}`:`Entrée invalide : attendu ${t}, reçu ${i}`}case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${x(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${S(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function cu(){return{localeError:su()}}const lu=()=>{let e={string:{label:`מחרוזת`,gender:`f`},number:{label:`מספר`,gender:`m`},boolean:{label:`ערך בוליאני`,gender:`m`},bigint:{label:`BigInt`,gender:`m`},date:{label:`תאריך`,gender:`m`},array:{label:`מערך`,gender:`m`},object:{label:`אובייקט`,gender:`m`},null:{label:`ערך ריק (null)`,gender:`m`},undefined:{label:`ערך לא מוגדר (undefined)`,gender:`m`},symbol:{label:`סימבול (Symbol)`,gender:`m`},function:{label:`פונקציה`,gender:`f`},map:{label:`מפה (Map)`,gender:`f`},set:{label:`קבוצה (Set)`,gender:`f`},file:{label:`קובץ`,gender:`m`},promise:{label:`Promise`,gender:`m`},NaN:{label:`NaN`,gender:`m`},unknown:{label:`ערך לא ידוע`,gender:`m`},value:{label:`ערך`,gender:`m`}},t={string:{unit:`תווים`,shortLabel:`קצר`,longLabel:`ארוך`},file:{unit:`בייטים`,shortLabel:`קטן`,longLabel:`גדול`},array:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},set:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},number:{unit:``,shortLabel:`קטן`,longLabel:`גדול`}},n=t=>t?e[t]:void 0,r=t=>{let r=n(t);return r?r.label:t??e.unknown.label},i=e=>`ה${r(e)}`,a=e=>(n(e)?.gender??`m`)===`f`?`צריכה להיות`:`צריך להיות`,o=e=>e?t[e]??null:null,s={regex:{label:`קלט`,gender:`m`},email:{label:`כתובת אימייל`,gender:`f`},url:{label:`כתובת רשת`,gender:`f`},emoji:{label:`אימוג'י`,gender:`m`},uuid:{label:`UUID`,gender:`m`},nanoid:{label:`nanoid`,gender:`m`},guid:{label:`GUID`,gender:`m`},cuid:{label:`cuid`,gender:`m`},cuid2:{label:`cuid2`,gender:`m`},ulid:{label:`ULID`,gender:`m`},xid:{label:`XID`,gender:`m`},ksuid:{label:`KSUID`,gender:`m`},datetime:{label:`תאריך וזמן ISO`,gender:`m`},date:{label:`תאריך ISO`,gender:`m`},time:{label:`זמן ISO`,gender:`m`},duration:{label:`משך זמן ISO`,gender:`m`},ipv4:{label:`כתובת IPv4`,gender:`f`},ipv6:{label:`כתובת IPv6`,gender:`f`},cidrv4:{label:`טווח IPv4`,gender:`m`},cidrv6:{label:`טווח IPv6`,gender:`m`},base64:{label:`מחרוזת בבסיס 64`,gender:`f`},base64url:{label:`מחרוזת בבסיס 64 לכתובות רשת`,gender:`f`},json_string:{label:`מחרוזת JSON`,gender:`f`},e164:{label:`מספר E.164`,gender:`m`},jwt:{label:`JWT`,gender:`m`},ends_with:{label:`קלט`,gender:`m`},includes:{label:`קלט`,gender:`m`},lowercase:{label:`קלט`,gender:`m`},starts_with:{label:`קלט`,gender:`m`},uppercase:{label:`קלט`,gender:`m`}},c={nan:`NaN`};return t=>{switch(t.code){case`invalid_type`:{let n=t.expected,i=c[n??``]??r(n),a=C(t.input),o=c[a]??e[a]?.label??a;return/^[A-Z]/.test(t.expected)?`קלט לא תקין: צריך להיות instanceof ${t.expected}, התקבל ${o}`:`קלט לא תקין: צריך להיות ${i}, התקבל ${o}`}case`invalid_value`:{if(t.values.length===1)return`ערך לא תקין: הערך חייב להיות ${x(t.values[0])}`;let e=t.values.map(e=>x(e));if(t.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${e[0]} או ${e[1]}`;let n=e[e.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${e.slice(0,-1).join(`, `)} או ${n}`}case`too_big`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.longLabel??`ארוך`} מדי: ${n} צריכה להכיל ${t.maximum.toString()} ${e?.unit??``} ${t.inclusive?`או פחות`:`לכל היותר`}`.trim();if(t.origin===`number`)return`גדול מדי: ${n} צריך להיות ${t.inclusive?`קטן או שווה ל-${t.maximum}`:`קטן מ-${t.maximum}`}`;if(t.origin===`array`||t.origin===`set`)return`גדול מדי: ${n} ${t.origin===`set`?`צריכה`:`צריך`} להכיל ${t.inclusive?`${t.maximum} ${e?.unit??``} או פחות`:`פחות מ-${t.maximum} ${e?.unit??``}`}`.trim();let r=t.inclusive?`<=`:`<`,s=a(t.origin??`value`);return e?.unit?`${e.longLabel} מדי: ${n} ${s} ${r}${t.maximum.toString()} ${e.unit}`:`${e?.longLabel??`גדול`} מדי: ${n} ${s} ${r}${t.maximum.toString()}`}case`too_small`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.shortLabel??`קצר`} מדי: ${n} צריכה להכיל ${t.minimum.toString()} ${e?.unit??``} ${t.inclusive?`או יותר`:`לפחות`}`.trim();if(t.origin===`number`)return`קטן מדי: ${n} צריך להיות ${t.inclusive?`גדול או שווה ל-${t.minimum}`:`גדול מ-${t.minimum}`}`;if(t.origin===`array`||t.origin===`set`){let r=t.origin===`set`?`צריכה`:`צריך`;return t.minimum===1&&t.inclusive?`קטן מדי: ${n} ${r} להכיל ${t.origin,`לפחות פריט אחד`}`:`קטן מדי: ${n} ${r} להכיל ${t.inclusive?`${t.minimum} ${e?.unit??``} או יותר`:`יותר מ-${t.minimum} ${e?.unit??``}`}`.trim()}let r=t.inclusive?`>=`:`>`,s=a(t.origin??`value`);return e?.unit?`${e.shortLabel} מדי: ${n} ${s} ${r}${t.minimum.toString()} ${e.unit}`:`${e?.shortLabel??`קטן`} מדי: ${n} ${s} ${r}${t.minimum.toString()}`}case`invalid_format`:{let e=t;if(e.format===`starts_with`)return`המחרוזת חייבת להתחיל ב "${e.prefix}"`;if(e.format===`ends_with`)return`המחרוזת חייבת להסתיים ב "${e.suffix}"`;if(e.format===`includes`)return`המחרוזת חייבת לכלול "${e.includes}"`;if(e.format===`regex`)return`המחרוזת חייבת להתאים לתבנית ${e.pattern}`;let n=s[e.format];return`${n?.label??e.format} לא ${(n?.gender??`m`)===`f`?`תקינה`:`תקין`}`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case`unrecognized_keys`:return`מפתח${t.keys.length>1?`ות`:``} לא מזוה${t.keys.length>1?`ים`:`ה`}: ${S(t.keys,`, `)}`;case`invalid_key`:return`שדה לא תקין באובייקט`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${i(t.origin??`array`)}`;default:return`קלט לא תקין`}}};function uu(){return{localeError:lu()}}const du=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n={regex:`bemenet`,email:`email cím`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO időbélyeg`,date:`ISO dátum`,time:`ISO idő`,duration:`ISO időintervallum`,ipv4:`IPv4 cím`,ipv6:`IPv6 cím`,cidrv4:`IPv4 tartomány`,cidrv6:`IPv6 tartomány`,base64:`base64-kódolt string`,base64url:`base64url-kódolt string`,json_string:`JSON string`,e164:`E.164 szám`,jwt:`JWT`,template_literal:`bemenet`},r={nan:`NaN`,number:`szám`,array:`tömb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Érvénytelen bemenet: a várt érték instanceof ${e.expected}, a kapott érték ${i}`:`Érvénytelen bemenet: a várt érték ${t}, a kapott érték ${i}`}case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${x(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}};function fu(){return{localeError:du()}}function pu(e,t,n){return Math.abs(e)===1?t:n}function mu(e){if(!e)return``;let t=[`ա`,`ե`,`ը`,`ի`,`ո`,`ու`,`օ`],n=e[e.length-1];return e+(t.includes(n)?`ն`:`ը`)}const hu=()=>{let e={string:{unit:{one:`նշան`,many:`նշաններ`},verb:`ունենալ`},file:{unit:{one:`բայթ`,many:`բայթեր`},verb:`ունենալ`},array:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`},set:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`}};function t(t){return e[t]??null}let n={regex:`մուտք`,email:`էլ. հասցե`,url:`URL`,emoji:`էմոջի`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO ամսաթիվ և ժամ`,date:`ISO ամսաթիվ`,time:`ISO ժամ`,duration:`ISO տևողություն`,ipv4:`IPv4 հասցե`,ipv6:`IPv6 հասցե`,cidrv4:`IPv4 միջակայք`,cidrv6:`IPv6 միջակայք`,base64:`base64 ձևաչափով տող`,base64url:`base64url ձևաչափով տող`,json_string:`JSON տող`,e164:`E.164 համար`,jwt:`JWT`,template_literal:`մուտք`},r={nan:`NaN`,number:`թիվ`,array:`զանգված`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${e.expected}, ստացվել է ${i}`:`Սխալ մուտքագրում․ սպասվում էր ${t}, ստացվել է ${i}`}case`invalid_value`:return e.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${x(e.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=pu(Number(e.maximum),r.unit.one,r.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${mu(e.origin??`արժեք`)} կունենա ${n}${e.maximum.toString()} ${t}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${mu(e.origin??`արժեք`)} լինի ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=pu(Number(e.minimum),r.unit.one,r.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${mu(e.origin)} կունենա ${n}${e.minimum.toString()} ${t}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${mu(e.origin)} լինի ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Սխալ տող․ պետք է սկսվի "${t.prefix}"-ով`:t.format===`ends_with`?`Սխալ տող․ պետք է ավարտվի "${t.suffix}"-ով`:t.format===`includes`?`Սխալ տող․ պետք է պարունակի "${t.includes}"`:t.format===`regex`?`Սխալ տող․ պետք է համապատասխանի ${t.pattern} ձևաչափին`:`Սխալ ${n[t.format]??e.format}`}case`not_multiple_of`:return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${e.divisor}-ի`;case`unrecognized_keys`:return`Չճանաչված բանալի${e.keys.length>1?`ներ`:``}. ${S(e.keys,`, `)}`;case`invalid_key`:return`Սխալ բանալի ${mu(e.origin)}-ում`;case`invalid_union`:return`Սխալ մուտքագրում`;case`invalid_element`:return`Սխալ արժեք ${mu(e.origin)}-ում`;default:return`Սխալ մուտքագրում`}}};function gu(){return{localeError:hu()}}const _u=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n={regex:`input`,email:`alamat email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tanggal dan waktu format ISO`,date:`tanggal format ISO`,time:`jam format ISO`,duration:`durasi format ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`rentang alamat IPv4`,cidrv6:`rentang alamat IPv6`,base64:`string dengan enkode base64`,base64url:`string dengan enkode base64url`,json_string:`string JSON`,e164:`angka E.164`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak valid: diharapkan instanceof ${e.expected}, diterima ${i}`:`Input tidak valid: diharapkan ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${x(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak valid: harus menyertakan "${t.includes}"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${n[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}};function vu(){return{localeError:_u()}}const yu=()=>{let e={string:{unit:`stafi`,verb:`að hafa`},file:{unit:`bæti`,verb:`að hafa`},array:{unit:`hluti`,verb:`að hafa`},set:{unit:`hluti`,verb:`að hafa`}};function t(t){return e[t]??null}let n={regex:`gildi`,email:`netfang`,url:`vefslóð`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dagsetning og tími`,date:`ISO dagsetning`,time:`ISO tími`,duration:`ISO tímalengd`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded strengur`,base64url:`base64url-encoded strengur`,json_string:`JSON strengur`,e164:`E.164 tölugildi`,jwt:`JWT`,template_literal:`gildi`},r={nan:`NaN`,number:`númer`,array:`fylki`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Rangt gildi: Þú slóst inn ${i} þar sem á að vera instanceof ${e.expected}`:`Rangt gildi: Þú slóst inn ${i} þar sem á að vera ${t}`}case`invalid_value`:return e.values.length===1?`Rangt gildi: gert ráð fyrir ${x(e.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} hafi ${n}${e.maximum.toString()} ${r.unit??`hluti`}`:`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} sé ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}`:`Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format===`ends_with`?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format===`includes`?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format===`regex`?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${n[t.format]??e.format}`}case`not_multiple_of`:return`Röng tala: verður að vera margfeldi af ${e.divisor}`;case`unrecognized_keys`:return`Óþekkt ${e.keys.length>1?`ir lyklar`:`ur lykill`}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Rangur lykill í ${e.origin}`;case`invalid_union`:return`Rangt gildi`;case`invalid_element`:return`Rangt gildi í ${e.origin}`;default:return`Rangt gildi`}}};function bu(){return{localeError:yu()}}const xu=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n={regex:`input`,email:`indirizzo email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e ora ISO`,date:`data ISO`,time:`ora ISO`,duration:`durata ISO`,ipv4:`indirizzo IPv4`,ipv6:`indirizzo IPv6`,cidrv4:`intervallo IPv4`,cidrv6:`intervallo IPv6`,base64:`stringa codificata in base64`,base64url:`URL codificata in base64`,json_string:`stringa JSON`,e164:`numero E.164`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`numero`,array:`vettore`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input non valido: atteso instanceof ${e.expected}, ricevuto ${i}`:`Input non valido: atteso ${t}, ricevuto ${i}`}case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${x(e.values[0])}`:`Opzione non valida: atteso uno tra ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format===`ends_with`?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format===`includes`?`Stringa non valida: deve includere "${t.includes}"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}};function Su(){return{localeError:xu()}}const Cu=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n={regex:`入力値`,email:`メールアドレス`,url:`URL`,emoji:`絵文字`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日時`,date:`ISO日付`,time:`ISO時刻`,duration:`ISO期間`,ipv4:`IPv4アドレス`,ipv6:`IPv6アドレス`,cidrv4:`IPv4範囲`,cidrv6:`IPv6範囲`,base64:`base64エンコード文字列`,base64url:`base64urlエンコード文字列`,json_string:`JSON文字列`,e164:`E.164番号`,jwt:`JWT`,template_literal:`入力値`},r={nan:`NaN`,number:`数値`,array:`配列`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無効な入力: instanceof ${e.expected}が期待されましたが、${i}が入力されました`:`無効な入力: ${t}が期待されましたが、${i}が入力されました`}case`invalid_value`:return e.values.length===1?`無効な入力: ${x(e.values[0])}が期待されました`:`無効な選択: ${S(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format===`includes`?`無効な文字列: "${t.includes}"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${n[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${S(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}};function wu(){return{localeError:Cu()}}const Tu=()=>{let e={string:{unit:`სიმბოლო`,verb:`უნდა შეიცავდეს`},file:{unit:`ბაიტი`,verb:`უნდა შეიცავდეს`},array:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},set:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`}};function t(t){return e[t]??null}let n={regex:`შეყვანა`,email:`ელ-ფოსტის მისამართი`,url:`URL`,emoji:`ემოჯი`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`თარიღი-დრო`,date:`თარიღი`,time:`დრო`,duration:`ხანგრძლივობა`,ipv4:`IPv4 მისამართი`,ipv6:`IPv6 მისამართი`,cidrv4:`IPv4 დიაპაზონი`,cidrv6:`IPv6 დიაპაზონი`,base64:`base64-კოდირებული სტრინგი`,base64url:`base64url-კოდირებული სტრინგი`,json_string:`JSON სტრინგი`,e164:`E.164 ნომერი`,jwt:`JWT`,template_literal:`შეყვანა`},r={nan:`NaN`,number:`რიცხვი`,string:`სტრინგი`,boolean:`ბულეანი`,function:`ფუნქცია`,array:`მასივი`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${e.expected}, მიღებული ${i}`:`არასწორი შეყვანა: მოსალოდნელი ${t}, მიღებული ${i}`}case`invalid_value`:return e.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${x(e.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${S(e.values,`|`)}-დან`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} იყოს ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ზედმეტად პატარა: მოსალოდნელი ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${e.origin} იყოს ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`არასწორი სტრინგი: უნდა იწყებოდეს "${t.prefix}"-ით`:t.format===`ends_with`?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${t.suffix}"-ით`:t.format===`includes`?`არასწორი სტრინგი: უნდა შეიცავდეს "${t.includes}"-ს`:t.format===`regex`?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`:`არასწორი ${n[t.format]??e.format}`}case`not_multiple_of`:return`არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`;case`unrecognized_keys`:return`უცნობი გასაღებ${e.keys.length>1?`ები`:`ი`}: ${S(e.keys,`, `)}`;case`invalid_key`:return`არასწორი გასაღები ${e.origin}-ში`;case`invalid_union`:return`არასწორი შეყვანა`;case`invalid_element`:return`არასწორი მნიშვნელობა ${e.origin}-ში`;default:return`არასწორი შეყვანა`}}};function Eu(){return{localeError:Tu()}}const Du=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n={regex:`ទិន្នន័យបញ្ចូល`,email:`អាសយដ្ឋានអ៊ីមែល`,url:`URL`,emoji:`សញ្ញាអារម្មណ៍`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`កាលបរិច្ឆេទ និងម៉ោង ISO`,date:`កាលបរិច្ឆេទ ISO`,time:`ម៉ោង ISO`,duration:`រយៈពេល ISO`,ipv4:`អាសយដ្ឋាន IPv4`,ipv6:`អាសយដ្ឋាន IPv6`,cidrv4:`ដែនអាសយដ្ឋាន IPv4`,cidrv6:`ដែនអាសយដ្ឋាន IPv6`,base64:`ខ្សែអក្សរអ៊ិកូដ base64`,base64url:`ខ្សែអក្សរអ៊ិកូដ base64url`,json_string:`ខ្សែអក្សរ JSON`,e164:`លេខ E.164`,jwt:`JWT`,template_literal:`ទិន្នន័យបញ្ចូល`},r={nan:`NaN`,number:`លេខ`,array:`អារេ (Array)`,null:`គ្មានតម្លៃ (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${e.expected} ប៉ុន្តែទទួលបាន ${i}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t} ប៉ុន្តែទទួលបាន ${i}`}case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${x(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${n[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${S(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}};function Ou(){return{localeError:Du()}}function ku(){return Ou()}const Au=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`입력`,email:`이메일 주소`,url:`URL`,emoji:`이모지`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 날짜시간`,date:`ISO 날짜`,time:`ISO 시간`,duration:`ISO 기간`,ipv4:`IPv4 주소`,ipv6:`IPv6 주소`,cidrv4:`IPv4 범위`,cidrv6:`IPv6 범위`,base64:`base64 인코딩 문자열`,base64url:`base64url 인코딩 문자열`,json_string:`JSON 문자열`,e164:`E.164 번호`,jwt:`JWT`,template_literal:`입력`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`잘못된 입력: 예상 타입은 instanceof ${e.expected}, 받은 타입은 ${i}입니다`:`잘못된 입력: 예상 타입은 ${t}, 받은 타입은 ${i}입니다`}case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${x(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${S(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${n[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${S(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}};function ju(){return{localeError:Au()}}const Mu=e=>e.charAt(0).toUpperCase()+e.slice(1);function Nu(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?`many`:n===1?`one`:`few`}const Pu=()=>{let e={string:{unit:{one:`simbolis`,few:`simboliai`,many:`simbolių`},verb:{smaller:{inclusive:`turi būti ne ilgesnė kaip`,notInclusive:`turi būti trumpesnė kaip`},bigger:{inclusive:`turi būti ne trumpesnė kaip`,notInclusive:`turi būti ilgesnė kaip`}}},file:{unit:{one:`baitas`,few:`baitai`,many:`baitų`},verb:{smaller:{inclusive:`turi būti ne didesnis kaip`,notInclusive:`turi būti mažesnis kaip`},bigger:{inclusive:`turi būti ne mažesnis kaip`,notInclusive:`turi būti didesnis kaip`}}},array:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}},set:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}}};function t(t,n,r,i){let a=e[t]??null;return a===null?a:{unit:a.unit[n],verb:a.verb[i][r?`inclusive`:`notInclusive`]}}let n={regex:`įvestis`,email:`el. pašto adresas`,url:`URL`,emoji:`jaustukas`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO data ir laikas`,date:`ISO data`,time:`ISO laikas`,duration:`ISO trukmė`,ipv4:`IPv4 adresas`,ipv6:`IPv6 adresas`,cidrv4:`IPv4 tinklo prefiksas (CIDR)`,cidrv6:`IPv6 tinklo prefiksas (CIDR)`,base64:`base64 užkoduota eilutė`,base64url:`base64url užkoduota eilutė`,json_string:`JSON eilutė`,e164:`E.164 numeris`,jwt:`JWT`,template_literal:`įvestis`},r={nan:`NaN`,number:`skaičius`,bigint:`sveikasis skaičius`,string:`eilutė`,boolean:`loginė reikšmė`,undefined:`neapibrėžta reikšmė`,function:`funkcija`,symbol:`simbolis`,array:`masyvas`,object:`objektas`,null:`nulinė reikšmė`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Gautas tipas ${i}, o tikėtasi - instanceof ${e.expected}`:`Gautas tipas ${i}, o tikėtasi - ${t}`}case`invalid_value`:return e.values.length===1?`Privalo būti ${x(e.values[0])}`:`Privalo būti vienas iš ${S(e.values,`|`)} pasirinkimų`;case`too_big`:{let n=r[e.origin]??e.origin,i=t(e.origin,Nu(Number(e.maximum)),e.inclusive??!1,`smaller`);if(i?.verb)return`${Mu(n??e.origin??`reikšmė`)} ${i.verb} ${e.maximum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne didesnis kaip`:`mažesnis kaip`;return`${Mu(n??e.origin??`reikšmė`)} turi būti ${a} ${e.maximum.toString()} ${i?.unit}`}case`too_small`:{let n=r[e.origin]??e.origin,i=t(e.origin,Nu(Number(e.minimum)),e.inclusive??!1,`bigger`);if(i?.verb)return`${Mu(n??e.origin??`reikšmė`)} ${i.verb} ${e.minimum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne mažesnis kaip`:`didesnis kaip`;return`${Mu(n??e.origin??`reikšmė`)} turi būti ${a} ${e.minimum.toString()} ${i?.unit}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Eilutė privalo prasidėti "${t.prefix}"`:t.format===`ends_with`?`Eilutė privalo pasibaigti "${t.suffix}"`:t.format===`includes`?`Eilutė privalo įtraukti "${t.includes}"`:t.format===`regex`?`Eilutė privalo atitikti ${t.pattern}`:`Neteisingas ${n[t.format]??e.format}`}case`not_multiple_of`:return`Skaičius privalo būti ${e.divisor} kartotinis.`;case`unrecognized_keys`:return`Neatpažint${e.keys.length>1?`i`:`as`} rakt${e.keys.length>1?`ai`:`as`}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Rastas klaidingas raktas`;case`invalid_union`:return`Klaidinga įvestis`;case`invalid_element`:{let t=r[e.origin]??e.origin;return`${Mu(t??e.origin??`reikšmė`)} turi klaidingą įvestį`}default:return`Klaidinga įvestis`}}};function Fu(){return{localeError:Pu()}}const Iu=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n={regex:`внес`,email:`адреса на е-пошта`,url:`URL`,emoji:`емоџи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO датум и време`,date:`ISO датум`,time:`ISO време`,duration:`ISO времетраење`,ipv4:`IPv4 адреса`,ipv6:`IPv6 адреса`,cidrv4:`IPv4 опсег`,cidrv6:`IPv6 опсег`,base64:`base64-енкодирана низа`,base64url:`base64url-енкодирана низа`,json_string:`JSON низа`,e164:`E.164 број`,jwt:`JWT`,template_literal:`внес`},r={nan:`NaN`,number:`број`,array:`низа`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Грешен внес: се очекува instanceof ${e.expected}, примено ${i}`:`Грешен внес: се очекува ${t}, примено ${i}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${x(e.values[0])}`:`Грешана опција: се очекува една ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format===`includes`?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}};function Lu(){return{localeError:Iu()}}const Ru=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n={regex:`input`,email:`alamat e-mel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tarikh masa ISO`,date:`tarikh ISO`,time:`masa ISO`,duration:`tempoh ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`julat IPv4`,cidrv6:`julat IPv6`,base64:`string dikodkan base64`,base64url:`string dikodkan base64url`,json_string:`string JSON`,e164:`nombor E.164`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`nombor`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak sah: dijangka instanceof ${e.expected}, diterima ${i}`:`Input tidak sah: dijangka ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${x(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${n[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${S(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}};function zu(){return{localeError:Ru()}}const Bu=()=>{let e={string:{unit:`tekens`,verb:`heeft`},file:{unit:`bytes`,verb:`heeft`},array:{unit:`elementen`,verb:`heeft`},set:{unit:`elementen`,verb:`heeft`}};function t(t){return e[t]??null}let n={regex:`invoer`,email:`emailadres`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum en tijd`,date:`ISO datum`,time:`ISO tijd`,duration:`ISO duur`,ipv4:`IPv4-adres`,ipv6:`IPv6-adres`,cidrv4:`IPv4-bereik`,cidrv6:`IPv6-bereik`,base64:`base64-gecodeerde tekst`,base64url:`base64 URL-gecodeerde tekst`,json_string:`JSON string`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`invoer`},r={nan:`NaN`,number:`getal`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ongeldige invoer: verwacht instanceof ${e.expected}, ontving ${i}`:`Ongeldige invoer: verwacht ${t}, ontving ${i}`}case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${x(e.values[0])}`:`Ongeldige optie: verwacht één van ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin),i=e.origin===`date`?`laat`:e.origin===`string`?`lang`:`groot`;return r?`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin),i=e.origin===`date`?`vroeg`:e.origin===`string`?`kort`:`klein`;return r?`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format===`includes`?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}};function Vu(){return{localeError:Bu()}}const Hu=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-postadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslett`,date:`ISO-dato`,time:`ISO-klokkeslett`,duration:`ISO-varighet`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spekter`,cidrv6:`IPv6-spekter`,base64:`base64-enkodet streng`,base64url:`base64url-enkodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`tall`,array:`liste`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldig input: forventet instanceof ${e.expected}, fikk ${i}`:`Ugyldig input: forventet ${t}, fikk ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${x(e.values[0])}`:`Ugyldig valg: forventet en av ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må inneholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}};function Uu(){return{localeError:Hu()}}const Wu=()=>{let e={string:{unit:`harf`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`unsur`,verb:`olmalıdır`},set:{unit:`unsur`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n={regex:`giren`,email:`epostagâh`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO hengâmı`,date:`ISO tarihi`,time:`ISO zamanı`,duration:`ISO müddeti`,ipv4:`IPv4 nişânı`,ipv6:`IPv6 nişânı`,cidrv4:`IPv4 menzili`,cidrv6:`IPv6 menzili`,base64:`base64-şifreli metin`,base64url:`base64url-şifreli metin`,json_string:`JSON metin`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`giren`},r={nan:`NaN`,number:`numara`,array:`saf`,null:`gayb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Fâsit giren: umulan instanceof ${e.expected}, alınan ${i}`:`Fâsit giren: umulan ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${x(e.values[0])}`:`Fâsit tercih: mûteberler ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format===`includes`?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${n[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}};function Gu(){return{localeError:Wu()}}const Ku=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n={regex:`ورودي`,email:`بریښنالیک`,url:`یو آر ال`,emoji:`ایموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`نیټه او وخت`,date:`نېټه`,time:`وخت`,duration:`موده`,ipv4:`د IPv4 پته`,ipv6:`د IPv6 پته`,cidrv4:`د IPv4 ساحه`,cidrv6:`د IPv6 ساحه`,base64:`base64-encoded متن`,base64url:`base64url-encoded متن`,json_string:`JSON متن`,e164:`د E.164 شمېره`,jwt:`JWT`,template_literal:`ورودي`},r={nan:`NaN`,number:`عدد`,array:`ارې`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ناسم ورودي: باید instanceof ${e.expected} وای, مګر ${i} ترلاسه شو`:`ناسم ورودي: باید ${t} وای, مګر ${i} ترلاسه شو`}case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${x(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${S(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید "${t.includes}" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${n[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${S(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}};function qu(){return{localeError:Ku()}}const Ju=()=>{let e={string:{unit:`znaków`,verb:`mieć`},file:{unit:`bajtów`,verb:`mieć`},array:{unit:`elementów`,verb:`mieć`},set:{unit:`elementów`,verb:`mieć`}};function t(t){return e[t]??null}let n={regex:`wyrażenie`,email:`adres email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i godzina w formacie ISO`,date:`data w formacie ISO`,time:`godzina w formacie ISO`,duration:`czas trwania ISO`,ipv4:`adres IPv4`,ipv6:`adres IPv6`,cidrv4:`zakres IPv4`,cidrv6:`zakres IPv6`,base64:`ciąg znaków zakodowany w formacie base64`,base64url:`ciąg znaków zakodowany w formacie base64url`,json_string:`ciąg znaków w formacie JSON`,e164:`liczba E.164`,jwt:`JWT`,template_literal:`wejście`},r={nan:`NaN`,number:`liczba`,array:`tablica`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${e.expected}, otrzymano ${i}`:`Nieprawidłowe dane wejściowe: oczekiwano ${t}, otrzymano ${i}`}case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${x(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}};function Yu(){return{localeError:Ju()}}const Xu=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let n={regex:`padrão`,email:`endereço de e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`duração ISO`,ipv4:`endereço IPv4`,ipv6:`endereço IPv6`,cidrv4:`faixa de IPv4`,cidrv6:`faixa de IPv6`,base64:`texto codificado em base64`,base64url:`URL codificada em base64`,json_string:`texto JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`,number:`número`,null:`nulo`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipo inválido: esperado instanceof ${e.expected}, recebido ${i}`:`Tipo inválido: esperado ${t}, recebido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${x(e.values[0])}`:`Opção inválida: esperada uma das ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar com "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${n[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}};function Zu(){return{localeError:Xu()}}function Qu(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const $u=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,jwt:`JWT`,template_literal:`ввод`},r={nan:`NaN`,number:`число`,array:`массив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неверный ввод: ожидалось instanceof ${e.expected}, получено ${i}`:`Неверный ввод: ожидалось ${t}, получено ${i}`}case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${x(e.values[0])}`:`Неверный вариант: ожидалось одно из ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Qu(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=Qu(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}};function ed(){return{localeError:$u()}}const td=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n={regex:`vnos`,email:`e-poštni naslov`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum in čas`,date:`ISO datum`,time:`ISO čas`,duration:`ISO trajanje`,ipv4:`IPv4 naslov`,ipv6:`IPv6 naslov`,cidrv4:`obseg IPv4`,cidrv6:`obseg IPv6`,base64:`base64 kodiran niz`,base64url:`base64url kodiran niz`,json_string:`JSON niz`,e164:`E.164 številka`,jwt:`JWT`,template_literal:`vnos`},r={nan:`NaN`,number:`število`,array:`tabela`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neveljaven vnos: pričakovano instanceof ${e.expected}, prejeto ${i}`:`Neveljaven vnos: pričakovano ${t}, prejeto ${i}`}case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${x(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format===`includes`?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}};function nd(){return{localeError:td()}}const rd=()=>{let e={string:{unit:`tecken`,verb:`att ha`},file:{unit:`bytes`,verb:`att ha`},array:{unit:`objekt`,verb:`att innehålla`},set:{unit:`objekt`,verb:`att innehålla`}};function t(t){return e[t]??null}let n={regex:`reguljärt uttryck`,email:`e-postadress`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datum och tid`,date:`ISO-datum`,time:`ISO-tid`,duration:`ISO-varaktighet`,ipv4:`IPv4-intervall`,ipv6:`IPv6-intervall`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodad sträng`,base64url:`base64url-kodad sträng`,json_string:`JSON-sträng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`mall-literal`},r={nan:`NaN`,number:`antal`,array:`lista`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ogiltig inmatning: förväntat instanceof ${e.expected}, fick ${i}`:`Ogiltig inmatning: förväntat ${t}, fick ${i}`}case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${x(e.values[0])}`:`Ogiltigt val: förväntade en av ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format===`includes`?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}};function id(){return{localeError:rd()}}const ad=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n={regex:`உள்ளீடு`,email:`மின்னஞ்சல் முகவரி`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO தேதி நேரம்`,date:`ISO தேதி`,time:`ISO நேரம்`,duration:`ISO கால அளவு`,ipv4:`IPv4 முகவரி`,ipv6:`IPv6 முகவரி`,cidrv4:`IPv4 வரம்பு`,cidrv6:`IPv6 வரம்பு`,base64:`base64-encoded சரம்`,base64url:`base64url-encoded சரம்`,json_string:`JSON சரம்`,e164:`E.164 எண்`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`எண்`,array:`அணி`,null:`வெறுமை`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${e.expected}, பெறப்பட்டது ${i}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t}, பெறப்பட்டது ${i}`}case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${x(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${S(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${n[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}};function od(){return{localeError:ad()}}const sd=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n={regex:`ข้อมูลที่ป้อน`,email:`ที่อยู่อีเมล`,url:`URL`,emoji:`อิโมจิ`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`วันที่เวลาแบบ ISO`,date:`วันที่แบบ ISO`,time:`เวลาแบบ ISO`,duration:`ช่วงเวลาแบบ ISO`,ipv4:`ที่อยู่ IPv4`,ipv6:`ที่อยู่ IPv6`,cidrv4:`ช่วง IP แบบ IPv4`,cidrv6:`ช่วง IP แบบ IPv6`,base64:`ข้อความแบบ Base64`,base64url:`ข้อความแบบ Base64 สำหรับ URL`,json_string:`ข้อความแบบ JSON`,e164:`เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`,jwt:`โทเคน JWT`,template_literal:`ข้อมูลที่ป้อน`},r={nan:`NaN`,number:`ตัวเลข`,array:`อาร์เรย์ (Array)`,null:`ไม่มีค่า (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${e.expected} แต่ได้รับ ${i}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t} แต่ได้รับ ${i}`}case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${x(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${n[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${S(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}};function cd(){return{localeError:sd()}}const ld=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let n={regex:`girdi`,email:`e-posta adresi`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO tarih ve saat`,date:`ISO tarih`,time:`ISO saat`,duration:`ISO süre`,ipv4:`IPv4 adresi`,ipv6:`IPv6 adresi`,cidrv4:`IPv4 aralığı`,cidrv6:`IPv6 aralığı`,base64:`base64 ile şifrelenmiş metin`,base64url:`base64url ile şifrelenmiş metin`,json_string:`JSON dizesi`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`Şablon dizesi`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Geçersiz değer: beklenen instanceof ${e.expected}, alınan ${i}`:`Geçersiz değer: beklenen ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${x(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format===`includes`?`Geçersiz metin: "${t.includes}" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}};function ud(){return{localeError:ld()}}const dd=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n={regex:`вхідні дані`,email:`адреса електронної пошти`,url:`URL`,emoji:`емодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`дата та час ISO`,date:`дата ISO`,time:`час ISO`,duration:`тривалість ISO`,ipv4:`адреса IPv4`,ipv6:`адреса IPv6`,cidrv4:`діапазон IPv4`,cidrv6:`діапазон IPv6`,base64:`рядок у кодуванні base64`,base64url:`рядок у кодуванні base64url`,json_string:`рядок JSON`,e164:`номер E.164`,jwt:`JWT`,template_literal:`вхідні дані`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неправильні вхідні дані: очікується instanceof ${e.expected}, отримано ${i}`:`Неправильні вхідні дані: очікується ${t}, отримано ${i}`}case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${x(e.values[0])}`:`Неправильна опція: очікується одне з ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format===`includes`?`Неправильний рядок: повинен містити "${t.includes}"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}};function fd(){return{localeError:dd()}}function pd(){return fd()}const md=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n={regex:`ان پٹ`,email:`ای میل ایڈریس`,url:`یو آر ایل`,emoji:`ایموجی`,uuid:`یو یو آئی ڈی`,uuidv4:`یو یو آئی ڈی وی 4`,uuidv6:`یو یو آئی ڈی وی 6`,nanoid:`نینو آئی ڈی`,guid:`جی یو آئی ڈی`,cuid:`سی یو آئی ڈی`,cuid2:`سی یو آئی ڈی 2`,ulid:`یو ایل آئی ڈی`,xid:`ایکس آئی ڈی`,ksuid:`کے ایس یو آئی ڈی`,datetime:`آئی ایس او ڈیٹ ٹائم`,date:`آئی ایس او تاریخ`,time:`آئی ایس او وقت`,duration:`آئی ایس او مدت`,ipv4:`آئی پی وی 4 ایڈریس`,ipv6:`آئی پی وی 6 ایڈریس`,cidrv4:`آئی پی وی 4 رینج`,cidrv6:`آئی پی وی 6 رینج`,base64:`بیس 64 ان کوڈڈ سٹرنگ`,base64url:`بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`,json_string:`جے ایس او این سٹرنگ`,e164:`ای 164 نمبر`,jwt:`جے ڈبلیو ٹی`,template_literal:`ان پٹ`},r={nan:`NaN`,number:`نمبر`,array:`آرے`,null:`نل`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`غلط ان پٹ: instanceof ${e.expected} متوقع تھا، ${i} موصول ہوا`:`غلط ان پٹ: ${t} متوقع تھا، ${i} موصول ہوا`}case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${x(e.values[0])} متوقع تھا`:`غلط آپشن: ${S(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${n[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${S(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}};function hd(){return{localeError:md()}}const gd=()=>{let e={string:{unit:`belgi`,verb:`bo‘lishi kerak`},file:{unit:`bayt`,verb:`bo‘lishi kerak`},array:{unit:`element`,verb:`bo‘lishi kerak`},set:{unit:`element`,verb:`bo‘lishi kerak`}};function t(t){return e[t]??null}let n={regex:`kirish`,email:`elektron pochta manzili`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO sana va vaqti`,date:`ISO sana`,time:`ISO vaqt`,duration:`ISO davomiylik`,ipv4:`IPv4 manzil`,ipv6:`IPv6 manzil`,mac:`MAC manzil`,cidrv4:`IPv4 diapazon`,cidrv6:`IPv6 diapazon`,base64:`base64 kodlangan satr`,base64url:`base64url kodlangan satr`,json_string:`JSON satr`,e164:`E.164 raqam`,jwt:`JWT`,template_literal:`kirish`},r={nan:`NaN`,number:`raqam`,array:`massiv`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${e.expected}, qabul qilingan ${i}`:`Noto‘g‘ri kirish: kutilgan ${t}, qabul qilingan ${i}`}case`invalid_value`:return e.values.length===1?`Noto‘g‘ri kirish: kutilgan ${x(e.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()} ${r.unit} ${r.verb}`:`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Noto‘g‘ri satr: "${t.prefix}" bilan boshlanishi kerak`:t.format===`ends_with`?`Noto‘g‘ri satr: "${t.suffix}" bilan tugashi kerak`:t.format===`includes`?`Noto‘g‘ri satr: "${t.includes}" ni o‘z ichiga olishi kerak`:t.format===`regex`?`Noto‘g‘ri satr: ${t.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${n[t.format]??e.format}`}case`not_multiple_of`:return`Noto‘g‘ri raqam: ${e.divisor} ning karralisi bo‘lishi kerak`;case`unrecognized_keys`:return`Noma’lum kalit${e.keys.length>1?`lar`:``}: ${S(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} dagi kalit noto‘g‘ri`;case`invalid_union`:return`Noto‘g‘ri kirish`;case`invalid_element`:return`${e.origin} da noto‘g‘ri qiymat`;default:return`Noto‘g‘ri kirish`}}};function _d(){return{localeError:gd()}}const vd=()=>{let e={string:{unit:`ký tự`,verb:`có`},file:{unit:`byte`,verb:`có`},array:{unit:`phần tử`,verb:`có`},set:{unit:`phần tử`,verb:`có`}};function t(t){return e[t]??null}let n={regex:`đầu vào`,email:`địa chỉ email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ngày giờ ISO`,date:`ngày ISO`,time:`giờ ISO`,duration:`khoảng thời gian ISO`,ipv4:`địa chỉ IPv4`,ipv6:`địa chỉ IPv6`,cidrv4:`dải IPv4`,cidrv6:`dải IPv6`,base64:`chuỗi mã hóa base64`,base64url:`chuỗi mã hóa base64url`,json_string:`chuỗi JSON`,e164:`số E.164`,jwt:`JWT`,template_literal:`đầu vào`},r={nan:`NaN`,number:`số`,array:`mảng`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${e.expected}, nhận được ${i}`:`Đầu vào không hợp lệ: mong đợi ${t}, nhận được ${i}`}case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${x(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${n[t.format]??e.format} không hợp lệ`}case`not_multiple_of`:return`Số không hợp lệ: phải là bội số của ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${S(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.origin}`;case`invalid_union`:return`Đầu vào không hợp lệ`;case`invalid_element`:return`Giá trị không hợp lệ trong ${e.origin}`;default:return`Đầu vào không hợp lệ`}}};function yd(){return{localeError:vd()}}const bd=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n={regex:`输入`,email:`电子邮件`,url:`URL`,emoji:`表情符号`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日期时间`,date:`ISO日期`,time:`ISO时间`,duration:`ISO时长`,ipv4:`IPv4地址`,ipv6:`IPv6地址`,cidrv4:`IPv4网段`,cidrv6:`IPv6网段`,base64:`base64编码字符串`,base64url:`base64url编码字符串`,json_string:`JSON字符串`,e164:`E.164号码`,jwt:`JWT`,template_literal:`输入`},r={nan:`NaN`,number:`数字`,array:`数组`,null:`空值(null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`无效输入:期望 instanceof ${e.expected},实际接收 ${i}`:`无效输入:期望 ${t},实际接收 ${i}`}case`invalid_value`:return e.values.length===1?`无效输入:期望 ${x(e.values[0])}`:`无效选项:期望以下之一 ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 "${t.prefix}" 开头`:t.format===`ends_with`?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format===`includes`?`无效字符串:必须包含 "${t.includes}"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${n[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${S(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}};function xd(){return{localeError:bd()}}const Sd=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n={regex:`輸入`,email:`郵件地址`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 日期時間`,date:`ISO 日期`,time:`ISO 時間`,duration:`ISO 期間`,ipv4:`IPv4 位址`,ipv6:`IPv6 位址`,cidrv4:`IPv4 範圍`,cidrv6:`IPv6 範圍`,base64:`base64 編碼字串`,base64url:`base64url 編碼字串`,json_string:`JSON 字串`,e164:`E.164 數值`,jwt:`JWT`,template_literal:`輸入`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無效的輸入值:預期為 instanceof ${e.expected},但收到 ${i}`:`無效的輸入值:預期為 ${t},但收到 ${i}`}case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${x(e.values[0])}`:`無效的選項:預期為以下其中之一 ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format===`ends_with`?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format===`includes`?`無效的字串:必須包含 "${t.includes}"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${n[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${S(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}};function Cd(){return{localeError:Sd()}}const wd=()=>{let e={string:{unit:`àmi`,verb:`ní`},file:{unit:`bytes`,verb:`ní`},array:{unit:`nkan`,verb:`ní`},set:{unit:`nkan`,verb:`ní`}};function t(t){return e[t]??null}let n={regex:`ẹ̀rọ ìbáwọlé`,email:`àdírẹ́sì ìmẹ́lì`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`àkókò ISO`,date:`ọjọ́ ISO`,time:`àkókò ISO`,duration:`àkókò tó pé ISO`,ipv4:`àdírẹ́sì IPv4`,ipv6:`àdírẹ́sì IPv6`,cidrv4:`àgbègbè IPv4`,cidrv6:`àgbègbè IPv6`,base64:`ọ̀rọ̀ tí a kọ́ ní base64`,base64url:`ọ̀rọ̀ base64url`,json_string:`ọ̀rọ̀ JSON`,e164:`nọ́mbà E.164`,jwt:`JWT`,template_literal:`ẹ̀rọ ìbáwọlé`},r={nan:`NaN`,number:`nọ́mbà`,array:`akopọ`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=C(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${e.expected}, àmọ̀ a rí ${i}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${t}, àmọ̀ a rí ${i}`}case`invalid_value`:return e.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${x(e.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${S(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin??`iye`} ${r.verb} ${n}${e.maximum} ${r.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}`:`Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"`:t.format===`ends_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"`:t.format===`includes`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"`:t.format===`regex`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}`:`Aṣìṣe: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`;case`unrecognized_keys`:return`Bọtìnì àìmọ̀: ${S(e.keys,`, `)}`;case`invalid_key`:return`Bọtìnì aṣìṣe nínú ${e.origin}`;case`invalid_union`:return`Ìbáwọlé aṣìṣe`;case`invalid_element`:return`Iye aṣìṣe nínú ${e.origin}`;default:return`Ìbáwọlé aṣìṣe`}}};function Td(){return{localeError:wd()}}var Ed=r({ar:()=>Nl,az:()=>Fl,be:()=>Rl,bg:()=>Bl,ca:()=>Hl,cs:()=>Wl,da:()=>Kl,de:()=>Jl,en:()=>Xl,eo:()=>Ql,es:()=>eu,fa:()=>nu,fi:()=>iu,fr:()=>ou,frCA:()=>cu,he:()=>uu,hu:()=>fu,hy:()=>gu,id:()=>vu,is:()=>bu,it:()=>Su,ja:()=>wu,ka:()=>Eu,kh:()=>ku,km:()=>Ou,ko:()=>ju,lt:()=>Fu,mk:()=>Lu,ms:()=>zu,nl:()=>Vu,no:()=>Uu,ota:()=>Gu,pl:()=>Yu,ps:()=>qu,pt:()=>Zu,ru:()=>ed,sl:()=>nd,sv:()=>id,ta:()=>od,th:()=>cd,tr:()=>ud,ua:()=>pd,uk:()=>fd,ur:()=>hd,uz:()=>_d,vi:()=>yd,yo:()=>Td,zhCN:()=>xd,zhTW:()=>Cd}),Dd=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??`draft-2020-12`;t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),this.ctx=oc({processors:Xs,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return ar(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),Xn(this.ctx,e);let{"~standard":n,...r}=be(this.ctx,e);return r}},Od=r({}),kd=r({$ZodAny:()=>Un,$ZodArray:()=>Pc,$ZodAsyncError:()=>Qo,$ZodBase64:()=>pe,$ZodBase64URL:()=>wr,$ZodBigInt:()=>dt,$ZodBigIntFormat:()=>gr,$ZodBoolean:()=>Mr,$ZodCIDRv4:()=>nt,$ZodCIDRv6:()=>Ft,$ZodCUID:()=>cs,$ZodCUID2:()=>Dt,$ZodCatch:()=>Yr,$ZodCheck:()=>Li,$ZodCheckBigIntFormat:()=>fo,$ZodCheckEndsWith:()=>Vs,$ZodCheckGreaterThan:()=>qi,$ZodCheckIncludes:()=>ua,$ZodCheckLengthEquals:()=>Xo,$ZodCheckLessThan:()=>xo,$ZodCheckLowerCase:()=>ka,$ZodCheckMaxLength:()=>ya,$ZodCheckMaxSize:()=>li,$ZodCheckMimeType:()=>Ys,$ZodCheckMinLength:()=>Sc,$ZodCheckMinSize:()=>Oi,$ZodCheckMultipleOf:()=>mc,$ZodCheckNumberFormat:()=>Yn,$ZodCheckOverwrite:()=>ye,$ZodCheckProperty:()=>ac,$ZodCheckRegex:()=>ir,$ZodCheckSizeEquals:()=>Ie,$ZodCheckStartsWith:()=>Oe,$ZodCheckStringFormat:()=>mn,$ZodCheckUpperCase:()=>no,$ZodCodec:()=>Br,$ZodCustom:()=>ii,$ZodCustomStringFormat:()=>Fn,$ZodDate:()=>v,$ZodDefault:()=>sa,$ZodDiscriminatedUnion:()=>Rs,$ZodE164:()=>Io,$ZodEmail:()=>bs,$ZodEmoji:()=>Wa,$ZodEncodeError:()=>Co,$ZodEnum:()=>wi,$ZodError:()=>Ps,$ZodExactOptional:()=>Ko,$ZodFile:()=>ks,$ZodFunction:()=>Ui,$ZodGUID:()=>_o,$ZodIPv4:()=>Ks,$ZodIPv6:()=>Qi,$ZodISODate:()=>ga,$ZodISODateTime:()=>ns,$ZodISODuration:()=>Do,$ZodISOTime:()=>Fa,$ZodIntersection:()=>Ta,$ZodJWT:()=>hi,$ZodKSUID:()=>tc,$ZodLazy:()=>Oc,$ZodLiteral:()=>Ni,$ZodMAC:()=>yc,$ZodMap:()=>er,$ZodNaN:()=>we,$ZodNanoID:()=>uc,$ZodNever:()=>lr,$ZodNonOptional:()=>Ve,$ZodNull:()=>Ne,$ZodNullable:()=>yn,$ZodNumber:()=>so,$ZodNumberFormat:()=>se,$ZodObject:()=>Qa,$ZodObjectJIT:()=>tn,$ZodOptional:()=>dn,$ZodPipe:()=>On,$ZodPrefault:()=>Xe,$ZodPromise:()=>xt,$ZodReadonly:()=>Kt,$ZodRealError:()=>Mo,$ZodRecord:()=>Gn,$ZodRegistry:()=>ln,$ZodSet:()=>Ic,$ZodString:()=>he,$ZodStringFormat:()=>Er,$ZodSuccess:()=>pt,$ZodSymbol:()=>vr,$ZodTemplateLiteral:()=>Pr,$ZodTransform:()=>it,$ZodTuple:()=>Lt,$ZodType:()=>us,$ZodULID:()=>kt,$ZodURL:()=>Zr,$ZodUUID:()=>Hr,$ZodUndefined:()=>oi,$ZodUnion:()=>Ln,$ZodUnknown:()=>b,$ZodVoid:()=>ta,$ZodXID:()=>Ms,$ZodXor:()=>Ao,$brand:()=>ja,$constructor:()=>xa,$input:()=>En,$output:()=>Je,Doc:()=>Cs,JSONSchema:()=>Od,JSONSchemaGenerator:()=>Dd,NEVER:()=>di,TimePrecision:()=>Le,_any:()=>ke,_array:()=>hn,_base64:()=>ro,_base64url:()=>re,_bigint:()=>Ja,_boolean:()=>Zt,_catch:()=>sn,_check:()=>wn,_cidrv4:()=>Ke,_cidrv6:()=>_t,_coercedBigint:()=>Ht,_coercedBoolean:()=>Vn,_coercedDate:()=>Mc,_coercedNumber:()=>de,_coercedString:()=>Sr,_cuid:()=>lt,_cuid2:()=>mr,_custom:()=>Ar,_date:()=>et,_decode:()=>qa,_decodeAsync:()=>Xt,_default:()=>Nt,_discriminatedUnion:()=>os,_e164:()=>Tt,_email:()=>qr,_emoji:()=>Rr,_encode:()=>on,_encodeAsync:()=>Cn,_endsWith:()=>ni,_enum:()=>Nn,_file:()=>g,_float32:()=>ea,_float64:()=>js,_gt:()=>ko,_gte:()=>ps,_guid:()=>La,_includes:()=>_i,_int:()=>zo,_int32:()=>Ss,_int64:()=>Ii,_intersection:()=>uo,_ipv4:()=>Bs,_ipv6:()=>Ki,_isoDate:()=>la,_isoDateTime:()=>Yo,_isoDuration:()=>bo,_isoTime:()=>Oa,_jwt:()=>va,_ksuid:()=>ci,_lazy:()=>Js,_length:()=>xc,_literal:()=>Di,_lowercase:()=>pc,_lt:()=>Jn,_lte:()=>ve,_mac:()=>ic,_map:()=>rr,_max:()=>ve,_maxLength:()=>Fe,_maxSize:()=>De,_mime:()=>pn,_min:()=>ps,_minLength:()=>to,_minSize:()=>te,_multipleOf:()=>Ka,_nan:()=>Yt,_nanoid:()=>an,_nativeEnum:()=>Sn,_negative:()=>We,_never:()=>ht,_nonnegative:()=>Bt,_nonoptional:()=>zn,_nonpositive:()=>Ac,_normalize:()=>le,_null:()=>br,_nullable:()=>st,_number:()=>fr,_optional:()=>Or,_overwrite:()=>Qe,_parse:()=>Ge,_parseAsync:()=>gt,_pipe:()=>jt,_positive:()=>is,_promise:()=>Ct,_property:()=>Gr,_readonly:()=>Ir,_record:()=>ei,_refine:()=>jn,_regex:()=>m,_safeDecode:()=>Vt,_safeDecodeAsync:()=>Bn,_safeEncode:()=>jc,_safeEncodeAsync:()=>ue,_safeParse:()=>xr,_safeParseAsync:()=>ct,_set:()=>aa,_size:()=>Is,_slugify:()=>Po,_startsWith:()=>vs,_string:()=>Ha,_stringFormat:()=>Si,_stringbool:()=>Wo,_success:()=>Ds,_superRefine:()=>Vi,_symbol:()=>ho,_templateLiteral:()=>Ws,_toLowerCase:()=>Xi,_toUpperCase:()=>ma,_transform:()=>es,_trim:()=>To,_tuple:()=>Na,_uint32:()=>Ca,_uint64:()=>pi,_ulid:()=>$s,_undefined:()=>Ec,_union:()=>ji,_unknown:()=>_c,_uppercase:()=>Qn,_url:()=>Se,_uuid:()=>cc,_uuidv4:()=>sr,_uuidv6:()=>ze,_uuidv7:()=>je,_void:()=>_n,_xid:()=>ao,_xor:()=>ae,clone:()=>zi,config:()=>Zs,createStandardJSONSchemaMethod:()=>ki,createToJSONSchemaMethod:()=>hc,decode:()=>pr,decodeAsync:()=>kr,describe:()=>Xa,encode:()=>$e,encodeAsync:()=>Mt,extractDefs:()=>Xn,finalize:()=>be,flattenError:()=>gs,formatError:()=>Ba,globalConfig:()=>wc,globalRegistry:()=>yt,initializeContext:()=>oc,isValidBase64:()=>ms,isValidBase64URL:()=>Ra,isValidJWT:()=>vi,locales:()=>Ed,meta:()=>$t,parse:()=>as,parseAsync:()=>wt,prettifyError:()=>bi,process:()=>ar,regexes:()=>ne,registry:()=>Wt,safeDecode:()=>Kr,safeDecodeAsync:()=>Lr,safeEncode:()=>ti,safeEncodeAsync:()=>Mn,safeParse:()=>h,safeParseAsync:()=>ra,toDotPath:()=>Ho,toJSONSchema:()=>Cc,treeifyError:()=>Ts,util:()=>fa,version:()=>Bo}),Ad=r({endsWith:()=>ni,gt:()=>ko,gte:()=>ps,includes:()=>_i,length:()=>xc,lowercase:()=>pc,lt:()=>Jn,lte:()=>ve,maxLength:()=>Fe,maxSize:()=>De,mime:()=>pn,minLength:()=>to,minSize:()=>te,multipleOf:()=>Ka,negative:()=>We,nonnegative:()=>Bt,nonpositive:()=>Ac,normalize:()=>le,overwrite:()=>Qe,positive:()=>is,property:()=>Gr,regex:()=>m,size:()=>Is,slugify:()=>Po,startsWith:()=>vs,toLowerCase:()=>Xi,toUpperCase:()=>ma,trim:()=>To,uppercase:()=>Qn});const jd={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};function Md(e){Zs({customError:e})}function Nd(){return Zs().customError}var Pd;Pd||={};const w={...oo,...Ad,iso:ui},Fd=new Set(`$schema.$ref.$defs.definitions.$id.id.$comment.$anchor.$vocabulary.$dynamicRef.$dynamicAnchor.type.enum.const.anyOf.oneOf.allOf.not.properties.required.additionalProperties.patternProperties.propertyNames.minProperties.maxProperties.items.prefixItems.additionalItems.minItems.maxItems.uniqueItems.contains.minContains.maxContains.minLength.maxLength.pattern.format.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.description.default.contentEncoding.contentMediaType.contentSchema.unevaluatedItems.unevaluatedProperties.if.then.else.dependentSchemas.dependentRequired.nullable.readOnly`.split(`.`));function Id(e,t){let n=e.$schema;return n===`https://json-schema.org/draft/2020-12/schema`?`draft-2020-12`:n===`http://json-schema.org/draft-07/schema#`?`draft-7`:n===`http://json-schema.org/draft-04/schema#`?`draft-4`:t??`draft-2020-12`}function Ld(e,t){if(!e.startsWith(`#`))throw Error(`External $ref is not supported, only local refs (#/...) are allowed`);let n=e.slice(1).split(`/`).filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version===`draft-2020-12`?`$defs`:`definitions`;if(n[0]===r){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function Rd(e,t){if(e.not!==void 0){if(typeof e.not==`object`&&Object.keys(e.not).length===0)return w.never();throw Error(`not is not supported in Zod (except { not: {} } for never)`)}if(e.unevaluatedItems!==void 0)throw Error(`unevaluatedItems is not supported`);if(e.unevaluatedProperties!==void 0)throw Error(`unevaluatedProperties is not supported`);if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error(`Conditional schemas (if/then/else) are not supported`);if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error(`dependentSchemas and dependentRequired are not supported`);if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return w.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let r=zd(Ld(n,t),t);return t.refs.set(n,r),t.processing.delete(n),r}if(e.enum!==void 0){let n=e.enum;if(t.version===`openapi-3.0`&&e.nullable===!0&&n.length===1&&n[0]===null)return w.null();if(n.length===0)return w.never();if(n.length===1)return w.literal(n[0]);if(n.every(e=>typeof e==`string`))return w.enum(n);let r=n.map(e=>w.literal(e));return r.length<2?r[0]:w.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return w.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(n=>Rd({...e,type:n},t));return r.length===0?w.never():r.length===1?r[0]:w.union(r)}if(!n)return w.any();let r;switch(n){case`string`:{let t=w.string();if(e.format){let n=e.format;n===`email`?t=t.check(w.email()):n===`uri`||n===`uri-reference`?t=t.check(w.url()):n===`uuid`||n===`guid`?t=t.check(w.uuid()):n===`date-time`?t=t.check(w.iso.datetime()):n===`date`?t=t.check(w.iso.date()):n===`time`?t=t.check(w.iso.time()):n===`duration`?t=t.check(w.iso.duration()):n===`ipv4`?t=t.check(w.ipv4()):n===`ipv6`?t=t.check(w.ipv6()):n===`mac`?t=t.check(w.mac()):n===`cidr`?t=t.check(w.cidrv4()):n===`cidr-v6`?t=t.check(w.cidrv6()):n===`base64`?t=t.check(w.base64()):n===`base64url`?t=t.check(w.base64url()):n===`e164`?t=t.check(w.e164()):n===`jwt`?t=t.check(w.jwt()):n===`emoji`?t=t.check(w.emoji()):n===`nanoid`?t=t.check(w.nanoid()):n===`cuid`?t=t.check(w.cuid()):n===`cuid2`?t=t.check(w.cuid2()):n===`ulid`?t=t.check(w.ulid()):n===`xid`?t=t.check(w.xid()):n===`ksuid`&&(t=t.check(w.ksuid()))}typeof e.minLength==`number`&&(t=t.min(e.minLength)),typeof e.maxLength==`number`&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case`number`:case`integer`:{let t=n===`integer`?w.number().int():w.number();typeof e.minimum==`number`&&(t=t.min(e.minimum)),typeof e.maximum==`number`&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum==`number`?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum==`number`&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum==`number`?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum==`number`&&(t=t.lt(e.maximum)),typeof e.multipleOf==`number`&&(t=t.multipleOf(e.multipleOf)),r=t;break}case`boolean`:r=w.boolean();break;case`null`:r=w.null();break;case`object`:{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[e,r]of Object.entries(i)){let i=zd(r,t);n[e]=a.has(e)?i:i.optional()}if(e.propertyNames){let i=zd(e.propertyNames,t),a=e.additionalProperties&&typeof e.additionalProperties==`object`?zd(e.additionalProperties,t):w.any();if(Object.keys(n).length===0){r=w.record(i,a);break}let o=w.object(n).passthrough(),s=w.looseRecord(i,a);r=w.intersection(o,s);break}if(e.patternProperties){let i=e.patternProperties,a=Object.keys(i),o=[];for(let e of a){let n=zd(i[e],t),r=w.string().regex(new RegExp(e));o.push(w.looseRecord(r,n))}let s=[];if(Object.keys(n).length>0&&s.push(w.object(n).passthrough()),s.push(...o),s.length===0)r=w.object({}).passthrough();else if(s.length===1)r=s[0];else{let e=w.intersection(s[0],s[1]);for(let t=2;t<s.length;t++)e=w.intersection(e,s[t]);r=e}break}let o=w.object(n);r=e.additionalProperties===!1?o.strict():typeof e.additionalProperties==`object`?o.catchall(zd(e.additionalProperties,t)):o.passthrough();break}case`array`:{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(e=>zd(e,t)),o=i&&typeof i==`object`&&!Array.isArray(i)?zd(i,t):void 0;r=o?w.tuple(a).rest(o):w.tuple(a),typeof e.minItems==`number`&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(w.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=i.map(e=>zd(e,t)),a=e.additionalItems&&typeof e.additionalItems==`object`?zd(e.additionalItems,t):void 0;r=a?w.tuple(n).rest(a):w.tuple(n),typeof e.minItems==`number`&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(w.maxLength(e.maxItems)))}else if(i!==void 0){let n=zd(i,t),a=w.array(n);typeof e.minItems==`number`&&(a=a.min(e.minItems)),typeof e.maxItems==`number`&&(a=a.max(e.maxItems)),r=a}else r=w.array(w.any());break}default:throw Error(`Unsupported type: ${n}`)}return e.description&&(r=r.describe(e.description)),e.default!==void 0&&(r=r.default(e.default)),r}function zd(e,t){if(typeof e==`boolean`)return e?w.any():w.never();let n=Rd(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>zd(e,t)),a=w.union(i);n=r?w.intersection(n,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>zd(e,t)),a=w.xor(i);n=r?w.intersection(n,a):a}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:w.any();else{let i=r?n:zd(e.allOf[0],t),a=+!r;for(let n=a;n<e.allOf.length;n++)i=w.intersection(i,zd(e.allOf[n],t));n=i}e.nullable===!0&&t.version===`openapi-3.0`&&(n=w.nullable(n)),e.readOnly===!0&&(n=w.readonly(n));let i={};for(let t of[`$id`,`id`,`$comment`,`$anchor`,`$vocabulary`,`$dynamicRef`,`$dynamicAnchor`])t in e&&(i[t]=e[t]);for(let t of[`contentEncoding`,`contentMediaType`,`contentSchema`])t in e&&(i[t]=e[t]);for(let t of Object.keys(e))Fd.has(t)||(i[t]=e[t]);return Object.keys(i).length>0&&t.registry.add(n,i),n}function Bd(e,t){return typeof e==`boolean`?e?w.any():w.never():zd(e,{version:Id(e,t?.defaultTarget),defs:e.$defs||e.definitions||{},refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??yt})}var Vd=r({$brand:()=>ja,$input:()=>En,$output:()=>Je,NEVER:()=>di,TimePrecision:()=>Le,ZodAny:()=>$r,ZodArray:()=>An,ZodBase64:()=>p,ZodBase64URL:()=>ca,ZodBigInt:()=>zs,ZodBigIntFormat:()=>Lo,ZodBoolean:()=>xs,ZodCIDRv4:()=>Ga,ZodCIDRv6:()=>Ti,ZodCUID:()=>qo,ZodCUID2:()=>As,ZodCatch:()=>Wi,ZodCodec:()=>vo,ZodCustom:()=>qs,ZodCustomStringFormat:()=>$i,ZodDate:()=>_a,ZodDefault:()=>rs,ZodDiscriminatedUnion:()=>Oo,ZodE164:()=>Ia,ZodEmail:()=>Ea,ZodEmoji:()=>gi,ZodEnum:()=>nc,ZodError:()=>Ji,ZodExactOptional:()=>kc,ZodFile:()=>Pi,ZodFirstPartyTypeKind:()=>Pd,ZodFunction:()=>bc,ZodGUID:()=>tr,ZodIPv4:()=>Te,ZodIPv6:()=>dc,ZodISODate:()=>Zo,ZodISODateTime:()=>So,ZodISODuration:()=>Aa,ZodISOTime:()=>ba,ZodIntersection:()=>ur,ZodIssueCode:()=>jd,ZodJWT:()=>He,ZodKSUID:()=>Pe,ZodLazy:()=>bn,ZodLiteral:()=>co,ZodMAC:()=>ce,ZodMap:()=>$a,ZodNaN:()=>nn,ZodNanoID:()=>fn,ZodNever:()=>kn,ZodNonOptional:()=>Ze,ZodNull:()=>St,ZodNullable:()=>qt,ZodNumber:()=>Kn,ZodNumberFormat:()=>Lc,ZodObject:()=>ge,ZodOptional:()=>Dr,ZodPipe:()=>mt,ZodPrefault:()=>yr,ZodPromise:()=>Fr,ZodReadonly:()=>at,ZodRealError:()=>da,ZodRecord:()=>Rt,ZodSet:()=>ds,ZodString:()=>At,ZodStringFormat:()=>Qr,ZodSuccess:()=>Ur,ZodSymbol:()=>si,ZodTemplateLiteral:()=>Rn,ZodTransform:()=>ee,ZodTuple:()=>ia,ZodType:()=>Fs,ZodULID:()=>No,ZodURL:()=>_s,ZodUUID:()=>Va,ZodUndefined:()=>xi,ZodUnion:()=>Uo,ZodUnknown:()=>Es,ZodVoid:()=>Bi,ZodXID:()=>mo,ZodXor:()=>Us,_ZodString:()=>Yi,_default:()=>$o,_function:()=>Ma,any:()=>Ai,array:()=>gc,base64:()=>Zn,base64url:()=>xe,bigint:()=>sc,boolean:()=>or,catch:()=>pa,check:()=>Re,cidrv4:()=>Ae,cidrv6:()=>gn,clone:()=>zi,codec:()=>io,coerce:()=>Wr,config:()=>Zs,core:()=>kd,cuid:()=>ie,cuid2:()=>Ya,custom:()=>Qt,date:()=>cn,decode:()=>y,decodeAsync:()=>na,describe:()=>Tn,discriminatedUnion:()=>qe,e164:()=>vt,email:()=>Ut,emoji:()=>Hn,encode:()=>Ns,encodeAsync:()=>jo,endsWith:()=>ni,enum:()=>wo,exactOptional:()=>Nc,file:()=>fe,flattenError:()=>gs,float32:()=>Cr,float64:()=>ut,formatError:()=>Ba,fromJSONSchema:()=>Bd,function:()=>Ma,getErrorMap:()=>Nd,globalRegistry:()=>yt,gt:()=>ko,gte:()=>ps,guid:()=>hr,hash:()=>jr,hex:()=>tt,hostname:()=>Pt,httpUrl:()=>ss,includes:()=>_i,instanceof:()=>Sa,int:()=>Et,int32:()=>Jr,int64:()=>zr,intersection:()=>ri,ipv4:()=>Pn,ipv6:()=>_,iso:()=>ui,json:()=>oa,jwt:()=>Ls,keyof:()=>Fo,ksuid:()=>ys,lazy:()=>Ua,length:()=>xc,literal:()=>Ci,locales:()=>Ed,looseObject:()=>Go,looseRecord:()=>Os,lowercase:()=>pc,lt:()=>Jn,lte:()=>ve,mac:()=>Hi,map:()=>go,maxLength:()=>Fe,maxSize:()=>De,meta:()=>Gs,mime:()=>pn,minLength:()=>to,minSize:()=>te,multipleOf:()=>Ka,nan:()=>Zi,nanoid:()=>ha,nativeEnum:()=>ts,negative:()=>We,never:()=>Eo,nonnegative:()=>Bt,nonoptional:()=>Pa,nonpositive:()=>Ac,normalize:()=>le,null:()=>fi,nullable:()=>wa,nullish:()=>mi,number:()=>ec,object:()=>Dc,optional:()=>Mi,overwrite:()=>Qe,parse:()=>hs,parseAsync:()=>za,partialRecord:()=>vc,pipe:()=>$n,positive:()=>is,prefault:()=>Ce,preprocess:()=>lc,prettifyError:()=>bi,promise:()=>cr,property:()=>Gr,readonly:()=>Be,record:()=>Me,refine:()=>vn,regex:()=>m,regexes:()=>ne,registry:()=>Wt,safeDecode:()=>yi,safeDecodeAsync:()=>Vo,safeEncode:()=>ws,safeEncodeAsync:()=>Ri,safeParse:()=>po,safeParseAsync:()=>Hs,set:()=>oe,setErrorMap:()=>Md,size:()=>Is,slugify:()=>Po,startsWith:()=>vs,strictObject:()=>Za,string:()=>en,stringFormat:()=>un,stringbool:()=>Dn,success:()=>Ye,superRefine:()=>bt,symbol:()=>Gt,templateLiteral:()=>Wn,toJSONSchema:()=>Cc,toLowerCase:()=>Xi,toUpperCase:()=>ma,transform:()=>Fc,treeifyError:()=>Ts,trim:()=>To,tuple:()=>me,uint32:()=>Tr,uint64:()=>ft,ulid:()=>_r,undefined:()=>Qs,union:()=>Nr,unknown:()=>rt,uppercase:()=>Qn,url:()=>It,util:()=>fa,uuid:()=>ls,uuidv4:()=>Ot,uuidv6:()=>Xr,uuidv7:()=>Vr,void:()=>Tc,xid:()=>ai,xor:()=>In});Zs(Xl());var Hd=Vd,Ud=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{SYMBOL_FOR_REQ_CONTEXT:()=>u,getContext:()=>d}),t.exports=c(l);let u=Symbol.for(`@vercel/request-context`);function d(){return globalThis[u]?.get?.()??{}}0&&(t.exports={SYMBOL_FOR_REQ_CONTEXT:u,getContext:d})})),Wd=i(((e,t)=>{var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},c=(e,t,n,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(r({},`__esModule`,{value:!0}),e),u={};s(u,{getVercelOidcToken:()=>p,getVercelOidcTokenSync:()=>m}),t.exports=l(u);var d=Ud(),f=Jc();async function p(e){let t=``,r;try{t=m()}catch(e){r=e}try{let[{getTokenPayload:r,isExpired:i},{refreshToken:a}]=await Promise.all([await import(`../../_chunks/workflow/token-util-Ldar52H7.js`).then(e=>n(e.t())),await import(`../../_chunks/workflow/token-DHD-q-fS.js`).then(e=>n(e.default))]);(!t||i(r(t),e?.expirationBufferMs))&&(await a(e),t=m())}catch(e){let t=r instanceof Error?r.message:``;throw e instanceof Error&&(t=`${t}
|
|
2
|
-
${e.message}`),t?new f.VercelOidcTokenError(t):e}return t}function m(){let e=(0,d.getContext)().headers?.[`x-vercel-oidc-token`]??process.env.VERCEL_OIDC_TOKEN;if(!e)throw Error(`The 'x-vercel-oidc-token' header is missing from the request. Do you have the OIDC option enabled in the Vercel project settings?`);return e}0&&(t.exports={getVercelOidcToken:p,getVercelOidcTokenSync:m})})),Gd=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{AccessTokenMissingError:()=>f.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>f.RefreshAccessTokenFailedError,getContext:()=>d.getContext,getVercelOidcToken:()=>u.getVercelOidcToken,getVercelOidcTokenSync:()=>u.getVercelOidcTokenSync,getVercelToken:()=>p.getVercelToken}),t.exports=c(l);var u=Wd(),d=Ud(),f=qc(),p=Yc();0&&(t.exports={AccessTokenMissingError,RefreshAccessTokenFailedError,getContext,getVercelOidcToken,getVercelOidcTokenSync,getVercelToken})}))();let Kd;try{Kd=new TextDecoder}catch{}let T,qd,E=0;const Jd=[],Yd=57337,Xd={};let Zd=11281e4,Qd=1681e4,$d=Jd,ef=0,D={},O,tf,nf=0,rf=0,k,af,A=[],of=[],sf,cf,lf,uf={useRecords:!1,mapsAsObjects:!0},df=!1,ff=2;try{Function(``)}catch{ff=1/0}var pf=class e{constructor(e){if(e&&((e.keyMap||e._keyMap)&&!e.useRecords&&(e.useRecords=!1,e.mapsAsObjects=!0),e.useRecords===!1&&e.mapsAsObjects===void 0&&(e.mapsAsObjects=!0),e.getStructures&&(e.getShared=e.getStructures),e.getShared&&!e.structures&&((e.structures=[]).uninitialized=!0),e.keyMap)){this.mapKey=new Map;for(let[t,n]of Object.entries(e.keyMap))this.mapKey.set(n,t)}Object.assign(this,e)}decodeKey(e){return this.keyMap&&this.mapKey.get(e)||e}encodeKey(e){return this.keyMap&&this.keyMap.hasOwnProperty(e)?this.keyMap[e]:e}encodeKeys(e){if(!this._keyMap)return e;let t=new Map;for(let[n,r]of Object.entries(e))t.set(this._keyMap.hasOwnProperty(n)?this._keyMap[n]:n,r);return t}decodeKeys(e){if(!this._keyMap||e.constructor.name!=`Map`)return e;if(!this._mapKey){this._mapKey=new Map;for(let[e,t]of Object.entries(this._keyMap))this._mapKey.set(t,e)}let t={};return e.forEach((e,n)=>t[_f(this._mapKey.has(n)?this._mapKey.get(n):n)]=e),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n.constructor.name){case`Array`:return n.map(e=>this.decodeKeys(e))}return n}decode(t,n){if(T)return Bf(()=>(Vf(),this?this.decode(t,n):e.prototype.decode.call(uf,t,n)));qd=n>-1?n:t.length,E=0,ef=0,rf=0,tf=null,$d=Jd,k=null,T=t;try{cf=t.dataView||=new DataView(t.buffer,t.byteOffset,t.byteLength)}catch(e){throw T=null,t instanceof Uint8Array?e:Error(`Source must be a Uint8Array or Buffer but was a `+(t&&typeof t==`object`?t.constructor.name:typeof t))}if(this instanceof e){if(D=this,sf=this.sharedValues&&(this.pack?Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this.structures)return O=this.structures,mf();(!O||O.length>0)&&(O=[])}else D=uf,(!O||O.length>0)&&(O=[]),sf=null;return mf()}decodeMultiple(e,t){let n,r=0;try{let i=e.length;df=!0;let a=this?this.decode(e,i):Uf.decode(e,i);if(t){if(t(a)===!1)return;for(;E<i;)if(r=E,t(mf())===!1)return}else{for(n=[a];E<i;)r=E,n.push(mf());return n}}catch(e){throw e.lastPosition=r,e.values=n,e}finally{df=!1,Vf()}}};function mf(){try{let e=j();if(k){if(E>=k.postBundlePosition){let e=Error(`Unexpected bundle position`);throw e.incomplete=!0,e}E=k.postBundlePosition,k=null}if(E==qd)O=null,T=null,af&&=null;else if(E>qd){let e=Error(`Unexpected end of CBOR data`);throw e.incomplete=!0,e}else if(!df)throw Error(`Data read, but end of buffer not reached`);return e}catch(e){throw Vf(),(e instanceof RangeError||e.message.startsWith(`Unexpected end of buffer`))&&(e.incomplete=!0),e}}function j(){let e=T[E++],t=e>>5;if(e&=31,e>23)switch(e){case 24:e=T[E++];break;case 25:if(t==7)return Ef();e=cf.getUint16(E),E+=2;break;case 26:if(t==7){let e=cf.getFloat32(E);if(D.useFloat32>2){let t=Hf[(T[E]&127)<<1|T[E+1]>>7];return E+=4,(t*e+(e>0?.5:-.5)>>0)/t}return E+=4,e}e=cf.getUint32(E),E+=4;break;case 27:if(t==7){let e=cf.getFloat64(E);return E+=8,e}if(t>1){if(cf.getUint32(E)>0)throw Error(`JavaScript does not support arrays, maps, or strings with length over 4294967295`);e=cf.getUint32(E+4)}else D.int64AsNumber?(e=cf.getUint32(E)*4294967296,e+=cf.getUint32(E+4)):e=cf.getBigUint64(E);E+=8;break;case 31:switch(t){case 2:case 3:throw Error(`Indefinite length not supported for byte or text strings`);case 4:let e=[],n,r=0;for(;(n=j())!=Xd;){if(r>=Zd)throw Error(`Array length exceeds ${Zd}`);e[r++]=n}return t==4?e:t==3?e.join(``):Buffer.concat(e);case 5:let i;if(D.mapsAsObjects){let e={},t=0;if(D.keyMap)for(;(i=j())!=Xd;){if(t++>=Qd)throw Error(`Property count exceeds ${Qd}`);e[_f(D.decodeKey(i))]=j()}else for(;(i=j())!=Xd;){if(t++>=Qd)throw Error(`Property count exceeds ${Qd}`);e[_f(i)]=j()}return e}else{lf&&=(D.mapsAsObjects=!0,!1);let e=new Map;if(D.keyMap){let t=0;for(;(i=j())!=Xd;){if(t++>=Qd)throw Error(`Map size exceeds ${Qd}`);e.set(D.decodeKey(i),j())}}else{let t=0;for(;(i=j())!=Xd;){if(t++>=Qd)throw Error(`Map size exceeds ${Qd}`);e.set(i,j())}}return e}case 7:return Xd;default:throw Error(`Invalid major type for indefinite length `+t)}default:throw Error(`Unknown token `+e)}switch(t){case 0:return e;case 1:return~e;case 2:return Cf(e);case 3:if(rf>=E)return tf.slice(E-nf,(E+=e)-nf);if(rf==0&&qd<140&&e<32){let t=e<16?Sf(e):xf(e);if(t!=null)return t}return vf(e);case 4:if(e>=Zd)throw Error(`Array length exceeds ${Zd}`);let t=Array(e);for(let n=0;n<e;n++)t[n]=j();return t;case 5:if(e>=Qd)throw Error(`Map size exceeds ${Zd}`);if(D.mapsAsObjects){let t={};if(D.keyMap)for(let n=0;n<e;n++)t[_f(D.decodeKey(j()))]=j();else for(let n=0;n<e;n++)t[_f(j())]=j();return t}else{lf&&=(D.mapsAsObjects=!0,!1);let t=new Map;if(D.keyMap)for(let n=0;n<e;n++)t.set(D.decodeKey(j()),j());else for(let n=0;n<e;n++)t.set(j(),j());return t}case 6:if(e>=Yd){let t=O[e&8191];if(t)return t.read||=gf(t),t.read();if(e<65536){if(e==57343){let e=Rf(),t=j(),n=j();Of(t,n);let r={};if(D.keyMap)for(let t=2;t<e;t++){let e=D.decodeKey(n[t-2]);r[_f(e)]=j()}else for(let t=2;t<e;t++){let e=n[t-2];r[_f(e)]=j()}return r}else if(e==57342){let e=Rf(),t=j();for(let n=2;n<e;n++)Of(t++,j());return j()}else if(e==Yd)return Lf();if(D.getShared&&(zf(),t=O[e&8191],t))return t.read||=gf(t),t.read()}}let n=A[e];if(n)return n.handlesRead?n(j):n(j());{let t=j();for(let n=0;n<of.length;n++){let r=of[n](e,t);if(r!==void 0)return r}return new Df(t,e)}case 7:switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;default:let t=(sf||Mf())[e];if(t!==void 0)return t;throw Error(`Unknown token `+e)}default:if(isNaN(e)){let e=Error(`Unexpected end of CBOR data`);throw e.incomplete=!0,e}throw Error(`Unknown CBOR token `+e)}}const hf=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function gf(e){if(!e)throw Error(`Structure is required in record definition`);function t(){let e=T[E++];if(e&=31,e>23)switch(e){case 24:e=T[E++];break;case 25:e=cf.getUint16(E),E+=2;break;case 26:e=cf.getUint32(E),E+=4;break;default:throw Error(`Expected array header, but got `+T[E-1])}let t=this.compiledReader;for(;t;){if(t.propertyCount===e)return t(j);t=t.next}if(this.slowReads++>=ff){let n=this.length==e?this:this.slice(0,e);return t=D.keyMap?Function(`r`,`return {`+n.map(e=>D.decodeKey(e)).map(e=>hf.test(e)?_f(e)+`:r()`:`[`+JSON.stringify(e)+`]:r()`).join(`,`)+`}`):Function(`r`,`return {`+n.map(e=>hf.test(e)?_f(e)+`:r()`:`[`+JSON.stringify(e)+`]:r()`).join(`,`)+`}`),this.compiledReader&&(t.next=this.compiledReader),t.propertyCount=e,this.compiledReader=t,t(j)}let n={};if(D.keyMap)for(let t=0;t<e;t++)n[_f(D.decodeKey(this[t]))]=j();else for(let t=0;t<e;t++)n[_f(this[t])]=j();return n}return e.slowReads=0,t}function _f(e){if(typeof e==`string`)return e===`__proto__`?`__proto_`:e;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return e.toString();if(e==null)return e+``;throw Error(`Invalid property name type `+typeof e)}let vf=bf;function yf(e){vf=t(1);function t(t){return function(t){let n=$d[ef++];if(n==null){if(k)return bf(t);let r=e(E,qd,t,T);if(typeof r==`string`)n=r,$d=Jd;else if($d=r,ef=1,rf=1,n=$d[0],n===void 0)throw Error(`Unexpected end of buffer`)}let r=n.length;return r<=t?(E+=t,n):(tf=n,nf=E,rf=E+r,E+=t,n.slice(0,t))}}}function bf(e){let t;if(e<16&&(t=Sf(e)))return t;if(e>64&&Kd)return Kd.decode(T.subarray(E,E+=e));let n=E+e,r=[];for(t=``;E<n;){let e=T[E++];if(!(e&128))r.push(e);else if((e&224)==192){let t=T[E++]&63;r.push((e&31)<<6|t)}else if((e&240)==224){let t=T[E++]&63,n=T[E++]&63;r.push((e&31)<<12|t<<6|n)}else if((e&248)==240){let t=T[E++]&63,n=T[E++]&63,i=T[E++]&63,a=(e&7)<<18|t<<12|n<<6|i;a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a)}else r.push(e);r.length>=4096&&(t+=M.apply(String,r),r.length=0)}return r.length>0&&(t+=M.apply(String,r)),t}let M=String.fromCharCode;function xf(e){let t=E,n=Array(e);for(let r=0;r<e;r++){let e=T[E++];if((e&128)>0){E=t;return}n[r]=e}return M.apply(String,n)}function Sf(e){if(e<4)if(e<2){if(e===0)return``;{let e=T[E++];if((e&128)>1){--E;return}return M(e)}}else{let t=T[E++],n=T[E++];if((t&128)>0||(n&128)>0){E-=2;return}if(e<3)return M(t,n);let r=T[E++];if((r&128)>0){E-=3;return}return M(t,n,r)}else{let t=T[E++],n=T[E++],r=T[E++],i=T[E++];if((t&128)>0||(n&128)>0||(r&128)>0||(i&128)>0){E-=4;return}if(e<6){if(e===4)return M(t,n,r,i);{let e=T[E++];if((e&128)>0){E-=5;return}return M(t,n,r,i,e)}}else if(e<8){let a=T[E++],o=T[E++];if((a&128)>0||(o&128)>0){E-=6;return}if(e<7)return M(t,n,r,i,a,o);let s=T[E++];if((s&128)>0){E-=7;return}return M(t,n,r,i,a,o,s)}else{let a=T[E++],o=T[E++],s=T[E++],c=T[E++];if((a&128)>0||(o&128)>0||(s&128)>0||(c&128)>0){E-=8;return}if(e<10){if(e===8)return M(t,n,r,i,a,o,s,c);{let e=T[E++];if((e&128)>0){E-=9;return}return M(t,n,r,i,a,o,s,c,e)}}else if(e<12){let l=T[E++],u=T[E++];if((l&128)>0||(u&128)>0){E-=10;return}if(e<11)return M(t,n,r,i,a,o,s,c,l,u);let d=T[E++];if((d&128)>0){E-=11;return}return M(t,n,r,i,a,o,s,c,l,u,d)}else{let l=T[E++],u=T[E++],d=T[E++],f=T[E++];if((l&128)>0||(u&128)>0||(d&128)>0||(f&128)>0){E-=12;return}if(e<14){if(e===12)return M(t,n,r,i,a,o,s,c,l,u,d,f);{let e=T[E++];if((e&128)>0){E-=13;return}return M(t,n,r,i,a,o,s,c,l,u,d,f,e)}}else{let p=T[E++],m=T[E++];if((p&128)>0||(m&128)>0){E-=14;return}if(e<15)return M(t,n,r,i,a,o,s,c,l,u,d,f,p,m);let h=T[E++];if((h&128)>0){E-=15;return}return M(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}}}}}function Cf(e){return D.copyBuffers?Uint8Array.prototype.slice.call(T,E,E+=e):T.subarray(E,E+=e)}let wf=new Float32Array(1),Tf=new Uint8Array(wf.buffer,0,4);function Ef(){let e=T[E++],t=T[E++],n=(e&127)>>2;if(n===31)return t||e&3?NaN:e&128?-1/0:1/0;if(n===0){let n=((e&3)<<8|t)/(1<<24);return e&128?-n:n}return Tf[3]=e&128|(n>>1)+56,Tf[2]=(e&7)<<5|t>>3,Tf[1]=t<<5,Tf[0]=0,wf[0]}Array(4096);var Df=class{constructor(e,t){this.value=e,this.tag=t}};A[0]=e=>new Date(e),A[1]=e=>new Date(Math.round(e*1e3)),A[2]=e=>{let t=BigInt(0);for(let n=0,r=e.byteLength;n<r;n++)t=BigInt(e[n])+(t<<BigInt(8));return t},A[3]=e=>BigInt(-1)-A[2](e),A[4]=e=>+(e[1]+`e`+e[0]),A[5]=e=>e[1]*Math.exp(e[0]*Math.log(2));const Of=(e,t)=>{e-=57344;let n=O[e];n&&n.isShared&&((O.restoreStructures||=[])[e]=n),O[e]=t,t.read=gf(t)};A[105]=e=>{let t=e.length,n=e[1];Of(e[0],n);let r={};for(let i=2;i<t;i++){let t=n[i-2];r[_f(t)]=e[i]}return r},A[14]=e=>k?k[0].slice(k.position0,k.position0+=e):new Df(e,14),A[15]=e=>k?k[1].slice(k.position1,k.position1+=e):new Df(e,15);let kf={Error,RegExp};A[27]=e=>(kf[e[0]]||Error)(e[1],e[2]);const Af=e=>{if(T[E++]!=132){let e=Error(`Packed values structure must be followed by a 4 element array`);throw T.length<E&&(e.incomplete=!0),e}let t=e();if(!t||!t.length){let e=Error(`Packed values structure must be followed by a 4 element array`);throw e.incomplete=!0,e}return sf=sf?t.concat(sf.slice(t.length)):t,sf.prefixes=e(),sf.suffixes=e(),e()};Af.handlesRead=!0,A[51]=Af,A[6]=e=>{if(!sf)if(D.getShared)zf();else return new Df(e,6);if(typeof e==`number`)return sf[16+(e>=0?2*e:-2*e-1)];let t=Error(`No support for non-integer packed references yet`);throw e===void 0&&(t.incomplete=!0),t},A[28]=e=>{af||(af=new Map,af.id=0);let t=af.id++,n=E,r=T[E],i;i=r>>5==4?[]:{};let a={target:i};af.set(t,a);let o=e();return a.used?(Object.getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(E=n,i=o,af.set(t,{target:i}),o=e()),Object.assign(i,o)):(a.target=o,o)},A[28].handlesRead=!0,A[29]=e=>{let t=af.get(e);return t.used=!0,t.target},A[258]=e=>new Set(e),(A[259]=e=>(D.mapsAsObjects&&(D.mapsAsObjects=!1,lf=!0),e())).handlesRead=!0;function jf(e,t){return typeof e==`string`?e+t:e instanceof Array?e.concat(t):Object.assign({},e,t)}function Mf(){if(!sf)if(D.getShared)zf();else throw Error(`No packed values available`);return sf}of.push((e,t)=>{if(e>=225&&e<=255)return jf(Mf().prefixes[e-224],t);if(e>=28704&&e<=32767)return jf(Mf().prefixes[e-28672],t);if(e>=1879052288&&e<=2147483647)return jf(Mf().prefixes[e-1879048192],t);if(e>=216&&e<=223)return jf(t,Mf().suffixes[e-216]);if(e>=27647&&e<=28671)return jf(t,Mf().suffixes[e-27639]);if(e>=1811940352&&e<=1879048191)return jf(t,Mf().suffixes[e-1811939328]);if(e==1399353956)return{packedValues:sf,structures:O.slice(0),version:t};if(e==55799)return t});const Nf=new Uint8Array(new Uint16Array([1]).buffer)[0]==1,Pf=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>`u`?{name:`BigUint64Array`}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>`u`?{name:`BigInt64Array`}:BigInt64Array,Float32Array,Float64Array],Ff=[64,68,69,70,71,72,77,78,79,85,86];for(let e=0;e<Pf.length;e++)If(Pf[e],Ff[e]);function If(e,t){let n=`get`+e.name.slice(0,-5),r;typeof e==`function`?r=e.BYTES_PER_ELEMENT:e=null;for(let i=0;i<2;i++){if(!i&&r==1)continue;let a=r==2?1:r==4?2:r==8?3:0;A[i?t:t-4]=r==1||i==Nf?n=>{if(!e)throw Error(`Could not find typed array for code `+t);return!D.copyBuffers&&(r===1||r===2&&!(n.byteOffset&1)||r===4&&!(n.byteOffset&3)||r===8&&!(n.byteOffset&7))?new e(n.buffer,n.byteOffset,n.byteLength>>a):new e(Uint8Array.prototype.slice.call(n,0).buffer)}:r=>{if(!e)throw Error(`Could not find typed array for code `+t);let o=new DataView(r.buffer,r.byteOffset,r.byteLength),s=r.length>>a,c=new e(s),l=o[n];for(let e=0;e<s;e++)c[e]=l.call(o,e<<a,i);return c}}}function Lf(){let e=Rf(),t=E+j();for(let t=2;t<e;t++){let e=Rf();E+=e}let n=E;return E=t,k=[bf(Rf()),bf(Rf())],k.position0=0,k.position1=0,k.postBundlePosition=E,E=n,j()}function Rf(){let e=T[E++]&31;if(e>23)switch(e){case 24:e=T[E++];break;case 25:e=cf.getUint16(E),E+=2;break;case 26:e=cf.getUint32(E),E+=4;break}return e}function zf(){if(D.getShared){let e=Bf(()=>(T=null,D.getShared()))||{},t=e.structures||[];D.sharedVersion=e.version,sf=D.sharedValues=e.packedValues,O===!0?D.structures=O=t:O.splice.apply(O,[0,t.length].concat(t))}}function Bf(e){let t=qd,n=E,r=ef,i=nf,a=rf,o=tf,s=$d,c=af,l=k,u=new Uint8Array(T.slice(0,qd)),d=O,f=D,p=df,m=e();return qd=t,E=n,ef=r,nf=i,rf=a,tf=o,$d=s,af=c,k=l,T=u,df=p,O=d,D=f,cf=new DataView(T.buffer,T.byteOffset,T.byteLength),m}function Vf(){T=null,af=null,O=null}const Hf=Array(147);for(let e=0;e<256;e++)Hf[e]=+(`1e`+Math.floor(45.15-e*.30103));let Uf=new pf({useRecords:!1});const Wf=Uf.decode;Uf.decodeMultiple;const Gf={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let Kf;try{Kf=new TextEncoder}catch{}let qf,Jf;const Yf=typeof globalThis==`object`&&globalThis.Buffer,Xf=Yf!==void 0,Zf=Xf?Yf.allocUnsafeSlow:Uint8Array,Qf=Xf?Yf:Uint8Array,$f=Xf?4294967296:2144337920;let ep,N,P,F=0,tp,I=null;const np=/[\u0080-\uFFFF]/,rp=Symbol(`record-id`);var ip=class extends pf{constructor(e){super(e),this.offset=0;let t,n,r,i,a;e||={};let o=Qf.prototype.utf8Write?function(e,t,n){return N.utf8Write(e,t,n)}:Kf&&Kf.encodeInto?function(e,t){return Kf.encodeInto(e,N.subarray(t)).written}:!1,s=this,c=e.structures||e.saveStructures,l=e.maxSharedStructures;if(l??=c?128:0,l>8190)throw Error(`Maximum maxSharedStructure is 8190`);let u=e.sequential;u&&(l=0),this.structures||=[],this.saveStructures&&(this.saveShared=this.saveStructures);let d,f,p=e.sharedValues,m;if(p){m=Object.create(null);for(let e=0,t=p.length;e<t;e++)m[p[e]]=e}let h=[],g=0,_=0;this.mapEncode=function(e,t){if(this._keyMap&&!this._mapped)switch(e.constructor.name){case`Array`:e=e.map(e=>this.encodeKeys(e));break}return this.encode(e,t)},this.encode=function(o,c){if(N||(N=new Zf(8192),P=new DataView(N.buffer,0,8192),F=0),tp=N.length-10,tp-F<2048?(N=new Zf(N.length),P=new DataView(N.buffer,0,N.length),tp=N.length-10,F=0):c===512&&(F=F+7&2147483640),t=F,s.useSelfDescribedHeader&&(P.setUint32(F,3654940416),F+=3),a=s.structuredClone?new Map:null,s.bundleStrings&&typeof o!=`string`?(I=[],I.size=1/0):I=null,n=s.structures,n){if(n.uninitialized){let e=s.getShared()||{};s.structures=n=e.structures||[],s.sharedVersion=e.version;let t=s.sharedValues=e.packedValues;if(t){m={};for(let e=0,n=t.length;e<n;e++)m[t[e]]=e}}let e=n.length;if(e>l&&!u&&(e=l),!n.transitions){n.transitions=Object.create(null);for(let t=0;t<e;t++){let e=n[t];if(!e)continue;let r,i=n.transitions;for(let n=0,a=e.length;n<a;n++){i[rp]===void 0&&(i[rp]=t);let a=e[n];r=i[a],r||=i[a]=Object.create(null),i=r}i[rp]=t|1048576}}u||(n.nextId=e)}if(r&&=!1,i=n||[],f=m,e.pack){let t=new Map;if(t.values=[],t.encoder=s,t.maxValues=e.maxPrivatePackedValues||(m?16:1/0),t.objectMap=m||!1,t.samplingPackedValues=d,up(o,t),t.values.length>0){N[F++]=216,N[F++]=51,sp(4);let e=t.values;v(e),sp(0),sp(0),f=Object.create(m||null);for(let t=0,n=e.length;t<n;t++)f[e[t]]=t}}ep=c&Sp;try{if(ep)return;if(v(o),I&&hp(t,v),s.offset=F,a&&a.idsToInsert){F+=a.idsToInsert.length*2,F>tp&&b(F),s.offset=F;let e=mp(N.subarray(t,F),a.idsToInsert);return a=null,e}return c&512?(N.start=t,N.end=F,N):N.subarray(t,F)}finally{if(n){if(_<10&&_++,n.length>l&&(n.length=l),g>1e4)n.transitions=null,_=0,g=0,h.length>0&&(h=[]);else if(h.length>0&&!u){for(let e=0,t=h.length;e<t;e++)h[e][rp]=void 0;h=[]}}if(r&&s.saveShared){s.structures.length>l&&(s.structures=s.structures.slice(0,l));let e=N.subarray(t,F);return s.updateSharedData()===!1?s.encode(o):e}c&1024&&(F=t)}},this.findCommonStringsToPack=()=>(d=new Map,m||=Object.create(null),e=>{let t=e&&e.threshold||4,n=this.pack?e.maxPrivatePackedValues||16:0;p||=this.sharedValues=[];for(let[e,i]of d)i.count>t&&(m[e]=n++,p.push(e),r=!0);for(;this.saveShared&&this.updateSharedData()===!1;);d=null});let v=n=>{F>tp&&(N=b(F));var r=typeof n,i;if(r===`string`){if(f){let t=f[n];if(t>=0){t<16?N[F++]=t+224:(N[F++]=198,t&1?v(15-t>>1):v(t-16>>1));return}else if(d&&!e.pack){let e=d.get(n);e?e.count++:d.set(n,{count:1})}}let r=n.length;if(I&&r>=4&&r<1024){if((I.size+=r)>61440){let e,n=(I[0]?I[0].length*3+I[1].length:0)+10;F+n>tp&&(N=b(F+n)),N[F++]=217,N[F++]=223,N[F++]=249,N[F++]=I.position?132:130,N[F++]=26,e=F-t,F+=4,I.position&&hp(t,v),I=[``,``],I.size=0,I.position=e}let e=np.test(n);I[+!e]+=n,N[F++]=e?206:207,v(r);return}let a;a=r<32?1:r<256?2:r<65536?3:5;let s=r*3;if(F+s>tp&&(N=b(F+s)),r<64||!o){let e,t,o,s=F+a;for(e=0;e<r;e++)t=n.charCodeAt(e),t<128?N[s++]=t:t<2048?(N[s++]=t>>6|192,N[s++]=t&63|128):(t&64512)==55296&&((o=n.charCodeAt(e+1))&64512)==56320?(t=65536+((t&1023)<<10)+(o&1023),e++,N[s++]=t>>18|240,N[s++]=t>>12&63|128,N[s++]=t>>6&63|128,N[s++]=t&63|128):(N[s++]=t>>12|224,N[s++]=t>>6&63|128,N[s++]=t&63|128);i=s-F-a}else i=o(n,F+a,s);i<24?N[F++]=96|i:i<256?(a<2&&N.copyWithin(F+2,F+1,F+1+i),N[F++]=120,N[F++]=i):i<65536?(a<3&&N.copyWithin(F+3,F+2,F+2+i),N[F++]=121,N[F++]=i>>8,N[F++]=i&255):(a<5&&N.copyWithin(F+5,F+3,F+3+i),N[F++]=122,P.setUint32(F,i),F+=4),F+=i}else if(r===`number`)if(!this.alwaysUseFloat&&n>>>0===n)n<24?N[F++]=n:n<256?(N[F++]=24,N[F++]=n):n<65536?(N[F++]=25,N[F++]=n>>8,N[F++]=n&255):(N[F++]=26,P.setUint32(F,n),F+=4);else if(!this.alwaysUseFloat&&n>>0===n)n>=-24?N[F++]=31-n:n>=-256?(N[F++]=56,N[F++]=~n):n>=-65536?(N[F++]=57,P.setUint16(F,~n),F+=2):(N[F++]=58,P.setUint32(F,~n),F+=4);else{let e;if((e=this.useFloat32)>0&&n<4294967296&&n>=-2147483648){N[F++]=250,P.setFloat32(F,n);let t;if(e<4||(t=n*Hf[(N[F]&127)<<1|N[F+1]>>7])>>0===t){F+=4;return}else F--}N[F++]=251,P.setFloat64(F,n),F+=8}else if(r===`object`)if(!n)N[F++]=246;else{if(a){let e=a.get(n);if(e){if(N[F++]=216,N[F++]=29,N[F++]=25,!e.references){let t=a.idsToInsert||=[];e.references=[],t.push(e)}e.references.push(F-t),F+=2;return}else a.set(n,{offset:F-t})}let e=n.constructor;if(e===Object)y(n);else if(e===Array){i=n.length,i<24?N[F++]=128|i:sp(i);for(let e=0;e<i;e++)v(n[e])}else if(e===Map)if((this.mapsAsObjects?this.useTag259ForMaps!==!1:this.useTag259ForMaps)&&(N[F++]=217,N[F++]=1,N[F++]=3),i=n.size,i<24?N[F++]=160|i:i<256?(N[F++]=184,N[F++]=i):i<65536?(N[F++]=185,N[F++]=i>>8,N[F++]=i&255):(N[F++]=186,P.setUint32(F,i),F+=4),s.keyMap)for(let[e,t]of n)v(s.encodeKey(e)),v(t);else for(let[e,t]of n)v(e),v(t);else{for(let e=0,t=qf.length;e<t;e++){let t=Jf[e];if(n instanceof t){let t=qf[e],r=t.tag;r??=t.getTag&&t.getTag.call(this,n),r<24?N[F++]=192|r:r<256?(N[F++]=216,N[F++]=r):r<65536?(N[F++]=217,N[F++]=r>>8,N[F++]=r&255):r>-1&&(N[F++]=218,P.setUint32(F,r),F+=4),t.encode.call(this,n,v,b);return}}if(n[Symbol.iterator]){if(ep){let e=Error(`Iterable should be serialized as iterator`);throw e.iteratorNotHandled=!0,e}N[F++]=159;for(let e of n)v(e);N[F++]=255;return}if(n[Symbol.asyncIterator]||lp(n)){let e=Error(`Iterable/blob should be serialized as iterator`);throw e.iteratorNotHandled=!0,e}if(this.useToJSON&&n.toJSON){let e=n.toJSON();if(e!==n)return v(e)}y(n)}}else if(r===`boolean`)N[F++]=n?245:244;else if(r===`bigint`){if(n<BigInt(1)<<BigInt(64)&&n>=0)N[F++]=27,P.setBigUint64(F,n);else if(n>-(BigInt(1)<<BigInt(64))&&n<0)N[F++]=59,P.setBigUint64(F,-n-BigInt(1));else if(this.largeBigIntToFloat)N[F++]=251,P.setFloat64(F,Number(n));else{n>=BigInt(0)?N[F++]=194:(N[F++]=195,n=BigInt(-1)-n);let e=[];for(;n;)e.push(Number(n&BigInt(255))),n>>=BigInt(8);pp(new Uint8Array(e.reverse()),b);return}F+=8}else if(r===`undefined`)N[F++]=247;else throw Error(`Unknown type: `+r)},y=this.useRecords===!1?this.variableMapSize?e=>{let t=Object.keys(e),n=Object.values(e),r=t.length;if(r<24?N[F++]=160|r:r<256?(N[F++]=184,N[F++]=r):r<65536?(N[F++]=185,N[F++]=r>>8,N[F++]=r&255):(N[F++]=186,P.setUint32(F,r),F+=4),s.keyMap)for(let e=0;e<r;e++)v(s.encodeKey(t[e])),v(n[e]);else for(let e=0;e<r;e++)v(t[e]),v(n[e])}:e=>{N[F++]=185;let n=F-t;F+=2;let r=0;if(s.keyMap)for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(v(s.encodeKey(t)),v(e[t]),r++);else for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(v(t),v(e[t]),r++);N[n+++t]=r>>8,N[n+t]=r&255}:(e,t)=>{let n,a=i.transitions||=Object.create(null),o=0,s=0,c,u;if(this.keyMap){u=Object.keys(e).map(e=>this.encodeKey(e)),s=u.length;for(let e=0;e<s;e++){let t=u[e];n=a[t],n||(n=a[t]=Object.create(null),o++),a=n}}else for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(n=a[t],n||(a[rp]&1048576&&(c=a[rp]&65535),n=a[t]=Object.create(null),o++),a=n,s++);let d=a[rp];if(d!==void 0)d&=65535,N[F++]=217,N[F++]=d>>8|224,N[F++]=d&255;else if(u||=a.__keys__||=Object.keys(e),c===void 0?(d=i.nextId++,d||(d=0,i.nextId=1),d>=256&&(i.nextId=(d=l)+1)):d=c,i[d]=u,d<l){N[F++]=217,N[F++]=d>>8|224,N[F++]=d&255,a=i.transitions;for(let e=0;e<s;e++)(a[rp]===void 0||a[rp]&1048576)&&(a[rp]=d),a=a[u[e]];a[rp]=d|1048576,r=!0}else{if(a[rp]=d,P.setUint32(F,3655335680),F+=3,o&&(g+=_*o),h.length>=256-l&&(h.shift()[rp]=void 0),h.push(a),sp(s+2),v(57344+d),v(u),t)return;for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&v(e[t]);return}if(s<24?N[F++]=128|s:sp(s),!t)for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&v(e[t])},b=e=>{let n;if(e>16777216){if(e-t>$f)throw Error(`Encoded buffer would be larger than maximum buffer size`);n=Math.min($f,Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096)*4096)}else n=(Math.max(e-t<<2,N.length-1)>>12)+1<<12;let r=new Zf(n);return P=new DataView(r.buffer,0,n),N.copy?N.copy(r,0,t,e):r.set(N.slice(t,e)),F-=t,t=0,tp=r.length-10,N=r},ee=100,te=1e3;this.encodeAsIterable=function(e,t){return ae(e,t,ne)},this.encodeAsAsyncIterable=function(e,t){return ae(e,t,oe)};function*ne(e,n,r){let i=e.constructor;if(i===Object){let t=s.useRecords!==!1;t?y(e,!0):ap(Object.keys(e).length,160);for(let r in e){let i=e[r];t||v(r),i&&typeof i==`object`?n[r]?yield*ne(i,n[r]):yield*re(i,n,r):v(i)}}else if(i===Array){let r=e.length;sp(r);for(let i=0;i<r;i++){let r=e[i];r&&(typeof r==`object`||F-t>ee)?n.element?yield*ne(r,n.element):yield*re(r,n,`element`):v(r)}}else if(e[Symbol.iterator]&&!e.buffer){N[F++]=159;for(let r of e)r&&(typeof r==`object`||F-t>ee)?n.element?yield*ne(r,n.element):yield*re(r,n,`element`):v(r);N[F++]=255}else lp(e)?(ap(e.size,64),yield N.subarray(t,F),yield e,ie()):e[Symbol.asyncIterator]?(N[F++]=159,yield N.subarray(t,F),yield e,ie(),N[F++]=255):v(e);r&&F>t?yield N.subarray(t,F):F-t>ee&&(yield N.subarray(t,F),ie())}function*re(e,n,r){let i=F-t;try{v(e),F-t>ee&&(yield N.subarray(t,F),ie())}catch(a){if(a.iteratorNotHandled)n[r]={},F=t+i,yield*ne.call(this,e,n[r]);else throw a}}function ie(){ee=te,s.encode(null,Sp)}function ae(e,t,n){return ee=t&&t.chunkThreshold?te=t.chunkThreshold:100,e&&typeof e==`object`?(s.encode(null,Sp),n(e,s.iterateProperties||={},!0)):[s.encode(e)]}async function*oe(e,t){for(let n of ne(e,t,!0)){let e=n.constructor;if(e===Qf||e===Uint8Array)yield n;else if(lp(n)){let e=n.stream().getReader(),t;for(;!(t=await e.read()).done;)yield t.value}else if(n[Symbol.asyncIterator])for await(let e of n)ie(),e?yield*oe(e,t.async||={}):yield s.encode(e);else yield n}}}useBuffer(e){N=e,P=new DataView(N.buffer,N.byteOffset,N.byteLength),F=0}clearSharedData(){this.structures&&=[],this.sharedValues&&=void 0}updateSharedData(){let e=this.sharedVersion||0;this.sharedVersion=e+1;let t=this.structures.slice(0),n=new op(t,this.sharedValues,this.sharedVersion),r=this.saveShared(n,t=>(t&&t.version||0)==e);return r===!1?(n=this.getShared()||{},this.structures=n.structures||[],this.sharedValues=n.packedValues,this.sharedVersion=n.version,this.structures.nextId=this.structures.length):t.forEach((e,t)=>this.structures[t]=e),r}};function ap(e,t){e<24?N[F++]=t|e:e<256?(N[F++]=t|24,N[F++]=e):e<65536?(N[F++]=t|25,N[F++]=e>>8,N[F++]=e&255):(N[F++]=t|26,P.setUint32(F,e),F+=4)}var op=class{constructor(e,t,n){this.structures=e,this.packedValues=t,this.version=n}};function sp(e){e<24?N[F++]=128|e:e<256?(N[F++]=152,N[F++]=e):e<65536?(N[F++]=153,N[F++]=e>>8,N[F++]=e&255):(N[F++]=154,P.setUint32(F,e),F+=4)}const cp=typeof Blob>`u`?function(){}:Blob;function lp(e){if(e instanceof cp)return!0;let t=e[Symbol.toStringTag];return t===`Blob`||t===`File`}function up(e,t){switch(typeof e){case`string`:if(e.length>3){if(t.objectMap[e]>-1||t.values.length>=t.maxValues)return;let n=t.get(e);if(n)++n.count==2&&t.values.push(e);else if(t.set(e,{count:1}),t.samplingPackedValues){let n=t.samplingPackedValues.get(e);n?n.count++:t.samplingPackedValues.set(e,{count:1})}}break;case`object`:if(e)if(e instanceof Array)for(let n=0,r=e.length;n<r;n++)up(e[n],t);else{let r=!t.encoder.useRecords;for(var n in e)e.hasOwnProperty(n)&&(r&&up(n,t),up(e[n],t))}break;case`function`:console.log(e)}}const dp=new Uint8Array(new Uint16Array([1]).buffer)[0]==1;Jf=[Date,Set,Error,RegExp,Df,ArrayBuffer,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>`u`?function(){}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>`u`?function(){}:BigInt64Array,Float32Array,Float64Array,op],qf=[{tag:1,encode(e,t){let n=e.getTime()/1e3;(this.useTimestamp32||e.getMilliseconds()===0)&&n>=0&&n<4294967296?(N[F++]=26,P.setUint32(F,n),F+=4):(N[F++]=251,P.setFloat64(F,n),F+=8)}},{tag:258,encode(e,t){t(Array.from(e))}},{tag:27,encode(e,t){t([e.name,e.message])}},{tag:27,encode(e,t){t([`RegExp`,e.source,e.flags])}},{getTag(e){return e.tag},encode(e,t){t(e.value)}},{encode(e,t,n){pp(e,n)}},{getTag(e){if(e.constructor===Uint8Array&&(this.tagUint8Array||Xf&&this.tagUint8Array!==!1))return 64},encode(e,t,n){pp(e,n)}},fp(68,1),fp(69,2),fp(70,4),fp(71,8),fp(72,1),fp(77,2),fp(78,4),fp(79,8),fp(85,4),fp(86,8),{encode(e,t){let n=e.packedValues||[],r=e.structures||[];if(n.values.length>0){N[F++]=216,N[F++]=51,sp(4);let e=n.values;t(e),sp(0),sp(0),packedObjectMap=Object.create(sharedPackedObjectMap||null);for(let t=0,n=e.length;t<n;t++)packedObjectMap[e[t]]=t}if(r){P.setUint32(F,3655335424),F+=3;let n=r.slice(0);n.unshift(57344),n.push(new Df(e.version,1399353956)),t(n)}else t(new Df(e.version,1399353956))}}];function fp(e,t){return!dp&&t>1&&(e-=4),{tag:e,encode:function(e,t){let n=e.byteLength,r=e.byteOffset||0,i=e.buffer||e;t(Xf?Yf.from(i,r,n):new Uint8Array(i,r,n))}}}function pp(e,t){let n=e.byteLength;n<24?N[F++]=64+n:n<256?(N[F++]=88,N[F++]=n):n<65536?(N[F++]=89,N[F++]=n>>8,N[F++]=n&255):(N[F++]=90,P.setUint32(F,n),F+=4),F+n>=N.length&&t(F+n),N.set(e.buffer?e:new Uint8Array(e),F),F+=n}function mp(e,t){let n,r=t.length*2,i=e.length-r;t.sort((e,t)=>e.offset>t.offset?1:-1);for(let n=0;n<t.length;n++){let r=t[n];r.id=n;for(let t of r.references)e[t++]=n>>8,e[t]=n&255}for(;n=t.pop();){let t=n.offset;e.copyWithin(t+r,t,i),r-=2;let a=t+r;e[a++]=216,e[a++]=28,i=t}return e}function hp(e,t){P.setUint32(I.position+e,F-I.position-e+1);let n=I;I=null,t(n[0]),t(n[1])}let gp=new ip({useRecords:!1});const _p=gp.encode;gp.encodeAsIterable,gp.encodeAsAsyncIterable;const{NEVER:vp,ALWAYS:yp,DECIMAL_ROUND:bp,DECIMAL_FIT:xp}=Gf,Sp=2048;var Cp=i(((e,t)=>{let n=()=>process.platform===`linux`,r=null;t.exports={isLinux:n,getReport:()=>{if(!r)if(n()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,r=process.report.getReport(),process.report.excludeNetwork=e}else r={};return r}}})),wp=i(((t,n)=>{let r=e(`fs`),i=2048;n.exports={LDD_PATH:`/usr/bin/ldd`,SELF_PATH:`/proc/self/exe`,readFileSync:e=>{let t=r.openSync(e,`r`),n=Buffer.alloc(i),a=r.readSync(t,n,0,i,0);return r.close(t,()=>{}),n.subarray(0,a)},readFile:e=>new Promise((t,n)=>{r.open(e,`r`,(e,a)=>{if(e)n(e);else{let e=Buffer.alloc(i);r.read(a,e,0,i,0,(n,i)=>{t(e.subarray(0,i)),r.close(a,()=>{})})}})})}})),Tp=i(((e,t)=>{t.exports={interpreterPath:e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),n=e.readUInt16LE(54),r=e.readUInt16LE(56);for(let i=0;i<r;i++){let r=t+i*n;if(e.readUInt32LE(r)===3){let t=e.readUInt32LE(r+8),n=e.readUInt32LE(r+32);return e.subarray(t,t+n).toString().replace(/\0.*$/g,``)}}return null}}})),Ep=i(((t,n)=>{let r=e(`child_process`),{isLinux:i,getReport:a}=Cp(),{LDD_PATH:o,SELF_PATH:s,readFile:c,readFileSync:l}=wp(),{interpreterPath:u}=Tp(),d,f,p,m=`getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true`,h=``,g=()=>h||new Promise(e=>{r.exec(m,(t,n)=>{h=t?` `:n,e(h)})}),_=()=>{if(!h)try{h=r.execSync(m,{encoding:`utf8`})}catch{h=` `}return h},v=`glibc`,y=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,b=`musl`,ee=e=>e.includes(`libc.musl-`)||e.includes(`ld-musl-`),te=()=>{let e=a();return e.header&&e.header.glibcVersionRuntime?v:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(ee)?b:null},ne=e=>{let[t,n]=e.split(/[\r\n]+/);return t&&t.includes(v)?v:n&&n.includes(b)?b:null},re=e=>{if(e){if(e.includes(`/ld-musl-`))return b;if(e.includes(`/ld-linux-`))return v}return null},ie=e=>(e=e.toString(),e.includes(`musl`)?b:e.includes(`GNU C Library`)?v:null),ae=async()=>{if(f!==void 0)return f;f=null;try{let e=await c(o);f=ie(e)}catch{}return f},oe=()=>{if(f!==void 0)return f;f=null;try{let e=l(o);f=ie(e)}catch{}return f},se=async()=>{if(d!==void 0)return d;d=null;try{let e=await c(s),t=u(e);d=re(t)}catch{}return d},ce=()=>{if(d!==void 0)return d;d=null;try{let e=l(s),t=u(e);d=re(t)}catch{}return d},le=async()=>{let e=null;if(i()&&(e=await se(),!e&&(e=await ae(),e||=te(),!e))){let t=await g();e=ne(t)}return e},ue=()=>{let e=null;if(i()&&(e=ce(),!e&&(e=oe(),e||=te(),!e))){let t=_();e=ne(t)}return e},de=async()=>i()&&await le()!==v,fe=()=>i()&&ue()!==v,pe=async()=>{if(p!==void 0)return p;p=null;try{let e=(await c(o)).match(y);e&&(p=e[1])}catch{}return p},me=()=>{if(p!==void 0)return p;p=null;try{let e=l(o).match(y);e&&(p=e[1])}catch{}return p},he=()=>{let e=a();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},ge=e=>e.trim().split(/\s+/)[1],_e=e=>{let[t,n,r]=e.split(/[\r\n]+/);return t&&t.includes(v)?ge(t):n&&r&&n.includes(b)?ge(r):null};n.exports={GLIBC:v,MUSL:b,family:le,familySync:ue,isNonGlibcLinux:de,isNonGlibcLinuxSync:fe,version:async()=>{let e=null;if(i()&&(e=await pe(),e||=he(),!e)){let t=await g();e=_e(t)}return e},versionSync:()=>{let e=null;if(i()&&(e=me(),e||=he(),!e)){let t=_();e=_e(t)}return e}}})),Dp=i(((t,n)=>{var r=e(`fs`),i=e(`path`),a=e(`url`),o=process.config&&process.config.variables||{},s=!!process.env.PREBUILDS_ONLY,c=process.versions,l=c.modules;(c.deno||process.isBun)&&(l=`unsupported`);var u=oe()?`electron`:`node`,d=process.arch,f=process.platform,p=process.env.LIBC||(se(f)?`musl`:`glibc`),m=process.env.ARM_VERSION||(d===`arm64`?`8`:o.arm_version)||``,h=(c.uv||``).split(`.`)[0];n.exports=g;function g(t){return typeof __webpack_require__==`function`?__non_webpack_require__(g.path(t)):e(g.path(t))}g.path=function(t){t=i.resolve(t||`.`);var n=``;try{n=typeof __webpack_require__==`function`?__non_webpack_require__(i.join(t,`package.json`)).name:e(i.join(t,`package.json`)).name;var r=n.toUpperCase().replace(/-/g,`_`)+`_PREBUILD`;process.env[r]&&(t=process.env[r])}catch{}if(!s){var o=v(i.join(t,`build/Release`),y);if(o)return o;var c=v(i.join(t,`build/Debug`),y);if(c)return c}var g=ce(t);if(g)return g;var ie=ce(i.dirname(process.execPath));if(ie)return ie;var oe=(n[0]==`@`?``:`@`+n+`/`)+n+`-`+f+`-`+d;try{return le(i.dirname(e(`module`).createRequire(a.pathToFileURL(i.join(t,`package.json`))).resolve(oe)))}catch{}var se=[`platform=`+f,`arch=`+d,`runtime=`+u,`abi=`+l,`uv=`+h,m?`armv=`+m:``,`libc=`+p,`node=`+process.versions.node,process.versions.electron?`electron=`+process.versions.electron:``,typeof __webpack_require__==`function`?`webpack=true`:``].filter(Boolean).join(` `);throw Error(`No native build was found for `+se+`
|
|
1
|
+
import{i as e,n as t,o as n,r,t as i}from"../../_chunks/workflow/rolldown-runtime-DaDcL9Zw.js";import{E as a,O as o,_ as s,c,d as l,g as u,o as d,r as f}from"../../_chunks/workflow/dist-CRTn4Sg8.js";import{$ as p,$a as m,$c as h,$i as g,$n as _,$o as v,$r as y,$s as b,$t as ee,Aa as te,Ac as ne,Ai as re,An as ie,Ao as ae,Ar as oe,As as se,At as ce,Ba as le,Bc as ue,Bi as de,Bn as fe,Bo as pe,Br as me,Bs as he,Bt as ge,C as _e,Ca as ve,Cc as ye,Ci as be,Cl as xe,Cn as Se,Co as Ce,Cr as we,Cs as Te,Ct as Ee,D as De,Da as Oe,Dc as ke,Di as Ae,Dn as je,Do as Me,Dr as Ne,Ds as Pe,Dt as Fe,E as Ie,Ea as Le,Ec as Re,Ei as ze,En as Be,Eo as Ve,Er as He,Es as Ue,Et as We,Fa as Ge,Fc as Ke,Fi as qe,Fn as Je,Fo as Ye,Fr as Xe,Fs as Ze,Ft as Qe,Ga as $e,Gc as et,Gi as tt,Gn as nt,Go as rt,Gr as it,Gs as at,Gt as ot,Ha as st,Hc as ct,Hi as lt,Hn as ut,Ho as dt,Hr as ft,Hs as pt,Ht as mt,I as ht,Ia as gt,Ic as _t,Ii as vt,In as yt,Io as bt,Ir as xt,Is as St,It as Ct,Ja as wt,Jc as Tt,Ji as Et,Jn as Dt,Jo as Ot,Jr as kt,Js as At,Jt as jt,K as Mt,Ka as Nt,Kc as Pt,Ki as Ft,Kn as It,Ko as Lt,Kr as Rt,Ks as zt,Kt as Bt,L as Vt,La as Ht,Lc as Ut,Li as Wt,Ln as Gt,Lo as Kt,Lr as qt,Ls as Jt,Lt as Yt,M as Xt,Ma as Zt,Mc as Qt,Mi as $t,Mn as en,Mo as tn,Mr as nn,Ms as rn,Mt as an,N as on,Na as sn,Nc as cn,Ni as ln,Nn as un,No as dn,Nr as fn,Ns as pn,Nt as mn,Oa as hn,Oc as gn,Oi as _n,On as vn,Oo as yn,Or as bn,Os as xn,Ot as Sn,Pa as Cn,Pc as wn,Pi as Tn,Pn as En,Po as Dn,Pr as On,Ps as kn,Pt as An,Qa as jn,Qc as Mn,Qi as Nn,Qn as Pn,Qo as Fn,Qr as In,Qs as Ln,Qt as Rn,R as zn,Ra as Bn,Rc as Vn,Ri as Hn,Rn as Un,Ro as Wn,Rr as Gn,Rs as Kn,Rt as qn,S as Jn,Sa as Yn,Sc as Xn,Si as Zn,Sl as Qn,Sn as $n,So as er,Sr as tr,Ss as nr,St as rr,T as ir,Ta as ar,Tc as or,Ti as sr,Tn as cr,To as lr,Tr as ur,Ts as dr,Tt as fr,Ua as pr,Uc as mr,Ui as hr,Un as gr,Uo as _r,Ur as vr,Us as yr,Ut as br,V as xr,Va as Sr,Vc as Cr,Vi as wr,Vn as Tr,Vo as Er,Vr as Dr,Vs as Or,Vt as kr,Wa as Ar,Wc as jr,Wi as Mr,Wn as Nr,Wo as Pr,Wr as Fr,Ws as Ir,Wt as Lr,Xa as Rr,Xc as zr,Xi as Br,Xn as Vr,Xo as Hr,Xr as Ur,Xs as Wr,Xt as Gr,Ya as Kr,Yc as qr,Yi as Jr,Yn as Yr,Yo as Xr,Yr as Zr,Ys as Qr,Yt as $r,Z as ei,Za as ti,Zc as ni,Zi as ri,Zn as ii,Zo as ai,Zr as oi,Zs as si,Zt as ci,_ as li,_a as ui,_c as di,_i as fi,_l as pi,_n as mi,_o as hi,_r as gi,_s as _i,_t as vi,aa as yi,ac as bi,ai as xi,al as Si,an as Ci,ao as wi,ar as Ti,as as Ei,at as Di,ba as Oi,bc as ki,bi as Ai,bl as ji,bn as Mi,bo as Ni,br as Pi,bs as Fi,bt as Ii,c as Li,ca as Ri,cc as zi,ci as Bi,cl as Vi,cn as Hi,co as Ui,cr as Wi,cs as Gi,ct as Ki,d as qi,da as Ji,dc as Yi,di as Xi,dl as Zi,dn as Qi,do as $i,dr as ea,ds as ta,dt as na,ea as ra,ec as ia,ei as aa,el as oa,en as sa,eo as ca,er as la,es as ua,fa as da,fc as fa,fi as pa,fl as ma,fn as ha,fo as ga,fr as _a,fs as va,ft as ya,g as ba,ga as xa,gc as Sa,gi as Ca,gl as x,gn as wa,go as Ta,gr as Ea,gs as Da,gt as Oa,h as ka,ha as Aa,hc as ja,hi as Ma,hl as S,hn as Na,ho as Pa,hr as Fa,hs as Ia,ht as La,ia as Ra,ic as za,ii as Ba,il as Va,in as Ha,io as Ua,ir as Wa,is as Ga,it as Ka,j as qa,ja as Ja,jc as Ya,ji as Xa,jn as Za,jo as Qa,jr as $a,js as eo,jt as to,k as no,ka as ro,kc as io,ki as ao,kn as oo,ko as so,kr as co,ks as lo,kt as uo,la as fo,lc as po,li as mo,ll as ho,ln as go,lo as _o,lr as vo,ls as yo,lt as bo,ma as xo,mc as So,mi as Co,ml as C,mn as wo,mo as To,mr as Eo,ms as Do,mt as Oo,na as ko,nc as Ao,ni as jo,nl as Mo,nn as No,no as Po,nr as Fo,ns as Io,nt as Lo,oa as Ro,oc as zo,oi as Bo,ol as Vo,on as Ho,oo as Uo,or as Wo,os as Go,ot as Ko,p as qo,pa as Jo,pc as Yo,pi as Xo,pl as Zo,pn as Qo,po as $o,pr as es,ps as ts,pt as ns,q as rs,qa as is,qc as as,qi as os,qn as ss,qo as cs,qr as ls,qs as us,qt as ds,r as fs,ra as ps,rc as ms,ri as hs,rl as gs,rn as _s,ro as vs,rr as ys,rs as bs,rt as xs,sa as Ss,sc as Cs,si as ws,sl as Ts,sn as Es,so as Ds,sr as Os,ss as ks,st as As,ta as js,tc as Ms,ti as Ns,tl as Ps,tn as Fs,to as Is,tr as Ls,ts as Rs,u as zs,ua as Bs,uc as Vs,ui as Hs,ul as Us,un as Ws,uo as Gs,ur as Ks,us as qs,ut as Js,va as Ys,vc as Xs,vi as Zs,vl as Qs,vn as $s,vo as ec,vr as tc,vs as nc,vt as rc,w as ic,wa as ac,wc as oc,wi as sc,wl as cc,wn as lc,wo as uc,wr as dc,ws as fc,wt as pc,xa as mc,xc as hc,xi as gc,xl as _c,xn as vc,xo as yc,xr as bc,xs as xc,xt as Sc,ya as Cc,yc as wc,yi as Tc,yl as Ec,yn as Dc,yo as Oc,yr as kc,ys as Ac,yt as jc,z as Mc,za as Nc,zc as Pc,zi as Fc,zn as Ic,zo as Lc,zr as Rc,zs as zc,zt as Bc}from"../../_chunks/workflow/dist-CNXUKQCp.js";import{t as Vc}from"../../_chunks/workflow/env-config-CYoX3muK.js";import{a as Hc,i as Uc,n as Wc,o as Gc,r as Kc,s as qc,t as Jc}from"../../_chunks/workflow/run-id-BdE0MZz9.js";import{t as Yc}from"../../_chunks/workflow/undici-CUIybhQ2.js";import{n as Xc,r as Zc,t as Qc}from"../../_chunks/workflow/token-util-Ldar52H7.js";import{i as $c,r as el,t as tl}from"../../_chunks/workflow/token-util-DNwIAn_u.js";import{createRequire as nl}from"module";import*as rl from"path";import*as il from"node:crypto";import{KeyObject as al,constants as ol,createCipheriv as sl,createDecipheriv as cl,createHash as ll,createHmac as ul,createPrivateKey as dl,createPublicKey as fl,createSecretKey as pl,diffieHellman as ml,generateKeyPair as hl,getCiphers as gl,pbkdf2 as _l,privateDecrypt as vl,publicEncrypt as yl,randomFillSync as bl,timingSafeEqual as xl,webcrypto as Sl}from"node:crypto";import*as Cl from"node:util";import{deprecate as wl,inspect as Tl,promisify as El}from"node:util";import{AsyncLocalStorage as Dl}from"node:async_hooks";import Ol from"node:os";import*as kl from"node:http";import{once as Al}from"node:events";import{Buffer as jl}from"node:buffer";import*as Ml from"fs";import*as Nl from"net";import*as Pl from"node:https";const Fl=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n={regex:`مدخل`,email:`بريد إلكتروني`,url:`رابط`,emoji:`إيموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاريخ ووقت بمعيار ISO`,date:`تاريخ بمعيار ISO`,time:`وقت بمعيار ISO`,duration:`مدة بمعيار ISO`,ipv4:`عنوان IPv4`,ipv6:`عنوان IPv6`,cidrv4:`مدى عناوين بصيغة IPv4`,cidrv6:`مدى عناوين بصيغة IPv6`,base64:`نَص بترميز base64-encoded`,base64url:`نَص بترميز base64url-encoded`,json_string:`نَص على هيئة JSON`,e164:`رقم هاتف بمعيار E.164`,jwt:`JWT`,template_literal:`مدخل`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${e.expected}، ولكن تم إدخال ${i}`:`مدخلات غير مقبولة: يفترض إدخال ${t}، ولكن تم إدخال ${i}`}case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${x(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${n[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${C(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}};function Il(){return{localeError:Fl()}}const Ll=()=>{let e={string:{unit:`simvol`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`element`,verb:`olmalıdır`},set:{unit:`element`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Yanlış dəyər: gözlənilən instanceof ${e.expected}, daxil olan ${i}`:`Yanlış dəyər: gözlənilən ${t}, daxil olan ${i}`}case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${x(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${n[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}};function Rl(){return{localeError:Ll()}}function zl(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const Bl=()=>{let e={string:{unit:{one:`сімвал`,few:`сімвалы`,many:`сімвалаў`},verb:`мець`},array:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},set:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},file:{unit:{one:`байт`,few:`байты`,many:`байтаў`},verb:`мець`}};function t(t){return e[t]??null}let n={regex:`увод`,email:`email адрас`,url:`URL`,emoji:`эмодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата і час`,date:`ISO дата`,time:`ISO час`,duration:`ISO працягласць`,ipv4:`IPv4 адрас`,ipv6:`IPv6 адрас`,cidrv4:`IPv4 дыяпазон`,cidrv6:`IPv6 дыяпазон`,base64:`радок у фармаце base64`,base64url:`радок у фармаце base64url`,json_string:`JSON радок`,e164:`нумар E.164`,jwt:`JWT`,template_literal:`увод`},r={nan:`NaN`,number:`лік`,array:`масіў`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Няправільны ўвод: чакаўся instanceof ${e.expected}, атрымана ${i}`:`Няправільны ўвод: чакаўся ${t}, атрымана ${i}`}case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${x(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=zl(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=zl(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з "${t.prefix}"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на "${t.suffix}"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць "${t.includes}"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${n[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}};function Vl(){return{localeError:Bl()}}const Hl=()=>{let e={string:{unit:`символа`,verb:`да съдържа`},file:{unit:`байта`,verb:`да съдържа`},array:{unit:`елемента`,verb:`да съдържа`},set:{unit:`елемента`,verb:`да съдържа`}};function t(t){return e[t]??null}let n={regex:`вход`,email:`имейл адрес`,url:`URL`,emoji:`емоджи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO време`,date:`ISO дата`,time:`ISO време`,duration:`ISO продължителност`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`base64-кодиран низ`,base64url:`base64url-кодиран низ`,json_string:`JSON низ`,e164:`E.164 номер`,jwt:`JWT`,template_literal:`вход`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Невалиден вход: очакван instanceof ${e.expected}, получен ${i}`:`Невалиден вход: очакван ${t}, получен ${i}`}case`invalid_value`:return e.values.length===1?`Невалиден вход: очакван ${x(e.values[0])}`:`Невалидна опция: очаквано едно от ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Твърде голямо: очаква се ${e.origin??`стойност`} да съдържа ${n}${e.maximum.toString()} ${r.unit??`елемента`}`:`Твърде голямо: очаква се ${e.origin??`стойност`} да бъде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Твърде малко: очаква се ${e.origin} да съдържа ${n}${e.minimum.toString()} ${r.unit}`:`Твърде малко: очаква се ${e.origin} да бъде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;if(t.format===`starts_with`)return`Невалиден низ: трябва да започва с "${t.prefix}"`;if(t.format===`ends_with`)return`Невалиден низ: трябва да завършва с "${t.suffix}"`;if(t.format===`includes`)return`Невалиден низ: трябва да включва "${t.includes}"`;if(t.format===`regex`)return`Невалиден низ: трябва да съвпада с ${t.pattern}`;let r=`Невалиден`;return t.format===`emoji`&&(r=`Невалидно`),t.format===`datetime`&&(r=`Невалидно`),t.format===`date`&&(r=`Невалидна`),t.format===`time`&&(r=`Невалидно`),t.format===`duration`&&(r=`Невалидна`),`${r} ${n[t.format]??e.format}`}case`not_multiple_of`:return`Невалидно число: трябва да бъде кратно на ${e.divisor}`;case`unrecognized_keys`:return`Неразпознат${e.keys.length>1?`и`:``} ключ${e.keys.length>1?`ове`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Невалиден ключ в ${e.origin}`;case`invalid_union`:return`Невалиден вход`;case`invalid_element`:return`Невалидна стойност в ${e.origin}`;default:return`Невалиден вход`}}};function Ul(){return{localeError:Hl()}}const Wl=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n={regex:`entrada`,email:`adreça electrònica`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`durada ISO`,ipv4:`adreça IPv4`,ipv6:`adreça IPv6`,cidrv4:`rang IPv4`,cidrv6:`rang IPv6`,base64:`cadena codificada en base64`,base64url:`cadena codificada en base64url`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipus invàlid: s'esperava instanceof ${e.expected}, s'ha rebut ${i}`:`Tipus invàlid: s'esperava ${t}, s'ha rebut ${i}`}case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${x(e.values[0])}`:`Opció invàlida: s'esperava una de ${C(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format===`includes`?`Format invàlid: ha d'incloure "${t.includes}"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}};function Gl(){return{localeError:Wl()}}const Kl=()=>{let e={string:{unit:`znaků`,verb:`mít`},file:{unit:`bajtů`,verb:`mít`},array:{unit:`prvků`,verb:`mít`},set:{unit:`prvků`,verb:`mít`}};function t(t){return e[t]??null}let n={regex:`regulární výraz`,email:`e-mailová adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`datum a čas ve formátu ISO`,date:`datum ve formátu ISO`,time:`čas ve formátu ISO`,duration:`doba trvání ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`řetězec zakódovaný ve formátu base64`,base64url:`řetězec zakódovaný ve formátu base64url`,json_string:`řetězec ve formátu JSON`,e164:`číslo E.164`,jwt:`JWT`,template_literal:`vstup`},r={nan:`NaN`,number:`číslo`,string:`řetězec`,function:`funkce`,array:`pole`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neplatný vstup: očekáváno instanceof ${e.expected}, obdrženo ${i}`:`Neplatný vstup: očekáváno ${t}, obdrženo ${i}`}case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${x(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${C(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}};function ql(){return{localeError:Kl()}}const Jl=()=>{let e={string:{unit:`tegn`,verb:`havde`},file:{unit:`bytes`,verb:`havde`},array:{unit:`elementer`,verb:`indeholdt`},set:{unit:`elementer`,verb:`indeholdt`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-mailadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslæt`,date:`ISO-dato`,time:`ISO-klokkeslæt`,duration:`ISO-varighed`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodet streng`,base64url:`base64url-kodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,string:`streng`,number:`tal`,boolean:`boolean`,array:`liste`,object:`objekt`,set:`sæt`,file:`fil`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldigt input: forventede instanceof ${e.expected}, fik ${i}`:`Ugyldigt input: forventede ${t}, fik ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig værdi: forventede ${x(e.values[0])}`:`Ugyldigt valg: forventede en af følgende ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For stor: forventede ${a??`value`} ${i.verb} ${n} ${e.maximum.toString()} ${i.unit??`elementer`}`:`For stor: forventede ${a??`value`} havde ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For lille: forventede ${a} ${i.verb} ${n} ${e.minimum.toString()} ${i.unit}`:`For lille: forventede ${a} havde ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: skal starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: skal ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: skal indeholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: skal matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldigt tal: skal være deleligt med ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukendte nøgler`:`Ukendt nøgle`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøgle i ${e.origin}`;case`invalid_union`:return`Ugyldigt input: matcher ingen af de tilladte typer`;case`invalid_element`:return`Ugyldig værdi i ${e.origin}`;default:return`Ugyldigt input`}}};function Yl(){return{localeError:Jl()}}const Xl=()=>{let e={string:{unit:`Zeichen`,verb:`zu haben`},file:{unit:`Bytes`,verb:`zu haben`},array:{unit:`Elemente`,verb:`zu haben`},set:{unit:`Elemente`,verb:`zu haben`}};function t(t){return e[t]??null}let n={regex:`Eingabe`,email:`E-Mail-Adresse`,url:`URL`,emoji:`Emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-Datum und -Uhrzeit`,date:`ISO-Datum`,time:`ISO-Uhrzeit`,duration:`ISO-Dauer`,ipv4:`IPv4-Adresse`,ipv6:`IPv6-Adresse`,cidrv4:`IPv4-Bereich`,cidrv6:`IPv6-Bereich`,base64:`Base64-codierter String`,base64url:`Base64-URL-codierter String`,json_string:`JSON-String`,e164:`E.164-Nummer`,jwt:`JWT`,template_literal:`Eingabe`},r={nan:`NaN`,number:`Zahl`,array:`Array`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ungültige Eingabe: erwartet instanceof ${e.expected}, erhalten ${i}`:`Ungültige Eingabe: erwartet ${t}, erhalten ${i}`}case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${x(e.values[0])}`:`Ungültige Option: erwartet eine von ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format===`includes`?`Ungültiger String: muss "${t.includes}" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}};function Zl(){return{localeError:Xl()}}const Ql=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${x(e.values[0])}`:`Invalid option: expected one of ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function $l(){return{localeError:Ql()}}const eu=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let n={regex:`enigo`,email:`retadreso`,url:`URL`,emoji:`emoĝio`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datotempo`,date:`ISO-dato`,time:`ISO-tempo`,duration:`ISO-daŭro`,ipv4:`IPv4-adreso`,ipv6:`IPv6-adreso`,cidrv4:`IPv4-rango`,cidrv6:`IPv6-rango`,base64:`64-ume kodita karaktraro`,base64url:`URL-64-ume kodita karaktraro`,json_string:`JSON-karaktraro`,e164:`E.164-nombro`,jwt:`JWT`,template_literal:`enigo`},r={nan:`NaN`,number:`nombro`,array:`tabelo`,null:`senvalora`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nevalida enigo: atendiĝis instanceof ${e.expected}, riceviĝis ${i}`:`Nevalida enigo: atendiĝis ${t}, riceviĝis ${i}`}case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${x(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}};function tu(){return{localeError:eu()}}const nu=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}};function t(t){return e[t]??null}let n={regex:`entrada`,email:`dirección de correo electrónico`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`fecha y hora ISO`,date:`fecha ISO`,time:`hora ISO`,duration:`duración ISO`,ipv4:`dirección IPv4`,ipv6:`dirección IPv6`,cidrv4:`rango IPv4`,cidrv6:`rango IPv6`,base64:`cadena codificada en base64`,base64url:`URL codificada en base64`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`,string:`texto`,number:`número`,boolean:`booleano`,array:`arreglo`,object:`objeto`,set:`conjunto`,file:`archivo`,date:`fecha`,bigint:`número grande`,symbol:`símbolo`,undefined:`indefinido`,null:`nulo`,function:`función`,map:`mapa`,record:`registro`,tuple:`tupla`,enum:`enumeración`,union:`unión`,literal:`literal`,promise:`promesa`,void:`vacío`,never:`nunca`,unknown:`desconocido`,any:`cualquiera`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrada inválida: se esperaba instanceof ${e.expected}, recibido ${i}`:`Entrada inválida: se esperaba ${t}, recibido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${x(e.values[0])}`:`Opción inválida: se esperaba una de ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado grande: se esperaba que ${a??`valor`} tuviera ${n}${e.maximum.toString()} ${i.unit??`elementos`}`:`Demasiado grande: se esperaba que ${a??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado pequeño: se esperaba que ${a} tuviera ${n}${e.minimum.toString()} ${i.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format===`ends_with`?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format===`includes`?`Cadena inválida: debe incluir "${t.includes}"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${r[e.origin]??e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${r[e.origin]??e.origin}`;default:return`Entrada inválida`}}};function ru(){return{localeError:nu()}}const iu=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n={regex:`ورودی`,email:`آدرس ایمیل`,url:`URL`,emoji:`ایموجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاریخ و زمان ایزو`,date:`تاریخ ایزو`,time:`زمان ایزو`,duration:`مدت زمان ایزو`,ipv4:`IPv4 آدرس`,ipv6:`IPv6 آدرس`,cidrv4:`IPv4 دامنه`,cidrv6:`IPv6 دامنه`,base64:`base64-encoded رشته`,base64url:`base64url-encoded رشته`,json_string:`JSON رشته`,e164:`E.164 عدد`,jwt:`JWT`,template_literal:`ورودی`},r={nan:`NaN`,number:`عدد`,array:`آرایه`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ورودی نامعتبر: میبایست instanceof ${e.expected} میبود، ${i} دریافت شد`:`ورودی نامعتبر: میبایست ${t} میبود، ${i} دریافت شد`}case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: میبایست ${x(e.values[0])} میبود`:`گزینه نامعتبر: میبایست یکی از ${C(e.values,`|`)} میبود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${n[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${C(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}};function au(){return{localeError:iu()}}const ou=()=>{let e={string:{unit:`merkkiä`,subject:`merkkijonon`},file:{unit:`tavua`,subject:`tiedoston`},array:{unit:`alkiota`,subject:`listan`},set:{unit:`alkiota`,subject:`joukon`},number:{unit:``,subject:`luvun`},bigint:{unit:``,subject:`suuren kokonaisluvun`},int:{unit:``,subject:`kokonaisluvun`},date:{unit:``,subject:`päivämäärän`}};function t(t){return e[t]??null}let n={regex:`säännöllinen lauseke`,email:`sähköpostiosoite`,url:`URL-osoite`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-aikaleima`,date:`ISO-päivämäärä`,time:`ISO-aika`,duration:`ISO-kesto`,ipv4:`IPv4-osoite`,ipv6:`IPv6-osoite`,cidrv4:`IPv4-alue`,cidrv6:`IPv6-alue`,base64:`base64-koodattu merkkijono`,base64url:`base64url-koodattu merkkijono`,json_string:`JSON-merkkijono`,e164:`E.164-luku`,jwt:`JWT`,template_literal:`templaattimerkkijono`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Virheellinen tyyppi: odotettiin instanceof ${e.expected}, oli ${i}`:`Virheellinen tyyppi: odotettiin ${t}, oli ${i}`}case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${x(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Virheellinen avain tietueessa`;case`invalid_union`:return`Virheellinen unioni`;case`invalid_element`:return`Virheellinen arvo joukossa`;default:return`Virheellinen syöte`}}};function su(){return{localeError:ou()}}const cu=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n={regex:`entrée`,email:`adresse e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date et heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`},r={nan:`NaN`,number:`nombre`,array:`tableau`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : instanceof ${e.expected} attendu, ${i} reçu`:`Entrée invalide : ${t} attendu, ${i} reçu`}case`invalid_value`:return e.values.length===1?`Entrée invalide : ${x(e.values[0])} attendu`:`Option invalide : une valeur parmi ${C(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Trop grand : ${e.origin??`valeur`} doit ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`élément(s)`}`:`Trop grand : ${e.origin??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Trop petit : ${e.origin} doit ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : ${e.origin} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${C(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function lu(){return{localeError:cu()}}const uu=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n={regex:`entrée`,email:`adresse courriel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date-heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : attendu instanceof ${e.expected}, reçu ${i}`:`Entrée invalide : attendu ${t}, reçu ${i}`}case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${x(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${C(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function du(){return{localeError:uu()}}const fu=()=>{let e={string:{label:`מחרוזת`,gender:`f`},number:{label:`מספר`,gender:`m`},boolean:{label:`ערך בוליאני`,gender:`m`},bigint:{label:`BigInt`,gender:`m`},date:{label:`תאריך`,gender:`m`},array:{label:`מערך`,gender:`m`},object:{label:`אובייקט`,gender:`m`},null:{label:`ערך ריק (null)`,gender:`m`},undefined:{label:`ערך לא מוגדר (undefined)`,gender:`m`},symbol:{label:`סימבול (Symbol)`,gender:`m`},function:{label:`פונקציה`,gender:`f`},map:{label:`מפה (Map)`,gender:`f`},set:{label:`קבוצה (Set)`,gender:`f`},file:{label:`קובץ`,gender:`m`},promise:{label:`Promise`,gender:`m`},NaN:{label:`NaN`,gender:`m`},unknown:{label:`ערך לא ידוע`,gender:`m`},value:{label:`ערך`,gender:`m`}},t={string:{unit:`תווים`,shortLabel:`קצר`,longLabel:`ארוך`},file:{unit:`בייטים`,shortLabel:`קטן`,longLabel:`גדול`},array:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},set:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},number:{unit:``,shortLabel:`קטן`,longLabel:`גדול`}},n=t=>t?e[t]:void 0,r=t=>{let r=n(t);return r?r.label:t??e.unknown.label},i=e=>`ה${r(e)}`,a=e=>(n(e)?.gender??`m`)===`f`?`צריכה להיות`:`צריך להיות`,o=e=>e?t[e]??null:null,s={regex:{label:`קלט`,gender:`m`},email:{label:`כתובת אימייל`,gender:`f`},url:{label:`כתובת רשת`,gender:`f`},emoji:{label:`אימוג'י`,gender:`m`},uuid:{label:`UUID`,gender:`m`},nanoid:{label:`nanoid`,gender:`m`},guid:{label:`GUID`,gender:`m`},cuid:{label:`cuid`,gender:`m`},cuid2:{label:`cuid2`,gender:`m`},ulid:{label:`ULID`,gender:`m`},xid:{label:`XID`,gender:`m`},ksuid:{label:`KSUID`,gender:`m`},datetime:{label:`תאריך וזמן ISO`,gender:`m`},date:{label:`תאריך ISO`,gender:`m`},time:{label:`זמן ISO`,gender:`m`},duration:{label:`משך זמן ISO`,gender:`m`},ipv4:{label:`כתובת IPv4`,gender:`f`},ipv6:{label:`כתובת IPv6`,gender:`f`},cidrv4:{label:`טווח IPv4`,gender:`m`},cidrv6:{label:`טווח IPv6`,gender:`m`},base64:{label:`מחרוזת בבסיס 64`,gender:`f`},base64url:{label:`מחרוזת בבסיס 64 לכתובות רשת`,gender:`f`},json_string:{label:`מחרוזת JSON`,gender:`f`},e164:{label:`מספר E.164`,gender:`m`},jwt:{label:`JWT`,gender:`m`},ends_with:{label:`קלט`,gender:`m`},includes:{label:`קלט`,gender:`m`},lowercase:{label:`קלט`,gender:`m`},starts_with:{label:`קלט`,gender:`m`},uppercase:{label:`קלט`,gender:`m`}},c={nan:`NaN`};return t=>{switch(t.code){case`invalid_type`:{let n=t.expected,i=c[n??``]??r(n),a=S(t.input),o=c[a]??e[a]?.label??a;return/^[A-Z]/.test(t.expected)?`קלט לא תקין: צריך להיות instanceof ${t.expected}, התקבל ${o}`:`קלט לא תקין: צריך להיות ${i}, התקבל ${o}`}case`invalid_value`:{if(t.values.length===1)return`ערך לא תקין: הערך חייב להיות ${x(t.values[0])}`;let e=t.values.map(e=>x(e));if(t.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${e[0]} או ${e[1]}`;let n=e[e.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${e.slice(0,-1).join(`, `)} או ${n}`}case`too_big`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.longLabel??`ארוך`} מדי: ${n} צריכה להכיל ${t.maximum.toString()} ${e?.unit??``} ${t.inclusive?`או פחות`:`לכל היותר`}`.trim();if(t.origin===`number`)return`גדול מדי: ${n} צריך להיות ${t.inclusive?`קטן או שווה ל-${t.maximum}`:`קטן מ-${t.maximum}`}`;if(t.origin===`array`||t.origin===`set`)return`גדול מדי: ${n} ${t.origin===`set`?`צריכה`:`צריך`} להכיל ${t.inclusive?`${t.maximum} ${e?.unit??``} או פחות`:`פחות מ-${t.maximum} ${e?.unit??``}`}`.trim();let r=t.inclusive?`<=`:`<`,s=a(t.origin??`value`);return e?.unit?`${e.longLabel} מדי: ${n} ${s} ${r}${t.maximum.toString()} ${e.unit}`:`${e?.longLabel??`גדול`} מדי: ${n} ${s} ${r}${t.maximum.toString()}`}case`too_small`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.shortLabel??`קצר`} מדי: ${n} צריכה להכיל ${t.minimum.toString()} ${e?.unit??``} ${t.inclusive?`או יותר`:`לפחות`}`.trim();if(t.origin===`number`)return`קטן מדי: ${n} צריך להיות ${t.inclusive?`גדול או שווה ל-${t.minimum}`:`גדול מ-${t.minimum}`}`;if(t.origin===`array`||t.origin===`set`){let r=t.origin===`set`?`צריכה`:`צריך`;return t.minimum===1&&t.inclusive?`קטן מדי: ${n} ${r} להכיל ${t.origin,`לפחות פריט אחד`}`:`קטן מדי: ${n} ${r} להכיל ${t.inclusive?`${t.minimum} ${e?.unit??``} או יותר`:`יותר מ-${t.minimum} ${e?.unit??``}`}`.trim()}let r=t.inclusive?`>=`:`>`,s=a(t.origin??`value`);return e?.unit?`${e.shortLabel} מדי: ${n} ${s} ${r}${t.minimum.toString()} ${e.unit}`:`${e?.shortLabel??`קטן`} מדי: ${n} ${s} ${r}${t.minimum.toString()}`}case`invalid_format`:{let e=t;if(e.format===`starts_with`)return`המחרוזת חייבת להתחיל ב "${e.prefix}"`;if(e.format===`ends_with`)return`המחרוזת חייבת להסתיים ב "${e.suffix}"`;if(e.format===`includes`)return`המחרוזת חייבת לכלול "${e.includes}"`;if(e.format===`regex`)return`המחרוזת חייבת להתאים לתבנית ${e.pattern}`;let n=s[e.format];return`${n?.label??e.format} לא ${(n?.gender??`m`)===`f`?`תקינה`:`תקין`}`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case`unrecognized_keys`:return`מפתח${t.keys.length>1?`ות`:``} לא מזוה${t.keys.length>1?`ים`:`ה`}: ${C(t.keys,`, `)}`;case`invalid_key`:return`שדה לא תקין באובייקט`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${i(t.origin??`array`)}`;default:return`קלט לא תקין`}}};function pu(){return{localeError:fu()}}const mu=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n={regex:`bemenet`,email:`email cím`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO időbélyeg`,date:`ISO dátum`,time:`ISO idő`,duration:`ISO időintervallum`,ipv4:`IPv4 cím`,ipv6:`IPv6 cím`,cidrv4:`IPv4 tartomány`,cidrv6:`IPv6 tartomány`,base64:`base64-kódolt string`,base64url:`base64url-kódolt string`,json_string:`JSON string`,e164:`E.164 szám`,jwt:`JWT`,template_literal:`bemenet`},r={nan:`NaN`,number:`szám`,array:`tömb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Érvénytelen bemenet: a várt érték instanceof ${e.expected}, a kapott érték ${i}`:`Érvénytelen bemenet: a várt érték ${t}, a kapott érték ${i}`}case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${x(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}};function hu(){return{localeError:mu()}}function gu(e,t,n){return Math.abs(e)===1?t:n}function _u(e){if(!e)return``;let t=[`ա`,`ե`,`ը`,`ի`,`ո`,`ու`,`օ`],n=e[e.length-1];return e+(t.includes(n)?`ն`:`ը`)}const vu=()=>{let e={string:{unit:{one:`նշան`,many:`նշաններ`},verb:`ունենալ`},file:{unit:{one:`բայթ`,many:`բայթեր`},verb:`ունենալ`},array:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`},set:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`}};function t(t){return e[t]??null}let n={regex:`մուտք`,email:`էլ. հասցե`,url:`URL`,emoji:`էմոջի`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO ամսաթիվ և ժամ`,date:`ISO ամսաթիվ`,time:`ISO ժամ`,duration:`ISO տևողություն`,ipv4:`IPv4 հասցե`,ipv6:`IPv6 հասցե`,cidrv4:`IPv4 միջակայք`,cidrv6:`IPv6 միջակայք`,base64:`base64 ձևաչափով տող`,base64url:`base64url ձևաչափով տող`,json_string:`JSON տող`,e164:`E.164 համար`,jwt:`JWT`,template_literal:`մուտք`},r={nan:`NaN`,number:`թիվ`,array:`զանգված`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${e.expected}, ստացվել է ${i}`:`Սխալ մուտքագրում․ սպասվում էր ${t}, ստացվել է ${i}`}case`invalid_value`:return e.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${x(e.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=gu(Number(e.maximum),r.unit.one,r.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${_u(e.origin??`արժեք`)} կունենա ${n}${e.maximum.toString()} ${t}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${_u(e.origin??`արժեք`)} լինի ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=gu(Number(e.minimum),r.unit.one,r.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${_u(e.origin)} կունենա ${n}${e.minimum.toString()} ${t}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${_u(e.origin)} լինի ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Սխալ տող․ պետք է սկսվի "${t.prefix}"-ով`:t.format===`ends_with`?`Սխալ տող․ պետք է ավարտվի "${t.suffix}"-ով`:t.format===`includes`?`Սխալ տող․ պետք է պարունակի "${t.includes}"`:t.format===`regex`?`Սխալ տող․ պետք է համապատասխանի ${t.pattern} ձևաչափին`:`Սխալ ${n[t.format]??e.format}`}case`not_multiple_of`:return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${e.divisor}-ի`;case`unrecognized_keys`:return`Չճանաչված բանալի${e.keys.length>1?`ներ`:``}. ${C(e.keys,`, `)}`;case`invalid_key`:return`Սխալ բանալի ${_u(e.origin)}-ում`;case`invalid_union`:return`Սխալ մուտքագրում`;case`invalid_element`:return`Սխալ արժեք ${_u(e.origin)}-ում`;default:return`Սխալ մուտքագրում`}}};function yu(){return{localeError:vu()}}const bu=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n={regex:`input`,email:`alamat email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tanggal dan waktu format ISO`,date:`tanggal format ISO`,time:`jam format ISO`,duration:`durasi format ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`rentang alamat IPv4`,cidrv6:`rentang alamat IPv6`,base64:`string dengan enkode base64`,base64url:`string dengan enkode base64url`,json_string:`string JSON`,e164:`angka E.164`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak valid: diharapkan instanceof ${e.expected}, diterima ${i}`:`Input tidak valid: diharapkan ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${x(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak valid: harus menyertakan "${t.includes}"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${n[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}};function xu(){return{localeError:bu()}}const Su=()=>{let e={string:{unit:`stafi`,verb:`að hafa`},file:{unit:`bæti`,verb:`að hafa`},array:{unit:`hluti`,verb:`að hafa`},set:{unit:`hluti`,verb:`að hafa`}};function t(t){return e[t]??null}let n={regex:`gildi`,email:`netfang`,url:`vefslóð`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dagsetning og tími`,date:`ISO dagsetning`,time:`ISO tími`,duration:`ISO tímalengd`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded strengur`,base64url:`base64url-encoded strengur`,json_string:`JSON strengur`,e164:`E.164 tölugildi`,jwt:`JWT`,template_literal:`gildi`},r={nan:`NaN`,number:`númer`,array:`fylki`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Rangt gildi: Þú slóst inn ${i} þar sem á að vera instanceof ${e.expected}`:`Rangt gildi: Þú slóst inn ${i} þar sem á að vera ${t}`}case`invalid_value`:return e.values.length===1?`Rangt gildi: gert ráð fyrir ${x(e.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} hafi ${n}${e.maximum.toString()} ${r.unit??`hluti`}`:`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} sé ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}`:`Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format===`ends_with`?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format===`includes`?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format===`regex`?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${n[t.format]??e.format}`}case`not_multiple_of`:return`Röng tala: verður að vera margfeldi af ${e.divisor}`;case`unrecognized_keys`:return`Óþekkt ${e.keys.length>1?`ir lyklar`:`ur lykill`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Rangur lykill í ${e.origin}`;case`invalid_union`:return`Rangt gildi`;case`invalid_element`:return`Rangt gildi í ${e.origin}`;default:return`Rangt gildi`}}};function Cu(){return{localeError:Su()}}const wu=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n={regex:`input`,email:`indirizzo email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e ora ISO`,date:`data ISO`,time:`ora ISO`,duration:`durata ISO`,ipv4:`indirizzo IPv4`,ipv6:`indirizzo IPv6`,cidrv4:`intervallo IPv4`,cidrv6:`intervallo IPv6`,base64:`stringa codificata in base64`,base64url:`URL codificata in base64`,json_string:`stringa JSON`,e164:`numero E.164`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`numero`,array:`vettore`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input non valido: atteso instanceof ${e.expected}, ricevuto ${i}`:`Input non valido: atteso ${t}, ricevuto ${i}`}case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${x(e.values[0])}`:`Opzione non valida: atteso uno tra ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format===`ends_with`?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format===`includes`?`Stringa non valida: deve includere "${t.includes}"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}};function Tu(){return{localeError:wu()}}const Eu=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n={regex:`入力値`,email:`メールアドレス`,url:`URL`,emoji:`絵文字`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日時`,date:`ISO日付`,time:`ISO時刻`,duration:`ISO期間`,ipv4:`IPv4アドレス`,ipv6:`IPv6アドレス`,cidrv4:`IPv4範囲`,cidrv6:`IPv6範囲`,base64:`base64エンコード文字列`,base64url:`base64urlエンコード文字列`,json_string:`JSON文字列`,e164:`E.164番号`,jwt:`JWT`,template_literal:`入力値`},r={nan:`NaN`,number:`数値`,array:`配列`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無効な入力: instanceof ${e.expected}が期待されましたが、${i}が入力されました`:`無効な入力: ${t}が期待されましたが、${i}が入力されました`}case`invalid_value`:return e.values.length===1?`無効な入力: ${x(e.values[0])}が期待されました`:`無効な選択: ${C(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format===`includes`?`無効な文字列: "${t.includes}"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${n[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${C(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}};function Du(){return{localeError:Eu()}}const Ou=()=>{let e={string:{unit:`სიმბოლო`,verb:`უნდა შეიცავდეს`},file:{unit:`ბაიტი`,verb:`უნდა შეიცავდეს`},array:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},set:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`}};function t(t){return e[t]??null}let n={regex:`შეყვანა`,email:`ელ-ფოსტის მისამართი`,url:`URL`,emoji:`ემოჯი`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`თარიღი-დრო`,date:`თარიღი`,time:`დრო`,duration:`ხანგრძლივობა`,ipv4:`IPv4 მისამართი`,ipv6:`IPv6 მისამართი`,cidrv4:`IPv4 დიაპაზონი`,cidrv6:`IPv6 დიაპაზონი`,base64:`base64-კოდირებული სტრინგი`,base64url:`base64url-კოდირებული სტრინგი`,json_string:`JSON სტრინგი`,e164:`E.164 ნომერი`,jwt:`JWT`,template_literal:`შეყვანა`},r={nan:`NaN`,number:`რიცხვი`,string:`სტრინგი`,boolean:`ბულეანი`,function:`ფუნქცია`,array:`მასივი`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${e.expected}, მიღებული ${i}`:`არასწორი შეყვანა: მოსალოდნელი ${t}, მიღებული ${i}`}case`invalid_value`:return e.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${x(e.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${C(e.values,`|`)}-დან`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} იყოს ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ზედმეტად პატარა: მოსალოდნელი ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${e.origin} იყოს ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`არასწორი სტრინგი: უნდა იწყებოდეს "${t.prefix}"-ით`:t.format===`ends_with`?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${t.suffix}"-ით`:t.format===`includes`?`არასწორი სტრინგი: უნდა შეიცავდეს "${t.includes}"-ს`:t.format===`regex`?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`:`არასწორი ${n[t.format]??e.format}`}case`not_multiple_of`:return`არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`;case`unrecognized_keys`:return`უცნობი გასაღებ${e.keys.length>1?`ები`:`ი`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`არასწორი გასაღები ${e.origin}-ში`;case`invalid_union`:return`არასწორი შეყვანა`;case`invalid_element`:return`არასწორი მნიშვნელობა ${e.origin}-ში`;default:return`არასწორი შეყვანა`}}};function ku(){return{localeError:Ou()}}const Au=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n={regex:`ទិន្នន័យបញ្ចូល`,email:`អាសយដ្ឋានអ៊ីមែល`,url:`URL`,emoji:`សញ្ញាអារម្មណ៍`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`កាលបរិច្ឆេទ និងម៉ោង ISO`,date:`កាលបរិច្ឆេទ ISO`,time:`ម៉ោង ISO`,duration:`រយៈពេល ISO`,ipv4:`អាសយដ្ឋាន IPv4`,ipv6:`អាសយដ្ឋាន IPv6`,cidrv4:`ដែនអាសយដ្ឋាន IPv4`,cidrv6:`ដែនអាសយដ្ឋាន IPv6`,base64:`ខ្សែអក្សរអ៊ិកូដ base64`,base64url:`ខ្សែអក្សរអ៊ិកូដ base64url`,json_string:`ខ្សែអក្សរ JSON`,e164:`លេខ E.164`,jwt:`JWT`,template_literal:`ទិន្នន័យបញ្ចូល`},r={nan:`NaN`,number:`លេខ`,array:`អារេ (Array)`,null:`គ្មានតម្លៃ (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${e.expected} ប៉ុន្តែទទួលបាន ${i}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t} ប៉ុន្តែទទួលបាន ${i}`}case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${x(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${n[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${C(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}};function ju(){return{localeError:Au()}}function Mu(){return ju()}const Nu=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`입력`,email:`이메일 주소`,url:`URL`,emoji:`이모지`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 날짜시간`,date:`ISO 날짜`,time:`ISO 시간`,duration:`ISO 기간`,ipv4:`IPv4 주소`,ipv6:`IPv6 주소`,cidrv4:`IPv4 범위`,cidrv6:`IPv6 범위`,base64:`base64 인코딩 문자열`,base64url:`base64url 인코딩 문자열`,json_string:`JSON 문자열`,e164:`E.164 번호`,jwt:`JWT`,template_literal:`입력`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`잘못된 입력: 예상 타입은 instanceof ${e.expected}, 받은 타입은 ${i}입니다`:`잘못된 입력: 예상 타입은 ${t}, 받은 타입은 ${i}입니다`}case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${x(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${C(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${n[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${C(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}};function Pu(){return{localeError:Nu()}}const Fu=e=>e.charAt(0).toUpperCase()+e.slice(1);function Iu(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?`many`:n===1?`one`:`few`}const Lu=()=>{let e={string:{unit:{one:`simbolis`,few:`simboliai`,many:`simbolių`},verb:{smaller:{inclusive:`turi būti ne ilgesnė kaip`,notInclusive:`turi būti trumpesnė kaip`},bigger:{inclusive:`turi būti ne trumpesnė kaip`,notInclusive:`turi būti ilgesnė kaip`}}},file:{unit:{one:`baitas`,few:`baitai`,many:`baitų`},verb:{smaller:{inclusive:`turi būti ne didesnis kaip`,notInclusive:`turi būti mažesnis kaip`},bigger:{inclusive:`turi būti ne mažesnis kaip`,notInclusive:`turi būti didesnis kaip`}}},array:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}},set:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}}};function t(t,n,r,i){let a=e[t]??null;return a===null?a:{unit:a.unit[n],verb:a.verb[i][r?`inclusive`:`notInclusive`]}}let n={regex:`įvestis`,email:`el. pašto adresas`,url:`URL`,emoji:`jaustukas`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO data ir laikas`,date:`ISO data`,time:`ISO laikas`,duration:`ISO trukmė`,ipv4:`IPv4 adresas`,ipv6:`IPv6 adresas`,cidrv4:`IPv4 tinklo prefiksas (CIDR)`,cidrv6:`IPv6 tinklo prefiksas (CIDR)`,base64:`base64 užkoduota eilutė`,base64url:`base64url užkoduota eilutė`,json_string:`JSON eilutė`,e164:`E.164 numeris`,jwt:`JWT`,template_literal:`įvestis`},r={nan:`NaN`,number:`skaičius`,bigint:`sveikasis skaičius`,string:`eilutė`,boolean:`loginė reikšmė`,undefined:`neapibrėžta reikšmė`,function:`funkcija`,symbol:`simbolis`,array:`masyvas`,object:`objektas`,null:`nulinė reikšmė`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Gautas tipas ${i}, o tikėtasi - instanceof ${e.expected}`:`Gautas tipas ${i}, o tikėtasi - ${t}`}case`invalid_value`:return e.values.length===1?`Privalo būti ${x(e.values[0])}`:`Privalo būti vienas iš ${C(e.values,`|`)} pasirinkimų`;case`too_big`:{let n=r[e.origin]??e.origin,i=t(e.origin,Iu(Number(e.maximum)),e.inclusive??!1,`smaller`);if(i?.verb)return`${Fu(n??e.origin??`reikšmė`)} ${i.verb} ${e.maximum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne didesnis kaip`:`mažesnis kaip`;return`${Fu(n??e.origin??`reikšmė`)} turi būti ${a} ${e.maximum.toString()} ${i?.unit}`}case`too_small`:{let n=r[e.origin]??e.origin,i=t(e.origin,Iu(Number(e.minimum)),e.inclusive??!1,`bigger`);if(i?.verb)return`${Fu(n??e.origin??`reikšmė`)} ${i.verb} ${e.minimum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne mažesnis kaip`:`didesnis kaip`;return`${Fu(n??e.origin??`reikšmė`)} turi būti ${a} ${e.minimum.toString()} ${i?.unit}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Eilutė privalo prasidėti "${t.prefix}"`:t.format===`ends_with`?`Eilutė privalo pasibaigti "${t.suffix}"`:t.format===`includes`?`Eilutė privalo įtraukti "${t.includes}"`:t.format===`regex`?`Eilutė privalo atitikti ${t.pattern}`:`Neteisingas ${n[t.format]??e.format}`}case`not_multiple_of`:return`Skaičius privalo būti ${e.divisor} kartotinis.`;case`unrecognized_keys`:return`Neatpažint${e.keys.length>1?`i`:`as`} rakt${e.keys.length>1?`ai`:`as`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Rastas klaidingas raktas`;case`invalid_union`:return`Klaidinga įvestis`;case`invalid_element`:{let t=r[e.origin]??e.origin;return`${Fu(t??e.origin??`reikšmė`)} turi klaidingą įvestį`}default:return`Klaidinga įvestis`}}};function Ru(){return{localeError:Lu()}}const zu=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n={regex:`внес`,email:`адреса на е-пошта`,url:`URL`,emoji:`емоџи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO датум и време`,date:`ISO датум`,time:`ISO време`,duration:`ISO времетраење`,ipv4:`IPv4 адреса`,ipv6:`IPv6 адреса`,cidrv4:`IPv4 опсег`,cidrv6:`IPv6 опсег`,base64:`base64-енкодирана низа`,base64url:`base64url-енкодирана низа`,json_string:`JSON низа`,e164:`E.164 број`,jwt:`JWT`,template_literal:`внес`},r={nan:`NaN`,number:`број`,array:`низа`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Грешен внес: се очекува instanceof ${e.expected}, примено ${i}`:`Грешен внес: се очекува ${t}, примено ${i}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${x(e.values[0])}`:`Грешана опција: се очекува една ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format===`includes`?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}};function Bu(){return{localeError:zu()}}const Vu=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n={regex:`input`,email:`alamat e-mel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tarikh masa ISO`,date:`tarikh ISO`,time:`masa ISO`,duration:`tempoh ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`julat IPv4`,cidrv6:`julat IPv6`,base64:`string dikodkan base64`,base64url:`string dikodkan base64url`,json_string:`string JSON`,e164:`nombor E.164`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`nombor`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak sah: dijangka instanceof ${e.expected}, diterima ${i}`:`Input tidak sah: dijangka ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${x(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${n[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${C(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}};function Hu(){return{localeError:Vu()}}const Uu=()=>{let e={string:{unit:`tekens`,verb:`heeft`},file:{unit:`bytes`,verb:`heeft`},array:{unit:`elementen`,verb:`heeft`},set:{unit:`elementen`,verb:`heeft`}};function t(t){return e[t]??null}let n={regex:`invoer`,email:`emailadres`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum en tijd`,date:`ISO datum`,time:`ISO tijd`,duration:`ISO duur`,ipv4:`IPv4-adres`,ipv6:`IPv6-adres`,cidrv4:`IPv4-bereik`,cidrv6:`IPv6-bereik`,base64:`base64-gecodeerde tekst`,base64url:`base64 URL-gecodeerde tekst`,json_string:`JSON string`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`invoer`},r={nan:`NaN`,number:`getal`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ongeldige invoer: verwacht instanceof ${e.expected}, ontving ${i}`:`Ongeldige invoer: verwacht ${t}, ontving ${i}`}case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${x(e.values[0])}`:`Ongeldige optie: verwacht één van ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin),i=e.origin===`date`?`laat`:e.origin===`string`?`lang`:`groot`;return r?`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin),i=e.origin===`date`?`vroeg`:e.origin===`string`?`kort`:`klein`;return r?`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format===`includes`?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}};function Wu(){return{localeError:Uu()}}const Gu=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-postadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslett`,date:`ISO-dato`,time:`ISO-klokkeslett`,duration:`ISO-varighet`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spekter`,cidrv6:`IPv6-spekter`,base64:`base64-enkodet streng`,base64url:`base64url-enkodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`tall`,array:`liste`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldig input: forventet instanceof ${e.expected}, fikk ${i}`:`Ugyldig input: forventet ${t}, fikk ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${x(e.values[0])}`:`Ugyldig valg: forventet en av ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må inneholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}};function Ku(){return{localeError:Gu()}}const qu=()=>{let e={string:{unit:`harf`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`unsur`,verb:`olmalıdır`},set:{unit:`unsur`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n={regex:`giren`,email:`epostagâh`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO hengâmı`,date:`ISO tarihi`,time:`ISO zamanı`,duration:`ISO müddeti`,ipv4:`IPv4 nişânı`,ipv6:`IPv6 nişânı`,cidrv4:`IPv4 menzili`,cidrv6:`IPv6 menzili`,base64:`base64-şifreli metin`,base64url:`base64url-şifreli metin`,json_string:`JSON metin`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`giren`},r={nan:`NaN`,number:`numara`,array:`saf`,null:`gayb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Fâsit giren: umulan instanceof ${e.expected}, alınan ${i}`:`Fâsit giren: umulan ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${x(e.values[0])}`:`Fâsit tercih: mûteberler ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format===`includes`?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${n[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}};function Ju(){return{localeError:qu()}}const Yu=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n={regex:`ورودي`,email:`بریښنالیک`,url:`یو آر ال`,emoji:`ایموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`نیټه او وخت`,date:`نېټه`,time:`وخت`,duration:`موده`,ipv4:`د IPv4 پته`,ipv6:`د IPv6 پته`,cidrv4:`د IPv4 ساحه`,cidrv6:`د IPv6 ساحه`,base64:`base64-encoded متن`,base64url:`base64url-encoded متن`,json_string:`JSON متن`,e164:`د E.164 شمېره`,jwt:`JWT`,template_literal:`ورودي`},r={nan:`NaN`,number:`عدد`,array:`ارې`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ناسم ورودي: باید instanceof ${e.expected} وای, مګر ${i} ترلاسه شو`:`ناسم ورودي: باید ${t} وای, مګر ${i} ترلاسه شو`}case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${x(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${C(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید "${t.includes}" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${n[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}};function Xu(){return{localeError:Yu()}}const Zu=()=>{let e={string:{unit:`znaków`,verb:`mieć`},file:{unit:`bajtów`,verb:`mieć`},array:{unit:`elementów`,verb:`mieć`},set:{unit:`elementów`,verb:`mieć`}};function t(t){return e[t]??null}let n={regex:`wyrażenie`,email:`adres email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i godzina w formacie ISO`,date:`data w formacie ISO`,time:`godzina w formacie ISO`,duration:`czas trwania ISO`,ipv4:`adres IPv4`,ipv6:`adres IPv6`,cidrv4:`zakres IPv4`,cidrv6:`zakres IPv6`,base64:`ciąg znaków zakodowany w formacie base64`,base64url:`ciąg znaków zakodowany w formacie base64url`,json_string:`ciąg znaków w formacie JSON`,e164:`liczba E.164`,jwt:`JWT`,template_literal:`wejście`},r={nan:`NaN`,number:`liczba`,array:`tablica`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${e.expected}, otrzymano ${i}`:`Nieprawidłowe dane wejściowe: oczekiwano ${t}, otrzymano ${i}`}case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${x(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}};function Qu(){return{localeError:Zu()}}const $u=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let n={regex:`padrão`,email:`endereço de e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`duração ISO`,ipv4:`endereço IPv4`,ipv6:`endereço IPv6`,cidrv4:`faixa de IPv4`,cidrv6:`faixa de IPv6`,base64:`texto codificado em base64`,base64url:`URL codificada em base64`,json_string:`texto JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`,number:`número`,null:`nulo`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipo inválido: esperado instanceof ${e.expected}, recebido ${i}`:`Tipo inválido: esperado ${t}, recebido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${x(e.values[0])}`:`Opção inválida: esperada uma das ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar com "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${n[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}};function ed(){return{localeError:$u()}}function td(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const nd=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,jwt:`JWT`,template_literal:`ввод`},r={nan:`NaN`,number:`число`,array:`массив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неверный ввод: ожидалось instanceof ${e.expected}, получено ${i}`:`Неверный ввод: ожидалось ${t}, получено ${i}`}case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${x(e.values[0])}`:`Неверный вариант: ожидалось одно из ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=td(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=td(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}};function rd(){return{localeError:nd()}}const id=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n={regex:`vnos`,email:`e-poštni naslov`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum in čas`,date:`ISO datum`,time:`ISO čas`,duration:`ISO trajanje`,ipv4:`IPv4 naslov`,ipv6:`IPv6 naslov`,cidrv4:`obseg IPv4`,cidrv6:`obseg IPv6`,base64:`base64 kodiran niz`,base64url:`base64url kodiran niz`,json_string:`JSON niz`,e164:`E.164 številka`,jwt:`JWT`,template_literal:`vnos`},r={nan:`NaN`,number:`število`,array:`tabela`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neveljaven vnos: pričakovano instanceof ${e.expected}, prejeto ${i}`:`Neveljaven vnos: pričakovano ${t}, prejeto ${i}`}case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${x(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format===`includes`?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}};function ad(){return{localeError:id()}}const od=()=>{let e={string:{unit:`tecken`,verb:`att ha`},file:{unit:`bytes`,verb:`att ha`},array:{unit:`objekt`,verb:`att innehålla`},set:{unit:`objekt`,verb:`att innehålla`}};function t(t){return e[t]??null}let n={regex:`reguljärt uttryck`,email:`e-postadress`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datum och tid`,date:`ISO-datum`,time:`ISO-tid`,duration:`ISO-varaktighet`,ipv4:`IPv4-intervall`,ipv6:`IPv6-intervall`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodad sträng`,base64url:`base64url-kodad sträng`,json_string:`JSON-sträng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`mall-literal`},r={nan:`NaN`,number:`antal`,array:`lista`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ogiltig inmatning: förväntat instanceof ${e.expected}, fick ${i}`:`Ogiltig inmatning: förväntat ${t}, fick ${i}`}case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${x(e.values[0])}`:`Ogiltigt val: förväntade en av ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format===`includes`?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}};function sd(){return{localeError:od()}}const cd=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n={regex:`உள்ளீடு`,email:`மின்னஞ்சல் முகவரி`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO தேதி நேரம்`,date:`ISO தேதி`,time:`ISO நேரம்`,duration:`ISO கால அளவு`,ipv4:`IPv4 முகவரி`,ipv6:`IPv6 முகவரி`,cidrv4:`IPv4 வரம்பு`,cidrv6:`IPv6 வரம்பு`,base64:`base64-encoded சரம்`,base64url:`base64url-encoded சரம்`,json_string:`JSON சரம்`,e164:`E.164 எண்`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`எண்`,array:`அணி`,null:`வெறுமை`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${e.expected}, பெறப்பட்டது ${i}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t}, பெறப்பட்டது ${i}`}case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${x(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${C(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${n[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}};function ld(){return{localeError:cd()}}const ud=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n={regex:`ข้อมูลที่ป้อน`,email:`ที่อยู่อีเมล`,url:`URL`,emoji:`อิโมจิ`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`วันที่เวลาแบบ ISO`,date:`วันที่แบบ ISO`,time:`เวลาแบบ ISO`,duration:`ช่วงเวลาแบบ ISO`,ipv4:`ที่อยู่ IPv4`,ipv6:`ที่อยู่ IPv6`,cidrv4:`ช่วง IP แบบ IPv4`,cidrv6:`ช่วง IP แบบ IPv6`,base64:`ข้อความแบบ Base64`,base64url:`ข้อความแบบ Base64 สำหรับ URL`,json_string:`ข้อความแบบ JSON`,e164:`เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`,jwt:`โทเคน JWT`,template_literal:`ข้อมูลที่ป้อน`},r={nan:`NaN`,number:`ตัวเลข`,array:`อาร์เรย์ (Array)`,null:`ไม่มีค่า (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${e.expected} แต่ได้รับ ${i}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t} แต่ได้รับ ${i}`}case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${x(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${n[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${C(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}};function dd(){return{localeError:ud()}}const fd=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let n={regex:`girdi`,email:`e-posta adresi`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO tarih ve saat`,date:`ISO tarih`,time:`ISO saat`,duration:`ISO süre`,ipv4:`IPv4 adresi`,ipv6:`IPv6 adresi`,cidrv4:`IPv4 aralığı`,cidrv6:`IPv6 aralığı`,base64:`base64 ile şifrelenmiş metin`,base64url:`base64url ile şifrelenmiş metin`,json_string:`JSON dizesi`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`Şablon dizesi`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Geçersiz değer: beklenen instanceof ${e.expected}, alınan ${i}`:`Geçersiz değer: beklenen ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${x(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format===`includes`?`Geçersiz metin: "${t.includes}" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}};function pd(){return{localeError:fd()}}const md=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n={regex:`вхідні дані`,email:`адреса електронної пошти`,url:`URL`,emoji:`емодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`дата та час ISO`,date:`дата ISO`,time:`час ISO`,duration:`тривалість ISO`,ipv4:`адреса IPv4`,ipv6:`адреса IPv6`,cidrv4:`діапазон IPv4`,cidrv6:`діапазон IPv6`,base64:`рядок у кодуванні base64`,base64url:`рядок у кодуванні base64url`,json_string:`рядок JSON`,e164:`номер E.164`,jwt:`JWT`,template_literal:`вхідні дані`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неправильні вхідні дані: очікується instanceof ${e.expected}, отримано ${i}`:`Неправильні вхідні дані: очікується ${t}, отримано ${i}`}case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${x(e.values[0])}`:`Неправильна опція: очікується одне з ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format===`includes`?`Неправильний рядок: повинен містити "${t.includes}"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}};function hd(){return{localeError:md()}}function gd(){return hd()}const _d=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n={regex:`ان پٹ`,email:`ای میل ایڈریس`,url:`یو آر ایل`,emoji:`ایموجی`,uuid:`یو یو آئی ڈی`,uuidv4:`یو یو آئی ڈی وی 4`,uuidv6:`یو یو آئی ڈی وی 6`,nanoid:`نینو آئی ڈی`,guid:`جی یو آئی ڈی`,cuid:`سی یو آئی ڈی`,cuid2:`سی یو آئی ڈی 2`,ulid:`یو ایل آئی ڈی`,xid:`ایکس آئی ڈی`,ksuid:`کے ایس یو آئی ڈی`,datetime:`آئی ایس او ڈیٹ ٹائم`,date:`آئی ایس او تاریخ`,time:`آئی ایس او وقت`,duration:`آئی ایس او مدت`,ipv4:`آئی پی وی 4 ایڈریس`,ipv6:`آئی پی وی 6 ایڈریس`,cidrv4:`آئی پی وی 4 رینج`,cidrv6:`آئی پی وی 6 رینج`,base64:`بیس 64 ان کوڈڈ سٹرنگ`,base64url:`بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`,json_string:`جے ایس او این سٹرنگ`,e164:`ای 164 نمبر`,jwt:`جے ڈبلیو ٹی`,template_literal:`ان پٹ`},r={nan:`NaN`,number:`نمبر`,array:`آرے`,null:`نل`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`غلط ان پٹ: instanceof ${e.expected} متوقع تھا، ${i} موصول ہوا`:`غلط ان پٹ: ${t} متوقع تھا، ${i} موصول ہوا`}case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${x(e.values[0])} متوقع تھا`:`غلط آپشن: ${C(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${n[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${C(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}};function vd(){return{localeError:_d()}}const yd=()=>{let e={string:{unit:`belgi`,verb:`bo‘lishi kerak`},file:{unit:`bayt`,verb:`bo‘lishi kerak`},array:{unit:`element`,verb:`bo‘lishi kerak`},set:{unit:`element`,verb:`bo‘lishi kerak`}};function t(t){return e[t]??null}let n={regex:`kirish`,email:`elektron pochta manzili`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO sana va vaqti`,date:`ISO sana`,time:`ISO vaqt`,duration:`ISO davomiylik`,ipv4:`IPv4 manzil`,ipv6:`IPv6 manzil`,mac:`MAC manzil`,cidrv4:`IPv4 diapazon`,cidrv6:`IPv6 diapazon`,base64:`base64 kodlangan satr`,base64url:`base64url kodlangan satr`,json_string:`JSON satr`,e164:`E.164 raqam`,jwt:`JWT`,template_literal:`kirish`},r={nan:`NaN`,number:`raqam`,array:`massiv`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${e.expected}, qabul qilingan ${i}`:`Noto‘g‘ri kirish: kutilgan ${t}, qabul qilingan ${i}`}case`invalid_value`:return e.values.length===1?`Noto‘g‘ri kirish: kutilgan ${x(e.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()} ${r.unit} ${r.verb}`:`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Noto‘g‘ri satr: "${t.prefix}" bilan boshlanishi kerak`:t.format===`ends_with`?`Noto‘g‘ri satr: "${t.suffix}" bilan tugashi kerak`:t.format===`includes`?`Noto‘g‘ri satr: "${t.includes}" ni o‘z ichiga olishi kerak`:t.format===`regex`?`Noto‘g‘ri satr: ${t.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${n[t.format]??e.format}`}case`not_multiple_of`:return`Noto‘g‘ri raqam: ${e.divisor} ning karralisi bo‘lishi kerak`;case`unrecognized_keys`:return`Noma’lum kalit${e.keys.length>1?`lar`:``}: ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} dagi kalit noto‘g‘ri`;case`invalid_union`:return`Noto‘g‘ri kirish`;case`invalid_element`:return`${e.origin} da noto‘g‘ri qiymat`;default:return`Noto‘g‘ri kirish`}}};function bd(){return{localeError:yd()}}const xd=()=>{let e={string:{unit:`ký tự`,verb:`có`},file:{unit:`byte`,verb:`có`},array:{unit:`phần tử`,verb:`có`},set:{unit:`phần tử`,verb:`có`}};function t(t){return e[t]??null}let n={regex:`đầu vào`,email:`địa chỉ email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ngày giờ ISO`,date:`ngày ISO`,time:`giờ ISO`,duration:`khoảng thời gian ISO`,ipv4:`địa chỉ IPv4`,ipv6:`địa chỉ IPv6`,cidrv4:`dải IPv4`,cidrv6:`dải IPv6`,base64:`chuỗi mã hóa base64`,base64url:`chuỗi mã hóa base64url`,json_string:`chuỗi JSON`,e164:`số E.164`,jwt:`JWT`,template_literal:`đầu vào`},r={nan:`NaN`,number:`số`,array:`mảng`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${e.expected}, nhận được ${i}`:`Đầu vào không hợp lệ: mong đợi ${t}, nhận được ${i}`}case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${x(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${n[t.format]??e.format} không hợp lệ`}case`not_multiple_of`:return`Số không hợp lệ: phải là bội số của ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${C(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.origin}`;case`invalid_union`:return`Đầu vào không hợp lệ`;case`invalid_element`:return`Giá trị không hợp lệ trong ${e.origin}`;default:return`Đầu vào không hợp lệ`}}};function Sd(){return{localeError:xd()}}const Cd=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n={regex:`输入`,email:`电子邮件`,url:`URL`,emoji:`表情符号`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日期时间`,date:`ISO日期`,time:`ISO时间`,duration:`ISO时长`,ipv4:`IPv4地址`,ipv6:`IPv6地址`,cidrv4:`IPv4网段`,cidrv6:`IPv6网段`,base64:`base64编码字符串`,base64url:`base64url编码字符串`,json_string:`JSON字符串`,e164:`E.164号码`,jwt:`JWT`,template_literal:`输入`},r={nan:`NaN`,number:`数字`,array:`数组`,null:`空值(null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`无效输入:期望 instanceof ${e.expected},实际接收 ${i}`:`无效输入:期望 ${t},实际接收 ${i}`}case`invalid_value`:return e.values.length===1?`无效输入:期望 ${x(e.values[0])}`:`无效选项:期望以下之一 ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 "${t.prefix}" 开头`:t.format===`ends_with`?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format===`includes`?`无效字符串:必须包含 "${t.includes}"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${n[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${C(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}};function wd(){return{localeError:Cd()}}const Td=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n={regex:`輸入`,email:`郵件地址`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 日期時間`,date:`ISO 日期`,time:`ISO 時間`,duration:`ISO 期間`,ipv4:`IPv4 位址`,ipv6:`IPv6 位址`,cidrv4:`IPv4 範圍`,cidrv6:`IPv6 範圍`,base64:`base64 編碼字串`,base64url:`base64url 編碼字串`,json_string:`JSON 字串`,e164:`E.164 數值`,jwt:`JWT`,template_literal:`輸入`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無效的輸入值:預期為 instanceof ${e.expected},但收到 ${i}`:`無效的輸入值:預期為 ${t},但收到 ${i}`}case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${x(e.values[0])}`:`無效的選項:預期為以下其中之一 ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format===`ends_with`?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format===`includes`?`無效的字串:必須包含 "${t.includes}"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${n[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${C(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}};function Ed(){return{localeError:Td()}}const Dd=()=>{let e={string:{unit:`àmi`,verb:`ní`},file:{unit:`bytes`,verb:`ní`},array:{unit:`nkan`,verb:`ní`},set:{unit:`nkan`,verb:`ní`}};function t(t){return e[t]??null}let n={regex:`ẹ̀rọ ìbáwọlé`,email:`àdírẹ́sì ìmẹ́lì`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`àkókò ISO`,date:`ọjọ́ ISO`,time:`àkókò ISO`,duration:`àkókò tó pé ISO`,ipv4:`àdírẹ́sì IPv4`,ipv6:`àdírẹ́sì IPv6`,cidrv4:`àgbègbè IPv4`,cidrv6:`àgbègbè IPv6`,base64:`ọ̀rọ̀ tí a kọ́ ní base64`,base64url:`ọ̀rọ̀ base64url`,json_string:`ọ̀rọ̀ JSON`,e164:`nọ́mbà E.164`,jwt:`JWT`,template_literal:`ẹ̀rọ ìbáwọlé`},r={nan:`NaN`,number:`nọ́mbà`,array:`akopọ`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=S(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${e.expected}, àmọ̀ a rí ${i}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${t}, àmọ̀ a rí ${i}`}case`invalid_value`:return e.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${x(e.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${C(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin??`iye`} ${r.verb} ${n}${e.maximum} ${r.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}`:`Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"`:t.format===`ends_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"`:t.format===`includes`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"`:t.format===`regex`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}`:`Aṣìṣe: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`;case`unrecognized_keys`:return`Bọtìnì àìmọ̀: ${C(e.keys,`, `)}`;case`invalid_key`:return`Bọtìnì aṣìṣe nínú ${e.origin}`;case`invalid_union`:return`Ìbáwọlé aṣìṣe`;case`invalid_element`:return`Iye aṣìṣe nínú ${e.origin}`;default:return`Ìbáwọlé aṣìṣe`}}};function Od(){return{localeError:Dd()}}var kd=r({ar:()=>Il,az:()=>Rl,be:()=>Vl,bg:()=>Ul,ca:()=>Gl,cs:()=>ql,da:()=>Yl,de:()=>Zl,en:()=>$l,eo:()=>tu,es:()=>ru,fa:()=>au,fi:()=>su,fr:()=>lu,frCA:()=>du,he:()=>pu,hu:()=>hu,hy:()=>yu,id:()=>xu,is:()=>Cu,it:()=>Tu,ja:()=>Du,ka:()=>ku,kh:()=>Mu,km:()=>ju,ko:()=>Pu,lt:()=>Ru,mk:()=>Bu,ms:()=>Hu,nl:()=>Wu,no:()=>Ku,ota:()=>Ju,pl:()=>Qu,ps:()=>Xu,pt:()=>ed,ru:()=>rd,sl:()=>ad,sv:()=>sd,ta:()=>ld,th:()=>dd,tr:()=>pd,ua:()=>gd,uk:()=>hd,ur:()=>vd,uz:()=>bd,vi:()=>Sd,yo:()=>Od,zhCN:()=>wd,zhTW:()=>Ed}),Ad=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??`draft-2020-12`;t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),this.ctx=ao({processors:be,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return re(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),Ae(this.ctx,e);let{"~standard":n,...r}=_n(this.ctx,e);return r}},jd=r({}),Md=r({$ZodAny:()=>_r,$ZodArray:()=>Pr,$ZodAsyncError:()=>Qs,$ZodBase64:()=>rt,$ZodBase64URL:()=>Lt,$ZodBigInt:()=>cs,$ZodBigIntFormat:()=>Ot,$ZodBoolean:()=>Xr,$ZodCIDRv4:()=>Hr,$ZodCIDRv6:()=>ai,$ZodCUID:()=>Fn,$ZodCUID2:()=>v,$ZodCatch:()=>ua,$ZodCheck:()=>Yo,$ZodCheckBigIntFormat:()=>So,$ZodCheckEndsWith:()=>ja,$ZodCheckGreaterThan:()=>Sa,$ZodCheckIncludes:()=>di,$ZodCheckLengthEquals:()=>Xs,$ZodCheckLessThan:()=>wc,$ZodCheckLowerCase:()=>ki,$ZodCheckMaxLength:()=>hc,$ZodCheckMaxSize:()=>Xn,$ZodCheckMimeType:()=>ye,$ZodCheckMinLength:()=>oc,$ZodCheckMinSize:()=>or,$ZodCheckMultipleOf:()=>Re,$ZodCheckNumberFormat:()=>ke,$ZodCheckOverwrite:()=>gn,$ZodCheckProperty:()=>io,$ZodCheckRegex:()=>ne,$ZodCheckSizeEquals:()=>Ya,$ZodCheckStartsWith:()=>Qt,$ZodCheckStringFormat:()=>cn,$ZodCheckUpperCase:()=>wn,$ZodCodec:()=>Rs,$ZodCustom:()=>Io,$ZodCustomStringFormat:()=>bs,$ZodDate:()=>Ga,$ZodDefault:()=>Ei,$ZodDiscriminatedUnion:()=>Go,$ZodE164:()=>ks,$ZodEmail:()=>Gi,$ZodEmoji:()=>yo,$ZodEncodeError:()=>Ec,$ZodEnum:()=>qs,$ZodError:()=>Vo,$ZodExactOptional:()=>ta,$ZodFile:()=>va,$ZodFunction:()=>ts,$ZodGUID:()=>Do,$ZodIPv4:()=>Ia,$ZodIPv6:()=>Da,$ZodISODate:()=>_i,$ZodISODateTime:()=>nc,$ZodISODuration:()=>Ac,$ZodISOTime:()=>Fi,$ZodIntersection:()=>xc,$ZodJWT:()=>nr,$ZodKSUID:()=>Te,$ZodLazy:()=>fc,$ZodLiteral:()=>dr,$ZodMAC:()=>Ue,$ZodMap:()=>Pe,$ZodNaN:()=>xn,$ZodNanoID:()=>lo,$ZodNever:()=>se,$ZodNonOptional:()=>eo,$ZodNull:()=>rn,$ZodNullable:()=>pn,$ZodNumber:()=>kn,$ZodNumberFormat:()=>Ze,$ZodObject:()=>St,$ZodObjectJIT:()=>Jt,$ZodOptional:()=>Kn,$ZodPipe:()=>zc,$ZodPrefault:()=>he,$ZodPromise:()=>Or,$ZodReadonly:()=>pt,$ZodRealError:()=>Ts,$ZodRecord:()=>yr,$ZodRegistry:()=>Wn,$ZodSet:()=>Ir,$ZodString:()=>at,$ZodStringFormat:()=>zt,$ZodSuccess:()=>us,$ZodSymbol:()=>At,$ZodTemplateLiteral:()=>Qr,$ZodTransform:()=>Wr,$ZodTuple:()=>si,$ZodType:()=>Ln,$ZodULID:()=>b,$ZodURL:()=>ia,$ZodUUID:()=>Ms,$ZodUndefined:()=>Ao,$ZodUnion:()=>ms,$ZodUnknown:()=>za,$ZodVoid:()=>bi,$ZodXID:()=>zo,$ZodXor:()=>Cs,$brand:()=>ji,$constructor:()=>_c,$input:()=>Lc,$output:()=>pe,Doc:()=>fa,JSONSchema:()=>jd,JSONSchemaGenerator:()=>Ad,NEVER:()=>Qn,TimePrecision:()=>Xa,_any:()=>$t,_array:()=>ln,_base64:()=>Tn,_base64url:()=>qe,_bigint:()=>vt,_boolean:()=>Wt,_catch:()=>Hn,_check:()=>Fc,_cidrv4:()=>de,_cidrv6:()=>wr,_coercedBigint:()=>lt,_coercedBoolean:()=>hr,_coercedDate:()=>Mr,_coercedNumber:()=>tt,_coercedString:()=>Ft,_cuid:()=>os,_cuid2:()=>Et,_custom:()=>Jr,_date:()=>Br,_decode:()=>_t,_decodeAsync:()=>Ut,_default:()=>ri,_discriminatedUnion:()=>Nn,_e164:()=>g,_email:()=>ra,_emoji:()=>js,_encode:()=>Vn,_encodeAsync:()=>Pc,_endsWith:()=>ko,_enum:()=>ps,_file:()=>Ra,_float32:()=>yi,_float64:()=>Ro,_gt:()=>Ss,_gte:()=>Ri,_guid:()=>fo,_includes:()=>Bs,_int:()=>Ji,_int32:()=>da,_int64:()=>Jo,_intersection:()=>xo,_ipv4:()=>Aa,_ipv6:()=>xa,_isoDate:()=>ui,_isoDateTime:()=>Ys,_isoDuration:()=>Cc,_isoTime:()=>Oi,_jwt:()=>mc,_ksuid:()=>Yn,_lazy:()=>ve,_length:()=>ac,_literal:()=>ar,_lowercase:()=>Le,_lt:()=>Oe,_lte:()=>hn,_mac:()=>ro,_map:()=>te,_max:()=>hn,_maxLength:()=>Ja,_maxSize:()=>Zt,_mime:()=>sn,_min:()=>Ri,_minLength:()=>Cn,_minSize:()=>Ge,_multipleOf:()=>gt,_nan:()=>Ht,_nanoid:()=>Bn,_nativeEnum:()=>Nc,_negative:()=>le,_never:()=>Sr,_nonnegative:()=>st,_nonoptional:()=>pr,_nonpositive:()=>Ar,_normalize:()=>$e,_null:()=>Nt,_nullable:()=>is,_number:()=>wt,_optional:()=>Kr,_overwrite:()=>Rr,_parse:()=>ue,_parseAsync:()=>Cr,_pipe:()=>ti,_positive:()=>jn,_promise:()=>m,_property:()=>ca,_readonly:()=>Is,_record:()=>Po,_refine:()=>vs,_regex:()=>Ua,_safeDecode:()=>ct,_safeDecodeAsync:()=>mr,_safeEncode:()=>jr,_safeEncodeAsync:()=>et,_safeParse:()=>Pt,_safeParseAsync:()=>as,_set:()=>wi,_size:()=>Uo,_slugify:()=>Ds,_startsWith:()=>Ui,_string:()=>_o,_stringFormat:()=>Gs,_stringbool:()=>$i,_success:()=>ga,_superRefine:()=>$o,_symbol:()=>To,_templateLiteral:()=>Pa,_toLowerCase:()=>Ta,_toUpperCase:()=>hi,_transform:()=>ec,_trim:()=>Oc,_tuple:()=>Ni,_uint32:()=>yc,_uint64:()=>er,_ulid:()=>Ce,_undefined:()=>uc,_union:()=>lr,_unknown:()=>Ve,_uppercase:()=>Me,_url:()=>yn,_uuid:()=>so,_uuidv4:()=>ae,_uuidv6:()=>Qa,_uuidv7:()=>tn,_void:()=>dn,_xid:()=>Dn,_xor:()=>Ye,clone:()=>Zo,config:()=>xe,createStandardJSONSchemaMethod:()=>sr,createToJSONSchemaMethod:()=>ze,decode:()=>Tt,decodeAsync:()=>qr,describe:()=>bt,encode:()=>zr,encodeAsync:()=>ni,extractDefs:()=>Ae,finalize:()=>_n,flattenError:()=>Vi,formatError:()=>ho,globalConfig:()=>cc,globalRegistry:()=>Er,initializeContext:()=>ao,isValidBase64:()=>zi,isValidBase64URL:()=>po,isValidJWT:()=>Vs,locales:()=>kd,meta:()=>Kt,parse:()=>Mn,parseAsync:()=>h,prettifyError:()=>Us,process:()=>re,regexes:()=>Ke,registry:()=>dt,safeDecode:()=>oa,safeDecodeAsync:()=>Ps,safeEncode:()=>Mo,safeEncodeAsync:()=>gs,safeParse:()=>Va,safeParseAsync:()=>Si,toDotPath:()=>Zi,toJSONSchema:()=>sc,treeifyError:()=>ma,util:()=>pi,version:()=>Yi}),Nd=r({endsWith:()=>ko,gt:()=>Ss,gte:()=>Ri,includes:()=>Bs,length:()=>ac,lowercase:()=>Le,lt:()=>Oe,lte:()=>hn,maxLength:()=>Ja,maxSize:()=>Zt,mime:()=>sn,minLength:()=>Cn,minSize:()=>Ge,multipleOf:()=>gt,negative:()=>le,nonnegative:()=>st,nonpositive:()=>Ar,normalize:()=>$e,overwrite:()=>Rr,positive:()=>jn,property:()=>ca,regex:()=>Ua,size:()=>Uo,slugify:()=>Ds,startsWith:()=>Ui,toLowerCase:()=>Ta,toUpperCase:()=>hi,trim:()=>Oc,uppercase:()=>Me});const Pd={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};function Fd(e){xe({customError:e})}function Id(){return xe().customError}var Ld;Ld||={};const w={...On,...Nd,iso:Zn},Rd=new Set(`$schema.$ref.$defs.definitions.$id.id.$comment.$anchor.$vocabulary.$dynamicRef.$dynamicAnchor.type.enum.const.anyOf.oneOf.allOf.not.properties.required.additionalProperties.patternProperties.propertyNames.minProperties.maxProperties.items.prefixItems.additionalItems.minItems.maxItems.uniqueItems.contains.minContains.maxContains.minLength.maxLength.pattern.format.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.description.default.contentEncoding.contentMediaType.contentSchema.unevaluatedItems.unevaluatedProperties.if.then.else.dependentSchemas.dependentRequired.nullable.readOnly`.split(`.`));function zd(e,t){let n=e.$schema;return n===`https://json-schema.org/draft/2020-12/schema`?`draft-2020-12`:n===`http://json-schema.org/draft-07/schema#`?`draft-7`:n===`http://json-schema.org/draft-04/schema#`?`draft-4`:t??`draft-2020-12`}function Bd(e,t){if(!e.startsWith(`#`))throw Error(`External $ref is not supported, only local refs (#/...) are allowed`);let n=e.slice(1).split(`/`).filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version===`draft-2020-12`?`$defs`:`definitions`;if(n[0]===r){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function Vd(e,t){if(e.not!==void 0){if(typeof e.not==`object`&&Object.keys(e.not).length===0)return w.never();throw Error(`not is not supported in Zod (except { not: {} } for never)`)}if(e.unevaluatedItems!==void 0)throw Error(`unevaluatedItems is not supported`);if(e.unevaluatedProperties!==void 0)throw Error(`unevaluatedProperties is not supported`);if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error(`Conditional schemas (if/then/else) are not supported`);if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error(`dependentSchemas and dependentRequired are not supported`);if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return w.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let r=Hd(Bd(n,t),t);return t.refs.set(n,r),t.processing.delete(n),r}if(e.enum!==void 0){let n=e.enum;if(t.version===`openapi-3.0`&&e.nullable===!0&&n.length===1&&n[0]===null)return w.null();if(n.length===0)return w.never();if(n.length===1)return w.literal(n[0]);if(n.every(e=>typeof e==`string`))return w.enum(n);let r=n.map(e=>w.literal(e));return r.length<2?r[0]:w.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return w.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(n=>Vd({...e,type:n},t));return r.length===0?w.never():r.length===1?r[0]:w.union(r)}if(!n)return w.any();let r;switch(n){case`string`:{let t=w.string();if(e.format){let n=e.format;n===`email`?t=t.check(w.email()):n===`uri`||n===`uri-reference`?t=t.check(w.url()):n===`uuid`||n===`guid`?t=t.check(w.uuid()):n===`date-time`?t=t.check(w.iso.datetime()):n===`date`?t=t.check(w.iso.date()):n===`time`?t=t.check(w.iso.time()):n===`duration`?t=t.check(w.iso.duration()):n===`ipv4`?t=t.check(w.ipv4()):n===`ipv6`?t=t.check(w.ipv6()):n===`mac`?t=t.check(w.mac()):n===`cidr`?t=t.check(w.cidrv4()):n===`cidr-v6`?t=t.check(w.cidrv6()):n===`base64`?t=t.check(w.base64()):n===`base64url`?t=t.check(w.base64url()):n===`e164`?t=t.check(w.e164()):n===`jwt`?t=t.check(w.jwt()):n===`emoji`?t=t.check(w.emoji()):n===`nanoid`?t=t.check(w.nanoid()):n===`cuid`?t=t.check(w.cuid()):n===`cuid2`?t=t.check(w.cuid2()):n===`ulid`?t=t.check(w.ulid()):n===`xid`?t=t.check(w.xid()):n===`ksuid`&&(t=t.check(w.ksuid()))}typeof e.minLength==`number`&&(t=t.min(e.minLength)),typeof e.maxLength==`number`&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case`number`:case`integer`:{let t=n===`integer`?w.number().int():w.number();typeof e.minimum==`number`&&(t=t.min(e.minimum)),typeof e.maximum==`number`&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum==`number`?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum==`number`&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum==`number`?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum==`number`&&(t=t.lt(e.maximum)),typeof e.multipleOf==`number`&&(t=t.multipleOf(e.multipleOf)),r=t;break}case`boolean`:r=w.boolean();break;case`null`:r=w.null();break;case`object`:{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[e,r]of Object.entries(i)){let i=Hd(r,t);n[e]=a.has(e)?i:i.optional()}if(e.propertyNames){let i=Hd(e.propertyNames,t),a=e.additionalProperties&&typeof e.additionalProperties==`object`?Hd(e.additionalProperties,t):w.any();if(Object.keys(n).length===0){r=w.record(i,a);break}let o=w.object(n).passthrough(),s=w.looseRecord(i,a);r=w.intersection(o,s);break}if(e.patternProperties){let i=e.patternProperties,a=Object.keys(i),o=[];for(let e of a){let n=Hd(i[e],t),r=w.string().regex(new RegExp(e));o.push(w.looseRecord(r,n))}let s=[];if(Object.keys(n).length>0&&s.push(w.object(n).passthrough()),s.push(...o),s.length===0)r=w.object({}).passthrough();else if(s.length===1)r=s[0];else{let e=w.intersection(s[0],s[1]);for(let t=2;t<s.length;t++)e=w.intersection(e,s[t]);r=e}break}let o=w.object(n);r=e.additionalProperties===!1?o.strict():typeof e.additionalProperties==`object`?o.catchall(Hd(e.additionalProperties,t)):o.passthrough();break}case`array`:{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(e=>Hd(e,t)),o=i&&typeof i==`object`&&!Array.isArray(i)?Hd(i,t):void 0;r=o?w.tuple(a).rest(o):w.tuple(a),typeof e.minItems==`number`&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(w.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=i.map(e=>Hd(e,t)),a=e.additionalItems&&typeof e.additionalItems==`object`?Hd(e.additionalItems,t):void 0;r=a?w.tuple(n).rest(a):w.tuple(n),typeof e.minItems==`number`&&(r=r.check(w.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(w.maxLength(e.maxItems)))}else if(i!==void 0){let n=Hd(i,t),a=w.array(n);typeof e.minItems==`number`&&(a=a.min(e.minItems)),typeof e.maxItems==`number`&&(a=a.max(e.maxItems)),r=a}else r=w.array(w.any());break}default:throw Error(`Unsupported type: ${n}`)}return e.description&&(r=r.describe(e.description)),e.default!==void 0&&(r=r.default(e.default)),r}function Hd(e,t){if(typeof e==`boolean`)return e?w.any():w.never();let n=Vd(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>Hd(e,t)),a=w.union(i);n=r?w.intersection(n,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>Hd(e,t)),a=w.xor(i);n=r?w.intersection(n,a):a}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:w.any();else{let i=r?n:Hd(e.allOf[0],t),a=+!r;for(let n=a;n<e.allOf.length;n++)i=w.intersection(i,Hd(e.allOf[n],t));n=i}e.nullable===!0&&t.version===`openapi-3.0`&&(n=w.nullable(n)),e.readOnly===!0&&(n=w.readonly(n));let i={};for(let t of[`$id`,`id`,`$comment`,`$anchor`,`$vocabulary`,`$dynamicRef`,`$dynamicAnchor`])t in e&&(i[t]=e[t]);for(let t of[`contentEncoding`,`contentMediaType`,`contentSchema`])t in e&&(i[t]=e[t]);for(let t of Object.keys(e))Rd.has(t)||(i[t]=e[t]);return Object.keys(i).length>0&&t.registry.add(n,i),n}function Ud(e,t){return typeof e==`boolean`?e?w.any():w.never():Hd(e,{version:zd(e,t?.defaultTarget),defs:e.$defs||e.definitions||{},refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??Er})}var Wd=r({$brand:()=>ji,$input:()=>Lc,$output:()=>pe,NEVER:()=>Qn,TimePrecision:()=>Xa,ZodAny:()=>Lo,ZodArray:()=>xs,ZodBase64:()=>Ka,ZodBase64URL:()=>Di,ZodBigInt:()=>Ko,ZodBigIntFormat:()=>As,ZodBoolean:()=>Ki,ZodCIDRv4:()=>bo,ZodCIDRv6:()=>Js,ZodCUID:()=>na,ZodCUID2:()=>ya,ZodCatch:()=>ns,ZodCodec:()=>Oo,ZodCustom:()=>La,ZodCustomStringFormat:()=>Oa,ZodDate:()=>vi,ZodDefault:()=>rc,ZodDiscriminatedUnion:()=>jc,ZodE164:()=>Ii,ZodEmail:()=>Sc,ZodEmoji:()=>rr,ZodEnum:()=>Ee,ZodError:()=>Ca,ZodExactOptional:()=>pc,ZodFile:()=>fr,ZodFirstPartyTypeKind:()=>Ld,ZodFunction:()=>We,ZodGUID:()=>Fe,ZodIPv4:()=>Sn,ZodIPv6:()=>uo,ZodISODate:()=>Zs,ZodISODateTime:()=>Tc,ZodISODuration:()=>Ai,ZodISOTime:()=>gc,ZodIntersection:()=>ce,ZodIssueCode:()=>Pd,ZodJWT:()=>to,ZodKSUID:()=>an,ZodLazy:()=>mn,ZodLiteral:()=>An,ZodMAC:()=>Qe,ZodMap:()=>Ct,ZodNaN:()=>Yt,ZodNanoID:()=>qn,ZodNever:()=>Bc,ZodNonOptional:()=>ge,ZodNull:()=>kr,ZodNullable:()=>mt,ZodNumber:()=>br,ZodNumberFormat:()=>Lr,ZodObject:()=>ot,ZodOptional:()=>Bt,ZodPipe:()=>ds,ZodPrefault:()=>jt,ZodPromise:()=>$r,ZodReadonly:()=>Gr,ZodRealError:()=>fi,ZodRecord:()=>ci,ZodSet:()=>Rn,ZodString:()=>ee,ZodStringFormat:()=>sa,ZodSuccess:()=>Fs,ZodSymbol:()=>No,ZodTemplateLiteral:()=>_s,ZodTransform:()=>Ha,ZodTuple:()=>Ci,ZodType:()=>Ho,ZodULID:()=>Es,ZodURL:()=>Hi,ZodUUID:()=>go,ZodUndefined:()=>Ws,ZodUnion:()=>Qi,ZodUnknown:()=>ha,ZodVoid:()=>Qo,ZodXID:()=>wo,ZodXor:()=>Na,_ZodString:()=>wa,_default:()=>$s,_function:()=>Mi,any:()=>cr,array:()=>Be,base64:()=>je,base64url:()=>vn,bigint:()=>oo,boolean:()=>ie,catch:()=>mi,check:()=>Za,cidrv4:()=>en,cidrv6:()=>un,clone:()=>Zo,codec:()=>En,coerce:()=>p,config:()=>xe,core:()=>Md,cuid:()=>Je,cuid2:()=>yt,custom:()=>Gt,date:()=>Un,decode:()=>Ba,decodeAsync:()=>xi,describe:()=>Ic,discriminatedUnion:()=>fe,e164:()=>Tr,email:()=>ut,emoji:()=>gr,encode:()=>Bo,encodeAsync:()=>ws,endsWith:()=>ko,enum:()=>Dc,exactOptional:()=>Nr,file:()=>nt,flattenError:()=>Vi,float32:()=>It,float64:()=>ss,formatError:()=>ho,fromJSONSchema:()=>Ud,function:()=>Mi,getErrorMap:()=>Id,globalRegistry:()=>Er,gt:()=>Ss,gte:()=>Ri,guid:()=>Dt,hash:()=>Yr,hex:()=>Vr,hostname:()=>ii,httpUrl:()=>Pn,includes:()=>Bs,instanceof:()=>vc,int:()=>_,int32:()=>la,int64:()=>Ls,intersection:()=>Fo,ipv4:()=>ys,ipv6:()=>Wa,iso:()=>Zn,json:()=>Ti,jwt:()=>Wo,keyof:()=>Os,ksuid:()=>Wi,lazy:()=>vo,length:()=>ac,literal:()=>Ks,locales:()=>kd,looseObject:()=>ea,looseRecord:()=>_a,lowercase:()=>Le,lt:()=>Oe,lte:()=>hn,mac:()=>es,map:()=>Eo,maxLength:()=>Ja,maxSize:()=>Zt,meta:()=>Fa,mime:()=>sn,minLength:()=>Cn,minSize:()=>Ge,multipleOf:()=>gt,nan:()=>Ea,nanoid:()=>gi,nativeEnum:()=>tc,negative:()=>le,never:()=>kc,nonnegative:()=>st,nonoptional:()=>Pi,nonpositive:()=>Ar,normalize:()=>$e,null:()=>$n,nullable:()=>bc,nullish:()=>tr,number:()=>we,object:()=>dc,optional:()=>ur,overwrite:()=>Rr,parse:()=>Bi,parseAsync:()=>mo,partialRecord:()=>He,pipe:()=>Ne,positive:()=>jn,prefault:()=>bn,preprocess:()=>co,prettifyError:()=>Us,promise:()=>oe,property:()=>ca,readonly:()=>$a,record:()=>nn,refine:()=>fn,regex:()=>Ua,regexes:()=>Ke,registry:()=>dt,safeDecode:()=>Hs,safeDecodeAsync:()=>Xi,safeEncode:()=>pa,safeEncodeAsync:()=>Xo,safeParse:()=>Co,safeParseAsync:()=>Ma,set:()=>Xe,setErrorMap:()=>Fd,size:()=>Uo,slugify:()=>Ds,startsWith:()=>Ui,strictObject:()=>xt,string:()=>qt,stringFormat:()=>Gn,stringbool:()=>Rc,success:()=>me,superRefine:()=>Dr,symbol:()=>ft,templateLiteral:()=>vr,toJSONSchema:()=>sc,toLowerCase:()=>Ta,toUpperCase:()=>hi,transform:()=>Fr,treeifyError:()=>ma,trim:()=>Oc,tuple:()=>it,uint32:()=>Rt,uint64:()=>ls,ulid:()=>kt,undefined:()=>Se,union:()=>Zr,unknown:()=>Ur,uppercase:()=>Me,url:()=>oi,util:()=>pi,uuid:()=>In,uuidv4:()=>y,uuidv6:()=>aa,uuidv7:()=>Ns,void:()=>lc,xid:()=>jo,xor:()=>hs});xe($l());var Gd=Wd,Kd=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{SYMBOL_FOR_REQ_CONTEXT:()=>u,getContext:()=>d}),t.exports=c(l);let u=Symbol.for(`@vercel/request-context`);function d(){return globalThis[u]?.get?.()??{}}0&&(t.exports={SYMBOL_FOR_REQ_CONTEXT:u,getContext:d})})),qd=i(((e,t)=>{var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},c=(e,t,n,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(r({},`__esModule`,{value:!0}),e),u={};s(u,{getVercelOidcToken:()=>p,getVercelOidcTokenSync:()=>m}),t.exports=l(u);var d=Kd(),f=Zc();async function p(e){let t=``,r;try{t=m()}catch(e){r=e}try{let[{getTokenPayload:r,isExpired:i},{refreshToken:a}]=await Promise.all([await import(`../../_chunks/workflow/token-util-Ldar52H7.js`).then(e=>n(e.t())),await import(`../../_chunks/workflow/token-DHD-q-fS.js`).then(e=>n(e.default))]);(!t||i(r(t),e?.expirationBufferMs))&&(await a(e),t=m())}catch(e){let t=r instanceof Error?r.message:``;throw e instanceof Error&&(t=`${t}
|
|
2
|
+
${e.message}`),t?new f.VercelOidcTokenError(t):e}return t}function m(){let e=(0,d.getContext)().headers?.[`x-vercel-oidc-token`]??process.env.VERCEL_OIDC_TOKEN;if(!e)throw Error(`The 'x-vercel-oidc-token' header is missing from the request. Do you have the OIDC option enabled in the Vercel project settings?`);return e}0&&(t.exports={getVercelOidcToken:p,getVercelOidcTokenSync:m})})),Jd=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{AccessTokenMissingError:()=>f.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>f.RefreshAccessTokenFailedError,getContext:()=>d.getContext,getVercelOidcToken:()=>u.getVercelOidcToken,getVercelOidcTokenSync:()=>u.getVercelOidcTokenSync,getVercelToken:()=>p.getVercelToken}),t.exports=c(l);var u=qd(),d=Kd(),f=Xc(),p=Qc();0&&(t.exports={AccessTokenMissingError,RefreshAccessTokenFailedError,getContext,getVercelOidcToken,getVercelOidcTokenSync,getVercelToken})}))();let Yd;try{Yd=new TextDecoder}catch{}let T,Xd,E=0;const Zd=[],Qd=57337,$d={};let ef=11281e4,tf=1681e4,nf=Zd,rf=0,D={},O,af,of=0,sf=0,k,cf,A=[],lf=[],uf,df,ff,pf={useRecords:!1,mapsAsObjects:!0},mf=!1,hf=2;try{Function(``)}catch{hf=1/0}var gf=class e{constructor(e){if(e&&((e.keyMap||e._keyMap)&&!e.useRecords&&(e.useRecords=!1,e.mapsAsObjects=!0),e.useRecords===!1&&e.mapsAsObjects===void 0&&(e.mapsAsObjects=!0),e.getStructures&&(e.getShared=e.getStructures),e.getShared&&!e.structures&&((e.structures=[]).uninitialized=!0),e.keyMap)){this.mapKey=new Map;for(let[t,n]of Object.entries(e.keyMap))this.mapKey.set(n,t)}Object.assign(this,e)}decodeKey(e){return this.keyMap&&this.mapKey.get(e)||e}encodeKey(e){return this.keyMap&&this.keyMap.hasOwnProperty(e)?this.keyMap[e]:e}encodeKeys(e){if(!this._keyMap)return e;let t=new Map;for(let[n,r]of Object.entries(e))t.set(this._keyMap.hasOwnProperty(n)?this._keyMap[n]:n,r);return t}decodeKeys(e){if(!this._keyMap||e.constructor.name!=`Map`)return e;if(!this._mapKey){this._mapKey=new Map;for(let[e,t]of Object.entries(this._keyMap))this._mapKey.set(t,e)}let t={};return e.forEach((e,n)=>t[bf(this._mapKey.has(n)?this._mapKey.get(n):n)]=e),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n.constructor.name){case`Array`:return n.map(e=>this.decodeKeys(e))}return n}decode(t,n){if(T)return Uf(()=>(Wf(),this?this.decode(t,n):e.prototype.decode.call(pf,t,n)));Xd=n>-1?n:t.length,E=0,rf=0,sf=0,af=null,nf=Zd,k=null,T=t;try{df=t.dataView||=new DataView(t.buffer,t.byteOffset,t.byteLength)}catch(e){throw T=null,t instanceof Uint8Array?e:Error(`Source must be a Uint8Array or Buffer but was a `+(t&&typeof t==`object`?t.constructor.name:typeof t))}if(this instanceof e){if(D=this,uf=this.sharedValues&&(this.pack?Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this.structures)return O=this.structures,_f();(!O||O.length>0)&&(O=[])}else D=pf,(!O||O.length>0)&&(O=[]),uf=null;return _f()}decodeMultiple(e,t){let n,r=0;try{let i=e.length;mf=!0;let a=this?this.decode(e,i):Kf.decode(e,i);if(t){if(t(a)===!1)return;for(;E<i;)if(r=E,t(_f())===!1)return}else{for(n=[a];E<i;)r=E,n.push(_f());return n}}catch(e){throw e.lastPosition=r,e.values=n,e}finally{mf=!1,Wf()}}};function _f(){try{let e=j();if(k){if(E>=k.postBundlePosition){let e=Error(`Unexpected bundle position`);throw e.incomplete=!0,e}E=k.postBundlePosition,k=null}if(E==Xd)O=null,T=null,cf&&=null;else if(E>Xd){let e=Error(`Unexpected end of CBOR data`);throw e.incomplete=!0,e}else if(!mf)throw Error(`Data read, but end of buffer not reached`);return e}catch(e){throw Wf(),(e instanceof RangeError||e.message.startsWith(`Unexpected end of buffer`))&&(e.incomplete=!0),e}}function j(){let e=T[E++],t=e>>5;if(e&=31,e>23)switch(e){case 24:e=T[E++];break;case 25:if(t==7)return kf();e=df.getUint16(E),E+=2;break;case 26:if(t==7){let e=df.getFloat32(E);if(D.useFloat32>2){let t=Gf[(T[E]&127)<<1|T[E+1]>>7];return E+=4,(t*e+(e>0?.5:-.5)>>0)/t}return E+=4,e}e=df.getUint32(E),E+=4;break;case 27:if(t==7){let e=df.getFloat64(E);return E+=8,e}if(t>1){if(df.getUint32(E)>0)throw Error(`JavaScript does not support arrays, maps, or strings with length over 4294967295`);e=df.getUint32(E+4)}else D.int64AsNumber?(e=df.getUint32(E)*4294967296,e+=df.getUint32(E+4)):e=df.getBigUint64(E);E+=8;break;case 31:switch(t){case 2:case 3:throw Error(`Indefinite length not supported for byte or text strings`);case 4:let e=[],n,r=0;for(;(n=j())!=$d;){if(r>=ef)throw Error(`Array length exceeds ${ef}`);e[r++]=n}return t==4?e:t==3?e.join(``):Buffer.concat(e);case 5:let i;if(D.mapsAsObjects){let e={},t=0;if(D.keyMap)for(;(i=j())!=$d;){if(t++>=tf)throw Error(`Property count exceeds ${tf}`);e[bf(D.decodeKey(i))]=j()}else for(;(i=j())!=$d;){if(t++>=tf)throw Error(`Property count exceeds ${tf}`);e[bf(i)]=j()}return e}else{ff&&=(D.mapsAsObjects=!0,!1);let e=new Map;if(D.keyMap){let t=0;for(;(i=j())!=$d;){if(t++>=tf)throw Error(`Map size exceeds ${tf}`);e.set(D.decodeKey(i),j())}}else{let t=0;for(;(i=j())!=$d;){if(t++>=tf)throw Error(`Map size exceeds ${tf}`);e.set(i,j())}}return e}case 7:return $d;default:throw Error(`Invalid major type for indefinite length `+t)}default:throw Error(`Unknown token `+e)}switch(t){case 0:return e;case 1:return~e;case 2:return Ef(e);case 3:if(sf>=E)return af.slice(E-of,(E+=e)-of);if(sf==0&&Xd<140&&e<32){let t=e<16?Tf(e):wf(e);if(t!=null)return t}return xf(e);case 4:if(e>=ef)throw Error(`Array length exceeds ${ef}`);let t=Array(e);for(let n=0;n<e;n++)t[n]=j();return t;case 5:if(e>=tf)throw Error(`Map size exceeds ${ef}`);if(D.mapsAsObjects){let t={};if(D.keyMap)for(let n=0;n<e;n++)t[bf(D.decodeKey(j()))]=j();else for(let n=0;n<e;n++)t[bf(j())]=j();return t}else{ff&&=(D.mapsAsObjects=!0,!1);let t=new Map;if(D.keyMap)for(let n=0;n<e;n++)t.set(D.decodeKey(j()),j());else for(let n=0;n<e;n++)t.set(j(),j());return t}case 6:if(e>=Qd){let t=O[e&8191];if(t)return t.read||=yf(t),t.read();if(e<65536){if(e==57343){let e=Vf(),t=j(),n=j();jf(t,n);let r={};if(D.keyMap)for(let t=2;t<e;t++){let e=D.decodeKey(n[t-2]);r[bf(e)]=j()}else for(let t=2;t<e;t++){let e=n[t-2];r[bf(e)]=j()}return r}else if(e==57342){let e=Vf(),t=j();for(let n=2;n<e;n++)jf(t++,j());return j()}else if(e==Qd)return Bf();if(D.getShared&&(Hf(),t=O[e&8191],t))return t.read||=yf(t),t.read()}}let n=A[e];if(n)return n.handlesRead?n(j):n(j());{let t=j();for(let n=0;n<lf.length;n++){let r=lf[n](e,t);if(r!==void 0)return r}return new Af(t,e)}case 7:switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;default:let t=(uf||Ff())[e];if(t!==void 0)return t;throw Error(`Unknown token `+e)}default:if(isNaN(e)){let e=Error(`Unexpected end of CBOR data`);throw e.incomplete=!0,e}throw Error(`Unknown CBOR token `+e)}}const vf=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function yf(e){if(!e)throw Error(`Structure is required in record definition`);function t(){let e=T[E++];if(e&=31,e>23)switch(e){case 24:e=T[E++];break;case 25:e=df.getUint16(E),E+=2;break;case 26:e=df.getUint32(E),E+=4;break;default:throw Error(`Expected array header, but got `+T[E-1])}let t=this.compiledReader;for(;t;){if(t.propertyCount===e)return t(j);t=t.next}if(this.slowReads++>=hf){let n=this.length==e?this:this.slice(0,e);return t=D.keyMap?Function(`r`,`return {`+n.map(e=>D.decodeKey(e)).map(e=>vf.test(e)?bf(e)+`:r()`:`[`+JSON.stringify(e)+`]:r()`).join(`,`)+`}`):Function(`r`,`return {`+n.map(e=>vf.test(e)?bf(e)+`:r()`:`[`+JSON.stringify(e)+`]:r()`).join(`,`)+`}`),this.compiledReader&&(t.next=this.compiledReader),t.propertyCount=e,this.compiledReader=t,t(j)}let n={};if(D.keyMap)for(let t=0;t<e;t++)n[bf(D.decodeKey(this[t]))]=j();else for(let t=0;t<e;t++)n[bf(this[t])]=j();return n}return e.slowReads=0,t}function bf(e){if(typeof e==`string`)return e===`__proto__`?`__proto_`:e;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return e.toString();if(e==null)return e+``;throw Error(`Invalid property name type `+typeof e)}let xf=Cf;function Sf(e){xf=t(1);function t(t){return function(t){let n=nf[rf++];if(n==null){if(k)return Cf(t);let r=e(E,Xd,t,T);if(typeof r==`string`)n=r,nf=Zd;else if(nf=r,rf=1,sf=1,n=nf[0],n===void 0)throw Error(`Unexpected end of buffer`)}let r=n.length;return r<=t?(E+=t,n):(af=n,of=E,sf=E+r,E+=t,n.slice(0,t))}}}function Cf(e){let t;if(e<16&&(t=Tf(e)))return t;if(e>64&&Yd)return Yd.decode(T.subarray(E,E+=e));let n=E+e,r=[];for(t=``;E<n;){let e=T[E++];if(!(e&128))r.push(e);else if((e&224)==192){let t=T[E++]&63;r.push((e&31)<<6|t)}else if((e&240)==224){let t=T[E++]&63,n=T[E++]&63;r.push((e&31)<<12|t<<6|n)}else if((e&248)==240){let t=T[E++]&63,n=T[E++]&63,i=T[E++]&63,a=(e&7)<<18|t<<12|n<<6|i;a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a)}else r.push(e);r.length>=4096&&(t+=M.apply(String,r),r.length=0)}return r.length>0&&(t+=M.apply(String,r)),t}let M=String.fromCharCode;function wf(e){let t=E,n=Array(e);for(let r=0;r<e;r++){let e=T[E++];if((e&128)>0){E=t;return}n[r]=e}return M.apply(String,n)}function Tf(e){if(e<4)if(e<2){if(e===0)return``;{let e=T[E++];if((e&128)>1){--E;return}return M(e)}}else{let t=T[E++],n=T[E++];if((t&128)>0||(n&128)>0){E-=2;return}if(e<3)return M(t,n);let r=T[E++];if((r&128)>0){E-=3;return}return M(t,n,r)}else{let t=T[E++],n=T[E++],r=T[E++],i=T[E++];if((t&128)>0||(n&128)>0||(r&128)>0||(i&128)>0){E-=4;return}if(e<6){if(e===4)return M(t,n,r,i);{let e=T[E++];if((e&128)>0){E-=5;return}return M(t,n,r,i,e)}}else if(e<8){let a=T[E++],o=T[E++];if((a&128)>0||(o&128)>0){E-=6;return}if(e<7)return M(t,n,r,i,a,o);let s=T[E++];if((s&128)>0){E-=7;return}return M(t,n,r,i,a,o,s)}else{let a=T[E++],o=T[E++],s=T[E++],c=T[E++];if((a&128)>0||(o&128)>0||(s&128)>0||(c&128)>0){E-=8;return}if(e<10){if(e===8)return M(t,n,r,i,a,o,s,c);{let e=T[E++];if((e&128)>0){E-=9;return}return M(t,n,r,i,a,o,s,c,e)}}else if(e<12){let l=T[E++],u=T[E++];if((l&128)>0||(u&128)>0){E-=10;return}if(e<11)return M(t,n,r,i,a,o,s,c,l,u);let d=T[E++];if((d&128)>0){E-=11;return}return M(t,n,r,i,a,o,s,c,l,u,d)}else{let l=T[E++],u=T[E++],d=T[E++],f=T[E++];if((l&128)>0||(u&128)>0||(d&128)>0||(f&128)>0){E-=12;return}if(e<14){if(e===12)return M(t,n,r,i,a,o,s,c,l,u,d,f);{let e=T[E++];if((e&128)>0){E-=13;return}return M(t,n,r,i,a,o,s,c,l,u,d,f,e)}}else{let p=T[E++],m=T[E++];if((p&128)>0||(m&128)>0){E-=14;return}if(e<15)return M(t,n,r,i,a,o,s,c,l,u,d,f,p,m);let h=T[E++];if((h&128)>0){E-=15;return}return M(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}}}}}function Ef(e){return D.copyBuffers?Uint8Array.prototype.slice.call(T,E,E+=e):T.subarray(E,E+=e)}let Df=new Float32Array(1),Of=new Uint8Array(Df.buffer,0,4);function kf(){let e=T[E++],t=T[E++],n=(e&127)>>2;if(n===31)return t||e&3?NaN:e&128?-1/0:1/0;if(n===0){let n=((e&3)<<8|t)/(1<<24);return e&128?-n:n}return Of[3]=e&128|(n>>1)+56,Of[2]=(e&7)<<5|t>>3,Of[1]=t<<5,Of[0]=0,Df[0]}Array(4096);var Af=class{constructor(e,t){this.value=e,this.tag=t}};A[0]=e=>new Date(e),A[1]=e=>new Date(Math.round(e*1e3)),A[2]=e=>{let t=BigInt(0);for(let n=0,r=e.byteLength;n<r;n++)t=BigInt(e[n])+(t<<BigInt(8));return t},A[3]=e=>BigInt(-1)-A[2](e),A[4]=e=>+(e[1]+`e`+e[0]),A[5]=e=>e[1]*Math.exp(e[0]*Math.log(2));const jf=(e,t)=>{e-=57344;let n=O[e];n&&n.isShared&&((O.restoreStructures||=[])[e]=n),O[e]=t,t.read=yf(t)};A[105]=e=>{let t=e.length,n=e[1];jf(e[0],n);let r={};for(let i=2;i<t;i++){let t=n[i-2];r[bf(t)]=e[i]}return r},A[14]=e=>k?k[0].slice(k.position0,k.position0+=e):new Af(e,14),A[15]=e=>k?k[1].slice(k.position1,k.position1+=e):new Af(e,15);let Mf={Error,RegExp};A[27]=e=>(Mf[e[0]]||Error)(e[1],e[2]);const Nf=e=>{if(T[E++]!=132){let e=Error(`Packed values structure must be followed by a 4 element array`);throw T.length<E&&(e.incomplete=!0),e}let t=e();if(!t||!t.length){let e=Error(`Packed values structure must be followed by a 4 element array`);throw e.incomplete=!0,e}return uf=uf?t.concat(uf.slice(t.length)):t,uf.prefixes=e(),uf.suffixes=e(),e()};Nf.handlesRead=!0,A[51]=Nf,A[6]=e=>{if(!uf)if(D.getShared)Hf();else return new Af(e,6);if(typeof e==`number`)return uf[16+(e>=0?2*e:-2*e-1)];let t=Error(`No support for non-integer packed references yet`);throw e===void 0&&(t.incomplete=!0),t},A[28]=e=>{cf||(cf=new Map,cf.id=0);let t=cf.id++,n=E,r=T[E],i;i=r>>5==4?[]:{};let a={target:i};cf.set(t,a);let o=e();return a.used?(Object.getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(E=n,i=o,cf.set(t,{target:i}),o=e()),Object.assign(i,o)):(a.target=o,o)},A[28].handlesRead=!0,A[29]=e=>{let t=cf.get(e);return t.used=!0,t.target},A[258]=e=>new Set(e),(A[259]=e=>(D.mapsAsObjects&&(D.mapsAsObjects=!1,ff=!0),e())).handlesRead=!0;function Pf(e,t){return typeof e==`string`?e+t:e instanceof Array?e.concat(t):Object.assign({},e,t)}function Ff(){if(!uf)if(D.getShared)Hf();else throw Error(`No packed values available`);return uf}lf.push((e,t)=>{if(e>=225&&e<=255)return Pf(Ff().prefixes[e-224],t);if(e>=28704&&e<=32767)return Pf(Ff().prefixes[e-28672],t);if(e>=1879052288&&e<=2147483647)return Pf(Ff().prefixes[e-1879048192],t);if(e>=216&&e<=223)return Pf(t,Ff().suffixes[e-216]);if(e>=27647&&e<=28671)return Pf(t,Ff().suffixes[e-27639]);if(e>=1811940352&&e<=1879048191)return Pf(t,Ff().suffixes[e-1811939328]);if(e==1399353956)return{packedValues:uf,structures:O.slice(0),version:t};if(e==55799)return t});const If=new Uint8Array(new Uint16Array([1]).buffer)[0]==1,Lf=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>`u`?{name:`BigUint64Array`}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>`u`?{name:`BigInt64Array`}:BigInt64Array,Float32Array,Float64Array],Rf=[64,68,69,70,71,72,77,78,79,85,86];for(let e=0;e<Lf.length;e++)zf(Lf[e],Rf[e]);function zf(e,t){let n=`get`+e.name.slice(0,-5),r;typeof e==`function`?r=e.BYTES_PER_ELEMENT:e=null;for(let i=0;i<2;i++){if(!i&&r==1)continue;let a=r==2?1:r==4?2:r==8?3:0;A[i?t:t-4]=r==1||i==If?n=>{if(!e)throw Error(`Could not find typed array for code `+t);return!D.copyBuffers&&(r===1||r===2&&!(n.byteOffset&1)||r===4&&!(n.byteOffset&3)||r===8&&!(n.byteOffset&7))?new e(n.buffer,n.byteOffset,n.byteLength>>a):new e(Uint8Array.prototype.slice.call(n,0).buffer)}:r=>{if(!e)throw Error(`Could not find typed array for code `+t);let o=new DataView(r.buffer,r.byteOffset,r.byteLength),s=r.length>>a,c=new e(s),l=o[n];for(let e=0;e<s;e++)c[e]=l.call(o,e<<a,i);return c}}}function Bf(){let e=Vf(),t=E+j();for(let t=2;t<e;t++){let e=Vf();E+=e}let n=E;return E=t,k=[Cf(Vf()),Cf(Vf())],k.position0=0,k.position1=0,k.postBundlePosition=E,E=n,j()}function Vf(){let e=T[E++]&31;if(e>23)switch(e){case 24:e=T[E++];break;case 25:e=df.getUint16(E),E+=2;break;case 26:e=df.getUint32(E),E+=4;break}return e}function Hf(){if(D.getShared){let e=Uf(()=>(T=null,D.getShared()))||{},t=e.structures||[];D.sharedVersion=e.version,uf=D.sharedValues=e.packedValues,O===!0?D.structures=O=t:O.splice.apply(O,[0,t.length].concat(t))}}function Uf(e){let t=Xd,n=E,r=rf,i=of,a=sf,o=af,s=nf,c=cf,l=k,u=new Uint8Array(T.slice(0,Xd)),d=O,f=D,p=mf,m=e();return Xd=t,E=n,rf=r,of=i,sf=a,af=o,nf=s,cf=c,k=l,T=u,mf=p,O=d,D=f,df=new DataView(T.buffer,T.byteOffset,T.byteLength),m}function Wf(){T=null,cf=null,O=null}const Gf=Array(147);for(let e=0;e<256;e++)Gf[e]=+(`1e`+Math.floor(45.15-e*.30103));let Kf=new gf({useRecords:!1});const qf=Kf.decode;Kf.decodeMultiple;const Jf={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let Yf;try{Yf=new TextEncoder}catch{}let Xf,Zf;const Qf=typeof globalThis==`object`&&globalThis.Buffer,$f=Qf!==void 0,ep=$f?Qf.allocUnsafeSlow:Uint8Array,tp=$f?Qf:Uint8Array,np=$f?4294967296:2144337920;let rp,N,P,F=0,ip,I=null;const ap=/[\u0080-\uFFFF]/,op=Symbol(`record-id`);var sp=class extends gf{constructor(e){super(e),this.offset=0;let t,n,r,i,a;e||={};let o=tp.prototype.utf8Write?function(e,t,n){return N.utf8Write(e,t,n)}:Yf&&Yf.encodeInto?function(e,t){return Yf.encodeInto(e,N.subarray(t)).written}:!1,s=this,c=e.structures||e.saveStructures,l=e.maxSharedStructures;if(l??=c?128:0,l>8190)throw Error(`Maximum maxSharedStructure is 8190`);let u=e.sequential;u&&(l=0),this.structures||=[],this.saveStructures&&(this.saveShared=this.saveStructures);let d,f,p=e.sharedValues,m;if(p){m=Object.create(null);for(let e=0,t=p.length;e<t;e++)m[p[e]]=e}let h=[],g=0,_=0;this.mapEncode=function(e,t){if(this._keyMap&&!this._mapped)switch(e.constructor.name){case`Array`:e=e.map(e=>this.encodeKeys(e));break}return this.encode(e,t)},this.encode=function(o,c){if(N||(N=new ep(8192),P=new DataView(N.buffer,0,8192),F=0),ip=N.length-10,ip-F<2048?(N=new ep(N.length),P=new DataView(N.buffer,0,N.length),ip=N.length-10,F=0):c===512&&(F=F+7&2147483640),t=F,s.useSelfDescribedHeader&&(P.setUint32(F,3654940416),F+=3),a=s.structuredClone?new Map:null,s.bundleStrings&&typeof o!=`string`?(I=[],I.size=1/0):I=null,n=s.structures,n){if(n.uninitialized){let e=s.getShared()||{};s.structures=n=e.structures||[],s.sharedVersion=e.version;let t=s.sharedValues=e.packedValues;if(t){m={};for(let e=0,n=t.length;e<n;e++)m[t[e]]=e}}let e=n.length;if(e>l&&!u&&(e=l),!n.transitions){n.transitions=Object.create(null);for(let t=0;t<e;t++){let e=n[t];if(!e)continue;let r,i=n.transitions;for(let n=0,a=e.length;n<a;n++){i[op]===void 0&&(i[op]=t);let a=e[n];r=i[a],r||=i[a]=Object.create(null),i=r}i[op]=t|1048576}}u||(n.nextId=e)}if(r&&=!1,i=n||[],f=m,e.pack){let t=new Map;if(t.values=[],t.encoder=s,t.maxValues=e.maxPrivatePackedValues||(m?16:1/0),t.objectMap=m||!1,t.samplingPackedValues=d,pp(o,t),t.values.length>0){N[F++]=216,N[F++]=51,up(4);let e=t.values;v(e),up(0),up(0),f=Object.create(m||null);for(let t=0,n=e.length;t<n;t++)f[e[t]]=t}}rp=c&Tp;try{if(rp)return;if(v(o),I&&vp(t,v),s.offset=F,a&&a.idsToInsert){F+=a.idsToInsert.length*2,F>ip&&b(F),s.offset=F;let e=_p(N.subarray(t,F),a.idsToInsert);return a=null,e}return c&512?(N.start=t,N.end=F,N):N.subarray(t,F)}finally{if(n){if(_<10&&_++,n.length>l&&(n.length=l),g>1e4)n.transitions=null,_=0,g=0,h.length>0&&(h=[]);else if(h.length>0&&!u){for(let e=0,t=h.length;e<t;e++)h[e][op]=void 0;h=[]}}if(r&&s.saveShared){s.structures.length>l&&(s.structures=s.structures.slice(0,l));let e=N.subarray(t,F);return s.updateSharedData()===!1?s.encode(o):e}c&1024&&(F=t)}},this.findCommonStringsToPack=()=>(d=new Map,m||=Object.create(null),e=>{let t=e&&e.threshold||4,n=this.pack?e.maxPrivatePackedValues||16:0;p||=this.sharedValues=[];for(let[e,i]of d)i.count>t&&(m[e]=n++,p.push(e),r=!0);for(;this.saveShared&&this.updateSharedData()===!1;);d=null});let v=n=>{F>ip&&(N=b(F));var r=typeof n,i;if(r===`string`){if(f){let t=f[n];if(t>=0){t<16?N[F++]=t+224:(N[F++]=198,t&1?v(15-t>>1):v(t-16>>1));return}else if(d&&!e.pack){let e=d.get(n);e?e.count++:d.set(n,{count:1})}}let r=n.length;if(I&&r>=4&&r<1024){if((I.size+=r)>61440){let e,n=(I[0]?I[0].length*3+I[1].length:0)+10;F+n>ip&&(N=b(F+n)),N[F++]=217,N[F++]=223,N[F++]=249,N[F++]=I.position?132:130,N[F++]=26,e=F-t,F+=4,I.position&&vp(t,v),I=[``,``],I.size=0,I.position=e}let e=ap.test(n);I[+!e]+=n,N[F++]=e?206:207,v(r);return}let a;a=r<32?1:r<256?2:r<65536?3:5;let s=r*3;if(F+s>ip&&(N=b(F+s)),r<64||!o){let e,t,o,s=F+a;for(e=0;e<r;e++)t=n.charCodeAt(e),t<128?N[s++]=t:t<2048?(N[s++]=t>>6|192,N[s++]=t&63|128):(t&64512)==55296&&((o=n.charCodeAt(e+1))&64512)==56320?(t=65536+((t&1023)<<10)+(o&1023),e++,N[s++]=t>>18|240,N[s++]=t>>12&63|128,N[s++]=t>>6&63|128,N[s++]=t&63|128):(N[s++]=t>>12|224,N[s++]=t>>6&63|128,N[s++]=t&63|128);i=s-F-a}else i=o(n,F+a,s);i<24?N[F++]=96|i:i<256?(a<2&&N.copyWithin(F+2,F+1,F+1+i),N[F++]=120,N[F++]=i):i<65536?(a<3&&N.copyWithin(F+3,F+2,F+2+i),N[F++]=121,N[F++]=i>>8,N[F++]=i&255):(a<5&&N.copyWithin(F+5,F+3,F+3+i),N[F++]=122,P.setUint32(F,i),F+=4),F+=i}else if(r===`number`)if(!this.alwaysUseFloat&&n>>>0===n)n<24?N[F++]=n:n<256?(N[F++]=24,N[F++]=n):n<65536?(N[F++]=25,N[F++]=n>>8,N[F++]=n&255):(N[F++]=26,P.setUint32(F,n),F+=4);else if(!this.alwaysUseFloat&&n>>0===n)n>=-24?N[F++]=31-n:n>=-256?(N[F++]=56,N[F++]=~n):n>=-65536?(N[F++]=57,P.setUint16(F,~n),F+=2):(N[F++]=58,P.setUint32(F,~n),F+=4);else{let e;if((e=this.useFloat32)>0&&n<4294967296&&n>=-2147483648){N[F++]=250,P.setFloat32(F,n);let t;if(e<4||(t=n*Gf[(N[F]&127)<<1|N[F+1]>>7])>>0===t){F+=4;return}else F--}N[F++]=251,P.setFloat64(F,n),F+=8}else if(r===`object`)if(!n)N[F++]=246;else{if(a){let e=a.get(n);if(e){if(N[F++]=216,N[F++]=29,N[F++]=25,!e.references){let t=a.idsToInsert||=[];e.references=[],t.push(e)}e.references.push(F-t),F+=2;return}else a.set(n,{offset:F-t})}let e=n.constructor;if(e===Object)y(n);else if(e===Array){i=n.length,i<24?N[F++]=128|i:up(i);for(let e=0;e<i;e++)v(n[e])}else if(e===Map)if((this.mapsAsObjects?this.useTag259ForMaps!==!1:this.useTag259ForMaps)&&(N[F++]=217,N[F++]=1,N[F++]=3),i=n.size,i<24?N[F++]=160|i:i<256?(N[F++]=184,N[F++]=i):i<65536?(N[F++]=185,N[F++]=i>>8,N[F++]=i&255):(N[F++]=186,P.setUint32(F,i),F+=4),s.keyMap)for(let[e,t]of n)v(s.encodeKey(e)),v(t);else for(let[e,t]of n)v(e),v(t);else{for(let e=0,t=Xf.length;e<t;e++){let t=Zf[e];if(n instanceof t){let t=Xf[e],r=t.tag;r??=t.getTag&&t.getTag.call(this,n),r<24?N[F++]=192|r:r<256?(N[F++]=216,N[F++]=r):r<65536?(N[F++]=217,N[F++]=r>>8,N[F++]=r&255):r>-1&&(N[F++]=218,P.setUint32(F,r),F+=4),t.encode.call(this,n,v,b);return}}if(n[Symbol.iterator]){if(rp){let e=Error(`Iterable should be serialized as iterator`);throw e.iteratorNotHandled=!0,e}N[F++]=159;for(let e of n)v(e);N[F++]=255;return}if(n[Symbol.asyncIterator]||fp(n)){let e=Error(`Iterable/blob should be serialized as iterator`);throw e.iteratorNotHandled=!0,e}if(this.useToJSON&&n.toJSON){let e=n.toJSON();if(e!==n)return v(e)}y(n)}}else if(r===`boolean`)N[F++]=n?245:244;else if(r===`bigint`){if(n<BigInt(1)<<BigInt(64)&&n>=0)N[F++]=27,P.setBigUint64(F,n);else if(n>-(BigInt(1)<<BigInt(64))&&n<0)N[F++]=59,P.setBigUint64(F,-n-BigInt(1));else if(this.largeBigIntToFloat)N[F++]=251,P.setFloat64(F,Number(n));else{n>=BigInt(0)?N[F++]=194:(N[F++]=195,n=BigInt(-1)-n);let e=[];for(;n;)e.push(Number(n&BigInt(255))),n>>=BigInt(8);gp(new Uint8Array(e.reverse()),b);return}F+=8}else if(r===`undefined`)N[F++]=247;else throw Error(`Unknown type: `+r)},y=this.useRecords===!1?this.variableMapSize?e=>{let t=Object.keys(e),n=Object.values(e),r=t.length;if(r<24?N[F++]=160|r:r<256?(N[F++]=184,N[F++]=r):r<65536?(N[F++]=185,N[F++]=r>>8,N[F++]=r&255):(N[F++]=186,P.setUint32(F,r),F+=4),s.keyMap)for(let e=0;e<r;e++)v(s.encodeKey(t[e])),v(n[e]);else for(let e=0;e<r;e++)v(t[e]),v(n[e])}:e=>{N[F++]=185;let n=F-t;F+=2;let r=0;if(s.keyMap)for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(v(s.encodeKey(t)),v(e[t]),r++);else for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(v(t),v(e[t]),r++);N[n+++t]=r>>8,N[n+t]=r&255}:(e,t)=>{let n,a=i.transitions||=Object.create(null),o=0,s=0,c,u;if(this.keyMap){u=Object.keys(e).map(e=>this.encodeKey(e)),s=u.length;for(let e=0;e<s;e++){let t=u[e];n=a[t],n||(n=a[t]=Object.create(null),o++),a=n}}else for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(n=a[t],n||(a[op]&1048576&&(c=a[op]&65535),n=a[t]=Object.create(null),o++),a=n,s++);let d=a[op];if(d!==void 0)d&=65535,N[F++]=217,N[F++]=d>>8|224,N[F++]=d&255;else if(u||=a.__keys__||=Object.keys(e),c===void 0?(d=i.nextId++,d||(d=0,i.nextId=1),d>=256&&(i.nextId=(d=l)+1)):d=c,i[d]=u,d<l){N[F++]=217,N[F++]=d>>8|224,N[F++]=d&255,a=i.transitions;for(let e=0;e<s;e++)(a[op]===void 0||a[op]&1048576)&&(a[op]=d),a=a[u[e]];a[op]=d|1048576,r=!0}else{if(a[op]=d,P.setUint32(F,3655335680),F+=3,o&&(g+=_*o),h.length>=256-l&&(h.shift()[op]=void 0),h.push(a),up(s+2),v(57344+d),v(u),t)return;for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&v(e[t]);return}if(s<24?N[F++]=128|s:up(s),!t)for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&v(e[t])},b=e=>{let n;if(e>16777216){if(e-t>np)throw Error(`Encoded buffer would be larger than maximum buffer size`);n=Math.min(np,Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096)*4096)}else n=(Math.max(e-t<<2,N.length-1)>>12)+1<<12;let r=new ep(n);return P=new DataView(r.buffer,0,n),N.copy?N.copy(r,0,t,e):r.set(N.slice(t,e)),F-=t,t=0,ip=r.length-10,N=r},ee=100,te=1e3;this.encodeAsIterable=function(e,t){return ae(e,t,ne)},this.encodeAsAsyncIterable=function(e,t){return ae(e,t,oe)};function*ne(e,n,r){let i=e.constructor;if(i===Object){let t=s.useRecords!==!1;t?y(e,!0):cp(Object.keys(e).length,160);for(let r in e){let i=e[r];t||v(r),i&&typeof i==`object`?n[r]?yield*ne(i,n[r]):yield*re(i,n,r):v(i)}}else if(i===Array){let r=e.length;up(r);for(let i=0;i<r;i++){let r=e[i];r&&(typeof r==`object`||F-t>ee)?n.element?yield*ne(r,n.element):yield*re(r,n,`element`):v(r)}}else if(e[Symbol.iterator]&&!e.buffer){N[F++]=159;for(let r of e)r&&(typeof r==`object`||F-t>ee)?n.element?yield*ne(r,n.element):yield*re(r,n,`element`):v(r);N[F++]=255}else fp(e)?(cp(e.size,64),yield N.subarray(t,F),yield e,ie()):e[Symbol.asyncIterator]?(N[F++]=159,yield N.subarray(t,F),yield e,ie(),N[F++]=255):v(e);r&&F>t?yield N.subarray(t,F):F-t>ee&&(yield N.subarray(t,F),ie())}function*re(e,n,r){let i=F-t;try{v(e),F-t>ee&&(yield N.subarray(t,F),ie())}catch(a){if(a.iteratorNotHandled)n[r]={},F=t+i,yield*ne.call(this,e,n[r]);else throw a}}function ie(){ee=te,s.encode(null,Tp)}function ae(e,t,n){return ee=t&&t.chunkThreshold?te=t.chunkThreshold:100,e&&typeof e==`object`?(s.encode(null,Tp),n(e,s.iterateProperties||={},!0)):[s.encode(e)]}async function*oe(e,t){for(let n of ne(e,t,!0)){let e=n.constructor;if(e===tp||e===Uint8Array)yield n;else if(fp(n)){let e=n.stream().getReader(),t;for(;!(t=await e.read()).done;)yield t.value}else if(n[Symbol.asyncIterator])for await(let e of n)ie(),e?yield*oe(e,t.async||={}):yield s.encode(e);else yield n}}}useBuffer(e){N=e,P=new DataView(N.buffer,N.byteOffset,N.byteLength),F=0}clearSharedData(){this.structures&&=[],this.sharedValues&&=void 0}updateSharedData(){let e=this.sharedVersion||0;this.sharedVersion=e+1;let t=this.structures.slice(0),n=new lp(t,this.sharedValues,this.sharedVersion),r=this.saveShared(n,t=>(t&&t.version||0)==e);return r===!1?(n=this.getShared()||{},this.structures=n.structures||[],this.sharedValues=n.packedValues,this.sharedVersion=n.version,this.structures.nextId=this.structures.length):t.forEach((e,t)=>this.structures[t]=e),r}};function cp(e,t){e<24?N[F++]=t|e:e<256?(N[F++]=t|24,N[F++]=e):e<65536?(N[F++]=t|25,N[F++]=e>>8,N[F++]=e&255):(N[F++]=t|26,P.setUint32(F,e),F+=4)}var lp=class{constructor(e,t,n){this.structures=e,this.packedValues=t,this.version=n}};function up(e){e<24?N[F++]=128|e:e<256?(N[F++]=152,N[F++]=e):e<65536?(N[F++]=153,N[F++]=e>>8,N[F++]=e&255):(N[F++]=154,P.setUint32(F,e),F+=4)}const dp=typeof Blob>`u`?function(){}:Blob;function fp(e){if(e instanceof dp)return!0;let t=e[Symbol.toStringTag];return t===`Blob`||t===`File`}function pp(e,t){switch(typeof e){case`string`:if(e.length>3){if(t.objectMap[e]>-1||t.values.length>=t.maxValues)return;let n=t.get(e);if(n)++n.count==2&&t.values.push(e);else if(t.set(e,{count:1}),t.samplingPackedValues){let n=t.samplingPackedValues.get(e);n?n.count++:t.samplingPackedValues.set(e,{count:1})}}break;case`object`:if(e)if(e instanceof Array)for(let n=0,r=e.length;n<r;n++)pp(e[n],t);else{let r=!t.encoder.useRecords;for(var n in e)e.hasOwnProperty(n)&&(r&&pp(n,t),pp(e[n],t))}break;case`function`:console.log(e)}}const mp=new Uint8Array(new Uint16Array([1]).buffer)[0]==1;Zf=[Date,Set,Error,RegExp,Af,ArrayBuffer,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array>`u`?function(){}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>`u`?function(){}:BigInt64Array,Float32Array,Float64Array,lp],Xf=[{tag:1,encode(e,t){let n=e.getTime()/1e3;(this.useTimestamp32||e.getMilliseconds()===0)&&n>=0&&n<4294967296?(N[F++]=26,P.setUint32(F,n),F+=4):(N[F++]=251,P.setFloat64(F,n),F+=8)}},{tag:258,encode(e,t){t(Array.from(e))}},{tag:27,encode(e,t){t([e.name,e.message])}},{tag:27,encode(e,t){t([`RegExp`,e.source,e.flags])}},{getTag(e){return e.tag},encode(e,t){t(e.value)}},{encode(e,t,n){gp(e,n)}},{getTag(e){if(e.constructor===Uint8Array&&(this.tagUint8Array||$f&&this.tagUint8Array!==!1))return 64},encode(e,t,n){gp(e,n)}},hp(68,1),hp(69,2),hp(70,4),hp(71,8),hp(72,1),hp(77,2),hp(78,4),hp(79,8),hp(85,4),hp(86,8),{encode(e,t){let n=e.packedValues||[],r=e.structures||[];if(n.values.length>0){N[F++]=216,N[F++]=51,up(4);let e=n.values;t(e),up(0),up(0),packedObjectMap=Object.create(sharedPackedObjectMap||null);for(let t=0,n=e.length;t<n;t++)packedObjectMap[e[t]]=t}if(r){P.setUint32(F,3655335424),F+=3;let n=r.slice(0);n.unshift(57344),n.push(new Af(e.version,1399353956)),t(n)}else t(new Af(e.version,1399353956))}}];function hp(e,t){return!mp&&t>1&&(e-=4),{tag:e,encode:function(e,t){let n=e.byteLength,r=e.byteOffset||0,i=e.buffer||e;t($f?Qf.from(i,r,n):new Uint8Array(i,r,n))}}}function gp(e,t){let n=e.byteLength;n<24?N[F++]=64+n:n<256?(N[F++]=88,N[F++]=n):n<65536?(N[F++]=89,N[F++]=n>>8,N[F++]=n&255):(N[F++]=90,P.setUint32(F,n),F+=4),F+n>=N.length&&t(F+n),N.set(e.buffer?e:new Uint8Array(e),F),F+=n}function _p(e,t){let n,r=t.length*2,i=e.length-r;t.sort((e,t)=>e.offset>t.offset?1:-1);for(let n=0;n<t.length;n++){let r=t[n];r.id=n;for(let t of r.references)e[t++]=n>>8,e[t]=n&255}for(;n=t.pop();){let t=n.offset;e.copyWithin(t+r,t,i),r-=2;let a=t+r;e[a++]=216,e[a++]=28,i=t}return e}function vp(e,t){P.setUint32(I.position+e,F-I.position-e+1);let n=I;I=null,t(n[0]),t(n[1])}let yp=new sp({useRecords:!1});const bp=yp.encode;yp.encodeAsIterable,yp.encodeAsAsyncIterable;const{NEVER:xp,ALWAYS:Sp,DECIMAL_ROUND:Cp,DECIMAL_FIT:wp}=Jf,Tp=2048;var Ep=i(((e,t)=>{let n=()=>process.platform===`linux`,r=null;t.exports={isLinux:n,getReport:()=>{if(!r)if(n()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,r=process.report.getReport(),process.report.excludeNetwork=e}else r={};return r}}})),Dp=i(((t,n)=>{let r=e(`fs`),i=2048;n.exports={LDD_PATH:`/usr/bin/ldd`,SELF_PATH:`/proc/self/exe`,readFileSync:e=>{let t=r.openSync(e,`r`),n=Buffer.alloc(i),a=r.readSync(t,n,0,i,0);return r.close(t,()=>{}),n.subarray(0,a)},readFile:e=>new Promise((t,n)=>{r.open(e,`r`,(e,a)=>{if(e)n(e);else{let e=Buffer.alloc(i);r.read(a,e,0,i,0,(n,i)=>{t(e.subarray(0,i)),r.close(a,()=>{})})}})})}})),Op=i(((e,t)=>{t.exports={interpreterPath:e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),n=e.readUInt16LE(54),r=e.readUInt16LE(56);for(let i=0;i<r;i++){let r=t+i*n;if(e.readUInt32LE(r)===3){let t=e.readUInt32LE(r+8),n=e.readUInt32LE(r+32);return e.subarray(t,t+n).toString().replace(/\0.*$/g,``)}}return null}}})),kp=i(((t,n)=>{let r=e(`child_process`),{isLinux:i,getReport:a}=Ep(),{LDD_PATH:o,SELF_PATH:s,readFile:c,readFileSync:l}=Dp(),{interpreterPath:u}=Op(),d,f,p,m=`getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true`,h=``,g=()=>h||new Promise(e=>{r.exec(m,(t,n)=>{h=t?` `:n,e(h)})}),_=()=>{if(!h)try{h=r.execSync(m,{encoding:`utf8`})}catch{h=` `}return h},v=`glibc`,y=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,b=`musl`,ee=e=>e.includes(`libc.musl-`)||e.includes(`ld-musl-`),te=()=>{let e=a();return e.header&&e.header.glibcVersionRuntime?v:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(ee)?b:null},ne=e=>{let[t,n]=e.split(/[\r\n]+/);return t&&t.includes(v)?v:n&&n.includes(b)?b:null},re=e=>{if(e){if(e.includes(`/ld-musl-`))return b;if(e.includes(`/ld-linux-`))return v}return null},ie=e=>(e=e.toString(),e.includes(`musl`)?b:e.includes(`GNU C Library`)?v:null),ae=async()=>{if(f!==void 0)return f;f=null;try{let e=await c(o);f=ie(e)}catch{}return f},oe=()=>{if(f!==void 0)return f;f=null;try{let e=l(o);f=ie(e)}catch{}return f},se=async()=>{if(d!==void 0)return d;d=null;try{let e=await c(s),t=u(e);d=re(t)}catch{}return d},ce=()=>{if(d!==void 0)return d;d=null;try{let e=l(s),t=u(e);d=re(t)}catch{}return d},le=async()=>{let e=null;if(i()&&(e=await se(),!e&&(e=await ae(),e||=te(),!e))){let t=await g();e=ne(t)}return e},ue=()=>{let e=null;if(i()&&(e=ce(),!e&&(e=oe(),e||=te(),!e))){let t=_();e=ne(t)}return e},de=async()=>i()&&await le()!==v,fe=()=>i()&&ue()!==v,pe=async()=>{if(p!==void 0)return p;p=null;try{let e=(await c(o)).match(y);e&&(p=e[1])}catch{}return p},me=()=>{if(p!==void 0)return p;p=null;try{let e=l(o).match(y);e&&(p=e[1])}catch{}return p},he=()=>{let e=a();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},ge=e=>e.trim().split(/\s+/)[1],_e=e=>{let[t,n,r]=e.split(/[\r\n]+/);return t&&t.includes(v)?ge(t):n&&r&&n.includes(b)?ge(r):null};n.exports={GLIBC:v,MUSL:b,family:le,familySync:ue,isNonGlibcLinux:de,isNonGlibcLinuxSync:fe,version:async()=>{let e=null;if(i()&&(e=await pe(),e||=he(),!e)){let t=await g();e=_e(t)}return e},versionSync:()=>{let e=null;if(i()&&(e=me(),e||=he(),!e)){let t=_();e=_e(t)}return e}}})),Ap=i(((t,n)=>{var r=e(`fs`),i=e(`path`),a=e(`url`),o=process.config&&process.config.variables||{},s=!!process.env.PREBUILDS_ONLY,c=process.versions,l=c.modules;(c.deno||process.isBun)&&(l=`unsupported`);var u=oe()?`electron`:`node`,d=process.arch,f=process.platform,p=process.env.LIBC||(se(f)?`musl`:`glibc`),m=process.env.ARM_VERSION||(d===`arm64`?`8`:o.arm_version)||``,h=(c.uv||``).split(`.`)[0];n.exports=g;function g(t){return typeof __webpack_require__==`function`?__non_webpack_require__(g.path(t)):e(g.path(t))}g.path=function(t){t=i.resolve(t||`.`);var n=``;try{n=typeof __webpack_require__==`function`?__non_webpack_require__(i.join(t,`package.json`)).name:e(i.join(t,`package.json`)).name;var r=n.toUpperCase().replace(/-/g,`_`)+`_PREBUILD`;process.env[r]&&(t=process.env[r])}catch{}if(!s){var o=v(i.join(t,`build/Release`),y);if(o)return o;var c=v(i.join(t,`build/Debug`),y);if(c)return c}var g=ce(t);if(g)return g;var ie=ce(i.dirname(process.execPath));if(ie)return ie;var oe=(n[0]==`@`?``:`@`+n+`/`)+n+`-`+f+`-`+d;try{return le(i.dirname(e(`module`).createRequire(a.pathToFileURL(i.join(t,`package.json`))).resolve(oe)))}catch{}var se=[`platform=`+f,`arch=`+d,`runtime=`+u,`abi=`+l,`uv=`+h,m?`armv=`+m:``,`libc=`+p,`node=`+process.versions.node,process.versions.electron?`electron=`+process.versions.electron:``,typeof __webpack_require__==`function`?`webpack=true`:``].filter(Boolean).join(` `);throw Error(`No native build was found for `+se+`
|
|
3
3
|
attempted loading from: `+t+` and package: `+oe+`
|
|
4
|
-
`);function ce(e){var t=_(i.join(e,`prebuilds`)).map(b).filter(ee(f,d)).sort(te)[0];if(t)return le(i.join(e,`prebuilds`,t.name))}function le(e){var t=_(e).map(ne).filter(re(u,l)).sort(ae(u))[0];if(t)return i.join(e,t.file)}};function _(e){try{return r.readdirSync(e)}catch{return[]}}function v(e,t){var n=_(e).filter(t);return n[0]&&i.join(e,n[0])}function y(e){return/\.node$/.test(e)}function b(e){var t=e.split(`-`);if(t.length===2){var n=t[0],r=t[1].split(`+`);if(n&&r.length&&r.every(Boolean))return{name:e,platform:n,architectures:r}}}function ee(e,t){return function(n){return n==null||n.platform!==e?!1:n.architectures.includes(t)}}function te(e,t){return e.architectures.length-t.architectures.length}function ne(e){var t=e.split(`.`),n=t.pop(),r={file:e,specificity:0};if(n===`node`){for(var i=0;i<t.length;i++){var a=t[i];if(a===`node`||a===`electron`||a===`node-webkit`)r.runtime=a;else if(a===`napi`)r.napi=!0;else if(a.slice(0,3)===`abi`)r.abi=a.slice(3);else if(a.slice(0,2)===`uv`)r.uv=a.slice(2);else if(a.slice(0,4)===`armv`)r.armv=a.slice(4);else if(a===`glibc`||a===`musl`)r.libc=a;else continue;r.specificity++}return r}}function re(e,t){return function(n){return!(n==null||n.runtime!==e&&!ie(n)||n.abi!==t&&!n.napi||n.uv&&n.uv!==h||n.armv&&n.armv!==m||n.libc&&n.libc!==p)}}function ie(e){return e.runtime===`node`&&e.napi}function ae(e){return function(t,n){return t.runtime===n.runtime?t.abi===n.abi?t.specificity===n.specificity?0:t.specificity>n.specificity?-1:1:t.abi?-1:1:t.runtime===e?-1:1}}function oe(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<`u`&&window.process&&window.process.type===`renderer`}function se(e){if(e!==`linux`)return!1;let{familySync:t,MUSL:n}=Ep();return t()===n}g.parseTags=ne,g.matchTags=re,g.compareTags=ae,g.parseTuple=b,g.matchTuple=ee,g.compareTuples=te})),Op=i(((e,t)=>{t.exports=Dp()(__dirname)}));if(!(process.env.CBOR_NATIVE_ACCELERATION_DISABLED!==void 0&&process.env.CBOR_NATIVE_ACCELERATION_DISABLED.toLowerCase()===`true`)){let t;try{t=typeof e==`function`?Op():$c(import.meta.url)(`cbor-extract`),t&&yf(t.extractStrings)}catch{}}var kp=Kc();let Ap,jp,Mp,Np;const Pp={connections:8,keepAliveTimeout:1e4},Fp={...Pp,allowH2:!1,pipelining:1},Ip={...Pp,allowH2:!0,pipelining:100,initialWindowSize:4194304,connectionWindowSize:16777216},Lp={...Pp,allowH2:!0,pipelining:1},Rp={retryAfter:!0,statusCodes:[500,502,503,504]},zp={retryAfter:!0,methods:[`PUT`],statusCodes:[429]},Bp={retryAfter:!0,methods:[`PUT`],statusCodes:[429,500,502,503,504]};function Vp(){return process.env.WORKFLOW_H2_MULTIPLEX!==`0`}function Hp(e){if(!e||typeof e!=`object`||Array.isArray(e))return NaN;let t=e,n=t[`content-length`]??t[`Content-Length`];return typeof n==`string`||typeof n==`number`?Number(n):NaN}function Up(e){return(t,n)=>{let r=t.body,i=!!r&&typeof r!=`string`&&!Buffer.isBuffer(r)&&typeof r[Symbol.asyncIterator]==`function`,a=Hp(t.headers);return!i||!(a>=0)||a>1048576?e({...t,idempotent:!0},n):((async()=>{try{let i=[];for await(let e of r)i.push(Buffer.from(e));e({...t,body:Buffer.concat(i),idempotent:!0},n)}catch(e){n.onError?.(e)}})(),!0)}}function Wp(e){return e?.dispatcher??Qp()}function Gp(e){return e?.dispatcher??$p()}function Kp(e){return e?.dispatcher??em()}function qp(e){return e?.dispatcher??tm()}function Jp(e,t){return new kp.RetryAgent(new kp.Agent(e),t)}function Yp(e){let t=new kp.RetryAgent(new kp.Agent({...Ip,...e}),Rp);return Vp()?Xp(t,t.compose(Up)):t}function Xp(e,t){return new Proxy(t,{get:(t,n)=>n===`close`||n===`destroy`?e[n].bind(e):t[n]})}function Zp(e,t){return new kp.RetryAgent(new kp.Agent({...Lp,...t}),e)}function Qp(){return Ap??=Jp(Fp,Rp),Ap}function $p(){return jp??=Yp(),jp}function em(){return Mp??=Zp(zp),Mp}function tm(){return Np??=Zp(Bp),Np}let nm=null;async function rm(){return nm||=import(`../../_chunks/workflow/src-Cj3P1ChQ.js`).then(e=>n(e.t(),1)).catch(e=>(typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`)&&console.warn(`[workflow] @opentelemetry/api unavailable — world-vercel spans disabled:`,e instanceof Error?e.message:e),null)),nm}let im=null;function am(){return typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`)}let om=!1;function sm(e,t){if(!(om||!am())){om=!0;try{let n=globalThis[Symbol.for(`opentelemetry.js.api.1`)],r=e.trace.getTracerProvider(),i=r.getDelegate?.()??r,a=t.startSpan(`workflow.otel.probe.world_vercel`);console.warn(`[workflow:otel-diag] world-vercel`,JSON.stringify({globalRegistrationVersion:n?.version??null,providerCtor:r?.constructor?.name??null,delegateCtor:i?.constructor?.name??null,tracerCtor:t?.constructor?.name??null,probeCtor:a?.constructor?.name??null,probeRecording:a.isRecording()})),a.end()}catch(e){console.warn(`[workflow:otel-diag] world-vercel failed:`,e instanceof Error?e.message:e)}}}async function cm(){return im||=rm().then(e=>{if(!e)return null;let t=e.trace.getTracer(`workflow`);return sm(e,t),t}),im}async function lm(e,...t){let[n,r]=await Promise.all([cm(),rm()]),{fn:i,opts:a}=typeof t[0]==`function`?{fn:t[0],opts:{}}:{fn:t[1],opts:t[0]};if(!i)throw Error(`Function to trace must be provided`);return!n||!r?await i():n.startActiveSpan(e,a,async e=>{try{let t=await i(e);return e.setStatus({code:r.SpanStatusCode.OK}),t}catch(t){throw e.setStatus({code:r.SpanStatusCode.ERROR,message:t.message}),t}finally{e.end()}})}async function um(e){let t=await rm();if(t)return t.SpanKind[e]}async function dm(e){let t=await rm();if(!t)return;let n={};t.propagation.inject(t.context.active(),n);for(let[t,r]of Object.entries(n))e.set(t,r)}function L(...e){return t=>Object.fromEntries(e.map(e=>[e,t]))}const fm=L(`http.request.method`),pm=L(`url.full`),mm=L(`server.address`),hm=L(`server.port`),gm=L(`http.response.status_code`),_m=L(`error.type`),vm=L(`workflow.world.parse.format`),ym=L(`peer.service`),bm=L(`rpc.system`),xm=L(`rpc.service`),Sm=L(`rpc.method`),Cm=L(`workflow.run.id`),wm=L(`step.id`),Tm=L(`workflow.stream.name`),Em=L(`workflow.stream.operation`),Dm=L(`workflow.stream.start_index`),Om=()=>Rc(`WORKFLOW_REQUEST_TIMEOUT_MS`,6e4,{integer:!0,min:1}),km=typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`),Am=[`x-vercel-id`,`x-vercel-error`,`x-vercel-mitigated`];function jm(e){return Am.flatMap(t=>{let n=e.get(t);return n?[`${t}=${n}`]:[]})}function Mm(e){let t=jm(e);return t.length>0?` (${t.join(`; `)})`:``}function Nm(e,t,n,r){if(!km)return;let i=jm(n.headers),a=i.length>0?`; ${i.join(`; `)}`:``;console.debug(`[workflow:world-vercel:http] ${e} ${t} -> ${n.status} (${r}ms${a})`)}function Pm(e,t,n){if(!process.env.DEBUG)return;let r=Array.from(n.entries()).filter(([e])=>e.toLowerCase()!==`authorization`).map(([e,t])=>`-H "${e}: ${t}"`).join(` `);console.error(`Failed to fetch, reproduce with:\ncurl -X ${e} ${r} "${t}"`)}function Fm(e){if(!e)return;let t=parseInt(e,10);return Number.isNaN(t)?void 0:t}function Im(e,t,n={}){let{retryAfter:r,code:i,url:o,mitigated:d,details:p}=n;return e===409?new f(t):e===410?new l(t):e===412?new c(t,{retryAfter:r,details:p}):e===425?new s(t,{retryAfter:r}):e===429?Lm(e,d)?new a(`${t} (x-vercel-mitigated=challenge)`,{url:o,status:e,code:`TRANSPORT`,retryAfter:r}):new u(t,{retryAfter:r}):new a(t,{url:o,status:e,code:i,retryAfter:r})}function Lm(e,t){return e===429&&t===`challenge`}async function Rm(e){return e?.token??process.env.VERCEL_TOKEN??await(0,Gd.getVercelOidcToken)().catch(()=>null)}function zm(e){try{let t=new URL(e);return{serverAddress:t.hostname,serverPort:t.port?parseInt(t.port,10):t.protocol===`https:`?443:80}}catch{return{}}}function Bm(e){let{method:t,url:n,peerService:r}=e,{serverAddress:i,serverPort:a}=zm(n);return{...fm(t),...pm(n),...i?mm(i):{},...a?hm(a):{},...ym(r),...bm(`http`),...xm(r)}}async function Vm(e){let{method:t,url:n,headers:r,body:i,dispatcher:o,peerService:s=`workflow-server`,timeoutMs:c=Om(),signal:l,injectTraceContext:u=!0,cacheBust:d=!0,logLabel:f,buildError:p,spanName:m,attributes:h,durationAttribute:g}=e,_=f??n;return lm(m??`http ${t}`,{kind:await um(`CLIENT`)},async e=>{if(m&&km&&e){let t=e.spanContext();console.warn(`[workflow:otel-diag] span-open`,JSON.stringify({spanName:m,traceId:t.traceId,spanId:t.spanId,recording:e.isRecording()}))}e?.setAttributes(Bm({method:t,url:n,peerService:s})),h&&e?.setAttributes(h),u&&await dm(r),d&&r.set(`X-Request-Time`,Date.now().toString());let f=c==null?void 0:AbortSignal.timeout(c),v=l&&f?AbortSignal.any([l,f]):l??f,y=Date.now(),b;try{b=await fetch(n,{method:t,headers:r,body:i,signal:v,dispatcher:o})}catch(r){let i=Date.now()-y;if(r instanceof Error&&(r.name===`TimeoutError`||r.name===`AbortError`)){let o=new a(`${t} ${_} timed out after ${i}ms`,{url:n,cause:r});throw e?.setAttributes({..._m(`TIMEOUT`)}),e?.recordException?.(o),o}throw r}let ee=Date.now()-y;if(Nm(t,_,b,ee),e?.setAttributes({...gm(b.status)}),g&&e?.setAttributes({[g]:ee}),!b.ok){if(e?.setAttributes({..._m(`HTTP ${b.status}`)}),Pm(t,n,r),p){let t=await p(b);throw e?.recordException?.(t),t}let i=await b.text().catch(()=>``),a=Im(b.status,`${t} ${_} -> HTTP ${b.status}: ${b.statusText}${i?` ${i}`:``}${Mm(b.headers)}`,{url:n,retryAfter:Fm(b.headers.get(`Retry-After`))});throw e?.recordException?.(a),a}return b})}const Hm=`5.0.0-beta.35`,Um=new Set([`GET`,`HEAD`]),Wm=new Set([`UND_ERR_REQ_RETRY`,`UND_ERR_SOCKET`,`UND_ERR_CONNECT`,`UND_ERR_CONNECT_TIMEOUT`,`UND_ERR_HEADERS_TIMEOUT`,`UND_ERR_BODY_TIMEOUT`,`UND_ERR_CLOSED`,`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`EAI_AGAIN`,`EPIPE`]);function Gm(e){let t=e;for(let e=0;t!=null&&e<5;e++){if(typeof t==`object`&&`code`in t){let e=t.code;if(typeof e==`string`&&Wm.has(e))return e}t=t?.cause}}const Km=()=>process.env.VERCEL_WORKFLOW_SERVER_URL||``,qm=()=>process.env.WORKFLOW_TEST_LIMIT_OVERRIDES?.trim()||``;function Jm(e){return e}const Ym=(...e)=>e.filter(Boolean).join(` `),Xm=()=>{let e=process.env.VERCEL_DEPLOYMENT_ID;return e?`@workflow/world-vercel/${Hm} node-${process.version} ${Tl.platform()} (${Tl.arch()}) ${e}`:`@workflow/world-vercel/${Hm} node-${process.version} ${Tl.platform()} (${Tl.arch()})`},Zm=e=>{let t=e?.projectConfig,n=Km()||`https://vercel-workflow.com`,r=process.env.WORKFLOW_VERCEL_BACKEND_URL,i=!!(t?.projectId&&t?.teamId);return{baseUrl:i?r||`https://api.vercel.com/v1/workflow`:`${n}/api`,usingProxy:i}},Qm=e=>{let t=e?.projectConfig;return t?t.environment||`production`:process.env.VERCEL_TARGET_ENV||process.env.VERCEL_ENV||void 0},$m=(e,t)=>{let n=e?.projectConfig,r=new Headers(e?.headers);r.set(`User-Agent`,Ym(Xm(),r.get(`User-Agent`)));let i=qm();i&&r.set(`x-workflow-test-limit-overrides`,i),n&&(r.set(`x-vercel-environment`,Qm(e)),n.projectId&&r.set(`x-vercel-project-id`,n.projectId),n.teamId&&r.set(`x-vercel-team-id`,n.teamId));let a=Km();return a&&t.usingProxy&&r.set(`x-vercel-workflow-api-url`,a),r};async function eh(e){let{baseUrl:t,usingProxy:n}=Zm(e),r=$m(e,{usingProxy:n});if(n){if(!e?.token)throw Error(`world-vercel: api-workflow proxy requested (${t}) but no Vercel auth token was provided. Pass one as \`config.token\` (the SDK reads it from \`WORKFLOW_VERCEL_AUTH_TOKEN\`).`);r.set(`Authorization`,`Bearer ${e.token}`)}else{let t;try{t=await(0,Gd.getVercelOidcToken)()}catch{}let n=e?.token??t;n&&r.set(`Authorization`,`Bearer ${n}`),t&&r.set(`x-vercel-trusted-oidc-idp-token`,t)}return{baseUrl:t,headers:r,usingProxy:n}}async function R({endpoint:e,options:t={},config:n={},schema:r,data:i,onResponse:o,retryConnectTimeout:s=!1}){let c=t.method||`GET`,{baseUrl:l,headers:u}=await eh(n),d=`${l}${e}`;return lm(`http ${c}`,{kind:await um(`CLIENT`)},async l=>{l?.setAttributes(Bm({method:c,url:d,peerService:`workflow-server`})),u.set(`Accept`,`application/cbor`),await dm(u);let f;i!==void 0&&(u.set(`Content-Type`,`application/cbor`),f=_p(i));let p=Um.has(c.toUpperCase()),m,h=``;for(let r=0;;r++){u.set(`X-Request-Time`,Date.now().toString());let i=AbortSignal.timeout(Om()),g=t.signal?AbortSignal.any([t.signal,i]):i,_=new Request(d,{...t,body:f,headers:u,signal:g}),v=Date.now(),y;try{y=await fetch(_,{dispatcher:Wp(n)})}catch(t){let n=Date.now()-v;if(t instanceof Error&&(t.name===`TimeoutError`||t.name===`AbortError`)){let r=new a(`${c} ${e} timed out after ${n}ms`,{url:d,code:`TIMEOUT`,cause:t});throw l?.setAttributes({..._m(`TIMEOUT`)}),l?.recordException?.(r),r}let i=Gm(t);if(i){if(s&&p&&i===`UND_ERR_CONNECT_TIMEOUT`&&r===0){await new Promise(e=>setTimeout(e,100));continue}let o=new a(`${c} ${e} transport failure after ${n}ms (${i})`,{url:d,code:`TRANSPORT`,cause:t});throw l?.setAttributes({..._m(`TRANSPORT`)}),l?.recordException?.(o),o}throw t}let b=Date.now()-v;if(h=Mm(y.headers),Nm(c,e,y,b),l?.setAttributes({...gm(y.status)}),!y.ok){let t=await nh(y).then(e=>e.data).catch(()=>({})),n=t.code??t.error;Pm(_.method,d,u);let r=Fm(y.headers.get(`Retry-After`)),i=(t.message||`${_.method} ${e} -> HTTP ${y.status}: ${y.statusText}`)+h,a=Im(y.status,i,{url:d,code:n,retryAfter:r,mitigated:y.headers.get(`x-vercel-mitigated`)});throw l?.setAttributes({..._m(n||`HTTP ${y.status}`)}),l?.recordException?.(a),a}o?.(y);try{m=await lm(`world.parse`,async e=>{let t=await nh(y),n=(y.headers.get(`Content-Type`)||``).includes(`application/cbor`);return e?.setAttributes({...vm(n?`cbor`:`json`)}),t});break}catch(t){if(p&&r<2){let n=100*2**r;l?.setAttributes({..._m(`PARSE_ERROR_RETRYING`)}),km&&console.debug(`[workflow:world-vercel:http] ${c} ${e} body parse failed (attempt ${r+1}/3); retrying in ${n}ms: ${t}`),await new Promise(e=>setTimeout(e,n));continue}let n=y.headers.get(`Content-Type`)||`unknown`;throw new a(`Failed to parse response body for ${c} ${e}${h} (Content-Type: ${n}):\n\n${t}`,{url:d,code:`PARSE_ERROR`,cause:t})}}return await lm(`world.validate`,async()=>{let t=r.safeParse(m.data);if(!t.success){let n=t.error.issues.map(e=>` ${e.path.length>0?e.path.join(`.`):`<root>`}: ${e.message}`).join(`
|
|
5
|
-
`),r=process.env.DEBUG?`\n\nResponse context: ${m.getDebugContext()}`:``;throw new
|
|
6
|
-
--${e}`),this.findPartialTailBoundary=
|
|
7
|
-
--${e}`),this.boundaryLength=4+e.length,this.findDoubleNewline=
|
|
4
|
+
`);function ce(e){var t=_(i.join(e,`prebuilds`)).map(b).filter(ee(f,d)).sort(te)[0];if(t)return le(i.join(e,`prebuilds`,t.name))}function le(e){var t=_(e).map(ne).filter(re(u,l)).sort(ae(u))[0];if(t)return i.join(e,t.file)}};function _(e){try{return r.readdirSync(e)}catch{return[]}}function v(e,t){var n=_(e).filter(t);return n[0]&&i.join(e,n[0])}function y(e){return/\.node$/.test(e)}function b(e){var t=e.split(`-`);if(t.length===2){var n=t[0],r=t[1].split(`+`);if(n&&r.length&&r.every(Boolean))return{name:e,platform:n,architectures:r}}}function ee(e,t){return function(n){return n==null||n.platform!==e?!1:n.architectures.includes(t)}}function te(e,t){return e.architectures.length-t.architectures.length}function ne(e){var t=e.split(`.`),n=t.pop(),r={file:e,specificity:0};if(n===`node`){for(var i=0;i<t.length;i++){var a=t[i];if(a===`node`||a===`electron`||a===`node-webkit`)r.runtime=a;else if(a===`napi`)r.napi=!0;else if(a.slice(0,3)===`abi`)r.abi=a.slice(3);else if(a.slice(0,2)===`uv`)r.uv=a.slice(2);else if(a.slice(0,4)===`armv`)r.armv=a.slice(4);else if(a===`glibc`||a===`musl`)r.libc=a;else continue;r.specificity++}return r}}function re(e,t){return function(n){return!(n==null||n.runtime!==e&&!ie(n)||n.abi!==t&&!n.napi||n.uv&&n.uv!==h||n.armv&&n.armv!==m||n.libc&&n.libc!==p)}}function ie(e){return e.runtime===`node`&&e.napi}function ae(e){return function(t,n){return t.runtime===n.runtime?t.abi===n.abi?t.specificity===n.specificity?0:t.specificity>n.specificity?-1:1:t.abi?-1:1:t.runtime===e?-1:1}}function oe(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<`u`&&window.process&&window.process.type===`renderer`}function se(e){if(e!==`linux`)return!1;let{familySync:t,MUSL:n}=kp();return t()===n}g.parseTags=ne,g.matchTags=re,g.compareTags=ae,g.parseTuple=b,g.matchTuple=ee,g.compareTuples=te})),jp=i(((e,t)=>{t.exports=Ap()(__dirname)}));if(!(process.env.CBOR_NATIVE_ACCELERATION_DISABLED!==void 0&&process.env.CBOR_NATIVE_ACCELERATION_DISABLED.toLowerCase()===`true`)){let t;try{t=typeof e==`function`?jp():nl(import.meta.url)(`cbor-extract`),t&&Sf(t.extractStrings)}catch{}}var Mp=Yc();let Np,Pp,Fp,Ip;const Lp={connections:8,keepAliveTimeout:1e4},Rp={...Lp,allowH2:!1,pipelining:1},zp={...Lp,allowH2:!0,pipelining:100,initialWindowSize:4194304,connectionWindowSize:16777216},Bp={...Lp,allowH2:!0,pipelining:1},Vp={retryAfter:!0,statusCodes:[500,502,503,504]},Hp={retryAfter:!0,methods:[`PUT`],statusCodes:[429]},Up={retryAfter:!0,methods:[`PUT`],statusCodes:[429,500,502,503,504]};function Wp(){return process.env.WORKFLOW_H2_MULTIPLEX!==`0`}function Gp(e){if(!e||typeof e!=`object`||Array.isArray(e))return NaN;let t=e,n=t[`content-length`]??t[`Content-Length`];return typeof n==`string`||typeof n==`number`?Number(n):NaN}function Kp(e){return(t,n)=>{let r=t.body,i=!!r&&typeof r!=`string`&&!Buffer.isBuffer(r)&&typeof r[Symbol.asyncIterator]==`function`,a=Gp(t.headers);return!i||!(a>=0)||a>1048576?e({...t,idempotent:!0},n):((async()=>{try{let i=[];for await(let e of r)i.push(Buffer.from(e));e({...t,body:Buffer.concat(i),idempotent:!0},n)}catch(e){n.onError?.(e)}})(),!0)}}function qp(e){return e?.dispatcher??tm()}function Jp(e){return e?.dispatcher??nm()}function Yp(e){return e?.dispatcher??rm()}function Xp(e){return e?.dispatcher??im()}function Zp(e,t){return new Mp.RetryAgent(new Mp.Agent(e),t)}function Qp(e){let t=new Mp.RetryAgent(new Mp.Agent({...zp,...e}),Vp);return Wp()?$p(t,t.compose(Kp)):t}function $p(e,t){return new Proxy(t,{get:(t,n)=>n===`close`||n===`destroy`?e[n].bind(e):t[n]})}function em(e,t){return new Mp.RetryAgent(new Mp.Agent({...Bp,...t}),e)}function tm(){return Np??=Zp(Rp,Vp),Np}function nm(){return Pp??=Qp(),Pp}function rm(){return Fp??=em(Hp),Fp}function im(){return Ip??=em(Up),Ip}let am=null;async function om(){return am||=import(`../../_chunks/workflow/src-Cj3P1ChQ.js`).then(e=>n(e.t(),1)).catch(e=>(typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`)&&console.warn(`[workflow] @opentelemetry/api unavailable — world-vercel spans disabled:`,e instanceof Error?e.message:e),null)),am}let sm=null;function cm(){return typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`)}let lm=!1;function um(e,t){if(!(lm||!cm())){lm=!0;try{let n=globalThis[Symbol.for(`opentelemetry.js.api.1`)],r=e.trace.getTracerProvider(),i=r.getDelegate?.()??r,a=t.startSpan(`workflow.otel.probe.world_vercel`);console.warn(`[workflow:otel-diag] world-vercel`,JSON.stringify({globalRegistrationVersion:n?.version??null,providerCtor:r?.constructor?.name??null,delegateCtor:i?.constructor?.name??null,tracerCtor:t?.constructor?.name??null,probeCtor:a?.constructor?.name??null,probeRecording:a.isRecording()})),a.end()}catch(e){console.warn(`[workflow:otel-diag] world-vercel failed:`,e instanceof Error?e.message:e)}}}async function dm(){return sm||=om().then(e=>{if(!e)return null;let t=e.trace.getTracer(`workflow`);return um(e,t),t}),sm}async function fm(e,...t){let[n,r]=await Promise.all([dm(),om()]),{fn:i,opts:a}=typeof t[0]==`function`?{fn:t[0],opts:{}}:{fn:t[1],opts:t[0]};if(!i)throw Error(`Function to trace must be provided`);return!n||!r?await i():n.startActiveSpan(e,a,async e=>{try{let t=await i(e);return e.setStatus({code:r.SpanStatusCode.OK}),t}catch(t){throw e.setStatus({code:r.SpanStatusCode.ERROR,message:t.message}),t}finally{e.end()}})}async function pm(e){let t=await om();if(t)return t.SpanKind[e]}async function mm(e){let t=await om();if(!t)return;let n={};t.propagation.inject(t.context.active(),n);for(let[t,r]of Object.entries(n))e.set(t,r)}function L(...e){return t=>Object.fromEntries(e.map(e=>[e,t]))}const hm=L(`http.request.method`),gm=L(`url.full`),_m=L(`server.address`),vm=L(`server.port`),ym=L(`http.response.status_code`),bm=L(`error.type`),xm=L(`workflow.world.parse.format`),Sm=L(`peer.service`),Cm=L(`rpc.system`),wm=L(`rpc.service`),Tm=L(`rpc.method`),Em=L(`workflow.run.id`),Dm=L(`step.id`),Om=L(`workflow.stream.name`),km=L(`workflow.stream.operation`),Am=L(`workflow.stream.start_index`),jm=()=>Vc(`WORKFLOW_REQUEST_TIMEOUT_MS`,6e4,{integer:!0,min:1}),Mm=typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`),Nm=[`x-vercel-id`,`x-vercel-error`,`x-vercel-mitigated`];function Pm(e){return Nm.flatMap(t=>{let n=e.get(t);return n?[`${t}=${n}`]:[]})}function Fm(e){let t=Pm(e);return t.length>0?` (${t.join(`; `)})`:``}function Im(e,t,n,r){if(!Mm)return;let i=Pm(n.headers),a=i.length>0?`; ${i.join(`; `)}`:``;console.debug(`[workflow:world-vercel:http] ${e} ${t} -> ${n.status} (${r}ms${a})`)}function Lm(e,t,n){if(!process.env.DEBUG)return;let r=Array.from(n.entries()).filter(([e])=>e.toLowerCase()!==`authorization`).map(([e,t])=>`-H "${e}: ${t}"`).join(` `);console.error(`Failed to fetch, reproduce with:\ncurl -X ${e} ${r} "${t}"`)}function Rm(e){if(!e)return;let t=parseInt(e,10);return Number.isNaN(t)?void 0:t}function zm(e,t,n={}){let{retryAfter:r,code:i,url:a,mitigated:d,details:p}=n;return e===409?new f(t):e===410?new l(t):e===412?new c(t,{retryAfter:r,details:p}):e===425?new s(t,{retryAfter:r}):e===429?Bm(e,d)?new o(`${t} (x-vercel-mitigated=challenge)`,{url:a,status:e,code:`TRANSPORT`,retryAfter:r}):new u(t,{retryAfter:r}):new o(t,{url:a,status:e,code:i,retryAfter:r})}function Bm(e,t){return e===429&&t===`challenge`}async function Vm(e){return e?.token??process.env.VERCEL_TOKEN??await(0,Jd.getVercelOidcToken)().catch(()=>null)}function Hm(e){try{let t=new URL(e);return{serverAddress:t.hostname,serverPort:t.port?parseInt(t.port,10):t.protocol===`https:`?443:80}}catch{return{}}}function Um(e){let{method:t,url:n,peerService:r}=e,{serverAddress:i,serverPort:a}=Hm(n);return{...hm(t),...gm(n),...i?_m(i):{},...a?vm(a):{},...Sm(r),...Cm(`http`),...wm(r)}}async function Wm(e){let{method:t,url:n,headers:r,body:i,dispatcher:a,peerService:s=`workflow-server`,timeoutMs:c=jm(),signal:l,injectTraceContext:u=!0,cacheBust:d=!0,logLabel:f,buildError:p,spanName:m,attributes:h,durationAttribute:g}=e,_=f??n;return fm(m??`http ${t}`,{kind:await pm(`CLIENT`)},async e=>{if(m&&Mm&&e){let t=e.spanContext();console.warn(`[workflow:otel-diag] span-open`,JSON.stringify({spanName:m,traceId:t.traceId,spanId:t.spanId,recording:e.isRecording()}))}e?.setAttributes(Um({method:t,url:n,peerService:s})),h&&e?.setAttributes(h),u&&await mm(r),d&&r.set(`X-Request-Time`,Date.now().toString());let f=c==null?void 0:AbortSignal.timeout(c),v=l&&f?AbortSignal.any([l,f]):l??f,y=Date.now(),b;try{b=await fetch(n,{method:t,headers:r,body:i,signal:v,dispatcher:a})}catch(r){let i=Date.now()-y;if(r instanceof Error&&(r.name===`TimeoutError`||r.name===`AbortError`)){let a=new o(`${t} ${_} timed out after ${i}ms`,{url:n,cause:r});throw e?.setAttributes({...bm(`TIMEOUT`)}),e?.recordException?.(a),a}throw r}let ee=Date.now()-y;if(Im(t,_,b,ee),e?.setAttributes({...ym(b.status)}),g&&e?.setAttributes({[g]:ee}),!b.ok){if(e?.setAttributes({...bm(`HTTP ${b.status}`)}),Lm(t,n,r),p){let t=await p(b);throw e?.recordException?.(t),t}let i=await b.text().catch(()=>``),a=zm(b.status,`${t} ${_} -> HTTP ${b.status}: ${b.statusText}${i?` ${i}`:``}${Fm(b.headers)}`,{url:n,retryAfter:Rm(b.headers.get(`Retry-After`))});throw e?.recordException?.(a),a}return b})}const Gm=`5.0.0-beta.36`,Km=new Set([`GET`,`HEAD`]),qm=new Set([`UND_ERR_REQ_RETRY`,`UND_ERR_SOCKET`,`UND_ERR_CONNECT`,`UND_ERR_CONNECT_TIMEOUT`,`UND_ERR_HEADERS_TIMEOUT`,`UND_ERR_BODY_TIMEOUT`,`UND_ERR_CLOSED`,`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`EAI_AGAIN`,`EPIPE`]);function Jm(e){let t=e;for(let e=0;t!=null&&e<5;e++){if(typeof t==`object`&&`code`in t){let e=t.code;if(typeof e==`string`&&qm.has(e))return e}t=t?.cause}}const Ym=()=>process.env.VERCEL_WORKFLOW_SERVER_URL||``,Xm=()=>process.env.WORKFLOW_TEST_LIMIT_OVERRIDES?.trim()||``;function Zm(e){return e}const Qm=(...e)=>e.filter(Boolean).join(` `),$m=()=>{let e=process.env.VERCEL_DEPLOYMENT_ID;return e?`@workflow/world-vercel/${Gm} node-${process.version} ${Ol.platform()} (${Ol.arch()}) ${e}`:`@workflow/world-vercel/${Gm} node-${process.version} ${Ol.platform()} (${Ol.arch()})`},eh=e=>{let t=e?.projectConfig,n=Ym()||`https://vercel-workflow.com`,r=process.env.WORKFLOW_VERCEL_BACKEND_URL,i=!!(t?.projectId&&t?.teamId);return{baseUrl:i?r||`https://api.vercel.com/v1/workflow`:`${n}/api`,usingProxy:i}},th=e=>{let t=e?.projectConfig;return t?t.environment||`production`:process.env.VERCEL_TARGET_ENV||process.env.VERCEL_ENV||void 0},nh=(e,t)=>{let n=e?.projectConfig,r=new Headers(e?.headers);r.set(`User-Agent`,Qm($m(),r.get(`User-Agent`)));let i=Xm();i&&r.set(`x-workflow-test-limit-overrides`,i),n&&(r.set(`x-vercel-environment`,th(e)),n.projectId&&r.set(`x-vercel-project-id`,n.projectId),n.teamId&&r.set(`x-vercel-team-id`,n.teamId));let a=Ym();return a&&t.usingProxy&&r.set(`x-vercel-workflow-api-url`,a),r};async function rh(e){let{baseUrl:t,usingProxy:n}=eh(e),r=nh(e,{usingProxy:n});if(n){if(!e?.token)throw Error(`world-vercel: api-workflow proxy requested (${t}) but no Vercel auth token was provided. Pass one as \`config.token\` (the SDK reads it from \`WORKFLOW_VERCEL_AUTH_TOKEN\`).`);r.set(`Authorization`,`Bearer ${e.token}`)}else{let t;try{t=await(0,Jd.getVercelOidcToken)()}catch{}let n=e?.token??t;n&&r.set(`Authorization`,`Bearer ${n}`),t&&r.set(`x-vercel-trusted-oidc-idp-token`,t)}return{baseUrl:t,headers:r,usingProxy:n}}async function R({endpoint:e,options:t={},config:n={},schema:r,data:i,onResponse:a,retryConnectTimeout:s=!1}){let c=t.method||`GET`,{baseUrl:l,headers:u}=await rh(n),d=`${l}${e}`;return fm(`http ${c}`,{kind:await pm(`CLIENT`)},async l=>{l?.setAttributes(Um({method:c,url:d,peerService:`workflow-server`})),u.set(`Accept`,`application/cbor`),await mm(u);let f;i!==void 0&&(u.set(`Content-Type`,`application/cbor`),f=bp(i));let p=Km.has(c.toUpperCase()),m,h=``;for(let r=0;;r++){u.set(`X-Request-Time`,Date.now().toString());let i=AbortSignal.timeout(jm()),g=t.signal?AbortSignal.any([t.signal,i]):i,_=new Request(d,{...t,body:f,headers:u,signal:g}),v=Date.now(),y;try{y=await fetch(_,{dispatcher:qp(n)})}catch(t){let n=Date.now()-v;if(t instanceof Error&&(t.name===`TimeoutError`||t.name===`AbortError`)){let r=new o(`${c} ${e} timed out after ${n}ms`,{url:d,code:`TIMEOUT`,cause:t});throw l?.setAttributes({...bm(`TIMEOUT`)}),l?.recordException?.(r),r}let i=Jm(t);if(i){if(s&&p&&i===`UND_ERR_CONNECT_TIMEOUT`&&r===0){await new Promise(e=>setTimeout(e,100));continue}let a=new o(`${c} ${e} transport failure after ${n}ms (${i})`,{url:d,code:`TRANSPORT`,cause:t});throw l?.setAttributes({...bm(`TRANSPORT`)}),l?.recordException?.(a),a}throw t}let b=Date.now()-v;if(h=Fm(y.headers),Im(c,e,y,b),l?.setAttributes({...ym(y.status)}),!y.ok){let t=await ah(y).then(e=>e.data).catch(()=>({})),n=t.code??t.error;Lm(_.method,d,u);let r=Rm(y.headers.get(`Retry-After`)),i=(t.message||`${_.method} ${e} -> HTTP ${y.status}: ${y.statusText}`)+h,a=zm(y.status,i,{url:d,code:n,retryAfter:r,mitigated:y.headers.get(`x-vercel-mitigated`)});throw l?.setAttributes({...bm(n||`HTTP ${y.status}`)}),l?.recordException?.(a),a}a?.(y);try{m=await fm(`world.parse`,async e=>{let t=await ah(y),n=(y.headers.get(`Content-Type`)||``).includes(`application/cbor`);return e?.setAttributes({...xm(n?`cbor`:`json`)}),t});break}catch(t){if(p&&r<2){let n=100*2**r;l?.setAttributes({...bm(`PARSE_ERROR_RETRYING`)}),Mm&&console.debug(`[workflow:world-vercel:http] ${c} ${e} body parse failed (attempt ${r+1}/3); retrying in ${n}ms: ${t}`),await new Promise(e=>setTimeout(e,n));continue}let n=y.headers.get(`Content-Type`)||`unknown`;throw new o(`Failed to parse response body for ${c} ${e}${h} (Content-Type: ${n}):\n\n${t}`,{url:d,code:`PARSE_ERROR`,cause:t})}}return await fm(`world.validate`,async()=>{let t=r.safeParse(m.data);if(!t.success){let n=t.error.issues.map(e=>` ${e.path.length>0?e.path.join(`.`):`<root>`}: ${e.message}`).join(`
|
|
5
|
+
`),r=process.env.DEBUG?`\n\nResponse context: ${m.getDebugContext()}`:``;throw new o(`Schema validation failed for ${c} ${e}${h}:\n${n}${r}`,{url:d,code:`SCHEMA_VALIDATION`,cause:t.error})}return t.data})})}function ih(e){let t=Tl(e,{depth:3,maxArrayLength:10,breakLength:120});return t.length>500?`${t.slice(0,500)}...`:t}async function ah(e){let t=e.headers.get(`Content-Type`)||``;if(t.includes(`application/cbor`)){let n=await e.arrayBuffer(),r=qf(new Uint8Array(n));return{data:r,getDebugContext:()=>`Content-Type: ${t}, ${n.byteLength} bytes (CBOR), preview: ${ih(r)}`}}let n=await e.text(),r=JSON.parse(n);return{data:r,getDebugContext:()=>`Content-Type: ${t}, ${n.length} bytes, preview: ${ih(r)}`}}function oh(e,t){t?.limit&&e.set(`limit`,t.limit.toString()),t?.cursor&&e.set(`cursor`,t.cursor),t?.sortOrder&&e.set(`sortOrder`,t.sortOrder)}function sh(e){let t=e.toString();return t?`?${t}`:``}function ch(e,t){t.workflowName&&e.set(`workflowName`,t.workflowName),t.startTime&&t.endTime&&(e.set(`startTime`,t.startTime),e.set(`endTime`,t.endTime)),oh(e,t.pagination)}function lh(e){return{runs:{get(t){return R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t)}`,config:e,schema:ir})},list(t={}){let n=new URLSearchParams;return t.workflowName&&n.set(`workflowName`,t.workflowName),t.status&&n.set(`status`,t.status),t.startTime&&t.endTime&&(n.set(`startTime`,t.startTime),n.set(`endTime`,t.endTime)),t.attributes&&Object.keys(t.attributes).length>0&&n.set(`attributes`,JSON.stringify(t.attributes)),oh(n,t.pagination),R({endpoint:`/v2/analytics/runs${sh(n)}`,config:e,schema:zs(ir)})}},attributes:{list(t={}){let n=new URLSearchParams;return ch(n,t),R({endpoint:`/v2/analytics/attributes${sh(n)}`,config:e,schema:zs(Jn)})}},steps:{get(t,n){return R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t)}/steps/${encodeURIComponent(n)}`,config:e,schema:Ie})},list(t){let n=new URLSearchParams;return oh(n,t.pagination),R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t.runId)}/steps${sh(n)}`,config:e,schema:zs(Ie)})}},events:{get(t,n){return R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t)}/events/${encodeURIComponent(n)}`,config:e,schema:_e})},list(t){let n=new URLSearchParams;return t.eventType&&n.set(`eventType`,t.eventType),t.correlationId&&n.set(`correlationId`,t.correlationId),oh(n,t.pagination),R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t.runId)}/events${sh(n)}`,config:e,schema:zs(_e)})},listByCorrelationId(t){let n=new URLSearchParams;return n.set(`correlationId`,t.correlationId),oh(n,t.pagination),R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t.runId)}/events${sh(n)}`,config:e,schema:zs(_e)})}},hooks:{get(t,n){let r=new URLSearchParams;return n?.runId&&r.set(`runId`,n.runId),R({endpoint:`/v2/analytics/hooks/${encodeURIComponent(t)}${sh(r)}`,config:e,schema:ic})},list(t){let n=new URLSearchParams;return n.set(`runId`,t.runId),oh(n,t.pagination),R({endpoint:`/v2/analytics/hooks${sh(n)}`,config:e,schema:zs(ic)})}},waits:{get(t,n){return R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t)}/waits/${encodeURIComponent(n)}`,config:e,schema:De})},list(t){let n=new URLSearchParams;return t.status&&n.set(`status`,t.status),oh(n,t.pagination),R({endpoint:`/v2/analytics/runs/${encodeURIComponent(t.runId)}/waits${sh(n)}`,config:e,schema:zs(De)})}}}}const uh=Li();let dh;function fh(e){let t=qc(e),n=5,r=1;for(;n>=0&&r>0;){let e=t[n]+r;t[n]=e&255,r=e>>8,n--}if(r>0)throw Error(`ULID space exhausted`);return Gc(t)}function ph(e){return typeof e!=`string`||e===``||e===`unknown`?null:Object.hasOwn(Uc,e)?e:null}function mh(e){return ph(e?.region)??ph(process.env.VERCEL_REGION)??`iad1`}function hh(e){let t=Uc[mh(e)],n=Wc(uh(),t);if(dh!==void 0)for(;n<=dh;)n=Wc(fh(dh),t);return dh=n,n}function gh(e){let t=e.startsWith(`wrun_`)?e.slice(5):e;try{let e=Jc(t);return e.tagged&&e.region?e.region:Kc}catch{return null}}function _h(e){let t=e.runId;return typeof t!=`string`||t.length===0?null:{region:gh(t)}}async function vh(e,t,n){if(e.length!==32)throw Error(`Invalid deployment key length: expected 32 bytes for AES-256, got ${e.length} bytes`);if(!t||typeof t!=`string`)throw Error(`projectId must be a non-empty string`);let r=await Sl.subtle.importKey(`raw`,e,`HKDF`,!1,[`deriveBits`]),i=new TextEncoder().encode(`${t}|${n}`),a=await Sl.subtle.deriveBits({name:`HKDF`,hash:`SHA-256`,salt:new Uint8Array(32),info:i},r,256);return new Uint8Array(a)}async function yh(e,t,n,r){let i=await Vm({token:r?.token});if(!i)throw Error(`Cannot fetch run key: no OIDC token or VERCEL_TOKEN available`);let a=new URLSearchParams({projectId:t,runId:n});r?.teamId&&a.set(`teamId`,r.teamId);let o=await(await Wm({method:`GET`,url:`https://api.vercel.com/v1/workflow/run-key/${e}?${a}`,headers:new Headers({Authorization:`Bearer ${i}`}),dispatcher:qp({dispatcher:r?.dispatcher}),peerService:`vercel-api`,timeoutMs:null,buildError:async t=>{let r;try{r=await t.text()}catch{r=`<unable to read response body>`}return Error(`Failed to fetch run key for ${n} (deployment ${e}): HTTP ${t.status} ${t.statusText}${r?` — ${r}`:``}`)}})).json(),s=dc({key:qt().nullable()}).safeParse(o);if(!s.success)throw Error(`Invalid response from Vercel API: expected { key: string | null }. Zod error: ${s.error.message}`);if(s.data.key!==null)return Buffer.from(s.data.key,`base64`)}function bh(e,t,n,r){if(!e)return;let i=process.env.VERCEL===`1`,a;function o(){if(a)return a;let e=process.env.VERCEL_DEPLOYMENT_KEY;if(e)return a=Buffer.from(e,`base64`),a}return async function(a,s){let c=typeof a==`string`?a:a.runId,l=typeof a==`string`?s?.deploymentId:a.deploymentId;if(i&&(!l||l===process.env.VERCEL_DEPLOYMENT_ID)){let t=o();return t?vh(t,e,c):void 0}if(l)return yh(l,e,c,{token:n,teamId:t,dispatcher:r})}}async function xh(){let{getDeadline:e}=await import(`../../_chunks/workflow/functions-ClJbpZhR.js`).then(e=>n(e.default,1));return e()}const Sh={peerService:`workflow-server`,rpcSystem:`http`,rpcService:`workflow-server`},Ch={"world.runs.get":0,"world.runs.experimentalSetAttributes":0,"world.steps.get":0,"world.events.create":0,"world.events.get":0},wh=new Set([`world.steps.list`,`world.events.list`,`world.hooks.list`]);function Th(e){if(e.length>=2&&typeof e[1]==`object`&&e[1]!==null){let t=e[1];if(typeof t.eventType==`string`)return t.eventType}}function Eh(e,t){return typeof e[t]==`string`?e[t]:void 0}function Dh(e){if(typeof e!=`object`||!e)return;let t=e.runId;return typeof t==`string`?t:void 0}function Oh(e){if(typeof e!=`object`||!e)return;let t=e;if(typeof t.runId==`string`)return t.runId;for(let e of[`run`,`step`,`hook`,`wait`]){let n=t[e];if(typeof n==`object`&&n){let e=n.runId;if(typeof e==`string`)return e}}}function kh(e,t,n){let r=`${e}.${t}`,i={},a=Ch[r],o=a===void 0?wh.has(r)?Dh(n[0]):void 0:Eh(n,a);if(o&&Object.assign(i,Em(o)),r===`world.steps.get`){let e=Eh(n,1);e&&Object.assign(i,Dm(e))}return i}function Ah(e,t){let n={};for(let r of Object.keys(t))if(typeof t[r]!=`function`)n[r]=t[r];else{let i=t[r],a=String(r);n[r]=async(...t)=>{let n=`${e}.${a}`;if(e===`world.events`&&a===`create`){let r=Th(t);r&&(n=`${e}.${a} ${r}`)}return fm(n,{kind:await pm(`CLIENT`)},async r=>{r?.setAttributes({...Sm(Sh.peerService),...Cm(Sh.rpcSystem),...wm(Sh.rpcService),...Tm(n),...kh(e,a,t)});let o=await i(...t),s=Oh(o);return s&&r?.setAttributes(Em(s)),o})}}return n}var z=class extends Error{constructor(e){super(e),this.name=`MultipartParseError`}};function jh(e){let t=new TextEncoder().encode(e);return(e,n=0)=>Buffer.prototype.indexOf.call(e,t,n)}function Mh(e){let t=new TextEncoder().encode(e),n={};for(let e=0;e<t.length;++e){let r=t[e];n[r]===void 0&&(n[r]=[]),n[r].push(e)}return function(e){let r=e.length-1;if(e[r]in n){let i=n[e[r]];for(let n=i.length-1;n>=0;--n)for(let a=i[n],o=r;a>=0&&e[o]===t[a];--a,--o)if(a===0)return o}return-1}}function Nh(e){let t=new TextDecoder(`iso-8859-1`).decode(e).trim().split(/\r?\n/),n=[];for(let e of t){let t=e.indexOf(`:`);if(t>0){let r=e.slice(0,t).trim(),i=e.slice(t+1).trim();n.push([r,i])}}return new Headers(n)}function Ph(e){let t=e.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!t)throw new z(`No boundary found in Content-Type header`);return t[1]??t[2]}var Fh=class{queue=[];waiters=[];finished=!1;cancelled=!1;error=null;enqueue(e){this.finished||this.cancelled||(this.waiters.length>0?this.waiters.shift().resolve(e):this.queue.push(e))}finish(e){if(!this.finished)for(this.finished=!0,this.error=e||null;this.waiters.length>0;){let t=this.waiters.shift();e?t.reject(e):t.resolve(null)}}cancel(){if(!(this.cancelled||this.finished))for(this.cancelled=!0;this.waiters.length>0;)this.waiters.shift().resolve(null)}async dequeue(){if(this.queue.length>0)return this.queue.shift();if(this.finished||this.cancelled){if(this.error)throw this.error;return null}return new Promise((e,t)=>{this.waiters.push({resolve:e,reject:t})})}get isTerminal(){return this.finished||this.cancelled}};async function*Ih(e,t){if(!e.body)throw new z(`Response body is null`);let n=e.headers.get(`content-type`);if(!n)throw new z(`Missing Content-Type header`);yield*new Lh(Ph(n),t).parseStream(e.body)}var Lh=class{boundary;findOpeningBoundary;openingBoundaryLength;findBoundary;findPartialTailBoundary;boundaryLength;findDoubleNewline;maxHeaderSize;maxBoundaryBuffer;state=0;buffer=null;currentHeaders=new Headers;currentPayloadController=null;constructor(e,t={}){this.boundary=e,this.findOpeningBoundary=jh(`--${e}`),this.openingBoundaryLength=2+e.length,this.findBoundary=jh(`\r
|
|
6
|
+
--${e}`),this.findPartialTailBoundary=Mh(`\r
|
|
7
|
+
--${e}`),this.boundaryLength=4+e.length,this.findDoubleNewline=jh(`\r
|
|
8
8
|
\r
|
|
9
|
-
`),this.maxHeaderSize=t.maxHeaderSize??65536,this.maxBoundaryBuffer=t.maxBoundaryBuffer??8192}async*parseStream(e){let t=e.getReader(),n=new
|
|
9
|
+
`),this.maxHeaderSize=t.maxHeaderSize??65536,this.maxBoundaryBuffer=t.maxBoundaryBuffer??8192}async*parseStream(e){let t=e.getReader(),n=new Fh,r=this.startProducer(t,n);try{yield*this.consumeMessages(n)}finally{n.cancel(),this.closeCurrentPayload();try{await t.cancel()}catch{}await r}}async startProducer(e,t){try{for(;!t.isTerminal;){let n;try{n=await e.read()}catch(e){if(e instanceof Error&&(e.name===`AbortError`||e.constructor.name===`AbortError`||e.name===`TimeoutError`||e.constructor.name===`TimeoutError`))break;throw e}let{done:r,value:i}=n;if(r){if(this.buffer!==null&&this.buffer.length>0){let e=this.write(new Uint8Array);for(let n of e){if(t.isTerminal)break;t.enqueue(n)}}if(this.state!==4)throw this.state===0?new z(`Invalid multipart stream: missing initial boundary`):new z(`Unexpected end of stream`);break}if(!(i instanceof Uint8Array))throw new z(`Invalid chunk type: expected Uint8Array, got ${typeof i}`);let a=this.write(i);for(let e of a){if(t.isTerminal)break;t.enqueue(e)}}t.isTerminal||t.finish()}catch(e){this.closeCurrentPayload(e),t.isTerminal||t.finish(e)}finally{try{e.releaseLock()}catch{}}}async*consumeMessages(e){for(;;){let t=await e.dequeue();if(t===null)break;yield t}}write(e){let t=[];if(this.state===4)throw new z(`Unexpected data after end of stream`);let n=0,r=e.length;if(this.buffer!==null){let t=this.buffer.length,n=t+r;if(this.state===2){if(n>this.maxHeaderSize)throw new z(`Buffer size limit exceeded: ${n} bytes > ${this.maxHeaderSize} bytes. This may indicate malformed multipart data with oversized headers.`)}else if(t>this.maxBoundaryBuffer)throw new z(`Boundary buffer limit exceeded: ${t} bytes > ${this.maxBoundaryBuffer} bytes. This may indicate malformed multipart data with invalid boundaries.`);let i=new Uint8Array(n);i.set(this.buffer,0),i.set(e,t),e=i,r=e.length,this.buffer=null}if(r===0&&this.state===0)throw new z(`Invalid multipart stream: missing initial boundary`);for(;;){if(this.state===3){if(r-n<this.boundaryLength){let t=e.subarray(n);if(t.length>this.maxBoundaryBuffer)throw new z(`Boundary buffer limit exceeded: ${t.length} > ${this.maxBoundaryBuffer}`);this.buffer=t;break}let t=this.findBoundary(e,n);if(t===-1){let t=this.findPartialTailBoundary(e);if(t===-1)this.writeBody(n===0?e:e.subarray(n));else{this.writeBody(e.subarray(n,t));let r=e.subarray(t);if(r.length>this.maxBoundaryBuffer)throw new z(`Partial boundary too large: ${r.length} > ${this.maxBoundaryBuffer}`);this.buffer=r}break}this.writeBody(e.subarray(n,t)),this.finishMessage(),n=t+this.boundaryLength,this.state=1}if(this.state===1){if(r-n<2){let t=e.subarray(n);if(t.length>this.maxBoundaryBuffer)throw new z(`After-boundary buffer limit exceeded: ${t.length} > ${this.maxBoundaryBuffer}`);this.buffer=t;break}if(e[n]===45&&e[n+1]===45){this.state=4;break}if(e[n]===13&&e[n+1]===10)n+=2;else if(e[n]===10)n+=1;else throw new z(`Invalid character after boundary: expected CRLF or LF, got 0x${e[n].toString(16)}`);this.state=2}if(this.state===2){if(r-n<4){let t=e.subarray(n);if(t.length>this.maxHeaderSize)throw new z(`Header buffer limit exceeded: ${t.length} > ${this.maxHeaderSize}`);this.buffer=t;break}let i=this.findDoubleNewline(e,n),a=4;if(i===-1&&(i=jh(`
|
|
10
10
|
|
|
11
|
-
`)(e,n),a=2),i===-1){let t=e.subarray(n);if(t.length>this.maxHeaderSize)throw new z(`Headers too large: ${t.length} > ${this.maxHeaderSize} bytes`);this.buffer=t;break}let o=e.subarray(n,i);this.currentHeaders=kh(o);let s=this.createStreamingMessage();t.push(s),n=i+a,this.state=3;continue}if(this.state===0){if(r<this.openingBoundaryLength){if(e.length>this.maxBoundaryBuffer)throw new z(`Initial chunk too large for boundary detection: ${e.length} > ${this.maxBoundaryBuffer}`);this.buffer=e;break}if(this.findOpeningBoundary(e)!==0)throw new z(`Invalid multipart stream: missing initial boundary`);n=this.openingBoundaryLength,this.state=1}}return t}createStreamingMessage(){let e=new Headers(this.currentHeaders),t=new ReadableStream({start:e=>{this.currentPayloadController=e}});return this.currentHeaders=new Headers,{headers:e,payload:t}}writeBody(e){this.currentPayloadController&&this.currentPayloadController.enqueue(e)}finishMessage(){this.currentPayloadController&&=(this.currentPayloadController.close(),null)}closeCurrentPayload(e){if(this.currentPayloadController){try{e?this.currentPayloadController.error(e):this.currentPayloadController.close()}catch{}this.currentPayloadController=null}}};const Ph=(e,t,n)=>{let r=e instanceof RegExp?Fh(e,n):e,i=t instanceof RegExp?Fh(t,n):t,a=r!==null&&i!=null&&Ih(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},Fh=(e,t)=>{let n=t.match(e);return n?n[0]:null},Ih=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},Lh=`\0SLASH`+Math.random()+`\0`,Rh=`\0OPEN`+Math.random()+`\0`,zh=`\0CLOSE`+Math.random()+`\0`,Bh=`\0COMMA`+Math.random()+`\0`,Vh=`\0PERIOD`+Math.random()+`\0`,Hh=new RegExp(Lh,`g`),Uh=new RegExp(Rh,`g`),Wh=new RegExp(zh,`g`),Gh=new RegExp(Bh,`g`),Kh=new RegExp(Vh,`g`),qh=/\\\\/g,Jh=/\\{/g,Yh=/\\}/g,Xh=/\\,/g,Zh=/\\\./g;function Qh(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function $h(e){return e.replace(qh,Lh).replace(Jh,Rh).replace(Yh,zh).replace(Xh,Bh).replace(Zh,Vh)}function eg(e){return e.replace(Hh,`\\`).replace(Uh,`{`).replace(Wh,`}`).replace(Gh,`,`).replace(Kh,`.`)}function tg(e){if(!e)return[``];let t=[],n=Ph(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=tg(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function ng(e,t={}){if(!e)return[];let{max:n=1e5}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),sg($h(e),n,!0).map(eg)}function rg(e){return`{`+e+`}`}function ig(e){return/^-?0\d/.test(e)}function ag(e,t){return e<=t}function og(e,t){return e>=t}function sg(e,t,n){let r=[];for(;;){let i=Ph(`{`,`}`,e);if(!i)return[e];let a=i.pre;if(/\$$/.test(i.pre)){let e=i.post.length?sg(i.post,t,!1):[``];for(let n=0;n<e.length&&n<t;n++){let t=a+`{`+i.body+`}`+e[n];r.push(t)}return r}let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),c=o||s,l=i.body.indexOf(`,`)>=0;if(!c&&!l){if(i.post.match(/,(?!,).*\}/)){e=i.pre+`{`+i.body+zh+i.post,n=!0;continue}return[e]}let u=i.post.length?sg(i.post,t,!1):[``],d;if(c)d=i.body.split(/\.\./);else if(d=tg(i.body),d.length===1&&d[0]!==void 0&&(d=sg(d[0],t,!1).map(rg),d.length===1))return u.map(e=>i.pre+d[0]+e);let f;if(c&&d[0]!==void 0&&d[1]!==void 0){let e=Qh(d[0]),n=Qh(d[1]),r=Math.max(d[0].length,d[1].length),i=d.length===3&&d[2]!==void 0?Math.max(Math.abs(Qh(d[2])),1):1,a=ag;n<e&&(i*=-1,a=og);let o=d.some(ig);f=[];for(let c=e;a(c,n)&&f.length<t;c+=i){let e;if(s)e=String.fromCharCode(c),e===`\\`&&(e=``);else if(e=String(c),o){let t=r-e.length;if(t>0){let n=Array(t+1).join(`0`);e=c<0?`-`+n+e.slice(1):n+e}}f.push(e)}}else{f=[];for(let e=0;e<d.length;e++)f.push.apply(f,sg(d[e],t,!1))}for(let e=0;e<f.length;e++)for(let i=0;i<u.length&&r.length<t;i++){let t=a+f[e]+u[i];(!n||c||t)&&r.push(t)}return r}}const cg=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},lg={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},ug=e=>e.replace(/[[\]\\-]/g,`\\$&`),dg=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),fg=e=>e.join(``),pg=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(lg))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(ug(d)+`-`+ug(t)):t===d&&r.push(ug(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(ug(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(ug(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let e=r[0].length===2?r[0].slice(-1):r[0];return[dg(e),!1,u-n,!1]}let f=`[`+(l?`^`:``)+fg(r)+`]`,p=`[`+(l?``:`^`)+fg(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},mg=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`);var hg;const gg=new Set([`!`,`?`,`+`,`*`,`@`]),_g=e=>gg.has(e),vg=e=>_g(e.type),yg=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),bg=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),xg=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),Sg=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),Cg=`(?!\\.)`,wg=new Set([`[`,`.`]),Tg=new Set([`..`,`.`]),Eg=new Set(`().*{}+?[]^$\\!`),Dg=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),Og=`[^/]+?`;let kg=0;var Ag=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++kg;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for(`nodejs.util.inspect.custom`)](){return{"@@type":`AST`,id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof hg&&t.#i===this))throw Error(`invalid part: `+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#r[t];if(!(n instanceof hg&&n.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new hg(this.type,e);for(let e of this.#r)t.copyIn(e);return t}static#f(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&_g(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new hg(n,t);u=hg.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new hg(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}if(!r.noext&&_g(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#h(n))){let a=t&&t.#h(n)?0:1;d.push(p),p=``;let o=new hg(n,d);d.push(o),u=hg.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new hg(null,t);continue}if(n===`)`)return p===``&&t.#r.length===0&&(t.#u=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#t=void 0,t.#r=[e.substring(n-1)],u}#p(e){return this.#m(e,bg)}#m(e,t=yg){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=xg){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new hg(null,n,this.options);r.#r.push(``),n.push(r),this.#_(e,t)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!Sg.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=Sg.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}static fromGlob(e,t={}){let n=new hg(null,void 0,t);return hg.#f(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!vg(this)){let n=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),r=this.#r.map(t=>{let[r,i,a,o]=typeof t==`string`?hg.#C(t,this.#t,n):t.toRegExpSource(e);return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&Tg.has(this.#r[0]))){let n=wg,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?`(?!(?:^|/)\\.\\.?(?:$|/))`:o?Cg:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,mg(r),this.#t=!!this.#t,this.#n]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#S(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,mg(this.toString()),!1,!1]}let a=!n||e||t?``:this.#S(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#u)o=(this.isStart()&&!t?Cg:``)+Og;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?Cg:``)+`[^/]*?)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,mg(i),this.#t=!!this.#t,this.#n]}#x(){if(vg(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(Eg.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?Og:`[^/]*?`,t=!0;continue}else o=!1;if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=pg(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=`[^/]`,t=!0;continue}i+=Dg(c)}return[i,mg(e),!!t,a]}};hg=Ag;const jg=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),B=(e,t,n={})=>(cg(t),!n.nocomment&&t.charAt(0)===`#`?!1:new a_(t,n).match(e)),Mg=/^\*+([^+@!?*[(]*)$/,Ng=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),Pg=e=>t=>t.endsWith(e),Fg=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),Ig=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Lg=/^\*+\.\*+$/,Rg=e=>!e.startsWith(`.`)&&e.includes(`.`),zg=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Bg=/^\.\*+$/,Vg=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),Hg=/^\*+$/,Ug=e=>e.length!==0&&!e.startsWith(`.`),Wg=e=>e.length!==0&&e!==`.`&&e!==`..`,Gg=/^\?+([^+@!?*[(]*)?$/,Kg=([e,t=``])=>{let n=Xg([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},qg=([e,t=``])=>{let n=Zg([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Jg=([e,t=``])=>{let n=Zg([e]);return t?e=>n(e)&&e.endsWith(t):n},Yg=([e,t=``])=>{let n=Xg([e]);return t?e=>n(e)&&e.endsWith(t):n},Xg=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},Zg=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},Qg=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,$g={win32:{sep:`\\`},posix:{sep:`/`}};B.sep=Qg===`win32`?$g.win32.sep:$g.posix.sep;const e_=Symbol(`globstar **`);B.GLOBSTAR=e_,B.filter=(e,t={})=>n=>B(n,e,t);const t_=(e,t={})=>Object.assign({},e,t);B.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return B;let t=B;return Object.assign((n,r,i={})=>t(n,r,t_(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,t_(e,n))}static defaults(n){return t.defaults(t_(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,t_(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,t_(e,r))}},unescape:(n,r={})=>t.unescape(n,t_(e,r)),escape:(n,r={})=>t.escape(n,t_(e,r)),filter:(n,r={})=>t.filter(n,t_(e,r)),defaults:n=>t.defaults(t_(e,n)),makeRe:(n,r={})=>t.makeRe(n,t_(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,t_(e,r)),match:(n,r,i={})=>t.match(n,r,t_(e,i)),sep:t.sep,GLOBSTAR:e_})};const n_=(e,t={})=>(cg(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:ng(e,{max:t.braceExpandMax}));B.braceExpand=n_,B.makeRe=(e,t={})=>new a_(e,t).makeRe(),B.match=(e,t,n={})=>{let r=new a_(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};const r_=/[?*]|[+@!]\(.*?\)|\[|\]/,i_=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var a_=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){cg(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||Qg,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!r_.test(e[2]))&&!r_.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(e_)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(e_,i),o=t.lastIndexOf(e_),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length,i+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===e_?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===e_)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return n_(this.pattern,this.options)}parse(e){cg(e);let t=this.options;if(e===`**`)return e_;if(e===``)return``;let n,r=null;(n=e.match(Hg))?r=t.dot?Wg:Ug:(n=e.match(Mg))?r=(t.nocase?t.dot?Ig:Fg:t.dot?Pg:Ng)(n[1]):(n=e.match(Gg))?r=(t.nocase?t.dot?qg:Kg:t.dot?Jg:Yg)(n):(n=e.match(Lg))?r=t.dot?zg:Rg:(n=e.match(Bg))&&(r=Vg);let i=Ag.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?`[^/]*?`:t.dot?`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`:`(?:(?!(?:\\/|^)\\.).)*?`,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?i_(e):e===e_?e_:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==e_||a===e_||(a===void 0?i!==void 0&&i!==e_?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==e_&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=e_))});let i=t.filter(e=>e!==e_);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e of i){let i=r;if(n.matchBase&&e.length===1&&(i=[a]),this.matchOne(i,e,t))return n.flipNegate?!0:!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return B.defaults(e).Minimatch}};B.AST=Ag,B.Minimatch=a_,B.escape=jg,B.unescape=mg;var o_=i(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),s_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{version:()=>u}),t.exports=c(l);let u=`3.8.0`;0&&(t.exports={version:u})})),c_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{exchangeVercelOidcToken:()=>p}),t.exports=c(l);var u=s_();let d=new class{constructor(e){this.maxEntries=e,this.entries=new Map}get(e){let t=this.entries.get(e);if(t!==void 0){if(t.expiresAt<=Date.now()){this.entries.delete(e);return}return this.entries.delete(e),this.entries.set(e,t),t.token}}set({key:e,token:t,expiresAt:n}){for(this.entries.delete(e),this.entries.set(e,{token:t,expiresAt:n});this.entries.size>this.maxEntries;){let e=this.entries.keys().next().value;if(e===void 0)break;this.entries.delete(e)}}}(1e3);async function f(e){let t=JSON.stringify([e.token,e.audience,e.jti]),n=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(t));return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function p(e){let t=await f(e);if(!e.skipCache){let e=d.get(t);if(e!==void 0)return e}let n=await fetch(`https://oidc.vercel.com/~token`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,"User-Agent":`@vercel/oidc@${u.version}`},body:JSON.stringify({token:e.token,aud:e.audience,...e.jti?{jti:e.jti}:void 0})});if(!n.ok)throw Error(`Failed to exchange token: ${await m(n)}`);let r;try{r=await n.json()}catch{throw Error(`Failed to exchange token: response was not valid JSON`)}if(!r||typeof r!=`object`||!(`token`in r)||typeof r.token!=`string`)throw Error(`Failed to exchange token: response did not contain a token`);let{token:i}=r,a=`expiry`in r&&typeof r.expiry==`number`?r.expiry:void 0;if(a!==void 0){let e=a*1e3;e>Date.now()&&d.set({key:t,token:i,expiresAt:e})}return i}async function m(e){try{let t=await e.json();if(t&&typeof t==`object`&&`error`in t&&typeof t.error==`string`)return t.error}catch{}return e.statusText||`HTTP ${e.status}`}0&&(t.exports={exchangeVercelOidcToken:p})})),l_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{SYMBOL_FOR_REQ_CONTEXT:()=>u,getContext:()=>d}),t.exports=c(l);let u=Symbol.for(`@vercel/request-context`);function d(){return globalThis[u]?.get?.()??{}}0&&(t.exports={SYMBOL_FOR_REQ_CONTEXT:u,getContext:d})})),u_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{getVercelOidcTokenSync:()=>d}),t.exports=c(l);var u=l_();function d(){let e=(0,u.getContext)().headers?.[`x-vercel-oidc-token`]??process.env.VERCEL_OIDC_TOKEN;if(!e)throw Error(`The 'x-vercel-oidc-token' header is missing from the request.`);return e}0&&(t.exports={getVercelOidcTokenSync:d})})),d_=i(((e,t)=>{var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},c=(e,t,n,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(r({},`__esModule`,{value:!0}),e),u={};s(u,{getVercelOidcToken:()=>m}),t.exports=l(u);var d=c_(),f=u_(),p=Xc();async function m(e){let t=``,r;try{t=(0,f.getVercelOidcTokenSync)()}catch(e){r=e}try{let[{getTokenPayload:r,isExpired:i},{refreshToken:a}]=await Promise.all([await import(`../../_chunks/workflow/token-util-DURSL1l8.js`).then(e=>n(e.t())),await import(`../../_chunks/workflow/token-hiUWkDKe.js`).then(e=>n(e.default))]);(!t||i(r(t),e?.expirationBufferMs))&&(await a(e),t=(0,f.getVercelOidcTokenSync)())}catch(e){let t=r instanceof Error?r.message:``;throw e instanceof Error&&(t=`${t}
|
|
12
|
-
${e.message}`),t?new p.VercelOidcTokenError(t):e}return e?.audience&&(t=await(0,d.exchangeVercelOidcToken)({token:t,audience:e.audience,jti:e.jti,skipCache:e.skipCache})),t}0&&(t.exports={getVercelOidcToken:m})})),f_,p_=t((()=>{f_=(e,t)=>ol(e).update(t).digest()}));function m_(...e){let t=e.reduce((e,{length:t})=>e+t,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function h_(e,t){return m_(V.encode(e),new Uint8Array([0]),t)}function g_(e,t,n){if(t<0||t>=S_)throw RangeError(`value must be >= 0 and <= ${S_-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,t&255],n)}function __(e){let t=Math.floor(e/S_),n=e%S_,r=new Uint8Array(8);return g_(r,t,0),g_(r,n,4),r}function v_(e){let t=new Uint8Array(4);return g_(t,e),t}function y_(e){return m_(v_(e.length),e)}async function b_(e,t,n){let r=Math.ceil((t>>3)/32),i=new Uint8Array(r*32);for(let t=0;t<r;t++){let r=new Uint8Array(4+e.length+n.length);r.set(v_(t+1)),r.set(e,4),r.set(n,4+e.length),i.set(await f_(`sha256`,r),t*32)}return i.slice(0,t>>3)}var V,x_,S_,H=t((()=>{p_(),V=new TextEncoder,x_=new TextDecoder,S_=2**32}));function C_(e){let t=e;return t instanceof Uint8Array&&(t=x_.decode(t)),t}var U,W,w_=t((()=>{H(),U=e=>Ol.from(e).toString(`base64url`),W=e=>new Uint8Array(Ol.from(C_(e),`base64url`))})),T_=r({JOSEAlgNotAllowed:()=>O_,JOSEError:()=>G,JOSENotSupported:()=>K,JWEDecryptionFailed:()=>k_,JWEInvalid:()=>q,JWKInvalid:()=>j_,JWKSInvalid:()=>M_,JWKSMultipleMatchingKeys:()=>P_,JWKSNoMatchingKey:()=>N_,JWKSTimeout:()=>F_,JWSInvalid:()=>J,JWSSignatureVerificationFailed:()=>I_,JWTClaimValidationFailed:()=>E_,JWTExpired:()=>D_,JWTInvalid:()=>A_}),G,E_,D_,O_,K,k_,q,J,A_,j_,M_,N_,P_,F_,I_,Y=t((()=>{G=class extends Error{static code=`ERR_JOSE_GENERIC`;code=`ERR_JOSE_GENERIC`;constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},E_=class extends G{static code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;claim;reason;payload;constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.claim=n,this.reason=r,this.payload=t}},D_=class extends G{static code=`ERR_JWT_EXPIRED`;code=`ERR_JWT_EXPIRED`;claim;reason;payload;constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.claim=n,this.reason=r,this.payload=t}},O_=class extends G{static code=`ERR_JOSE_ALG_NOT_ALLOWED`;code=`ERR_JOSE_ALG_NOT_ALLOWED`},K=class extends G{static code=`ERR_JOSE_NOT_SUPPORTED`;code=`ERR_JOSE_NOT_SUPPORTED`},k_=class extends G{static code=`ERR_JWE_DECRYPTION_FAILED`;code=`ERR_JWE_DECRYPTION_FAILED`;constructor(e=`decryption operation failed`,t){super(e,t)}},q=class extends G{static code=`ERR_JWE_INVALID`;code=`ERR_JWE_INVALID`},J=class extends G{static code=`ERR_JWS_INVALID`;code=`ERR_JWS_INVALID`},A_=class extends G{static code=`ERR_JWT_INVALID`;code=`ERR_JWT_INVALID`},j_=class extends G{static code=`ERR_JWK_INVALID`;code=`ERR_JWK_INVALID`},M_=class extends G{static code=`ERR_JWKS_INVALID`;code=`ERR_JWKS_INVALID`},N_=class extends G{static code=`ERR_JWKS_NO_MATCHING_KEY`;code=`ERR_JWKS_NO_MATCHING_KEY`;constructor(e=`no applicable key found in the JSON Web Key Set`,t){super(e,t)}},P_=class extends G{[Symbol.asyncIterator];static code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;constructor(e=`multiple matching keys found in the JSON Web Key Set`,t){super(e,t)}},F_=class extends G{static code=`ERR_JWKS_TIMEOUT`;code=`ERR_JWKS_TIMEOUT`;constructor(e=`request timed out`,t){super(e,t)}},I_=class extends G{static code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;constructor(e=`signature verification failed`,t){super(e,t)}}})),L_=t((()=>{}));function R_(e){switch(e){case`A128GCM`:case`A128GCMKW`:case`A192GCM`:case`A192GCMKW`:case`A256GCM`:case`A256GCMKW`:return 96;case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return 128;default:throw new K(`Unsupported JWE Algorithm: ${e}`)}}var z_,B_=t((()=>{Y(),L_(),z_=e=>_l(new Uint8Array(R_(e)>>3))})),V_,H_=t((()=>{Y(),B_(),V_=(e,t)=>{if(t.length<<3!==R_(e))throw new q(`Invalid Initialization Vector length`)}})),U_,W_=t((()=>{U_=e=>bl.types.isKeyObject(e)})),G_,K_=t((()=>{Y(),W_(),G_=(e,t)=>{let n;switch(e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:n=parseInt(e.slice(-3),10);break;case`A128GCM`:case`A192GCM`:case`A256GCM`:n=parseInt(e.slice(1,4),10);break;default:throw new K(`Content Encryption Algorithm ${e} is not supported either by JOSE or your javascript runtime`)}if(t instanceof Uint8Array){let e=t.byteLength<<3;if(e!==n)throw new q(`Invalid Content Encryption Key length. Expected ${n} bits, got ${e} bits`);return}if(U_(t)&&t.type===`secret`){let e=t.symmetricKeySize<<3;if(e!==n)throw new q(`Invalid Content Encryption Key length. Expected ${n} bits, got ${e} bits`);return}throw TypeError(`Invalid Content Encryption Key type`)}})),q_,J_=t((()=>{q_=vl}));function Y_(e,t,n,r,i,a){let o=m_(e,t,n,__(e.length<<3)),s=sl(`sha${r}`,i);return s.update(o),s.digest().slice(0,a>>3)}var X_=t((()=>{H()})),Z_,Q_,$_=t((()=>{Z_=tl.webcrypto,Q_=e=>bl.types.isCryptoKey(e)}));function X(e,t=`algorithm.name`){return TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function ev(e,t){return e.name===t}function tv(e){return parseInt(e.name.slice(4),10)}function nv(e){switch(e){case`ES256`:return`P-256`;case`ES384`:return`P-384`;case`ES512`:return`P-521`;default:throw Error(`unreachable`)}}function rv(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e=`CryptoKey does not support this operation, its usages must include `;if(t.length>2){let n=t.pop();e+=`one of ${t.join(`, `)}, or ${n}.`}else t.length===2?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw TypeError(e)}}function iv(e,t,...n){switch(t){case`HS256`:case`HS384`:case`HS512`:{if(!ev(e.algorithm,`HMAC`))throw X(`HMAC`);let n=parseInt(t.slice(2),10);if(tv(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}case`RS256`:case`RS384`:case`RS512`:{if(!ev(e.algorithm,`RSASSA-PKCS1-v1_5`))throw X(`RSASSA-PKCS1-v1_5`);let n=parseInt(t.slice(2),10);if(tv(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}case`PS256`:case`PS384`:case`PS512`:{if(!ev(e.algorithm,`RSA-PSS`))throw X(`RSA-PSS`);let n=parseInt(t.slice(2),10);if(tv(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}case`EdDSA`:if(e.algorithm.name!==`Ed25519`&&e.algorithm.name!==`Ed448`)throw X(`Ed25519 or Ed448`);break;case`Ed25519`:if(!ev(e.algorithm,`Ed25519`))throw X(`Ed25519`);break;case`ES256`:case`ES384`:case`ES512`:{if(!ev(e.algorithm,`ECDSA`))throw X(`ECDSA`);let n=nv(t);if(e.algorithm.namedCurve!==n)throw X(n,`algorithm.namedCurve`);break}default:throw TypeError(`CryptoKey does not support this operation`)}rv(e,n)}function av(e,t,...n){switch(t){case`A128GCM`:case`A192GCM`:case`A256GCM`:{if(!ev(e.algorithm,`AES-GCM`))throw X(`AES-GCM`);let n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw X(n,`algorithm.length`);break}case`A128KW`:case`A192KW`:case`A256KW`:{if(!ev(e.algorithm,`AES-KW`))throw X(`AES-KW`);let n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw X(n,`algorithm.length`);break}case`ECDH`:switch(e.algorithm.name){case`ECDH`:case`X25519`:case`X448`:break;default:throw X(`ECDH, X25519, or X448`)}break;case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:if(!ev(e.algorithm,`PBKDF2`))throw X(`PBKDF2`);break;case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:{if(!ev(e.algorithm,`RSA-OAEP`))throw X(`RSA-OAEP`);let n=parseInt(t.slice(9),10)||1;if(tv(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}default:throw TypeError(`CryptoKey does not support this operation`)}rv(e,n)}var ov=t((()=>{}));function sv(e,t,...n){if(n=n.filter(Boolean),n.length>2){let t=n.pop();e+=`one of type ${n.join(`, `)}, or ${t}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t==`function`&&t.name?e+=` Received function ${t.name}`:typeof t==`object`&&t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}function cv(e,t,...n){return sv(`Key for the ${e} algorithm must be `,t,...n)}var lv,uv=t((()=>{lv=(e,...t)=>sv(`Key must be `,e,...t)})),dv,fv,pv=t((()=>{fv=e=>(dv||=new Set(pl()),dv.has(e))})),mv,Z,hv=t((()=>{$_(),W_(),mv=e=>U_(e)||Q_(e),Z=[`KeyObject`],(globalThis.CryptoKey||Z_?.CryptoKey)&&Z.push(`CryptoKey`)}));function gv(e,t,n,r,i,a){let o=parseInt(e.slice(1,4),10);U_(t)&&(t=t.export());let s=t.subarray(o>>3),c=t.subarray(0,o>>3),l=parseInt(e.slice(-3),10),u=`aes-${o}-cbc`;if(!fv(u))throw new K(`alg ${e} is not supported by your javascript runtime`);let d=Y_(a,r,n,l,c,o),f;try{f=q_(i,d)}catch{}if(!f)throw new k_;let p;try{let e=al(u,s,r);p=m_(e.update(n),e.final())}catch{}if(!p)throw new k_;return p}function _v(e,t,n,r,i,a){let o=`aes-${parseInt(e.slice(1,4),10)}-gcm`;if(!fv(o))throw new K(`alg ${e} is not supported by your javascript runtime`);try{let e=al(o,t,r,{authTagLength:16});e.setAuthTag(i),a.byteLength&&e.setAAD(a,{plaintextLength:n.length});let s=e.update(n);return e.final(),s}catch{throw new k_}}var vv,yv=t((()=>{H_(),K_(),H(),Y(),J_(),X_(),$_(),ov(),W_(),uv(),pv(),hv(),vv=(e,t,n,r,i,a)=>{let o;if(Q_(t))av(t,e,`decrypt`),o=nl.from(t);else if(t instanceof Uint8Array||U_(t))o=t;else throw TypeError(lv(t,...Z,`Uint8Array`));if(!r)throw new q(`JWE Initialization Vector missing`);if(!i)throw new q(`JWE Authentication Tag missing`);switch(G_(e,o),V_(e,r),e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return gv(e,o,n,r,i,a);case`A128GCM`:case`A192GCM`:case`A256GCM`:return _v(e,o,n,r,i,a);default:throw new K(`Unsupported JWE Content Encryption Algorithm`)}}})),bv,xv=t((()=>{bv=(...e)=>{let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(let e of t){let t=Object.keys(e);if(!n||n.size===0){n=new Set(t);continue}for(let e of t){if(n.has(e))return!1;n.add(e)}}return!0}}));function Sv(e){return typeof e==`object`&&!!e}function Q(e){if(!Sv(e)||Object.prototype.toString.call(e)!==`[object Object]`)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var Cv=t((()=>{}));function wv(e,t){if(e.symmetricKeySize<<3!==parseInt(t.slice(1,4),10))throw TypeError(`Invalid key size for alg: ${t}`)}function Tv(e,t,n){if(U_(e))return e;if(e instanceof Uint8Array)return ul(e);if(Q_(e))return av(e,t,n),nl.from(e);throw TypeError(lv(e,...Z,`Uint8Array`))}var Ev,Dv,Ov=t((()=>{Y(),H(),$_(),ov(),W_(),uv(),pv(),hv(),Ev=(e,t,n)=>{let r=`aes${parseInt(e.slice(1,4),10)}-wrap`;if(!fv(r))throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`);let i=Tv(t,e,`wrapKey`);wv(i,e);let a=il(r,i,Ol.alloc(8,166));return m_(a.update(n),a.final())},Dv=(e,t,n)=>{let r=`aes${parseInt(e.slice(1,4),10)}-wrap`;if(!fv(r))throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`);let i=Tv(t,e,`unwrapKey`);wv(i,e);let a=al(r,i,Ol.alloc(8,166));return m_(a.update(n),a.final())}}));function kv(e){return Q(e)&&typeof e.kty==`string`}function Av(e){return e.kty!==`oct`&&typeof e.d==`string`}function jv(e){return e.kty!==`oct`&&e.d===void 0}function Mv(e){return kv(e)&&e.kty===`oct`&&typeof e.k==`string`}var Nv=t((()=>{Cv()})),Pv,Fv,Iv=t((()=>{Y(),$_(),W_(),uv(),hv(),Nv(),Pv=e=>{switch(e){case`prime256v1`:return`P-256`;case`secp384r1`:return`P-384`;case`secp521r1`:return`P-521`;case`secp256k1`:return`secp256k1`;default:throw new K(`Unsupported key curve for this operation`)}},Fv=(e,t)=>{let n;if(Q_(e))n=nl.from(e);else if(U_(e))n=e;else if(kv(e))return e.crv;else throw TypeError(lv(e,...Z));if(n.type===`secret`)throw TypeError(`only "private" or "public" type keys can be used for this operation`);switch(n.asymmetricKeyType){case`ed25519`:case`ed448`:return`Ed${n.asymmetricKeyType.slice(2)}`;case`x25519`:case`x448`:return`X${n.asymmetricKeyType.slice(1)}`;case`ec`:{let e=n.asymmetricKeyDetails.namedCurve;return t?e:Pv(e)}default:throw TypeError(`Invalid asymmetric key type for this operation`)}}}));async function Lv(e,t,n,r,i=new Uint8Array,a=new Uint8Array){let o;if(Q_(e))av(e,`ECDH`),o=nl.from(e);else if(U_(e))o=e;else throw TypeError(lv(e,...Z));let s;if(Q_(t))av(t,`ECDH`,`deriveBits`),s=nl.from(t);else if(U_(t))s=t;else throw TypeError(lv(t,...Z));let c=m_(y_(V.encode(n)),y_(i),y_(a),v_(r));return b_(dl({privateKey:s,publicKey:o}),r,c)}async function Rv(e){let t;if(Q_(e))t=nl.from(e);else if(U_(e))t=e;else throw TypeError(lv(e,...Z));switch(t.asymmetricKeyType){case`x25519`:return zv(`x25519`);case`x448`:return zv(`x448`);case`ec`:{let e=Fv(t);return zv(`ec`,{namedCurve:e})}default:throw new K(`Invalid or unsupported EPK`)}}var zv,Bv,Vv=t((()=>{Iv(),H(),Y(),$_(),ov(),W_(),uv(),hv(),zv=Cl(fl),Bv=e=>[`P-256`,`P-384`,`P-521`,`X25519`,`X448`].includes(Fv(e))}));function Hv(e){if(!(e instanceof Uint8Array)||e.length<8)throw new q(`PBES2 Salt Input must be 8 or more octets`)}var Uv=t((()=>{Y()}));function Wv(e,t){if(U_(e))return e.export();if(e instanceof Uint8Array)return e;if(Q_(e))return av(e,t,`deriveBits`,`deriveKey`),nl.from(e).export();throw TypeError(lv(e,...Z,`Uint8Array`))}var Gv,Kv,qv,Jv=t((()=>{L_(),H(),w_(),Ov(),Uv(),$_(),ov(),W_(),uv(),hv(),Gv=Cl(ml),Kv=async(e,t,n,r=2048,i=_l(new Uint8Array(16)))=>{Hv(i);let a=h_(e,i),o=parseInt(e.slice(13,16),10)>>3,s=Wv(t,e),c=await Gv(s,a,r,o,`sha${e.slice(8,11)}`);return{encryptedKey:await Ev(e.slice(-6),c,n),p2c:r,p2s:U(i)}},qv=async(e,t,n,r,i)=>{Hv(i);let a=h_(e,i),o=parseInt(e.slice(13,16),10)>>3,s=Wv(t,e),c=await Gv(s,a,r,o,`sha${e.slice(8,11)}`);return Dv(e.slice(-6),c,n)}})),Yv,Xv=t((()=>{Yv=(e,t)=>{let n;try{n=e instanceof nl?e.asymmetricKeyDetails?.modulusLength:Buffer.from(e.n,`base64url`).byteLength<<3}catch{}if(typeof n!=`number`||n<2048)throw TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}}));function Zv(e,t,...n){if(U_(e))return e;if(Q_(e))return av(e,t,...n),nl.from(e);throw TypeError(lv(e,...Z))}var Qv,$v,ey,ty,ny,ry,iy=t((()=>{Xv(),$_(),ov(),W_(),uv(),hv(),Qv=(e,t)=>{if(e.asymmetricKeyType!==`rsa`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be rsa`);Yv(e,t)},$v=xl(()=>rl.RSA_PKCS1_PADDING,`The RSA1_5 "alg" (JWE Algorithm) is deprecated and will be removed in the next major revision.`),ey=e=>{switch(e){case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:return rl.RSA_PKCS1_OAEP_PADDING;case`RSA1_5`:return $v();default:return}},ty=e=>{switch(e){case`RSA-OAEP`:return`sha1`;case`RSA-OAEP-256`:return`sha256`;case`RSA-OAEP-384`:return`sha384`;case`RSA-OAEP-512`:return`sha512`;default:return}},ny=(e,t,n)=>{let r=ey(e),i=ty(e),a=Zv(t,e,`wrapKey`,`encrypt`);return Qv(a,e),gl({key:a,oaepHash:i,padding:r},n)},ry=(e,t,n)=>{let r=ey(e),i=ty(e),a=Zv(t,e,`unwrapKey`,`decrypt`);return Qv(a,e),hl({key:a,oaepHash:i,padding:r},n)}})),ay,oy=t((()=>{ay={}}));function sy(e){switch(e){case`A128GCM`:return 128;case`A192GCM`:return 192;case`A256GCM`:case`A128CBC-HS256`:return 256;case`A192CBC-HS384`:return 384;case`A256CBC-HS512`:return 512;default:throw new K(`Unsupported JWE Algorithm: ${e}`)}}var cy,ly=t((()=>{Y(),L_(),cy=e=>_l(new Uint8Array(sy(e)>>3))})),uy,dy,fy,py,my,hy,gy=t((()=>{$_(),W_(),uv(),hv(),uy=(e,t,n)=>{let r;if(Q_(n)){if(!n.extractable)throw TypeError(`CryptoKey is not extractable`);r=nl.from(n)}else if(U_(n))r=n;else throw TypeError(lv(n,...Z));if(r.type!==e)throw TypeError(`key is not a ${e} key`);return r.export({format:`pem`,type:t})},dy=e=>uy(`public`,`spki`,e),fy=e=>uy(`private`,`pkcs8`,e),py=e=>cl({key:Ol.from(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,``),`base64`),type:`pkcs8`,format:`der`}),my=e=>ll({key:Ol.from(e.replace(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,``),`base64`),type:`spki`,format:`der`}),hy=e=>ll({key:e,type:`spki`,format:`pem`})})),_y,vy=t((()=>{_y=e=>e.d?cl({format:`jwk`,key:e}):ll({format:`jwk`,key:e})}));async function yy(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN PUBLIC KEY-----`)!==0)throw TypeError(`"spki" must be SPKI formatted string`);return my(e,t,n)}async function by(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN CERTIFICATE-----`)!==0)throw TypeError(`"x509" must be X.509 formatted string`);return hy(e,t,n)}async function xy(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN PRIVATE KEY-----`)!==0)throw TypeError(`"pkcs8" must be PKCS#8 formatted string`);return py(e,t,n)}async function Sy(e,t){if(!Q(e))throw TypeError(`JWK must be an object`);switch(t||=e.alg,e.kty){case`oct`:if(typeof e.k!=`string`||!e.k)throw TypeError(`missing "k" (Key Value) Parameter value`);return W(e.k);case`RSA`:if(`oth`in e&&e.oth!==void 0)throw new K(`RSA JWK "oth" (Other Primes Info) Parameter value is not supported`);case`EC`:case`OKP`:return _y({...e,alg:t});default:throw new K(`Unsupported "kty" (Key Type) Parameter value`)}}var Cy=t((()=>{w_(),gy(),vy(),Y(),Cv()}));function wy(e,t,n,r){t.startsWith(`HS`)||t===`dir`||t.startsWith(`PBES2`)||/^A\d{3}(?:GCM)?KW$/.test(t)?Dy(t,n,r,e):Oy(t,n,r,e)}var Ty,Ey,Dy,Oy,ky,Ay,jy=t((()=>{uv(),hv(),Nv(),Ty=e=>e?.[Symbol.toStringTag],Ey=(e,t,n)=>{if(t.use!==void 0&&t.use!==`sig`)throw TypeError(`Invalid key for this operation, when present its use must be sig`);if(t.key_ops!==void 0&&t.key_ops.includes?.(n)!==!0)throw TypeError(`Invalid key for this operation, when present its key_ops must include ${n}`);if(t.alg!==void 0&&t.alg!==e)throw TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0},Dy=(e,t,n,r)=>{if(!(t instanceof Uint8Array)){if(r&&kv(t)){if(Mv(t)&&Ey(e,t,n))return;throw TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`)}if(!mv(t))throw TypeError(cv(e,t,...Z,`Uint8Array`,r?`JSON Web Key`:null));if(t.type!==`secret`)throw TypeError(`${Ty(t)} instances for symmetric algorithms must be of type "secret"`)}},Oy=(e,t,n,r)=>{if(r&&kv(t))switch(n){case`sign`:if(Av(t)&&Ey(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a private JWK`);case`verify`:if(jv(t)&&Ey(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a public JWK`)}if(!mv(t))throw TypeError(cv(e,t,...Z,r?`JSON Web Key`:null));if(t.type===`secret`)throw TypeError(`${Ty(t)} instances for asymmetric algorithms must not be of type "secret"`);if(n===`sign`&&t.type===`public`)throw TypeError(`${Ty(t)} instances for asymmetric algorithm signing must be of type "private"`);if(n===`decrypt`&&t.type===`public`)throw TypeError(`${Ty(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&n===`verify`&&t.type===`private`)throw TypeError(`${Ty(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&n===`encrypt`&&t.type===`private`)throw TypeError(`${Ty(t)} instances for asymmetric algorithm encryption must be of type "public"`)},ky=wy.bind(void 0,!1),Ay=wy.bind(void 0,!0)}));function My(e,t,n,r,i){let a=parseInt(e.slice(1,4),10);U_(n)&&(n=n.export());let o=n.subarray(a>>3),s=n.subarray(0,a>>3),c=`aes-${a}-cbc`;if(!fv(c))throw new K(`alg ${e} is not supported by your javascript runtime`);let l=il(c,o,r),u=m_(l.update(t),l.final());return{ciphertext:u,tag:Y_(i,r,u,parseInt(e.slice(-3),10),s,a),iv:r}}function Ny(e,t,n,r,i){let a=`aes-${parseInt(e.slice(1,4),10)}-gcm`;if(!fv(a))throw new K(`alg ${e} is not supported by your javascript runtime`);let o=il(a,n,r,{authTagLength:16});i.byteLength&&o.setAAD(i,{plaintextLength:t.length});let s=o.update(t);return o.final(),{ciphertext:s,tag:o.getAuthTag(),iv:r}}var Py,Fy=t((()=>{H_(),K_(),H(),X_(),$_(),ov(),W_(),uv(),B_(),Y(),pv(),hv(),Py=(e,t,n,r,i)=>{let a;if(Q_(n))av(n,e,`encrypt`),a=nl.from(n);else if(n instanceof Uint8Array||U_(n))a=n;else throw TypeError(lv(n,...Z,`Uint8Array`));switch(G_(e,a),r?V_(e,r):r=z_(e),e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return My(e,t,a,r,i);case`A128GCM`:case`A192GCM`:case`A256GCM`:return Ny(e,t,a,r,i);default:throw new K(`Unsupported JWE Content Encryption Algorithm`)}}}));async function Iy(e,t,n,r){let i=await Py(e.slice(0,7),n,t,r,new Uint8Array);return{encryptedKey:i.ciphertext,iv:U(i.iv),tag:U(i.tag)}}async function Ly(e,t,n,r,i){return vv(e.slice(0,7),t,n,r,i,new Uint8Array)}var Ry=t((()=>{Fy(),yv(),w_()}));async function zy(e,t,n,r,i){switch(ky(e,t,`decrypt`),t=await ay.normalizePrivateKey?.(t,e)||t,e){case`dir`:if(n!==void 0)throw new q(`Encountered unexpected JWE Encrypted Key`);return t;case`ECDH-ES`:if(n!==void 0)throw new q(`Encountered unexpected JWE Encrypted Key`);case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{if(!Q(r.epk))throw new q(`JOSE Header "epk" (Ephemeral Public Key) missing or invalid`);if(!Bv(t))throw new K(`ECDH with the provided key is not allowed or not supported by your javascript runtime`);let i=await Sy(r.epk,e),a,o;if(r.apu!==void 0){if(typeof r.apu!=`string`)throw new q(`JOSE Header "apu" (Agreement PartyUInfo) invalid`);try{a=W(r.apu)}catch{throw new q(`Failed to base64url decode the apu`)}}if(r.apv!==void 0){if(typeof r.apv!=`string`)throw new q(`JOSE Header "apv" (Agreement PartyVInfo) invalid`);try{o=W(r.apv)}catch{throw new q(`Failed to base64url decode the apv`)}}let s=await Lv(i,t,e===`ECDH-ES`?r.enc:e,e===`ECDH-ES`?sy(r.enc):parseInt(e.slice(-5,-2),10),a,o);if(e===`ECDH-ES`)return s;if(n===void 0)throw new q(`JWE Encrypted Key missing`);return Dv(e.slice(-6),s,n)}case`RSA1_5`:case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:if(n===void 0)throw new q(`JWE Encrypted Key missing`);return ry(e,t,n);case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:{if(n===void 0)throw new q(`JWE Encrypted Key missing`);if(typeof r.p2c!=`number`)throw new q(`JOSE Header "p2c" (PBES2 Count) missing or invalid`);let a=i?.maxPBES2Count||1e4;if(r.p2c>a)throw new q(`JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds`);if(typeof r.p2s!=`string`)throw new q(`JOSE Header "p2s" (PBES2 Salt) missing or invalid`);let o;try{o=W(r.p2s)}catch{throw new q(`Failed to base64url decode the p2s`)}return qv(e,t,n,r.p2c,o)}case`A128KW`:case`A192KW`:case`A256KW`:if(n===void 0)throw new q(`JWE Encrypted Key missing`);return Dv(e,t,n);case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:{if(n===void 0)throw new q(`JWE Encrypted Key missing`);if(typeof r.iv!=`string`)throw new q(`JOSE Header "iv" (Initialization Vector) missing or invalid`);if(typeof r.tag!=`string`)throw new q(`JOSE Header "tag" (Authentication Tag) missing or invalid`);let i;try{i=W(r.iv)}catch{throw new q(`Failed to base64url decode the iv`)}let a;try{a=W(r.tag)}catch{throw new q(`Failed to base64url decode the tag`)}return Ly(e,t,n,i,a)}default:throw new K(`Invalid or unsupported "alg" (JWE Algorithm) header value`)}}var By=t((()=>{Ov(),Vv(),Jv(),iy(),w_(),oy(),Y(),ly(),Cy(),jy(),Cv(),Ry()}));function Vy(e,t,n,r,i){if(i.crit!==void 0&&r?.crit===void 0)throw new e(`"crit" (Critical) Header Parameter MUST be integrity protected`);if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(e=>typeof e!=`string`||e.length===0))throw new e(`"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present`);let a;a=n===void 0?t:new Map([...Object.entries(n),...t.entries()]);for(let t of r.crit){if(!a.has(t))throw new K(`Extension Header Parameter "${t}" is not recognized`);if(i[t]===void 0)throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&r[t]===void 0)throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(r.crit)}var Hy=t((()=>{Y()})),Uy,Wy=t((()=>{Uy=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(e=>typeof e!=`string`)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}}));async function Gy(e,t,n){if(!Q(e))throw new q(`Flattened JWE must be an object`);if(e.protected===void 0&&e.header===void 0&&e.unprotected===void 0)throw new q(`JOSE Header missing`);if(e.iv!==void 0&&typeof e.iv!=`string`)throw new q(`JWE Initialization Vector incorrect type`);if(typeof e.ciphertext!=`string`)throw new q(`JWE Ciphertext missing or incorrect type`);if(e.tag!==void 0&&typeof e.tag!=`string`)throw new q(`JWE Authentication Tag incorrect type`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new q(`JWE Protected Header incorrect type`);if(e.encrypted_key!==void 0&&typeof e.encrypted_key!=`string`)throw new q(`JWE Encrypted Key incorrect type`);if(e.aad!==void 0&&typeof e.aad!=`string`)throw new q(`JWE AAD incorrect type`);if(e.header!==void 0&&!Q(e.header))throw new q(`JWE Shared Unprotected Header incorrect type`);if(e.unprotected!==void 0&&!Q(e.unprotected))throw new q(`JWE Per-Recipient Unprotected Header incorrect type`);let r;if(e.protected)try{let t=W(e.protected);r=JSON.parse(x_.decode(t))}catch{throw new q(`JWE Protected Header is invalid`)}if(!bv(r,e.header,e.unprotected))throw new q(`JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header,...e.unprotected};if(Vy(q,new Map,n?.crit,r,i),i.zip!==void 0)throw new K(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`);let{alg:a,enc:o}=i;if(typeof a!=`string`||!a)throw new q(`missing JWE Algorithm (alg) in JWE Header`);if(typeof o!=`string`||!o)throw new q(`missing JWE Encryption Algorithm (enc) in JWE Header`);let s=n&&Uy(`keyManagementAlgorithms`,n.keyManagementAlgorithms),c=n&&Uy(`contentEncryptionAlgorithms`,n.contentEncryptionAlgorithms);if(s&&!s.has(a)||!s&&a.startsWith(`PBES2`))throw new O_(`"alg" (Algorithm) Header Parameter value not allowed`);if(c&&!c.has(o))throw new O_(`"enc" (Encryption Algorithm) Header Parameter value not allowed`);let l;if(e.encrypted_key!==void 0)try{l=W(e.encrypted_key)}catch{throw new q(`Failed to base64url decode the encrypted_key`)}let u=!1;typeof t==`function`&&(t=await t(r,e),u=!0);let d;try{d=await zy(a,t,l,i,n)}catch(e){if(e instanceof TypeError||e instanceof q||e instanceof K)throw e;d=cy(o)}let f,p;if(e.iv!==void 0)try{f=W(e.iv)}catch{throw new q(`Failed to base64url decode the iv`)}if(e.tag!==void 0)try{p=W(e.tag)}catch{throw new q(`Failed to base64url decode the tag`)}let m=V.encode(e.protected??``),h;h=e.aad===void 0?m:m_(m,V.encode(`.`),V.encode(e.aad));let g;try{g=W(e.ciphertext)}catch{throw new q(`Failed to base64url decode the ciphertext`)}let _={plaintext:await vv(o,d,g,f,p,h)};if(e.protected!==void 0&&(_.protectedHeader=r),e.aad!==void 0)try{_.additionalAuthenticatedData=W(e.aad)}catch{throw new q(`Failed to base64url decode the aad`)}return e.unprotected!==void 0&&(_.sharedUnprotectedHeader=e.unprotected),e.header!==void 0&&(_.unprotectedHeader=e.header),u?{..._,key:t}:_}var Ky=t((()=>{w_(),yv(),Y(),xv(),Cv(),By(),H(),ly(),Hy(),Wy()}));async function qy(e,t,n){if(e instanceof Uint8Array&&(e=x_.decode(e)),typeof e!=`string`)throw new q(`Compact JWE must be a string or Uint8Array`);let{0:r,1:i,2:a,3:o,4:s,length:c}=e.split(`.`);if(c!==5)throw new q(`Invalid Compact JWE`);let l=await Gy({ciphertext:o,iv:a||void 0,protected:r,tag:s||void 0,encrypted_key:i||void 0},t,n),u={plaintext:l.plaintext,protectedHeader:l.protectedHeader};return typeof t==`function`?{...u,key:l.key}:u}var Jy=t((()=>{Ky(),Y(),H()}));async function Yy(e,t,n){if(!Q(e))throw new q(`General JWE must be an object`);if(!Array.isArray(e.recipients)||!e.recipients.every(Q))throw new q(`JWE Recipients missing or incorrect type`);if(!e.recipients.length)throw new q(`JWE Recipients has no members`);for(let r of e.recipients)try{return await Gy({aad:e.aad,ciphertext:e.ciphertext,encrypted_key:r.encrypted_key,header:r.header,iv:e.iv,protected:e.protected,tag:e.tag,unprotected:e.unprotected},t,n)}catch{}throw new k_}var Xy=t((()=>{Ky(),Y(),Cv()})),Zy,Qy=t((()=>{Zy=Symbol()})),$y,eb=t((()=>{w_(),Y(),$_(),W_(),uv(),hv(),$y=e=>{let t;if(Q_(e)){if(!e.extractable)throw TypeError(`CryptoKey is not extractable`);t=nl.from(e)}else if(U_(e))t=e;else if(e instanceof Uint8Array)return{kty:`oct`,k:U(e)};else throw TypeError(lv(e,...Z,`Uint8Array`));if(t.type!==`secret`&&![`rsa`,`ec`,`ed25519`,`x25519`,`ed448`,`x448`].includes(t.asymmetricKeyType))throw new K(`Unsupported key asymmetricKeyType`);return t.export({format:`jwk`})}}));async function tb(e){return dy(e)}async function nb(e){return fy(e)}async function rb(e){return $y(e)}var ib=t((()=>{gy(),eb()}));async function ab(e,t,n,r,i={}){let a,o,s;switch(ky(e,n,`encrypt`),n=await ay.normalizePublicKey?.(n,e)||n,e){case`dir`:s=n;break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{if(!Bv(n))throw new K(`ECDH with the provided key is not allowed or not supported by your javascript runtime`);let{apu:c,apv:l}=i,{epk:u}=i;u||=(await Rv(n)).privateKey;let{x:d,y:f,crv:p,kty:m}=await rb(u),h=await Lv(n,u,e===`ECDH-ES`?t:e,e===`ECDH-ES`?sy(t):parseInt(e.slice(-5,-2),10),c,l);if(o={epk:{x:d,crv:p,kty:m}},m===`EC`&&(o.epk.y=f),c&&(o.apu=U(c)),l&&(o.apv=U(l)),e===`ECDH-ES`){s=h;break}s=r||cy(t),a=await Ev(e.slice(-6),h,s);break}case`RSA1_5`:case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:s=r||cy(t),a=await ny(e,n,s);break;case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:{s=r||cy(t);let{p2c:c,p2s:l}=i;({encryptedKey:a,...o}=await Kv(e,n,s,c,l));break}case`A128KW`:case`A192KW`:case`A256KW`:s=r||cy(t),a=await Ev(e,n,s);break;case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:{s=r||cy(t);let{iv:c}=i;({encryptedKey:a,...o}=await Iy(e,n,s,c));break}default:throw new K(`Invalid or unsupported "alg" (JWE Algorithm) header value`)}return{cek:s,encryptedKey:a,parameters:o}}var ob=t((()=>{Ov(),Vv(),Jv(),iy(),w_(),oy(),ly(),Y(),ib(),jy(),Ry()})),sb,cb=t((()=>{w_(),Qy(),Fy(),ob(),Y(),xv(),H(),Hy(),sb=class{_plaintext;_protectedHeader;_sharedUnprotectedHeader;_unprotectedHeader;_aad;_cek;_iv;_keyManagementParameters;constructor(e){if(!(e instanceof Uint8Array))throw TypeError(`plaintext must be an instance of Uint8Array`);this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError(`setKeyManagementParameters can only be called once`);return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw TypeError(`setSharedUnprotectedHeader can only be called once`);return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError(`setContentEncryptionKey can only be called once`);return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError(`setInitializationVector can only be called once`);return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new q(`either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()`);if(!bv(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new q(`JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint`);let n={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(Vy(q,new Map,t?.crit,this._protectedHeader,n),n.zip!==void 0)throw new K(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`);let{alg:r,enc:i}=n;if(typeof r!=`string`||!r)throw new q(`JWE "alg" (Algorithm) Header Parameter missing or invalid`);if(typeof i!=`string`||!i)throw new q(`JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid`);let a;if(this._cek&&(r===`dir`||r===`ECDH-ES`))throw TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${r}`);let o;{let n;({cek:o,encryptedKey:a,parameters:n}=await ab(r,i,e,this._cek,this._keyManagementParameters)),n&&(t&&Zy in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...n}:this.setUnprotectedHeader(n):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...n}:this.setProtectedHeader(n))}let s,c,l;c=this._protectedHeader?V.encode(U(JSON.stringify(this._protectedHeader))):V.encode(``),this._aad?(l=U(this._aad),s=m_(c,V.encode(`.`),V.encode(l))):s=c;let{ciphertext:u,tag:d,iv:f}=await Py(i,this._plaintext,o,this._iv,s),p={ciphertext:U(u)};return f&&(p.iv=U(f)),d&&(p.tag=U(d)),a&&(p.encrypted_key=U(a)),l&&(p.aad=l),this._protectedHeader&&(p.protected=x_.decode(c)),this._sharedUnprotectedHeader&&(p.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(p.header=this._unprotectedHeader),p}}})),lb,ub,db=t((()=>{cb(),Qy(),Y(),ly(),xv(),ob(),w_(),Hy(),lb=class{parent;unprotectedHeader;key;options;constructor(e,t,n){this.parent=e,this.key=t,this.options=n}setUnprotectedHeader(e){if(this.unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this.unprotectedHeader=e,this}addRecipient(...e){return this.parent.addRecipient(...e)}encrypt(...e){return this.parent.encrypt(...e)}done(){return this.parent}},ub=class{_plaintext;_recipients=[];_protectedHeader;_unprotectedHeader;_aad;constructor(e){this._plaintext=e}addRecipient(e,t){let n=new lb(this,e,{crit:t?.crit});return this._recipients.push(n),n}setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError(`setSharedUnprotectedHeader can only be called once`);return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}async encrypt(){if(!this._recipients.length)throw new q(`at least one recipient must be added`);if(this._recipients.length===1){let[e]=this._recipients,t=await new sb(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(e.unprotectedHeader).encrypt(e.key,{...e.options}),n={ciphertext:t.ciphertext,iv:t.iv,recipients:[{}],tag:t.tag};return t.aad&&(n.aad=t.aad),t.protected&&(n.protected=t.protected),t.unprotected&&(n.unprotected=t.unprotected),t.encrypted_key&&(n.recipients[0].encrypted_key=t.encrypted_key),t.header&&(n.recipients[0].header=t.header),n}let e;for(let t=0;t<this._recipients.length;t++){let n=this._recipients[t];if(!bv(this._protectedHeader,this._unprotectedHeader,n.unprotectedHeader))throw new q(`JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint`);let r={...this._protectedHeader,...this._unprotectedHeader,...n.unprotectedHeader},{alg:i}=r;if(typeof i!=`string`||!i)throw new q(`JWE "alg" (Algorithm) Header Parameter missing or invalid`);if(i===`dir`||i===`ECDH-ES`)throw new q(`"dir" and "ECDH-ES" alg may only be used with a single recipient`);if(typeof r.enc!=`string`||!r.enc)throw new q(`JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid`);if(!e)e=r.enc;else if(e!==r.enc)throw new q(`JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients`);if(Vy(q,new Map,n.options.crit,this._protectedHeader,r),r.zip!==void 0)throw new K(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`)}let t=cy(e),n={ciphertext:``,iv:``,recipients:[],tag:``};for(let r=0;r<this._recipients.length;r++){let i=this._recipients[r],a={};n.recipients.push(a);let o={...this._protectedHeader,...this._unprotectedHeader,...i.unprotectedHeader}.alg.startsWith(`PBES2`)?2048+r:void 0;if(r===0){let e=await new sb(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(t).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(i.unprotectedHeader).setKeyManagementParameters({p2c:o}).encrypt(i.key,{...i.options,[Zy]:!0});n.ciphertext=e.ciphertext,n.iv=e.iv,n.tag=e.tag,e.aad&&(n.aad=e.aad),e.protected&&(n.protected=e.protected),e.unprotected&&(n.unprotected=e.unprotected),a.encrypted_key=e.encrypted_key,e.header&&(a.header=e.header);continue}let{encryptedKey:s,parameters:c}=await ab(i.unprotectedHeader?.alg||this._protectedHeader?.alg||this._unprotectedHeader?.alg,e,i.key,t,{p2c:o});a.encrypted_key=U(s),(i.unprotectedHeader||c)&&(a.header={...i.unprotectedHeader,...c})}return n}}}));function fb(e){switch(e){case`PS256`:case`RS256`:case`ES256`:case`ES256K`:return`sha256`;case`PS384`:case`RS384`:case`ES384`:return`sha384`;case`PS512`:case`RS512`:case`ES512`:return`sha512`;case`Ed25519`:case`EdDSA`:return;default:throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var pb=t((()=>{Y()}));function mb(e,t){let n,r,i;if(t instanceof nl)n=t.asymmetricKeyType,r=t.asymmetricKeyDetails;else switch(i=!0,t.kty){case`RSA`:n=`rsa`;break;case`EC`:n=`ec`;break;case`OKP`:if(t.crv===`Ed25519`){n=`ed25519`;break}if(t.crv===`Ed448`){n=`ed448`;break}throw TypeError(`Invalid key for this operation, its crv must be Ed25519 or Ed448`);default:throw TypeError(`Invalid key for this operation, its kty must be RSA, OKP, or EC`)}let a;switch(e){case`Ed25519`:if(n!==`ed25519`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be ed25519`);break;case`EdDSA`:if(![`ed25519`,`ed448`].includes(n))throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be ed25519 or ed448`);break;case`RS256`:case`RS384`:case`RS512`:if(n!==`rsa`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be rsa`);Yv(t,e);break;case`PS256`:case`PS384`:case`PS512`:if(n===`rsa-pss`){let{hashAlgorithm:t,mgf1HashAlgorithm:n,saltLength:i}=r,a=parseInt(e.slice(-3),10);if(t!==void 0&&(t!==`sha${a}`||n!==t))throw TypeError(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}`);if(i!==void 0&&i>a>>3)throw TypeError(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}`)}else if(n!==`rsa`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be rsa or rsa-pss`);Yv(t,e),a={padding:rl.RSA_PKCS1_PSS_PADDING,saltLength:rl.RSA_PSS_SALTLEN_DIGEST};break;case`ES256`:case`ES256K`:case`ES384`:case`ES512`:{if(n!==`ec`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be ec`);let r=Fv(t),i=hb.get(e);if(r!==i)throw TypeError(`Invalid key curve for the algorithm, its curve must be ${i}, got ${r}`);a={dsaEncoding:`ieee-p1363`};break}default:throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`)}return i?{format:`jwk`,key:t,...a}:a?{...a,key:t}:t}var hb,gb=t((()=>{Iv(),Y(),Xv(),hb=new Map([[`ES256`,`P-256`],[`ES256K`,`secp256k1`],[`ES384`,`P-384`],[`ES512`,`P-521`]])}));function _b(e){switch(e){case`HS256`:return`sha256`;case`HS384`:return`sha384`;case`HS512`:return`sha512`;default:throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var vb=t((()=>{Y()}));function yb(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith(`HS`))throw TypeError(lv(t,...Z));return ul(t)}if(t instanceof nl)return t;if(Q_(t))return iv(t,e,n),nl.from(t);if(kv(t))return e.startsWith(`HS`)?ul(Buffer.from(t.k,`base64url`)):t;throw TypeError(lv(t,...Z,`Uint8Array`,`JSON Web Key`))}var bb=t((()=>{$_(),ov(),uv(),hv(),Nv()})),xb,Sb,Cb=t((()=>{pb(),vb(),gb(),bb(),xb=Cl(tl.sign),Sb=async(e,t,n)=>{let r=yb(e,t,`sign`);if(e.startsWith(`HS`)){let t=tl.createHmac(_b(e),r);return t.update(n),t.digest()}return xb(fb(e),n,mb(e,r))}})),wb,Tb,Eb=t((()=>{pb(),gb(),Cb(),bb(),wb=Cl(tl.verify),Tb=async(e,t,n,r)=>{let i=yb(e,t,`verify`);if(e.startsWith(`HS`)){let t=await Sb(e,i,r),a=n;try{return tl.timingSafeEqual(a,t)}catch{return!1}}let a=fb(e),o=mb(e,i);try{return await wb(a,r,o,n)}catch{return!1}}}));async function Db(e,t,n){if(!Q(e))throw new J(`Flattened JWS must be an object`);if(e.protected===void 0&&e.header===void 0)throw new J(`Flattened JWS must have either of the "protected" or "header" members`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new J(`JWS Protected Header incorrect type`);if(e.payload===void 0)throw new J(`JWS Payload missing`);if(typeof e.signature!=`string`)throw new J(`JWS Signature missing or incorrect type`);if(e.header!==void 0&&!Q(e.header))throw new J(`JWS Unprotected Header incorrect type`);let r={};if(e.protected)try{let t=W(e.protected);r=JSON.parse(x_.decode(t))}catch{throw new J(`JWS Protected Header is invalid`)}if(!bv(r,e.header))throw new J(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header},a=Vy(J,new Map([[`b64`,!0]]),n?.crit,r,i),o=!0;if(a.has(`b64`)&&(o=r.b64,typeof o!=`boolean`))throw new J(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:s}=i;if(typeof s!=`string`||!s)throw new J(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);let c=n&&Uy(`algorithms`,n.algorithms);if(c&&!c.has(s))throw new O_(`"alg" (Algorithm) Header Parameter value not allowed`);if(o){if(typeof e.payload!=`string`)throw new J(`JWS Payload must be a string`)}else if(typeof e.payload!=`string`&&!(e.payload instanceof Uint8Array))throw new J(`JWS Payload must be a string or an Uint8Array instance`);let l=!1;typeof t==`function`?(t=await t(r,e),l=!0,Ay(s,t,`verify`),kv(t)&&(t=await Sy(t,s))):Ay(s,t,`verify`);let u=m_(V.encode(e.protected??``),V.encode(`.`),typeof e.payload==`string`?V.encode(e.payload):e.payload),d;try{d=W(e.signature)}catch{throw new J(`Failed to base64url decode the signature`)}if(!await Tb(s,t,d,u))throw new I_;let f;if(o)try{f=W(e.payload)}catch{throw new J(`Failed to base64url decode the payload`)}else f=typeof e.payload==`string`?V.encode(e.payload):e.payload;let p={payload:f};return e.protected!==void 0&&(p.protectedHeader=r),e.header!==void 0&&(p.unprotectedHeader=e.header),l?{...p,key:t}:p}var Ob=t((()=>{w_(),Eb(),Y(),H(),xv(),Cv(),jy(),Hy(),Wy(),Nv(),Cy()}));async function kb(e,t,n){if(e instanceof Uint8Array&&(e=x_.decode(e)),typeof e!=`string`)throw new J(`Compact JWS must be a string or Uint8Array`);let{0:r,1:i,2:a,length:o}=e.split(`.`);if(o!==3)throw new J(`Invalid Compact JWS`);let s=await Db({payload:i,protected:r,signature:a},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return typeof t==`function`?{...c,key:s.key}:c}var Ab=t((()=>{Ob(),Y(),H()}));async function jb(e,t,n){if(!Q(e))throw new J(`General JWS must be an object`);if(!Array.isArray(e.signatures)||!e.signatures.every(Q))throw new J(`JWS Signatures missing or incorrect type`);for(let r of e.signatures)try{return await Db({header:r.header,payload:e.payload,protected:r.protected,signature:r.signature},t,n)}catch{}throw new I_}var Mb=t((()=>{Ob(),Y(),Cv()})),Nb,Pb=t((()=>{Nb=e=>Math.floor(e.getTime()/1e3)})),Fb,Ib,Lb,Rb,zb,Bb,Vb,Hb=t((()=>{Fb=60,Ib=Fb*60,Lb=Ib*24,Rb=Lb*7,zb=Lb*365.25,Bb=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Vb=e=>{let t=Bb.exec(e);if(!t||t[4]&&t[1])throw TypeError(`Invalid time period format`);let n=parseFloat(t[2]),r=t[3].toLowerCase(),i;switch(r){case`sec`:case`secs`:case`second`:case`seconds`:case`s`:i=Math.round(n);break;case`minute`:case`minutes`:case`min`:case`mins`:case`m`:i=Math.round(n*Fb);break;case`hour`:case`hours`:case`hr`:case`hrs`:case`h`:i=Math.round(n*Ib);break;case`day`:case`days`:case`d`:i=Math.round(n*Lb);break;case`week`:case`weeks`:case`w`:i=Math.round(n*Rb);break;default:i=Math.round(n*zb);break}return t[1]===`-`||t[4]===`ago`?-i:i}})),Ub,Wb,Gb,Kb=t((()=>{Y(),H(),Pb(),Hb(),Cv(),Ub=e=>e.toLowerCase().replace(/^application\//,``),Wb=(e,t)=>typeof e==`string`?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1,Gb=(e,t,n={})=>{let r;try{r=JSON.parse(x_.decode(t))}catch{}if(!Q(r))throw new A_(`JWT Claims Set must be a top-level JSON object`);let{typ:i}=n;if(i&&(typeof e.typ!=`string`||Ub(e.typ)!==Ub(i)))throw new E_(`unexpected "typ" JWT header value`,r,`typ`,`check_failed`);let{requiredClaims:a=[],issuer:o,subject:s,audience:c,maxTokenAge:l}=n,u=[...a];l!==void 0&&u.push(`iat`),c!==void 0&&u.push(`aud`),s!==void 0&&u.push(`sub`),o!==void 0&&u.push(`iss`);for(let e of new Set(u.reverse()))if(!(e in r))throw new E_(`missing required "${e}" claim`,r,e,`missing`);if(o&&!(Array.isArray(o)?o:[o]).includes(r.iss))throw new E_(`unexpected "iss" claim value`,r,`iss`,`check_failed`);if(s&&r.sub!==s)throw new E_(`unexpected "sub" claim value`,r,`sub`,`check_failed`);if(c&&!Wb(r.aud,typeof c==`string`?[c]:c))throw new E_(`unexpected "aud" claim value`,r,`aud`,`check_failed`);let d;switch(typeof n.clockTolerance){case`string`:d=Vb(n.clockTolerance);break;case`number`:d=n.clockTolerance;break;case`undefined`:d=0;break;default:throw TypeError(`Invalid clockTolerance option type`)}let{currentDate:f}=n,p=Nb(f||new Date);if((r.iat!==void 0||l)&&typeof r.iat!=`number`)throw new E_(`"iat" claim must be a number`,r,`iat`,`invalid`);if(r.nbf!==void 0){if(typeof r.nbf!=`number`)throw new E_(`"nbf" claim must be a number`,r,`nbf`,`invalid`);if(r.nbf>p+d)throw new E_(`"nbf" claim timestamp check failed`,r,`nbf`,`check_failed`)}if(r.exp!==void 0){if(typeof r.exp!=`number`)throw new E_(`"exp" claim must be a number`,r,`exp`,`invalid`);if(r.exp<=p-d)throw new D_(`"exp" claim timestamp check failed`,r,`exp`,`check_failed`)}if(l){let e=p-r.iat,t=typeof l==`number`?l:Vb(l);if(e-d>t)throw new D_(`"iat" claim timestamp check failed (too far in the past)`,r,`iat`,`check_failed`);if(e<0-d)throw new E_(`"iat" claim timestamp check failed (it should be in the past)`,r,`iat`,`check_failed`)}return r}}));async function qb(e,t,n){let r=await kb(e,t,n);if(r.protectedHeader.crit?.includes(`b64`)&&r.protectedHeader.b64===!1)throw new A_(`JWTs MUST NOT use unencoded payload`);let i={payload:Gb(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return typeof t==`function`?{...i,key:r.key}:i}var Jb=t((()=>{Ab(),Kb(),Y()}));async function Yb(e,t,n){let r=await qy(e,t,n),i=Gb(r.protectedHeader,r.plaintext,n),{protectedHeader:a}=r;if(a.iss!==void 0&&a.iss!==i.iss)throw new E_(`replicated "iss" claim header parameter mismatch`,i,`iss`,`mismatch`);if(a.sub!==void 0&&a.sub!==i.sub)throw new E_(`replicated "sub" claim header parameter mismatch`,i,`sub`,`mismatch`);if(a.aud!==void 0&&JSON.stringify(a.aud)!==JSON.stringify(i.aud))throw new E_(`replicated "aud" claim header parameter mismatch`,i,`aud`,`mismatch`);let o={payload:i,protectedHeader:a};return typeof t==`function`?{...o,key:r.key}:o}var Xb=t((()=>{Jy(),Kb(),Y()})),Zb,Qb=t((()=>{cb(),Zb=class{_flattened;constructor(e){this._flattened=new sb(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){let n=await this._flattened.encrypt(e,t);return[n.protected,n.encrypted_key,n.iv,n.ciphertext,n.tag].join(`.`)}}})),$b,ex=t((()=>{w_(),Cb(),xv(),Y(),H(),jy(),Hy(),$b=class{_payload;_protectedHeader;_unprotectedHeader;constructor(e){if(!(e instanceof Uint8Array))throw TypeError(`payload must be an instance of Uint8Array`);this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new J(`either setProtectedHeader or setUnprotectedHeader must be called before #sign()`);if(!bv(this._protectedHeader,this._unprotectedHeader))throw new J(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let n={...this._protectedHeader,...this._unprotectedHeader},r=Vy(J,new Map([[`b64`,!0]]),t?.crit,this._protectedHeader,n),i=!0;if(r.has(`b64`)&&(i=this._protectedHeader.b64,typeof i!=`boolean`))throw new J(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:a}=n;if(typeof a!=`string`||!a)throw new J(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);Ay(a,e,`sign`);let o=this._payload;i&&(o=V.encode(U(o)));let s;s=this._protectedHeader?V.encode(U(JSON.stringify(this._protectedHeader))):V.encode(``);let c={signature:U(await Sb(a,e,m_(s,V.encode(`.`),o))),payload:``};return i&&(c.payload=x_.decode(o)),this._unprotectedHeader&&(c.header=this._unprotectedHeader),this._protectedHeader&&(c.protected=x_.decode(s)),c}}})),tx,nx=t((()=>{ex(),tx=class{_flattened;constructor(e){this._flattened=new $b(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){let n=await this._flattened.sign(e,t);if(n.payload===void 0)throw TypeError(`use the flattened module for creating JWS with b64: false`);return`${n.protected}.${n.payload}.${n.signature}`}}})),rx,ix,ax=t((()=>{ex(),Y(),rx=class{parent;protectedHeader;unprotectedHeader;options;key;constructor(e,t,n){this.parent=e,this.key=t,this.options=n}setProtectedHeader(e){if(this.protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}},ix=class{_payload;_signatures=[];constructor(e){this._payload=e}addSignature(e,t){let n=new rx(this,e,t);return this._signatures.push(n),n}async sign(){if(!this._signatures.length)throw new J(`at least one signature must be added`);let e={signatures:[],payload:``};for(let t=0;t<this._signatures.length;t++){let n=this._signatures[t],r=new $b(this._payload);r.setProtectedHeader(n.protectedHeader),r.setUnprotectedHeader(n.unprotectedHeader);let{payload:i,...a}=await r.sign(n.key,n.options);if(t===0)e.payload=i;else if(e.payload!==i)throw new J(`inconsistent use of JWS Unencoded Payload (RFC7797)`);e.signatures.push(a)}return e}}}));function ox(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}var sx,cx=t((()=>{Pb(),Cv(),Hb(),sx=class{_payload;constructor(e={}){if(!Q(e))throw TypeError(`JWT Claims Set MUST be an object`);this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return typeof e==`number`?this._payload={...this._payload,nbf:ox(`setNotBefore`,e)}:e instanceof Date?this._payload={...this._payload,nbf:ox(`setNotBefore`,Nb(e))}:this._payload={...this._payload,nbf:Nb(new Date)+Vb(e)},this}setExpirationTime(e){return typeof e==`number`?this._payload={...this._payload,exp:ox(`setExpirationTime`,e)}:e instanceof Date?this._payload={...this._payload,exp:ox(`setExpirationTime`,Nb(e))}:this._payload={...this._payload,exp:Nb(new Date)+Vb(e)},this}setIssuedAt(e){return e===void 0?this._payload={...this._payload,iat:Nb(new Date)}:e instanceof Date?this._payload={...this._payload,iat:ox(`setIssuedAt`,Nb(e))}:typeof e==`string`?this._payload={...this._payload,iat:ox(`setIssuedAt`,Nb(new Date)+Vb(e))}:this._payload={...this._payload,iat:ox(`setIssuedAt`,e)},this}}})),lx,ux=t((()=>{nx(),Y(),H(),cx(),lx=class extends sx{_protectedHeader;setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){let n=new tx(V.encode(JSON.stringify(this._payload)));if(n.setProtectedHeader(this._protectedHeader),Array.isArray(this._protectedHeader?.crit)&&this._protectedHeader.crit.includes(`b64`)&&this._protectedHeader.b64===!1)throw new A_(`JWTs MUST NOT use unencoded payload`);return n.sign(e,t)}}})),dx,fx=t((()=>{Qb(),H(),cx(),dx=class extends sx{_cek;_iv;_keyManagementParameters;_protectedHeader;_replicateIssuerAsHeader;_replicateSubjectAsHeader;_replicateAudienceAsHeader;setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError(`setKeyManagementParameters can only be called once`);return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError(`setContentEncryptionKey can only be called once`);return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError(`setInitializationVector can only be called once`);return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){let n=new Zb(V.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),n.setProtectedHeader(this._protectedHeader),this._iv&&n.setInitializationVector(this._iv),this._cek&&n.setContentEncryptionKey(this._cek),this._keyManagementParameters&&n.setKeyManagementParameters(this._keyManagementParameters),n.encrypt(e,t)}}}));async function px(e,t){if(!Q(e))throw TypeError(`JWK must be an object`);if(t??=`sha256`,t!==`sha256`&&t!==`sha384`&&t!==`sha512`)throw TypeError(`digestAlgorithm must one of "sha256", "sha384", or "sha512"`);let n;switch(e.kty){case`EC`:hx(e.crv,`"crv" (Curve) Parameter`),hx(e.x,`"x" (X Coordinate) Parameter`),hx(e.y,`"y" (Y Coordinate) Parameter`),n={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case`OKP`:hx(e.crv,`"crv" (Subtype of Key Pair) Parameter`),hx(e.x,`"x" (Public Key) Parameter`),n={crv:e.crv,kty:e.kty,x:e.x};break;case`RSA`:hx(e.e,`"e" (Exponent) Parameter`),hx(e.n,`"n" (Modulus) Parameter`),n={e:e.e,kty:e.kty,n:e.n};break;case`oct`:hx(e.k,`"k" (Key Value) Parameter`),n={k:e.k,kty:e.kty};break;default:throw new K(`"kty" (Key Type) Parameter missing or unsupported`)}let r=V.encode(JSON.stringify(n));return U(await f_(t,r))}async function mx(e,t){t??=`sha256`;let n=await px(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${n}`}var hx,gx=t((()=>{p_(),w_(),Y(),H(),Cv(),hx=(e,t)=>{if(typeof e!=`string`||!e)throw new j_(`${t} missing or invalid`)}}));async function _x(e,t){let n={...e,...t?.header};if(!Q(n.jwk))throw new J(`"jwk" (JSON Web Key) Header Parameter must be a JSON object`);let r=await Sy({...n.jwk,ext:!0},n.alg);if(r instanceof Uint8Array||r.type!==`public`)throw new J(`"jwk" (JSON Web Key) Header Parameter must be a public key`);return r}var vx=t((()=>{Cy(),Cv(),Y()}));function yx(e){switch(typeof e==`string`&&e.slice(0,2)){case`RS`:case`PS`:return`RSA`;case`ES`:return`EC`;case`Ed`:return`OKP`;default:throw new K(`Unsupported "alg" value for a JSON Web Key Set`)}}function bx(e){return e&&typeof e==`object`&&Array.isArray(e.keys)&&e.keys.every(xx)}function xx(e){return Q(e)}function Sx(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}async function Cx(e,t,n){let r=e.get(t)||e.set(t,{}).get(t);if(r[n]===void 0){let e=await Sy({...t,ext:!0},n);if(e instanceof Uint8Array||e.type!==`public`)throw new M_(`JSON Web Key Set members must be public keys`);r[n]=e}return r[n]}function wx(e){let t=new Tx(e),n=async(e,n)=>t.getKey(e,n);return Object.defineProperties(n,{jwks:{value:()=>Sx(t._jwks),enumerable:!0,configurable:!1,writable:!1}}),n}var Tx,Ex=t((()=>{Cy(),Y(),Cv(),Tx=class{_jwks;_cached=new WeakMap;constructor(e){if(!bx(e))throw new M_(`JSON Web Key Set malformed`);this._jwks=Sx(e)}async getKey(e,t){let{alg:n,kid:r}={...e,...t?.header},i=yx(n),a=this._jwks.keys.filter(e=>{let t=i===e.kty;if(t&&typeof r==`string`&&(t=r===e.kid),t&&typeof e.alg==`string`&&(t=n===e.alg),t&&typeof e.use==`string`&&(t=e.use===`sig`),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes(`verify`)),t)switch(n){case`ES256`:t=e.crv===`P-256`;break;case`ES256K`:t=e.crv===`secp256k1`;break;case`ES384`:t=e.crv===`P-384`;break;case`ES512`:t=e.crv===`P-521`;break;case`Ed25519`:t=e.crv===`Ed25519`;break;case`EdDSA`:t=e.crv===`Ed25519`||e.crv===`Ed448`;break}return t}),{0:o,length:s}=a;if(s===0)throw new N_;if(s!==1){let e=new P_,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(let e of a)try{yield await Cx(t,e,n)}catch{}},e}return Cx(this._cached,o,n)}}})),Dx,Ox=t((()=>{Y(),H(),Dx=async(e,t,n)=>{let r;switch(e.protocol){case`https:`:r=jl.get;break;case`http:`:r=El.get;break;default:throw TypeError(`Unsupported URL protocol.`)}let{agent:i,headers:a}=n,o=r(e.href,{agent:i,timeout:t,headers:a}),[s]=await Promise.race([Dl(o,`response`),Dl(o,`timeout`)]);if(!s)throw o.destroy(),new F_;if(s.statusCode!==200)throw new G(`Expected 200 OK from the JSON Web Key Set HTTP response`);let c=[];for await(let e of s)c.push(e);try{return JSON.parse(x_.decode(m_(...c)))}catch{throw new G(`Failed to parse the JSON Web Key Set HTTP response as JSON`)}}}));function kx(){return typeof WebSocketPair<`u`||typeof navigator<`u`&&navigator.userAgent===`Cloudflare-Workers`||typeof EdgeRuntime<`u`&&EdgeRuntime===`vercel`}function Ax(e,t){return!(typeof e!=`object`||!e||!(`uat`in e)||typeof e.uat!=`number`||Date.now()-e.uat>=t||!(`jwks`in e)||!Q(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,Q))}function jx(e,t){let n=new Px(e,t),r=async(e,t)=>n.getKey(e,t);return Object.defineProperties(r,{coolingDown:{get:()=>n.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>n.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>n.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>!!n._pendingFetch,enumerable:!0,configurable:!1},jwks:{value:()=>n._local?.jwks(),enumerable:!0,configurable:!1,writable:!1}}),r}var Mx,Nx,Px,Fx,Ix=t((()=>{Ox(),Y(),Ex(),Cv(),(typeof navigator>`u`||!navigator.userAgent?.startsWith?.(`Mozilla/5.0 `))&&(Mx=`jose/v5.10.0`),Nx=Symbol(),Px=class{_url;_timeoutDuration;_cooldownDuration;_cacheMaxAge;_jwksTimestamp;_pendingFetch;_options;_local;_cache;constructor(e,t){if(!(e instanceof URL))throw TypeError(`url must be an instance of URL`);this._url=new URL(e.href),this._options={agent:t?.agent,headers:t?.headers},this._timeoutDuration=typeof t?.timeoutDuration==`number`?t?.timeoutDuration:5e3,this._cooldownDuration=typeof t?.cooldownDuration==`number`?t?.cooldownDuration:3e4,this._cacheMaxAge=typeof t?.cacheMaxAge==`number`?t?.cacheMaxAge:6e5,t?.[Nx]!==void 0&&(this._cache=t?.[Nx],Ax(t?.[Nx],this._cacheMaxAge)&&(this._jwksTimestamp=this._cache.uat,this._local=wx(this._cache.jwks)))}coolingDown(){return typeof this._jwksTimestamp==`number`&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return typeof this._jwksTimestamp==`number`&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){(!this._local||!this.fresh())&&await this.reload();try{return await this._local(e,t)}catch(n){if(n instanceof N_&&this.coolingDown()===!1)return await this.reload(),this._local(e,t);throw n}}async reload(){this._pendingFetch&&kx()&&(this._pendingFetch=void 0);let e=new Headers(this._options.headers);Mx&&!e.has(`User-Agent`)&&(e.set(`User-Agent`,Mx),this._options.headers=Object.fromEntries(e.entries())),this._pendingFetch||=Dx(this._url,this._timeoutDuration,this._options).then(e=>{this._local=wx(e),this._cache&&(this._cache.uat=Date.now(),this._cache.jwks=e),this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(e=>{throw this._pendingFetch=void 0,e}),await this._pendingFetch}},Fx=Nx})),Lx,Rx=t((()=>{w_(),H(),Y(),Kb(),cx(),Lx=class extends sx{encode(){return`${U(JSON.stringify({alg:`none`}))}.${U(JSON.stringify(this._payload))}.`}static decode(e,t){if(typeof e!=`string`)throw new A_(`Unsecured JWT must be a string`);let{0:n,1:r,2:i,length:a}=e.split(`.`);if(a!==3||i!==``)throw new A_(`Invalid Unsecured JWT`);let o;try{if(o=JSON.parse(x_.decode(W(n))),o.alg!==`none`)throw Error()}catch{throw new A_(`Invalid Unsecured JWT`)}return{payload:Gb(o,W(r),t),header:o}}}})),zx=r({decode:()=>Vx,encode:()=>Bx}),Bx,Vx,Hx=t((()=>{w_(),Bx=U,Vx=W}));function Ux(e){let t;if(typeof e==`string`){let n=e.split(`.`);(n.length===3||n.length===5)&&([t]=n)}else if(typeof e==`object`&&e)if(`protected`in e)t=e.protected;else throw TypeError(`Token does not contain a Protected Header`);try{if(typeof t!=`string`||!t)throw Error();let e=JSON.parse(x_.decode(Vx(t)));if(!Q(e))throw Error();return e}catch{throw TypeError(`Invalid Token or Protected Header formatting`)}}var Wx=t((()=>{Hx(),H(),Cv()}));function Gx(e){if(typeof e!=`string`)throw new A_(`JWTs must use Compact JWS serialization, JWT must be a string`);let{1:t,length:n}=e.split(`.`);if(n===5)throw new A_(`Only JWTs using Compact JWS serialization can be decoded`);if(n!==3)throw new A_(`Invalid JWT`);if(!t)throw new A_(`JWTs must contain a payload`);let r;try{r=Vx(t)}catch{throw new A_(`Failed to base64url decode the payload`)}let i;try{i=JSON.parse(x_.decode(r))}catch{throw new A_(`Failed to parse the decoded payload as JSON`)}if(!Q(i))throw new A_(`Invalid JWT Claims Set`);return i}var Kx=t((()=>{Hx(),H(),Cv(),Y()}));async function qx(e,t){let n;switch(e){case`HS256`:case`HS384`:case`HS512`:case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:n=parseInt(e.slice(-3),10);break;case`A128KW`:case`A192KW`:case`A256KW`:case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:case`A128GCM`:case`A192GCM`:case`A256GCM`:n=parseInt(e.slice(1,4),10);break;default:throw new K(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}return ul(_l(new Uint8Array(n>>3)))}async function Jx(e,t){switch(e){case`RS256`:case`RS384`:case`RS512`:case`PS256`:case`PS384`:case`PS512`:case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:case`RSA1_5`:{let e=t?.modulusLength??2048;if(typeof e!=`number`||e<2048)throw new K(`Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used`);return await Yx(`rsa`,{modulusLength:e,publicExponent:65537})}case`ES256`:return Yx(`ec`,{namedCurve:`P-256`});case`ES256K`:return Yx(`ec`,{namedCurve:`secp256k1`});case`ES384`:return Yx(`ec`,{namedCurve:`P-384`});case`ES512`:return Yx(`ec`,{namedCurve:`P-521`});case`Ed25519`:return Yx(`ed25519`);case`EdDSA`:switch(t?.crv){case void 0:case`Ed25519`:return Yx(`ed25519`);case`Ed448`:return Yx(`ed448`);default:throw new K(`Invalid or unsupported crv option provided, supported values are Ed25519 and Ed448`)}case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{let e=t?.crv??`P-256`;switch(e){case void 0:case`P-256`:case`P-384`:case`P-521`:return Yx(`ec`,{namedCurve:e});case`X25519`:return Yx(`x25519`);case`X448`:return Yx(`x448`);default:throw new K(`Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448`)}}default:throw new K(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}}var Yx,Xx=t((()=>{L_(),Y(),Yx=Cl(fl)}));async function Zx(e,t){return Jx(e,t)}var Qx=t((()=>{Xx()}));async function $x(e,t){return qx(e,t)}var eS=t((()=>{Xx()})),tS,nS=t((()=>{tS=`node:crypto`})),rS,iS=t((()=>{nS(),rS=tS})),aS=r({CompactEncrypt:()=>Zb,CompactSign:()=>tx,EmbeddedJWK:()=>_x,EncryptJWT:()=>dx,FlattenedEncrypt:()=>sb,FlattenedSign:()=>$b,GeneralEncrypt:()=>ub,GeneralSign:()=>ix,SignJWT:()=>lx,UnsecuredJWT:()=>Lx,base64url:()=>zx,calculateJwkThumbprint:()=>px,calculateJwkThumbprintUri:()=>mx,compactDecrypt:()=>qy,compactVerify:()=>kb,createLocalJWKSet:()=>wx,createRemoteJWKSet:()=>jx,cryptoRuntime:()=>rS,decodeJwt:()=>Gx,decodeProtectedHeader:()=>Ux,errors:()=>T_,experimental_jwksCache:()=>Fx,exportJWK:()=>rb,exportPKCS8:()=>nb,exportSPKI:()=>tb,flattenedDecrypt:()=>Gy,flattenedVerify:()=>Db,generalDecrypt:()=>Yy,generalVerify:()=>jb,generateKeyPair:()=>Zx,generateSecret:()=>$x,importJWK:()=>Sy,importPKCS8:()=>xy,importSPKI:()=>yy,importX509:()=>by,jwksCache:()=>Nx,jwtDecrypt:()=>Yb,jwtVerify:()=>qb}),oS=t((()=>{Jy(),Ky(),Xy(),db(),Ab(),Ob(),Mb(),Jb(),Xb(),Qb(),cb(),nx(),ex(),ax(),ux(),fx(),gx(),vx(),Ex(),Ix(),Rx(),ib(),Cy(),Wx(),Kx(),Y(),Qx(),eS(),Hx(),iS()})),sS=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{verifyVercelOidcToken:()=>h}),t.exports=c(l);var u=(oS(),c(aS));let d=`https://oidc.vercel.com`,f=new URL(`https://oidc.vercel.com/.well-known/jwks`),p=[`RS256`],m=(0,u.createRemoteJWKSet)(f);async function h(e,t){let{algorithms:n,projectId:r=process.env.VERCEL_PROJECT_ID,environment:i=process.env.VERCEL_TARGET_ENV||process.env.VERCEL_ENV,ownerId:a,...o}=t??{};if(r===`*`&&a===void 0&&!g(o.audience))throw TypeError(`Expected ownerId or audience to be provided when projectId is '*'.`);let s=await(0,u.jwtVerify)(e,m,{...o,algorithms:n??p});return _(s.payload.iss),v({actual:s.payload.project_id,claim:`project_id`,env:`VERCEL_PROJECT_ID`,expected:r,option:`projectId`}),v({actual:s.payload.environment,claim:`environment`,env:`VERCEL_TARGET_ENV or VERCEL_ENV`,expected:i,option:`environment`}),y({actual:s.payload.owner_id,claim:`owner_id`,expected:a}),s}function g(e){return Array.isArray(e)?e.length>0:e!==void 0}function _(e){if(e!==d&&(typeof e!=`string`||!e.startsWith(`${d}/`)))throw TypeError(`Expected Vercel OIDC token iss claim to be "${d}" or to start with "${d}/".`)}function v({actual:e,claim:t,env:n,expected:r,option:i}){if(r!==`*`){if(r===void 0||r.length===0)throw TypeError(`Expected ${n} to be set or ${i} to be provided. Pass ${i}: '*' to allow any ${t} claim.`);if(!(Array.isArray(r)&&typeof e==`string`&&r.includes(e))&&e!==r)throw TypeError(Array.isArray(r)?`Expected Vercel OIDC token ${t} claim to be one of: ${r.map(e=>`"${e}"`).join(`, `)}.`:`Expected Vercel OIDC token ${t} claim to be "${r}".`)}}function y({actual:e,claim:t,expected:n}){if(n!==void 0&&e!==n)throw TypeError(`Expected Vercel OIDC token ${t} claim to be "${n}".`)}0&&(t.exports={verifyVercelOidcToken:h})})),cS=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{AccessTokenMissingError:()=>m.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>m.RefreshAccessTokenFailedError,exchangeVercelOidcToken:()=>h.exchangeVercelOidcToken,getContext:()=>f.getContext,getVercelOidcToken:()=>u.getVercelOidcToken,getVercelOidcTokenSync:()=>d.getVercelOidcTokenSync,getVercelToken:()=>g.getVercelToken,verifyVercelOidcToken:()=>p.verifyVercelOidcToken}),t.exports=c(l);var u=d_(),d=u_(),f=l_(),p=sS(),m=Zc(),h=c_(),g=Qc();0&&(t.exports={AccessTokenMissingError,RefreshAccessTokenFailedError,exchangeVercelOidcToken,getContext,getVercelOidcToken,getVercelOidcTokenSync,getVercelToken,verifyVercelOidcToken})})),lS=n(o_(),1),uS=cS();async function dS(e){let t=0,n=e.getReader(),r=[];try{for(;;){let{done:e,value:i}=await n.read();if(e)break;r.push(i),t+=i.length}}finally{n.releaseLock()}return Buffer.concat(r,t)}var fS=class{contentType=`application/json`;replacer;reviver;constructor(e={}){this.replacer=e.replacer,this.reviver=e.reviver}serialize(e){return Buffer.from(JSON.stringify(e,this.replacer),`utf8`)}async deserialize(e){let t=await dS(e);return JSON.parse(t.toString(`utf8`),this.reviver)}},pS=class extends Error{constructor(e){super(`Message ${e} not found`),this.name=`MessageNotFoundError`}},mS=class extends Error{constructor(e,t){super(`Message ${e} not available for processing${t?`: ${t}`:``}`),this.name=`MessageNotAvailableError`}},hS=class extends Error{constructor(e,t){super(`Message ${e} is corrupted: ${t}`),this.name=`MessageCorruptedError`}},gS=class extends Error{retryAfter;constructor(e=`Too many requests`,t){super(e),this.name=`TooManyRequestsError`,this.retryAfter=t}},_S=class extends Error{constructor(e=`Missing or invalid authentication token`){super(e),this.name=`UnauthorizedError`}},vS=class extends Error{constructor(e=`Queue environment doesn't match token environment`){super(e),this.name=`ForbiddenError`}},yS=class extends Error{constructor(e){super(e),this.name=`BadRequestError`}},bS=class extends Error{constructor(e=`Unexpected server error`){super(e),this.name=`InternalServerError`}},xS=class extends Error{constructor(e,t=1,n=10){super(`Invalid limit: ${e}. Limit must be between ${t} and ${n}.`),this.name=`InvalidLimitError`}},SS=class extends Error{constructor(e){super(`Message ${e} has already been processed`),this.name=`MessageAlreadyProcessedError`}},CS=class extends Error{idempotencyKey;constructor(e,t){super(e),this.name=`DuplicateMessageError`,this.idempotencyKey=t}},wS=class extends Error{deploymentId;constructor(e,t){super(e),this.name=`ConsumerDiscoveryError`,this.deploymentId=t}},TS=class extends Error{constructor(e=`Consumer registry not configured`){super(e),this.name=`ConsumerRegistryNotConfiguredError`}},ES=300,DS=30,OS=60,kS=10,AS=3e3,jS=3,MS=250;function NS(e){return Math.min(OS,Math.max(kS,e/5))}var PS=class{client;topicName;consumerGroupName;visibilityTimeout;constructor(e,t,n,r={}){this.client=e,this.topicName=t,this.consumerGroupName=n,this.visibilityTimeout=Math.max(DS,r.visibilityTimeoutSeconds??ES)}isClientError(e){return e instanceof mS||e instanceof pS||e instanceof yS||e instanceof _S||e instanceof vS}isNetworkError(e){return e instanceof TypeError}async directiveCallWithRetries(e){let t;for(let n=1;n<=jS;n++)try{return await e()}catch(e){if(t=e,n===jS)throw e;if(e instanceof gS){if(e.retryAfter===void 0)throw e;await new Promise(t=>setTimeout(t,e.retryAfter*1e3));continue}if(!this.isNetworkError(e))throw e;let r=MS*n,i=r/2+r/2*Math.random();await new Promise(e=>setTimeout(e,i))}throw t}startVisibilityExtension(e,t){let n=!0,r=!1,i,a=null,o=NS(this.visibilityTimeout)*1e3,s=o;if(t?.visibilityDeadline){let e=t.visibilityDeadline.getTime()-Date.now();s=e>0?NS(e/1e3)*1e3:0}let c=new Promise(e=>{i=e}),l=()=>{r||(r=!0,i())},u=async()=>{if(!n){l();return}try{await this.client.changeVisibility({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e,visibilityTimeoutSeconds:this.visibilityTimeout}),n?a=setTimeout(()=>u(),o):l()}catch(t){if(this.isClientError(t)){console.error(`Visibility extension failed with client error for receipt handle ${e} (stopping retries):`,t),l();return}console.error(`Failed to extend visibility for receipt handle ${e} (will retry in ${AS/1e3}s):`,t),n?a=setTimeout(()=>u(),AS):l()}};return a=setTimeout(()=>u(),s),async(e=!1)=>{n=!1,a&&=(clearTimeout(a),null),e?await c:l()}}async finalizePayload(e){let t=this.client.getTransport();if(t.finalize&&e!=null)try{await t.finalize(e)}catch(e){console.warn(`Failed to finalize message payload:`,e)}}async processMessage(e,t,n){let r=this.startVisibilityExtension(e.receiptHandle,n),i={messageId:e.messageId,deliveryCount:e.deliveryCount,createdAt:e.createdAt,expiresAt:e.expiresAt??new Date(e.createdAt.getTime()+864e5),topicName:this.topicName,consumerGroup:this.consumerGroupName,region:this.client.getRegion()};try{await t(e.payload,i),await r(),await this.client.acknowledgeMessage({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e.receiptHandle})}catch(t){if(await r(),n?.retry){let r;try{r=n.retry(t,i)}catch(e){console.warn(`retry handler threw:`,e)}if(r){if(`acknowledge`in r&&r.acknowledge){try{await this.directiveCallWithRetries(()=>this.client.acknowledgeMessage({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e.receiptHandle}))}catch(e){console.warn(`Failed to acknowledge message:`,e)}await this.finalizePayload(e.payload);return}if(`afterSeconds`in r&&typeof r.afterSeconds==`number`){try{await this.directiveCallWithRetries(()=>this.client.changeVisibility({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e.receiptHandle,visibilityTimeoutSeconds:r.afterSeconds}))}catch(e){console.warn(`Failed to reschedule message for retry:`,e)}await this.finalizePayload(e.payload);return}}}throw await this.finalizePayload(e.payload),t}}async consumeMessage(e,t,n){await this.processMessage(t,e,n)}async consume(e,t){let n=t?.retry;if(t&&`messageId`in t){let r=await this.client.receiveMessageById({queueName:this.topicName,consumerGroup:this.consumerGroupName,messageId:t.messageId,visibilityTimeoutSeconds:this.visibilityTimeout});return await this.processMessage(r.message,e,{retry:n}),1}else{let r=t&&`limit`in t?t.limit:1,i=0;for await(let t of this.client.receiveMessages({queueName:this.topicName,consumerGroup:this.consumerGroupName,visibilityTimeoutSeconds:this.visibilityTimeout,limit:r}))i++,await this.processMessage(t,e,{retry:n});return i}}get name(){return this.consumerGroupName}get topic(){return this.topicName}},FS=class{client;topicName;constructor(e,t){this.client=e,this.topicName=t}async publish(e,t){let n=await this.client.sendMessage({queueName:this.topicName,payload:e,idempotencyKey:t?.idempotencyKey,retentionSeconds:t?.retentionSeconds,delaySeconds:t?.delaySeconds,headers:t?.headers,telemetry:t?.telemetry});return n.messageId&&YS()&&FC(this.topicName,n.messageId,this.client.getRegion(),t?.delaySeconds,t?.retentionSeconds),{messageId:n.messageId}}consumerGroup(e,t){return new PS(this.client,this.topicName,e,t)}get name(){return this.topicName}},IS=`com.vercel.queue.v1beta`,LS=`com.vercel.queue.v2beta`;function RS(e,t){let n=t.slice(0,-1);return e.startsWith(n)}function zS(e){return typeof e==`object`&&!!e}function BS(e,t){if(!t||!t.includes(`application/cloudevents+json`))throw Error(`Invalid content type: expected 'application/cloudevents+json'`);if(!zS(e)||!e.type||!e.source||!e.id||!zS(e.data))throw Error(`Invalid CloudEvent: missing required fields`);if(e.type!==`com.vercel.queue.v1beta`)throw Error(`Invalid CloudEvent type: expected '${IS}', got '${String(e.type)}'`);let{data:n}=e,r=[];if(`queueName`in n||r.push(`queueName`),`consumerGroup`in n||r.push(`consumerGroup`),`messageId`in n||r.push(`messageId`),r.length>0)throw Error(`Missing required CloudEvent data fields: ${r.join(`, `)}`);return{queueName:String(n.queueName),consumerGroup:String(n.consumerGroup),messageId:String(n.messageId)}}function VS(e,t){if(e instanceof Headers)return e.get(t);let n=e[t];return Array.isArray(n)?n[0]??null:n??null}function HS(e){let t=VS(e,`ce-type`);if(t!==`com.vercel.queue.v2beta`)throw Error(`Invalid CloudEvent type: expected '${LS}', got '${t}'`);let n=VS(e,`ce-vqsqueuename`),r=VS(e,`ce-vqsconsumergroup`),i=VS(e,`ce-vqsmessageid`),a=[];if(n||a.push(`ce-vqsqueuename`),r||a.push(`ce-vqsconsumergroup`),i||a.push(`ce-vqsmessageid`),a.length>0)throw Error(`Missing required CloudEvent headers: ${a.join(`, `)}`);let o=VS(e,`ce-vqsregion`)??void 0;if(o!==void 0&&!/^[a-z]{2,5}[0-9]{1,2}$/.test(o))throw Error(`Invalid ce-vqsregion header: ${JSON.stringify(o)}. Region must match /^[a-z]{2,5}[0-9]{1,2}$/ (e.g. "iad1", "lhr1").`);let s={queueName:n,consumerGroup:r,messageId:i,region:o},c=VS(e,`ce-vqsreceipthandle`);if(!c)return s;let l={...s,receiptHandle:c},u=VS(e,`ce-vqsdeliverycount`);u&&(l.deliveryCount=parseInt(u,10));let d=VS(e,`ce-vqscreatedat`);d&&(l.createdAt=d);let f=VS(e,`ce-vqsexpiresat`);f&&(l.expiresAt=f);let p=VS(e,`content-type`);p&&(l.contentType=p);let m=VS(e,`ce-vqsvisibilitydeadline`);return m&&(l.visibilityDeadline=m),l}function US(e,t){if(VS(t,`ce-type`)===`com.vercel.queue.v2beta`){let n=HS(t);return`receiptHandle`in n&&(n.parsedPayload=e),n}return BS(e,VS(t,`content-type`))}async function WS(e){if(e.headers.get(`ce-type`)===`com.vercel.queue.v2beta`){let t=HS(e.headers);return`receiptHandle`in t&&e.body&&(t.rawBody=e.body),t}let t;try{t=await e.json()}catch{throw Error(`Failed to parse CloudEvent from request body`)}let n={};return e.headers.forEach((e,t)=>{n[t]=e}),US(t,n)}async function GS(e,t,n){let{queueName:r,consumerGroup:i,messageId:a}=t;if(!n?.client)throw Error(`HandleCallbackOptions.client is required`);let o=mw(n.client);t.region&&(o=o.withRegion(t.region));let s=new FS(o,r).consumerGroup(i,n?.visibilityTimeoutSeconds===void 0?void 0:{visibilityTimeoutSeconds:n.visibilityTimeoutSeconds});if(`receiptHandle`in t){let r=o.getTransport(),i;if(t.rawBody)i=await r.deserialize(t.rawBody);else if(t.parsedPayload!==void 0)i=t.parsedPayload;else throw Error(`Binary mode callback with receipt handle is missing payload`);let c={messageId:a,payload:i,deliveryCount:t.deliveryCount??1,createdAt:t.createdAt?new Date(t.createdAt):new Date,expiresAt:t.expiresAt?new Date(t.expiresAt):void 0,contentType:t.contentType??r.contentType,receiptHandle:t.receiptHandle},l=t.visibilityDeadline?new Date(t.visibilityDeadline):void 0;await s.consumeMessage(e,c,{visibilityDeadline:l,retry:n?.retry})}else await s.consume(e,{messageId:a,retry:n?.retry})}var $=lS.default.cyan(`[queue]`),KS=lS.default.green(`✓`),qS=lS.default.red(`✗`),JS=lS.default.yellow(`↻`);function YS(){return process.env.NODE_ENV===`development`&&process.env.VERCEL_DEPLOYMENT_ID===void 0}var XS=Symbol.for(`@vercel/queue.devRouteMappings`);function ZS(e){let t=``;for(let n of e)n===`_`?t+=`__`:n===`/`?t+=`_S`:n===`.`?t+=`_D`:/[A-Za-z0-9-]/.test(n)?t+=n:t+=`_`+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`);return t}function QS(){let e=globalThis;if(XS in e)return e[XS]??null;try{let t=el.join(process.cwd(),`vercel.json`);if(!kl.existsSync(t))return e[XS]=null,null;let n=JSON.parse(kl.readFileSync(t,`utf-8`));if(!n.functions)return e[XS]=null,null;let r=[];for(let[e,t]of Object.entries(n.functions))if(t.experimentalTriggers){for(let n of t.experimentalTriggers)if(!(!n.type?.startsWith(`queue/`)||!n.topic)){if(n.type!==`queue/v2beta`){console.warn(`${$} Unsupported trigger type "${n.type}" for topic "${n.topic}" in ${e}. Use "queue/v2beta" instead.`);continue}r.push({filePath:e,topic:n.topic,consumer:ZS(e),retryAfterSeconds:n.retryAfterSeconds})}}return e[XS]=r.length>0?r:null,e[XS]}catch(t){return console.warn(`${$} Failed to read vercel.json:`,t),e[XS]=null,null}}function $S(e){let t=QS();return t?t.filter(t=>t.topic.includes(`*`)?RS(e,t.topic):t.topic===e):[]}function eC(e,t){return $S(e).find(e=>e.consumer===t)?.retryAfterSeconds}function tC(e){return/^src\/(app|pages|server)\//.test(e)?e.slice(4):null}function nC(e,t){return e===t||B(e,t)}function rC(e){let t=QS();if(!t)return[];let n=process.cwd(),r;try{r=el.relative(n,e)}catch{return[]}let i=r.replace(/\\/g,`/`),a=tC(i);return t.filter(e=>nC(i,e.filePath)||a!==null&&nC(a,e.filePath))}function iC(e){let t=e.match(/\((.+?):\d+:\d+\)/);if(t||=e.match(/at\s+(.+?):\d+:\d+/),!t)return null;let n=t[1].trim();if(n===`native`||n.startsWith(`node:`)||n.startsWith(`internal`))return null;if(n.startsWith(`file://`))try{n=new URL(n).pathname}catch{return null}return/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(n)?null:(n.startsWith(`./`)&&(n=n.slice(2)),n)}var aC;function oC(){if(aC)return aC;try{let e=typeof __dirname<`u`?__dirname:el.dirname(new URL(import.meta.url).pathname);aC=el.resolve(e,`..`)}catch{aC=``}return aC}function sC(){let e=Error().stack;if(!e)return null;let t=e.split(`
|
|
13
|
-
`).slice(1),n=
|
|
11
|
+
`)(e,n),a=2),i===-1){let t=e.subarray(n);if(t.length>this.maxHeaderSize)throw new z(`Headers too large: ${t.length} > ${this.maxHeaderSize} bytes`);this.buffer=t;break}let o=e.subarray(n,i);this.currentHeaders=Nh(o);let s=this.createStreamingMessage();t.push(s),n=i+a,this.state=3;continue}if(this.state===0){if(r<this.openingBoundaryLength){if(e.length>this.maxBoundaryBuffer)throw new z(`Initial chunk too large for boundary detection: ${e.length} > ${this.maxBoundaryBuffer}`);this.buffer=e;break}if(this.findOpeningBoundary(e)!==0)throw new z(`Invalid multipart stream: missing initial boundary`);n=this.openingBoundaryLength,this.state=1}}return t}createStreamingMessage(){let e=new Headers(this.currentHeaders),t=new ReadableStream({start:e=>{this.currentPayloadController=e}});return this.currentHeaders=new Headers,{headers:e,payload:t}}writeBody(e){this.currentPayloadController&&this.currentPayloadController.enqueue(e)}finishMessage(){this.currentPayloadController&&=(this.currentPayloadController.close(),null)}closeCurrentPayload(e){if(this.currentPayloadController){try{e?this.currentPayloadController.error(e):this.currentPayloadController.close()}catch{}this.currentPayloadController=null}}};const Rh=(e,t,n)=>{let r=e instanceof RegExp?zh(e,n):e,i=t instanceof RegExp?zh(t,n):t,a=r!==null&&i!=null&&Bh(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},zh=(e,t)=>{let n=t.match(e);return n?n[0]:null},Bh=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},Vh=`\0SLASH`+Math.random()+`\0`,Hh=`\0OPEN`+Math.random()+`\0`,Uh=`\0CLOSE`+Math.random()+`\0`,Wh=`\0COMMA`+Math.random()+`\0`,Gh=`\0PERIOD`+Math.random()+`\0`,Kh=new RegExp(Vh,`g`),qh=new RegExp(Hh,`g`),Jh=new RegExp(Uh,`g`),Yh=new RegExp(Wh,`g`),Xh=new RegExp(Gh,`g`),Zh=/\\\\/g,Qh=/\\{/g,$h=/\\}/g,eg=/\\,/g,tg=/\\\./g;function ng(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function rg(e){return e.replace(Zh,Vh).replace(Qh,Hh).replace($h,Uh).replace(eg,Wh).replace(tg,Gh)}function ig(e){return e.replace(Kh,`\\`).replace(qh,`{`).replace(Jh,`}`).replace(Yh,`,`).replace(Xh,`.`)}function ag(e){if(!e)return[``];let t=[],n=Rh(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=ag(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function og(e,t={}){if(!e)return[];let{max:n=1e5}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),dg(rg(e),n,!0).map(ig)}function sg(e){return`{`+e+`}`}function cg(e){return/^-?0\d/.test(e)}function lg(e,t){return e<=t}function ug(e,t){return e>=t}function dg(e,t,n){let r=[];for(;;){let i=Rh(`{`,`}`,e);if(!i)return[e];let a=i.pre;if(/\$$/.test(i.pre)){let e=i.post.length?dg(i.post,t,!1):[``];for(let n=0;n<e.length&&n<t;n++){let t=a+`{`+i.body+`}`+e[n];r.push(t)}return r}let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),c=o||s,l=i.body.indexOf(`,`)>=0;if(!c&&!l){if(i.post.match(/,(?!,).*\}/)){e=i.pre+`{`+i.body+Uh+i.post,n=!0;continue}return[e]}let u=i.post.length?dg(i.post,t,!1):[``],d;if(c)d=i.body.split(/\.\./);else if(d=ag(i.body),d.length===1&&d[0]!==void 0&&(d=dg(d[0],t,!1).map(sg),d.length===1))return u.map(e=>i.pre+d[0]+e);let f;if(c&&d[0]!==void 0&&d[1]!==void 0){let e=ng(d[0]),n=ng(d[1]),r=Math.max(d[0].length,d[1].length),i=d.length===3&&d[2]!==void 0?Math.max(Math.abs(ng(d[2])),1):1,a=lg;n<e&&(i*=-1,a=ug);let o=d.some(cg);f=[];for(let c=e;a(c,n)&&f.length<t;c+=i){let e;if(s)e=String.fromCharCode(c),e===`\\`&&(e=``);else if(e=String(c),o){let t=r-e.length;if(t>0){let n=Array(t+1).join(`0`);e=c<0?`-`+n+e.slice(1):n+e}}f.push(e)}}else{f=[];for(let e=0;e<d.length;e++)f.push.apply(f,dg(d[e],t,!1))}for(let e=0;e<f.length;e++)for(let i=0;i<u.length&&r.length<t;i++){let t=a+f[e]+u[i];(!n||c||t)&&r.push(t)}return r}}const fg=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},pg={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},mg=e=>e.replace(/[[\]\\-]/g,`\\$&`),hg=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),gg=e=>e.join(``),_g=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(pg))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(mg(d)+`-`+mg(t)):t===d&&r.push(mg(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(mg(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(mg(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let e=r[0].length===2?r[0].slice(-1):r[0];return[hg(e),!1,u-n,!1]}let f=`[`+(l?`^`:``)+gg(r)+`]`,p=`[`+(l?``:`^`)+gg(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},vg=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`);var yg;const bg=new Set([`!`,`?`,`+`,`*`,`@`]),xg=e=>bg.has(e),Sg=e=>xg(e.type),Cg=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),wg=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),Tg=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),Eg=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),Dg=`(?!\\.)`,Og=new Set([`[`,`.`]),kg=new Set([`..`,`.`]),Ag=new Set(`().*{}+?[]^$\\!`),jg=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),Mg=`[^/]+?`;let Ng=0;var Pg=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++Ng;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for(`nodejs.util.inspect.custom`)](){return{"@@type":`AST`,id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof yg&&t.#i===this))throw Error(`invalid part: `+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#r[t];if(!(n instanceof yg&&n.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new yg(this.type,e);for(let e of this.#r)t.copyIn(e);return t}static#f(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&xg(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new yg(n,t);u=yg.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new yg(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}if(!r.noext&&xg(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#h(n))){let a=t&&t.#h(n)?0:1;d.push(p),p=``;let o=new yg(n,d);d.push(o),u=yg.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new yg(null,t);continue}if(n===`)`)return p===``&&t.#r.length===0&&(t.#u=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#t=void 0,t.#r=[e.substring(n-1)],u}#p(e){return this.#m(e,wg)}#m(e,t=Cg){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=Tg){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new yg(null,n,this.options);r.#r.push(``),n.push(r),this.#_(e,t)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!Eg.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=Eg.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}static fromGlob(e,t={}){let n=new yg(null,void 0,t);return yg.#f(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!Sg(this)){let n=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),r=this.#r.map(t=>{let[r,i,a,o]=typeof t==`string`?yg.#C(t,this.#t,n):t.toRegExpSource(e);return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&kg.has(this.#r[0]))){let n=Og,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?`(?!(?:^|/)\\.\\.?(?:$|/))`:o?Dg:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,vg(r),this.#t=!!this.#t,this.#n]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#S(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,vg(this.toString()),!1,!1]}let a=!n||e||t?``:this.#S(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#u)o=(this.isStart()&&!t?Dg:``)+Mg;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?Dg:``)+`[^/]*?)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,vg(i),this.#t=!!this.#t,this.#n]}#x(){if(Sg(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(Ag.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?Mg:`[^/]*?`,t=!0;continue}else o=!1;if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=_g(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=`[^/]`,t=!0;continue}i+=jg(c)}return[i,vg(e),!!t,a]}};yg=Pg;const Fg=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),B=(e,t,n={})=>(fg(t),!n.nocomment&&t.charAt(0)===`#`?!1:new l_(t,n).match(e)),Ig=/^\*+([^+@!?*[(]*)$/,Lg=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),Rg=e=>t=>t.endsWith(e),zg=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),Bg=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Vg=/^\*+\.\*+$/,Hg=e=>!e.startsWith(`.`)&&e.includes(`.`),Ug=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Wg=/^\.\*+$/,Gg=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),Kg=/^\*+$/,qg=e=>e.length!==0&&!e.startsWith(`.`),Jg=e=>e.length!==0&&e!==`.`&&e!==`..`,Yg=/^\?+([^+@!?*[(]*)?$/,Xg=([e,t=``])=>{let n=e_([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Zg=([e,t=``])=>{let n=t_([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Qg=([e,t=``])=>{let n=t_([e]);return t?e=>n(e)&&e.endsWith(t):n},$g=([e,t=``])=>{let n=e_([e]);return t?e=>n(e)&&e.endsWith(t):n},e_=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},t_=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},n_=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,r_={win32:{sep:`\\`},posix:{sep:`/`}};B.sep=n_===`win32`?r_.win32.sep:r_.posix.sep;const i_=Symbol(`globstar **`);B.GLOBSTAR=i_,B.filter=(e,t={})=>n=>B(n,e,t);const a_=(e,t={})=>Object.assign({},e,t);B.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return B;let t=B;return Object.assign((n,r,i={})=>t(n,r,a_(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,a_(e,n))}static defaults(n){return t.defaults(a_(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,a_(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,a_(e,r))}},unescape:(n,r={})=>t.unescape(n,a_(e,r)),escape:(n,r={})=>t.escape(n,a_(e,r)),filter:(n,r={})=>t.filter(n,a_(e,r)),defaults:n=>t.defaults(a_(e,n)),makeRe:(n,r={})=>t.makeRe(n,a_(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,a_(e,r)),match:(n,r,i={})=>t.match(n,r,a_(e,i)),sep:t.sep,GLOBSTAR:i_})};const o_=(e,t={})=>(fg(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:og(e,{max:t.braceExpandMax}));B.braceExpand=o_,B.makeRe=(e,t={})=>new l_(e,t).makeRe(),B.match=(e,t,n={})=>{let r=new l_(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};const s_=/[?*]|[+@!]\(.*?\)|\[|\]/,c_=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var l_=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){fg(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||n_,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!s_.test(e[2]))&&!s_.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(i_)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(i_,i),o=t.lastIndexOf(i_),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length,i+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===i_?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===i_)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return o_(this.pattern,this.options)}parse(e){fg(e);let t=this.options;if(e===`**`)return i_;if(e===``)return``;let n,r=null;(n=e.match(Kg))?r=t.dot?Jg:qg:(n=e.match(Ig))?r=(t.nocase?t.dot?Bg:zg:t.dot?Rg:Lg)(n[1]):(n=e.match(Yg))?r=(t.nocase?t.dot?Zg:Xg:t.dot?Qg:$g)(n):(n=e.match(Vg))?r=t.dot?Ug:Hg:(n=e.match(Wg))&&(r=Gg);let i=Pg.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?`[^/]*?`:t.dot?`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`:`(?:(?!(?:\\/|^)\\.).)*?`,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?c_(e):e===i_?i_:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==i_||a===i_||(a===void 0?i!==void 0&&i!==i_?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==i_&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=i_))});let i=t.filter(e=>e!==i_);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e of i){let i=r;if(n.matchBase&&e.length===1&&(i=[a]),this.matchOne(i,e,t))return n.flipNegate?!0:!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return B.defaults(e).Minimatch}};B.AST=Pg,B.Minimatch=l_,B.escape=Fg,B.unescape=vg;var u_=i(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})),d_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{version:()=>u}),t.exports=c(l);let u=`3.8.0`;0&&(t.exports={version:u})})),f_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{exchangeVercelOidcToken:()=>p}),t.exports=c(l);var u=d_();let d=new class{constructor(e){this.maxEntries=e,this.entries=new Map}get(e){let t=this.entries.get(e);if(t!==void 0){if(t.expiresAt<=Date.now()){this.entries.delete(e);return}return this.entries.delete(e),this.entries.set(e,t),t.token}}set({key:e,token:t,expiresAt:n}){for(this.entries.delete(e),this.entries.set(e,{token:t,expiresAt:n});this.entries.size>this.maxEntries;){let e=this.entries.keys().next().value;if(e===void 0)break;this.entries.delete(e)}}}(1e3);async function f(e){let t=JSON.stringify([e.token,e.audience,e.jti]),n=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(t));return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function p(e){let t=await f(e);if(!e.skipCache){let e=d.get(t);if(e!==void 0)return e}let n=await fetch(`https://oidc.vercel.com/~token`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,"User-Agent":`@vercel/oidc@${u.version}`},body:JSON.stringify({token:e.token,aud:e.audience,...e.jti?{jti:e.jti}:void 0})});if(!n.ok)throw Error(`Failed to exchange token: ${await m(n)}`);let r;try{r=await n.json()}catch{throw Error(`Failed to exchange token: response was not valid JSON`)}if(!r||typeof r!=`object`||!(`token`in r)||typeof r.token!=`string`)throw Error(`Failed to exchange token: response did not contain a token`);let{token:i}=r,a=`expiry`in r&&typeof r.expiry==`number`?r.expiry:void 0;if(a!==void 0){let e=a*1e3;e>Date.now()&&d.set({key:t,token:i,expiresAt:e})}return i}async function m(e){try{let t=await e.json();if(t&&typeof t==`object`&&`error`in t&&typeof t.error==`string`)return t.error}catch{}return e.statusText||`HTTP ${e.status}`}0&&(t.exports={exchangeVercelOidcToken:p})})),p_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{SYMBOL_FOR_REQ_CONTEXT:()=>u,getContext:()=>d}),t.exports=c(l);let u=Symbol.for(`@vercel/request-context`);function d(){return globalThis[u]?.get?.()??{}}0&&(t.exports={SYMBOL_FOR_REQ_CONTEXT:u,getContext:d})})),m_=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{getVercelOidcTokenSync:()=>d}),t.exports=c(l);var u=p_();function d(){let e=(0,u.getContext)().headers?.[`x-vercel-oidc-token`]??process.env.VERCEL_OIDC_TOKEN;if(!e)throw Error(`The 'x-vercel-oidc-token' header is missing from the request.`);return e}0&&(t.exports={getVercelOidcTokenSync:d})})),h_=i(((e,t)=>{var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},c=(e,t,n,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(r({},`__esModule`,{value:!0}),e),u={};s(u,{getVercelOidcToken:()=>m}),t.exports=l(u);var d=f_(),f=m_(),p=$c();async function m(e){let t=``,r;try{t=(0,f.getVercelOidcTokenSync)()}catch(e){r=e}try{let[{getTokenPayload:r,isExpired:i},{refreshToken:a}]=await Promise.all([await import(`../../_chunks/workflow/token-util-DNwIAn_u.js`).then(e=>n(e.t())),await import(`../../_chunks/workflow/token-DtCUEpJs.js`).then(e=>n(e.default))]);(!t||i(r(t),e?.expirationBufferMs))&&(await a(e),t=(0,f.getVercelOidcTokenSync)())}catch(e){let t=r instanceof Error?r.message:``;throw e instanceof Error&&(t=`${t}
|
|
12
|
+
${e.message}`),t?new p.VercelOidcTokenError(t):e}return e?.audience&&(t=await(0,d.exchangeVercelOidcToken)({token:t,audience:e.audience,jti:e.jti,skipCache:e.skipCache})),t}0&&(t.exports={getVercelOidcToken:m})})),g_,__=t((()=>{g_=(e,t)=>ll(e).update(t).digest()}));function v_(...e){let t=e.reduce((e,{length:t})=>e+t,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function y_(e,t){return v_(V.encode(e),new Uint8Array([0]),t)}function b_(e,t,n){if(t<0||t>=E_)throw RangeError(`value must be >= 0 and <= ${E_-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,t&255],n)}function x_(e){let t=Math.floor(e/E_),n=e%E_,r=new Uint8Array(8);return b_(r,t,0),b_(r,n,4),r}function S_(e){let t=new Uint8Array(4);return b_(t,e),t}function C_(e){return v_(S_(e.length),e)}async function w_(e,t,n){let r=Math.ceil((t>>3)/32),i=new Uint8Array(r*32);for(let t=0;t<r;t++){let r=new Uint8Array(4+e.length+n.length);r.set(S_(t+1)),r.set(e,4),r.set(n,4+e.length),i.set(await g_(`sha256`,r),t*32)}return i.slice(0,t>>3)}var V,T_,E_,H=t((()=>{__(),V=new TextEncoder,T_=new TextDecoder,E_=2**32}));function D_(e){let t=e;return t instanceof Uint8Array&&(t=T_.decode(t)),t}var U,W,O_=t((()=>{H(),U=e=>jl.from(e).toString(`base64url`),W=e=>new Uint8Array(jl.from(D_(e),`base64url`))})),k_=r({JOSEAlgNotAllowed:()=>M_,JOSEError:()=>G,JOSENotSupported:()=>K,JWEDecryptionFailed:()=>N_,JWEInvalid:()=>q,JWKInvalid:()=>F_,JWKSInvalid:()=>I_,JWKSMultipleMatchingKeys:()=>R_,JWKSNoMatchingKey:()=>L_,JWKSTimeout:()=>z_,JWSInvalid:()=>J,JWSSignatureVerificationFailed:()=>B_,JWTClaimValidationFailed:()=>A_,JWTExpired:()=>j_,JWTInvalid:()=>P_}),G,A_,j_,M_,K,N_,q,J,P_,F_,I_,L_,R_,z_,B_,Y=t((()=>{G=class extends Error{static code=`ERR_JOSE_GENERIC`;code=`ERR_JOSE_GENERIC`;constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},A_=class extends G{static code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;claim;reason;payload;constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.claim=n,this.reason=r,this.payload=t}},j_=class extends G{static code=`ERR_JWT_EXPIRED`;code=`ERR_JWT_EXPIRED`;claim;reason;payload;constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.claim=n,this.reason=r,this.payload=t}},M_=class extends G{static code=`ERR_JOSE_ALG_NOT_ALLOWED`;code=`ERR_JOSE_ALG_NOT_ALLOWED`},K=class extends G{static code=`ERR_JOSE_NOT_SUPPORTED`;code=`ERR_JOSE_NOT_SUPPORTED`},N_=class extends G{static code=`ERR_JWE_DECRYPTION_FAILED`;code=`ERR_JWE_DECRYPTION_FAILED`;constructor(e=`decryption operation failed`,t){super(e,t)}},q=class extends G{static code=`ERR_JWE_INVALID`;code=`ERR_JWE_INVALID`},J=class extends G{static code=`ERR_JWS_INVALID`;code=`ERR_JWS_INVALID`},P_=class extends G{static code=`ERR_JWT_INVALID`;code=`ERR_JWT_INVALID`},F_=class extends G{static code=`ERR_JWK_INVALID`;code=`ERR_JWK_INVALID`},I_=class extends G{static code=`ERR_JWKS_INVALID`;code=`ERR_JWKS_INVALID`},L_=class extends G{static code=`ERR_JWKS_NO_MATCHING_KEY`;code=`ERR_JWKS_NO_MATCHING_KEY`;constructor(e=`no applicable key found in the JSON Web Key Set`,t){super(e,t)}},R_=class extends G{[Symbol.asyncIterator];static code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;constructor(e=`multiple matching keys found in the JSON Web Key Set`,t){super(e,t)}},z_=class extends G{static code=`ERR_JWKS_TIMEOUT`;code=`ERR_JWKS_TIMEOUT`;constructor(e=`request timed out`,t){super(e,t)}},B_=class extends G{static code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;constructor(e=`signature verification failed`,t){super(e,t)}}})),V_=t((()=>{}));function H_(e){switch(e){case`A128GCM`:case`A128GCMKW`:case`A192GCM`:case`A192GCMKW`:case`A256GCM`:case`A256GCMKW`:return 96;case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return 128;default:throw new K(`Unsupported JWE Algorithm: ${e}`)}}var U_,W_=t((()=>{Y(),V_(),U_=e=>bl(new Uint8Array(H_(e)>>3))})),G_,K_=t((()=>{Y(),W_(),G_=(e,t)=>{if(t.length<<3!==H_(e))throw new q(`Invalid Initialization Vector length`)}})),q_,J_=t((()=>{q_=e=>Cl.types.isKeyObject(e)})),Y_,X_=t((()=>{Y(),J_(),Y_=(e,t)=>{let n;switch(e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:n=parseInt(e.slice(-3),10);break;case`A128GCM`:case`A192GCM`:case`A256GCM`:n=parseInt(e.slice(1,4),10);break;default:throw new K(`Content Encryption Algorithm ${e} is not supported either by JOSE or your javascript runtime`)}if(t instanceof Uint8Array){let e=t.byteLength<<3;if(e!==n)throw new q(`Invalid Content Encryption Key length. Expected ${n} bits, got ${e} bits`);return}if(q_(t)&&t.type===`secret`){let e=t.symmetricKeySize<<3;if(e!==n)throw new q(`Invalid Content Encryption Key length. Expected ${n} bits, got ${e} bits`);return}throw TypeError(`Invalid Content Encryption Key type`)}})),Z_,Q_=t((()=>{Z_=xl}));function $_(e,t,n,r,i,a){let o=v_(e,t,n,x_(e.length<<3)),s=ul(`sha${r}`,i);return s.update(o),s.digest().slice(0,a>>3)}var ev=t((()=>{H()})),tv,nv,rv=t((()=>{tv=il.webcrypto,nv=e=>Cl.types.isCryptoKey(e)}));function X(e,t=`algorithm.name`){return TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function iv(e,t){return e.name===t}function av(e){return parseInt(e.name.slice(4),10)}function ov(e){switch(e){case`ES256`:return`P-256`;case`ES384`:return`P-384`;case`ES512`:return`P-521`;default:throw Error(`unreachable`)}}function sv(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e=`CryptoKey does not support this operation, its usages must include `;if(t.length>2){let n=t.pop();e+=`one of ${t.join(`, `)}, or ${n}.`}else t.length===2?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw TypeError(e)}}function cv(e,t,...n){switch(t){case`HS256`:case`HS384`:case`HS512`:{if(!iv(e.algorithm,`HMAC`))throw X(`HMAC`);let n=parseInt(t.slice(2),10);if(av(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}case`RS256`:case`RS384`:case`RS512`:{if(!iv(e.algorithm,`RSASSA-PKCS1-v1_5`))throw X(`RSASSA-PKCS1-v1_5`);let n=parseInt(t.slice(2),10);if(av(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}case`PS256`:case`PS384`:case`PS512`:{if(!iv(e.algorithm,`RSA-PSS`))throw X(`RSA-PSS`);let n=parseInt(t.slice(2),10);if(av(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}case`EdDSA`:if(e.algorithm.name!==`Ed25519`&&e.algorithm.name!==`Ed448`)throw X(`Ed25519 or Ed448`);break;case`Ed25519`:if(!iv(e.algorithm,`Ed25519`))throw X(`Ed25519`);break;case`ES256`:case`ES384`:case`ES512`:{if(!iv(e.algorithm,`ECDSA`))throw X(`ECDSA`);let n=ov(t);if(e.algorithm.namedCurve!==n)throw X(n,`algorithm.namedCurve`);break}default:throw TypeError(`CryptoKey does not support this operation`)}sv(e,n)}function lv(e,t,...n){switch(t){case`A128GCM`:case`A192GCM`:case`A256GCM`:{if(!iv(e.algorithm,`AES-GCM`))throw X(`AES-GCM`);let n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw X(n,`algorithm.length`);break}case`A128KW`:case`A192KW`:case`A256KW`:{if(!iv(e.algorithm,`AES-KW`))throw X(`AES-KW`);let n=parseInt(t.slice(1,4),10);if(e.algorithm.length!==n)throw X(n,`algorithm.length`);break}case`ECDH`:switch(e.algorithm.name){case`ECDH`:case`X25519`:case`X448`:break;default:throw X(`ECDH, X25519, or X448`)}break;case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:if(!iv(e.algorithm,`PBKDF2`))throw X(`PBKDF2`);break;case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:{if(!iv(e.algorithm,`RSA-OAEP`))throw X(`RSA-OAEP`);let n=parseInt(t.slice(9),10)||1;if(av(e.algorithm.hash)!==n)throw X(`SHA-${n}`,`algorithm.hash`);break}default:throw TypeError(`CryptoKey does not support this operation`)}sv(e,n)}var uv=t((()=>{}));function dv(e,t,...n){if(n=n.filter(Boolean),n.length>2){let t=n.pop();e+=`one of type ${n.join(`, `)}, or ${t}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t==`function`&&t.name?e+=` Received function ${t.name}`:typeof t==`object`&&t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}function fv(e,t,...n){return dv(`Key for the ${e} algorithm must be `,t,...n)}var pv,mv=t((()=>{pv=(e,...t)=>dv(`Key must be `,e,...t)})),hv,gv,_v=t((()=>{gv=e=>(hv||=new Set(gl()),hv.has(e))})),vv,Z,yv=t((()=>{rv(),J_(),vv=e=>q_(e)||nv(e),Z=[`KeyObject`],(globalThis.CryptoKey||tv?.CryptoKey)&&Z.push(`CryptoKey`)}));function bv(e,t,n,r,i,a){let o=parseInt(e.slice(1,4),10);q_(t)&&(t=t.export());let s=t.subarray(o>>3),c=t.subarray(0,o>>3),l=parseInt(e.slice(-3),10),u=`aes-${o}-cbc`;if(!gv(u))throw new K(`alg ${e} is not supported by your javascript runtime`);let d=$_(a,r,n,l,c,o),f;try{f=Z_(i,d)}catch{}if(!f)throw new N_;let p;try{let e=cl(u,s,r);p=v_(e.update(n),e.final())}catch{}if(!p)throw new N_;return p}function xv(e,t,n,r,i,a){let o=`aes-${parseInt(e.slice(1,4),10)}-gcm`;if(!gv(o))throw new K(`alg ${e} is not supported by your javascript runtime`);try{let e=cl(o,t,r,{authTagLength:16});e.setAuthTag(i),a.byteLength&&e.setAAD(a,{plaintextLength:n.length});let s=e.update(n);return e.final(),s}catch{throw new N_}}var Sv,Cv=t((()=>{K_(),X_(),H(),Y(),Q_(),ev(),rv(),uv(),J_(),mv(),_v(),yv(),Sv=(e,t,n,r,i,a)=>{let o;if(nv(t))lv(t,e,`decrypt`),o=al.from(t);else if(t instanceof Uint8Array||q_(t))o=t;else throw TypeError(pv(t,...Z,`Uint8Array`));if(!r)throw new q(`JWE Initialization Vector missing`);if(!i)throw new q(`JWE Authentication Tag missing`);switch(Y_(e,o),G_(e,r),e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return bv(e,o,n,r,i,a);case`A128GCM`:case`A192GCM`:case`A256GCM`:return xv(e,o,n,r,i,a);default:throw new K(`Unsupported JWE Content Encryption Algorithm`)}}})),wv,Tv=t((()=>{wv=(...e)=>{let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(let e of t){let t=Object.keys(e);if(!n||n.size===0){n=new Set(t);continue}for(let e of t){if(n.has(e))return!1;n.add(e)}}return!0}}));function Ev(e){return typeof e==`object`&&!!e}function Q(e){if(!Ev(e)||Object.prototype.toString.call(e)!==`[object Object]`)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var Dv=t((()=>{}));function Ov(e,t){if(e.symmetricKeySize<<3!==parseInt(t.slice(1,4),10))throw TypeError(`Invalid key size for alg: ${t}`)}function kv(e,t,n){if(q_(e))return e;if(e instanceof Uint8Array)return pl(e);if(nv(e))return lv(e,t,n),al.from(e);throw TypeError(pv(e,...Z,`Uint8Array`))}var Av,jv,Mv=t((()=>{Y(),H(),rv(),uv(),J_(),mv(),_v(),yv(),Av=(e,t,n)=>{let r=`aes${parseInt(e.slice(1,4),10)}-wrap`;if(!gv(r))throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`);let i=kv(t,e,`wrapKey`);Ov(i,e);let a=sl(r,i,jl.alloc(8,166));return v_(a.update(n),a.final())},jv=(e,t,n)=>{let r=`aes${parseInt(e.slice(1,4),10)}-wrap`;if(!gv(r))throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`);let i=kv(t,e,`unwrapKey`);Ov(i,e);let a=cl(r,i,jl.alloc(8,166));return v_(a.update(n),a.final())}}));function Nv(e){return Q(e)&&typeof e.kty==`string`}function Pv(e){return e.kty!==`oct`&&typeof e.d==`string`}function Fv(e){return e.kty!==`oct`&&e.d===void 0}function Iv(e){return Nv(e)&&e.kty===`oct`&&typeof e.k==`string`}var Lv=t((()=>{Dv()})),Rv,zv,Bv=t((()=>{Y(),rv(),J_(),mv(),yv(),Lv(),Rv=e=>{switch(e){case`prime256v1`:return`P-256`;case`secp384r1`:return`P-384`;case`secp521r1`:return`P-521`;case`secp256k1`:return`secp256k1`;default:throw new K(`Unsupported key curve for this operation`)}},zv=(e,t)=>{let n;if(nv(e))n=al.from(e);else if(q_(e))n=e;else if(Nv(e))return e.crv;else throw TypeError(pv(e,...Z));if(n.type===`secret`)throw TypeError(`only "private" or "public" type keys can be used for this operation`);switch(n.asymmetricKeyType){case`ed25519`:case`ed448`:return`Ed${n.asymmetricKeyType.slice(2)}`;case`x25519`:case`x448`:return`X${n.asymmetricKeyType.slice(1)}`;case`ec`:{let e=n.asymmetricKeyDetails.namedCurve;return t?e:Rv(e)}default:throw TypeError(`Invalid asymmetric key type for this operation`)}}}));async function Vv(e,t,n,r,i=new Uint8Array,a=new Uint8Array){let o;if(nv(e))lv(e,`ECDH`),o=al.from(e);else if(q_(e))o=e;else throw TypeError(pv(e,...Z));let s;if(nv(t))lv(t,`ECDH`,`deriveBits`),s=al.from(t);else if(q_(t))s=t;else throw TypeError(pv(t,...Z));let c=v_(C_(V.encode(n)),C_(i),C_(a),S_(r));return w_(ml({privateKey:s,publicKey:o}),r,c)}async function Hv(e){let t;if(nv(e))t=al.from(e);else if(q_(e))t=e;else throw TypeError(pv(e,...Z));switch(t.asymmetricKeyType){case`x25519`:return Uv(`x25519`);case`x448`:return Uv(`x448`);case`ec`:{let e=zv(t);return Uv(`ec`,{namedCurve:e})}default:throw new K(`Invalid or unsupported EPK`)}}var Uv,Wv,Gv=t((()=>{Bv(),H(),Y(),rv(),uv(),J_(),mv(),yv(),Uv=El(hl),Wv=e=>[`P-256`,`P-384`,`P-521`,`X25519`,`X448`].includes(zv(e))}));function Kv(e){if(!(e instanceof Uint8Array)||e.length<8)throw new q(`PBES2 Salt Input must be 8 or more octets`)}var qv=t((()=>{Y()}));function Jv(e,t){if(q_(e))return e.export();if(e instanceof Uint8Array)return e;if(nv(e))return lv(e,t,`deriveBits`,`deriveKey`),al.from(e).export();throw TypeError(pv(e,...Z,`Uint8Array`))}var Yv,Xv,Zv,Qv=t((()=>{V_(),H(),O_(),Mv(),qv(),rv(),uv(),J_(),mv(),yv(),Yv=El(_l),Xv=async(e,t,n,r=2048,i=bl(new Uint8Array(16)))=>{Kv(i);let a=y_(e,i),o=parseInt(e.slice(13,16),10)>>3,s=Jv(t,e),c=await Yv(s,a,r,o,`sha${e.slice(8,11)}`);return{encryptedKey:await Av(e.slice(-6),c,n),p2c:r,p2s:U(i)}},Zv=async(e,t,n,r,i)=>{Kv(i);let a=y_(e,i),o=parseInt(e.slice(13,16),10)>>3,s=Jv(t,e),c=await Yv(s,a,r,o,`sha${e.slice(8,11)}`);return jv(e.slice(-6),c,n)}})),$v,ey=t((()=>{$v=(e,t)=>{let n;try{n=e instanceof al?e.asymmetricKeyDetails?.modulusLength:Buffer.from(e.n,`base64url`).byteLength<<3}catch{}if(typeof n!=`number`||n<2048)throw TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}}));function ty(e,t,...n){if(q_(e))return e;if(nv(e))return lv(e,t,...n),al.from(e);throw TypeError(pv(e,...Z))}var ny,ry,iy,ay,oy,sy,cy=t((()=>{ey(),rv(),uv(),J_(),mv(),yv(),ny=(e,t)=>{if(e.asymmetricKeyType!==`rsa`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be rsa`);$v(e,t)},ry=wl(()=>ol.RSA_PKCS1_PADDING,`The RSA1_5 "alg" (JWE Algorithm) is deprecated and will be removed in the next major revision.`),iy=e=>{switch(e){case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:return ol.RSA_PKCS1_OAEP_PADDING;case`RSA1_5`:return ry();default:return}},ay=e=>{switch(e){case`RSA-OAEP`:return`sha1`;case`RSA-OAEP-256`:return`sha256`;case`RSA-OAEP-384`:return`sha384`;case`RSA-OAEP-512`:return`sha512`;default:return}},oy=(e,t,n)=>{let r=iy(e),i=ay(e),a=ty(t,e,`wrapKey`,`encrypt`);return ny(a,e),yl({key:a,oaepHash:i,padding:r},n)},sy=(e,t,n)=>{let r=iy(e),i=ay(e),a=ty(t,e,`unwrapKey`,`decrypt`);return ny(a,e),vl({key:a,oaepHash:i,padding:r},n)}})),ly,uy=t((()=>{ly={}}));function dy(e){switch(e){case`A128GCM`:return 128;case`A192GCM`:return 192;case`A256GCM`:case`A128CBC-HS256`:return 256;case`A192CBC-HS384`:return 384;case`A256CBC-HS512`:return 512;default:throw new K(`Unsupported JWE Algorithm: ${e}`)}}var fy,py=t((()=>{Y(),V_(),fy=e=>bl(new Uint8Array(dy(e)>>3))})),my,hy,gy,_y,vy,yy,by=t((()=>{rv(),J_(),mv(),yv(),my=(e,t,n)=>{let r;if(nv(n)){if(!n.extractable)throw TypeError(`CryptoKey is not extractable`);r=al.from(n)}else if(q_(n))r=n;else throw TypeError(pv(n,...Z));if(r.type!==e)throw TypeError(`key is not a ${e} key`);return r.export({format:`pem`,type:t})},hy=e=>my(`public`,`spki`,e),gy=e=>my(`private`,`pkcs8`,e),_y=e=>dl({key:jl.from(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,``),`base64`),type:`pkcs8`,format:`der`}),vy=e=>fl({key:jl.from(e.replace(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,``),`base64`),type:`spki`,format:`der`}),yy=e=>fl({key:e,type:`spki`,format:`pem`})})),xy,Sy=t((()=>{xy=e=>e.d?dl({format:`jwk`,key:e}):fl({format:`jwk`,key:e})}));async function Cy(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN PUBLIC KEY-----`)!==0)throw TypeError(`"spki" must be SPKI formatted string`);return vy(e,t,n)}async function wy(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN CERTIFICATE-----`)!==0)throw TypeError(`"x509" must be X.509 formatted string`);return yy(e,t,n)}async function Ty(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN PRIVATE KEY-----`)!==0)throw TypeError(`"pkcs8" must be PKCS#8 formatted string`);return _y(e,t,n)}async function Ey(e,t){if(!Q(e))throw TypeError(`JWK must be an object`);switch(t||=e.alg,e.kty){case`oct`:if(typeof e.k!=`string`||!e.k)throw TypeError(`missing "k" (Key Value) Parameter value`);return W(e.k);case`RSA`:if(`oth`in e&&e.oth!==void 0)throw new K(`RSA JWK "oth" (Other Primes Info) Parameter value is not supported`);case`EC`:case`OKP`:return xy({...e,alg:t});default:throw new K(`Unsupported "kty" (Key Type) Parameter value`)}}var Dy=t((()=>{O_(),by(),Sy(),Y(),Dv()}));function Oy(e,t,n,r){t.startsWith(`HS`)||t===`dir`||t.startsWith(`PBES2`)||/^A\d{3}(?:GCM)?KW$/.test(t)?jy(t,n,r,e):My(t,n,r,e)}var ky,Ay,jy,My,Ny,Py,Fy=t((()=>{mv(),yv(),Lv(),ky=e=>e?.[Symbol.toStringTag],Ay=(e,t,n)=>{if(t.use!==void 0&&t.use!==`sig`)throw TypeError(`Invalid key for this operation, when present its use must be sig`);if(t.key_ops!==void 0&&t.key_ops.includes?.(n)!==!0)throw TypeError(`Invalid key for this operation, when present its key_ops must include ${n}`);if(t.alg!==void 0&&t.alg!==e)throw TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0},jy=(e,t,n,r)=>{if(!(t instanceof Uint8Array)){if(r&&Nv(t)){if(Iv(t)&&Ay(e,t,n))return;throw TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`)}if(!vv(t))throw TypeError(fv(e,t,...Z,`Uint8Array`,r?`JSON Web Key`:null));if(t.type!==`secret`)throw TypeError(`${ky(t)} instances for symmetric algorithms must be of type "secret"`)}},My=(e,t,n,r)=>{if(r&&Nv(t))switch(n){case`sign`:if(Pv(t)&&Ay(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a private JWK`);case`verify`:if(Fv(t)&&Ay(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a public JWK`)}if(!vv(t))throw TypeError(fv(e,t,...Z,r?`JSON Web Key`:null));if(t.type===`secret`)throw TypeError(`${ky(t)} instances for asymmetric algorithms must not be of type "secret"`);if(n===`sign`&&t.type===`public`)throw TypeError(`${ky(t)} instances for asymmetric algorithm signing must be of type "private"`);if(n===`decrypt`&&t.type===`public`)throw TypeError(`${ky(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&n===`verify`&&t.type===`private`)throw TypeError(`${ky(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&n===`encrypt`&&t.type===`private`)throw TypeError(`${ky(t)} instances for asymmetric algorithm encryption must be of type "public"`)},Ny=Oy.bind(void 0,!1),Py=Oy.bind(void 0,!0)}));function Iy(e,t,n,r,i){let a=parseInt(e.slice(1,4),10);q_(n)&&(n=n.export());let o=n.subarray(a>>3),s=n.subarray(0,a>>3),c=`aes-${a}-cbc`;if(!gv(c))throw new K(`alg ${e} is not supported by your javascript runtime`);let l=sl(c,o,r),u=v_(l.update(t),l.final());return{ciphertext:u,tag:$_(i,r,u,parseInt(e.slice(-3),10),s,a),iv:r}}function Ly(e,t,n,r,i){let a=`aes-${parseInt(e.slice(1,4),10)}-gcm`;if(!gv(a))throw new K(`alg ${e} is not supported by your javascript runtime`);let o=sl(a,n,r,{authTagLength:16});i.byteLength&&o.setAAD(i,{plaintextLength:t.length});let s=o.update(t);return o.final(),{ciphertext:s,tag:o.getAuthTag(),iv:r}}var Ry,zy=t((()=>{K_(),X_(),H(),ev(),rv(),uv(),J_(),mv(),W_(),Y(),_v(),yv(),Ry=(e,t,n,r,i)=>{let a;if(nv(n))lv(n,e,`encrypt`),a=al.from(n);else if(n instanceof Uint8Array||q_(n))a=n;else throw TypeError(pv(n,...Z,`Uint8Array`));switch(Y_(e,a),r?G_(e,r):r=U_(e),e){case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:return Iy(e,t,a,r,i);case`A128GCM`:case`A192GCM`:case`A256GCM`:return Ly(e,t,a,r,i);default:throw new K(`Unsupported JWE Content Encryption Algorithm`)}}}));async function By(e,t,n,r){let i=await Ry(e.slice(0,7),n,t,r,new Uint8Array);return{encryptedKey:i.ciphertext,iv:U(i.iv),tag:U(i.tag)}}async function Vy(e,t,n,r,i){return Sv(e.slice(0,7),t,n,r,i,new Uint8Array)}var Hy=t((()=>{zy(),Cv(),O_()}));async function Uy(e,t,n,r,i){switch(Ny(e,t,`decrypt`),t=await ly.normalizePrivateKey?.(t,e)||t,e){case`dir`:if(n!==void 0)throw new q(`Encountered unexpected JWE Encrypted Key`);return t;case`ECDH-ES`:if(n!==void 0)throw new q(`Encountered unexpected JWE Encrypted Key`);case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{if(!Q(r.epk))throw new q(`JOSE Header "epk" (Ephemeral Public Key) missing or invalid`);if(!Wv(t))throw new K(`ECDH with the provided key is not allowed or not supported by your javascript runtime`);let i=await Ey(r.epk,e),a,o;if(r.apu!==void 0){if(typeof r.apu!=`string`)throw new q(`JOSE Header "apu" (Agreement PartyUInfo) invalid`);try{a=W(r.apu)}catch{throw new q(`Failed to base64url decode the apu`)}}if(r.apv!==void 0){if(typeof r.apv!=`string`)throw new q(`JOSE Header "apv" (Agreement PartyVInfo) invalid`);try{o=W(r.apv)}catch{throw new q(`Failed to base64url decode the apv`)}}let s=await Vv(i,t,e===`ECDH-ES`?r.enc:e,e===`ECDH-ES`?dy(r.enc):parseInt(e.slice(-5,-2),10),a,o);if(e===`ECDH-ES`)return s;if(n===void 0)throw new q(`JWE Encrypted Key missing`);return jv(e.slice(-6),s,n)}case`RSA1_5`:case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:if(n===void 0)throw new q(`JWE Encrypted Key missing`);return sy(e,t,n);case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:{if(n===void 0)throw new q(`JWE Encrypted Key missing`);if(typeof r.p2c!=`number`)throw new q(`JOSE Header "p2c" (PBES2 Count) missing or invalid`);let a=i?.maxPBES2Count||1e4;if(r.p2c>a)throw new q(`JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds`);if(typeof r.p2s!=`string`)throw new q(`JOSE Header "p2s" (PBES2 Salt) missing or invalid`);let o;try{o=W(r.p2s)}catch{throw new q(`Failed to base64url decode the p2s`)}return Zv(e,t,n,r.p2c,o)}case`A128KW`:case`A192KW`:case`A256KW`:if(n===void 0)throw new q(`JWE Encrypted Key missing`);return jv(e,t,n);case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:{if(n===void 0)throw new q(`JWE Encrypted Key missing`);if(typeof r.iv!=`string`)throw new q(`JOSE Header "iv" (Initialization Vector) missing or invalid`);if(typeof r.tag!=`string`)throw new q(`JOSE Header "tag" (Authentication Tag) missing or invalid`);let i;try{i=W(r.iv)}catch{throw new q(`Failed to base64url decode the iv`)}let a;try{a=W(r.tag)}catch{throw new q(`Failed to base64url decode the tag`)}return Vy(e,t,n,i,a)}default:throw new K(`Invalid or unsupported "alg" (JWE Algorithm) header value`)}}var Wy=t((()=>{Mv(),Gv(),Qv(),cy(),O_(),uy(),Y(),py(),Dy(),Fy(),Dv(),Hy()}));function Gy(e,t,n,r,i){if(i.crit!==void 0&&r?.crit===void 0)throw new e(`"crit" (Critical) Header Parameter MUST be integrity protected`);if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(e=>typeof e!=`string`||e.length===0))throw new e(`"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present`);let a;a=n===void 0?t:new Map([...Object.entries(n),...t.entries()]);for(let t of r.crit){if(!a.has(t))throw new K(`Extension Header Parameter "${t}" is not recognized`);if(i[t]===void 0)throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&r[t]===void 0)throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(r.crit)}var Ky=t((()=>{Y()})),qy,Jy=t((()=>{qy=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(e=>typeof e!=`string`)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}}));async function Yy(e,t,n){if(!Q(e))throw new q(`Flattened JWE must be an object`);if(e.protected===void 0&&e.header===void 0&&e.unprotected===void 0)throw new q(`JOSE Header missing`);if(e.iv!==void 0&&typeof e.iv!=`string`)throw new q(`JWE Initialization Vector incorrect type`);if(typeof e.ciphertext!=`string`)throw new q(`JWE Ciphertext missing or incorrect type`);if(e.tag!==void 0&&typeof e.tag!=`string`)throw new q(`JWE Authentication Tag incorrect type`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new q(`JWE Protected Header incorrect type`);if(e.encrypted_key!==void 0&&typeof e.encrypted_key!=`string`)throw new q(`JWE Encrypted Key incorrect type`);if(e.aad!==void 0&&typeof e.aad!=`string`)throw new q(`JWE AAD incorrect type`);if(e.header!==void 0&&!Q(e.header))throw new q(`JWE Shared Unprotected Header incorrect type`);if(e.unprotected!==void 0&&!Q(e.unprotected))throw new q(`JWE Per-Recipient Unprotected Header incorrect type`);let r;if(e.protected)try{let t=W(e.protected);r=JSON.parse(T_.decode(t))}catch{throw new q(`JWE Protected Header is invalid`)}if(!wv(r,e.header,e.unprotected))throw new q(`JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header,...e.unprotected};if(Gy(q,new Map,n?.crit,r,i),i.zip!==void 0)throw new K(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`);let{alg:a,enc:o}=i;if(typeof a!=`string`||!a)throw new q(`missing JWE Algorithm (alg) in JWE Header`);if(typeof o!=`string`||!o)throw new q(`missing JWE Encryption Algorithm (enc) in JWE Header`);let s=n&&qy(`keyManagementAlgorithms`,n.keyManagementAlgorithms),c=n&&qy(`contentEncryptionAlgorithms`,n.contentEncryptionAlgorithms);if(s&&!s.has(a)||!s&&a.startsWith(`PBES2`))throw new M_(`"alg" (Algorithm) Header Parameter value not allowed`);if(c&&!c.has(o))throw new M_(`"enc" (Encryption Algorithm) Header Parameter value not allowed`);let l;if(e.encrypted_key!==void 0)try{l=W(e.encrypted_key)}catch{throw new q(`Failed to base64url decode the encrypted_key`)}let u=!1;typeof t==`function`&&(t=await t(r,e),u=!0);let d;try{d=await Uy(a,t,l,i,n)}catch(e){if(e instanceof TypeError||e instanceof q||e instanceof K)throw e;d=fy(o)}let f,p;if(e.iv!==void 0)try{f=W(e.iv)}catch{throw new q(`Failed to base64url decode the iv`)}if(e.tag!==void 0)try{p=W(e.tag)}catch{throw new q(`Failed to base64url decode the tag`)}let m=V.encode(e.protected??``),h;h=e.aad===void 0?m:v_(m,V.encode(`.`),V.encode(e.aad));let g;try{g=W(e.ciphertext)}catch{throw new q(`Failed to base64url decode the ciphertext`)}let _={plaintext:await Sv(o,d,g,f,p,h)};if(e.protected!==void 0&&(_.protectedHeader=r),e.aad!==void 0)try{_.additionalAuthenticatedData=W(e.aad)}catch{throw new q(`Failed to base64url decode the aad`)}return e.unprotected!==void 0&&(_.sharedUnprotectedHeader=e.unprotected),e.header!==void 0&&(_.unprotectedHeader=e.header),u?{..._,key:t}:_}var Xy=t((()=>{O_(),Cv(),Y(),Tv(),Dv(),Wy(),H(),py(),Ky(),Jy()}));async function Zy(e,t,n){if(e instanceof Uint8Array&&(e=T_.decode(e)),typeof e!=`string`)throw new q(`Compact JWE must be a string or Uint8Array`);let{0:r,1:i,2:a,3:o,4:s,length:c}=e.split(`.`);if(c!==5)throw new q(`Invalid Compact JWE`);let l=await Yy({ciphertext:o,iv:a||void 0,protected:r,tag:s||void 0,encrypted_key:i||void 0},t,n),u={plaintext:l.plaintext,protectedHeader:l.protectedHeader};return typeof t==`function`?{...u,key:l.key}:u}var Qy=t((()=>{Xy(),Y(),H()}));async function $y(e,t,n){if(!Q(e))throw new q(`General JWE must be an object`);if(!Array.isArray(e.recipients)||!e.recipients.every(Q))throw new q(`JWE Recipients missing or incorrect type`);if(!e.recipients.length)throw new q(`JWE Recipients has no members`);for(let r of e.recipients)try{return await Yy({aad:e.aad,ciphertext:e.ciphertext,encrypted_key:r.encrypted_key,header:r.header,iv:e.iv,protected:e.protected,tag:e.tag,unprotected:e.unprotected},t,n)}catch{}throw new N_}var eb=t((()=>{Xy(),Y(),Dv()})),tb,nb=t((()=>{tb=Symbol()})),rb,ib=t((()=>{O_(),Y(),rv(),J_(),mv(),yv(),rb=e=>{let t;if(nv(e)){if(!e.extractable)throw TypeError(`CryptoKey is not extractable`);t=al.from(e)}else if(q_(e))t=e;else if(e instanceof Uint8Array)return{kty:`oct`,k:U(e)};else throw TypeError(pv(e,...Z,`Uint8Array`));if(t.type!==`secret`&&![`rsa`,`ec`,`ed25519`,`x25519`,`ed448`,`x448`].includes(t.asymmetricKeyType))throw new K(`Unsupported key asymmetricKeyType`);return t.export({format:`jwk`})}}));async function ab(e){return hy(e)}async function ob(e){return gy(e)}async function sb(e){return rb(e)}var cb=t((()=>{by(),ib()}));async function lb(e,t,n,r,i={}){let a,o,s;switch(Ny(e,n,`encrypt`),n=await ly.normalizePublicKey?.(n,e)||n,e){case`dir`:s=n;break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{if(!Wv(n))throw new K(`ECDH with the provided key is not allowed or not supported by your javascript runtime`);let{apu:c,apv:l}=i,{epk:u}=i;u||=(await Hv(n)).privateKey;let{x:d,y:f,crv:p,kty:m}=await sb(u),h=await Vv(n,u,e===`ECDH-ES`?t:e,e===`ECDH-ES`?dy(t):parseInt(e.slice(-5,-2),10),c,l);if(o={epk:{x:d,crv:p,kty:m}},m===`EC`&&(o.epk.y=f),c&&(o.apu=U(c)),l&&(o.apv=U(l)),e===`ECDH-ES`){s=h;break}s=r||fy(t),a=await Av(e.slice(-6),h,s);break}case`RSA1_5`:case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:s=r||fy(t),a=await oy(e,n,s);break;case`PBES2-HS256+A128KW`:case`PBES2-HS384+A192KW`:case`PBES2-HS512+A256KW`:{s=r||fy(t);let{p2c:c,p2s:l}=i;({encryptedKey:a,...o}=await Xv(e,n,s,c,l));break}case`A128KW`:case`A192KW`:case`A256KW`:s=r||fy(t),a=await Av(e,n,s);break;case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:{s=r||fy(t);let{iv:c}=i;({encryptedKey:a,...o}=await By(e,n,s,c));break}default:throw new K(`Invalid or unsupported "alg" (JWE Algorithm) header value`)}return{cek:s,encryptedKey:a,parameters:o}}var ub=t((()=>{Mv(),Gv(),Qv(),cy(),O_(),uy(),py(),Y(),cb(),Fy(),Hy()})),db,fb=t((()=>{O_(),nb(),zy(),ub(),Y(),Tv(),H(),Ky(),db=class{_plaintext;_protectedHeader;_sharedUnprotectedHeader;_unprotectedHeader;_aad;_cek;_iv;_keyManagementParameters;constructor(e){if(!(e instanceof Uint8Array))throw TypeError(`plaintext must be an instance of Uint8Array`);this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError(`setKeyManagementParameters can only be called once`);return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw TypeError(`setSharedUnprotectedHeader can only be called once`);return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError(`setContentEncryptionKey can only be called once`);return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError(`setInitializationVector can only be called once`);return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new q(`either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()`);if(!wv(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new q(`JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint`);let n={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(Gy(q,new Map,t?.crit,this._protectedHeader,n),n.zip!==void 0)throw new K(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`);let{alg:r,enc:i}=n;if(typeof r!=`string`||!r)throw new q(`JWE "alg" (Algorithm) Header Parameter missing or invalid`);if(typeof i!=`string`||!i)throw new q(`JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid`);let a;if(this._cek&&(r===`dir`||r===`ECDH-ES`))throw TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${r}`);let o;{let n;({cek:o,encryptedKey:a,parameters:n}=await lb(r,i,e,this._cek,this._keyManagementParameters)),n&&(t&&tb in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...n}:this.setUnprotectedHeader(n):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...n}:this.setProtectedHeader(n))}let s,c,l;c=this._protectedHeader?V.encode(U(JSON.stringify(this._protectedHeader))):V.encode(``),this._aad?(l=U(this._aad),s=v_(c,V.encode(`.`),V.encode(l))):s=c;let{ciphertext:u,tag:d,iv:f}=await Ry(i,this._plaintext,o,this._iv,s),p={ciphertext:U(u)};return f&&(p.iv=U(f)),d&&(p.tag=U(d)),a&&(p.encrypted_key=U(a)),l&&(p.aad=l),this._protectedHeader&&(p.protected=T_.decode(c)),this._sharedUnprotectedHeader&&(p.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(p.header=this._unprotectedHeader),p}}})),pb,mb,hb=t((()=>{fb(),nb(),Y(),py(),Tv(),ub(),O_(),Ky(),pb=class{parent;unprotectedHeader;key;options;constructor(e,t,n){this.parent=e,this.key=t,this.options=n}setUnprotectedHeader(e){if(this.unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this.unprotectedHeader=e,this}addRecipient(...e){return this.parent.addRecipient(...e)}encrypt(...e){return this.parent.encrypt(...e)}done(){return this.parent}},mb=class{_plaintext;_recipients=[];_protectedHeader;_unprotectedHeader;_aad;constructor(e){this._plaintext=e}addRecipient(e,t){let n=new pb(this,e,{crit:t?.crit});return this._recipients.push(n),n}setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError(`setSharedUnprotectedHeader can only be called once`);return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}async encrypt(){if(!this._recipients.length)throw new q(`at least one recipient must be added`);if(this._recipients.length===1){let[e]=this._recipients,t=await new db(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(e.unprotectedHeader).encrypt(e.key,{...e.options}),n={ciphertext:t.ciphertext,iv:t.iv,recipients:[{}],tag:t.tag};return t.aad&&(n.aad=t.aad),t.protected&&(n.protected=t.protected),t.unprotected&&(n.unprotected=t.unprotected),t.encrypted_key&&(n.recipients[0].encrypted_key=t.encrypted_key),t.header&&(n.recipients[0].header=t.header),n}let e;for(let t=0;t<this._recipients.length;t++){let n=this._recipients[t];if(!wv(this._protectedHeader,this._unprotectedHeader,n.unprotectedHeader))throw new q(`JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint`);let r={...this._protectedHeader,...this._unprotectedHeader,...n.unprotectedHeader},{alg:i}=r;if(typeof i!=`string`||!i)throw new q(`JWE "alg" (Algorithm) Header Parameter missing or invalid`);if(i===`dir`||i===`ECDH-ES`)throw new q(`"dir" and "ECDH-ES" alg may only be used with a single recipient`);if(typeof r.enc!=`string`||!r.enc)throw new q(`JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid`);if(!e)e=r.enc;else if(e!==r.enc)throw new q(`JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients`);if(Gy(q,new Map,n.options.crit,this._protectedHeader,r),r.zip!==void 0)throw new K(`JWE "zip" (Compression Algorithm) Header Parameter is not supported.`)}let t=fy(e),n={ciphertext:``,iv:``,recipients:[],tag:``};for(let r=0;r<this._recipients.length;r++){let i=this._recipients[r],a={};n.recipients.push(a);let o={...this._protectedHeader,...this._unprotectedHeader,...i.unprotectedHeader}.alg.startsWith(`PBES2`)?2048+r:void 0;if(r===0){let e=await new db(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(t).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(i.unprotectedHeader).setKeyManagementParameters({p2c:o}).encrypt(i.key,{...i.options,[tb]:!0});n.ciphertext=e.ciphertext,n.iv=e.iv,n.tag=e.tag,e.aad&&(n.aad=e.aad),e.protected&&(n.protected=e.protected),e.unprotected&&(n.unprotected=e.unprotected),a.encrypted_key=e.encrypted_key,e.header&&(a.header=e.header);continue}let{encryptedKey:s,parameters:c}=await lb(i.unprotectedHeader?.alg||this._protectedHeader?.alg||this._unprotectedHeader?.alg,e,i.key,t,{p2c:o});a.encrypted_key=U(s),(i.unprotectedHeader||c)&&(a.header={...i.unprotectedHeader,...c})}return n}}}));function gb(e){switch(e){case`PS256`:case`RS256`:case`ES256`:case`ES256K`:return`sha256`;case`PS384`:case`RS384`:case`ES384`:return`sha384`;case`PS512`:case`RS512`:case`ES512`:return`sha512`;case`Ed25519`:case`EdDSA`:return;default:throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var _b=t((()=>{Y()}));function vb(e,t){let n,r,i;if(t instanceof al)n=t.asymmetricKeyType,r=t.asymmetricKeyDetails;else switch(i=!0,t.kty){case`RSA`:n=`rsa`;break;case`EC`:n=`ec`;break;case`OKP`:if(t.crv===`Ed25519`){n=`ed25519`;break}if(t.crv===`Ed448`){n=`ed448`;break}throw TypeError(`Invalid key for this operation, its crv must be Ed25519 or Ed448`);default:throw TypeError(`Invalid key for this operation, its kty must be RSA, OKP, or EC`)}let a;switch(e){case`Ed25519`:if(n!==`ed25519`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be ed25519`);break;case`EdDSA`:if(![`ed25519`,`ed448`].includes(n))throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be ed25519 or ed448`);break;case`RS256`:case`RS384`:case`RS512`:if(n!==`rsa`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be rsa`);$v(t,e);break;case`PS256`:case`PS384`:case`PS512`:if(n===`rsa-pss`){let{hashAlgorithm:t,mgf1HashAlgorithm:n,saltLength:i}=r,a=parseInt(e.slice(-3),10);if(t!==void 0&&(t!==`sha${a}`||n!==t))throw TypeError(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}`);if(i!==void 0&&i>a>>3)throw TypeError(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}`)}else if(n!==`rsa`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be rsa or rsa-pss`);$v(t,e),a={padding:ol.RSA_PKCS1_PSS_PADDING,saltLength:ol.RSA_PSS_SALTLEN_DIGEST};break;case`ES256`:case`ES256K`:case`ES384`:case`ES512`:{if(n!==`ec`)throw TypeError(`Invalid key for this operation, its asymmetricKeyType must be ec`);let r=zv(t),i=yb.get(e);if(r!==i)throw TypeError(`Invalid key curve for the algorithm, its curve must be ${i}, got ${r}`);a={dsaEncoding:`ieee-p1363`};break}default:throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`)}return i?{format:`jwk`,key:t,...a}:a?{...a,key:t}:t}var yb,bb=t((()=>{Bv(),Y(),ey(),yb=new Map([[`ES256`,`P-256`],[`ES256K`,`secp256k1`],[`ES384`,`P-384`],[`ES512`,`P-521`]])}));function xb(e){switch(e){case`HS256`:return`sha256`;case`HS384`:return`sha384`;case`HS512`:return`sha512`;default:throw new K(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var Sb=t((()=>{Y()}));function Cb(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith(`HS`))throw TypeError(pv(t,...Z));return pl(t)}if(t instanceof al)return t;if(nv(t))return cv(t,e,n),al.from(t);if(Nv(t))return e.startsWith(`HS`)?pl(Buffer.from(t.k,`base64url`)):t;throw TypeError(pv(t,...Z,`Uint8Array`,`JSON Web Key`))}var wb=t((()=>{rv(),uv(),mv(),yv(),Lv()})),Tb,Eb,Db=t((()=>{_b(),Sb(),bb(),wb(),Tb=El(il.sign),Eb=async(e,t,n)=>{let r=Cb(e,t,`sign`);if(e.startsWith(`HS`)){let t=il.createHmac(xb(e),r);return t.update(n),t.digest()}return Tb(gb(e),n,vb(e,r))}})),Ob,kb,Ab=t((()=>{_b(),bb(),Db(),wb(),Ob=El(il.verify),kb=async(e,t,n,r)=>{let i=Cb(e,t,`verify`);if(e.startsWith(`HS`)){let t=await Eb(e,i,r),a=n;try{return il.timingSafeEqual(a,t)}catch{return!1}}let a=gb(e),o=vb(e,i);try{return await Ob(a,r,o,n)}catch{return!1}}}));async function jb(e,t,n){if(!Q(e))throw new J(`Flattened JWS must be an object`);if(e.protected===void 0&&e.header===void 0)throw new J(`Flattened JWS must have either of the "protected" or "header" members`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new J(`JWS Protected Header incorrect type`);if(e.payload===void 0)throw new J(`JWS Payload missing`);if(typeof e.signature!=`string`)throw new J(`JWS Signature missing or incorrect type`);if(e.header!==void 0&&!Q(e.header))throw new J(`JWS Unprotected Header incorrect type`);let r={};if(e.protected)try{let t=W(e.protected);r=JSON.parse(T_.decode(t))}catch{throw new J(`JWS Protected Header is invalid`)}if(!wv(r,e.header))throw new J(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header},a=Gy(J,new Map([[`b64`,!0]]),n?.crit,r,i),o=!0;if(a.has(`b64`)&&(o=r.b64,typeof o!=`boolean`))throw new J(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:s}=i;if(typeof s!=`string`||!s)throw new J(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);let c=n&&qy(`algorithms`,n.algorithms);if(c&&!c.has(s))throw new M_(`"alg" (Algorithm) Header Parameter value not allowed`);if(o){if(typeof e.payload!=`string`)throw new J(`JWS Payload must be a string`)}else if(typeof e.payload!=`string`&&!(e.payload instanceof Uint8Array))throw new J(`JWS Payload must be a string or an Uint8Array instance`);let l=!1;typeof t==`function`?(t=await t(r,e),l=!0,Py(s,t,`verify`),Nv(t)&&(t=await Ey(t,s))):Py(s,t,`verify`);let u=v_(V.encode(e.protected??``),V.encode(`.`),typeof e.payload==`string`?V.encode(e.payload):e.payload),d;try{d=W(e.signature)}catch{throw new J(`Failed to base64url decode the signature`)}if(!await kb(s,t,d,u))throw new B_;let f;if(o)try{f=W(e.payload)}catch{throw new J(`Failed to base64url decode the payload`)}else f=typeof e.payload==`string`?V.encode(e.payload):e.payload;let p={payload:f};return e.protected!==void 0&&(p.protectedHeader=r),e.header!==void 0&&(p.unprotectedHeader=e.header),l?{...p,key:t}:p}var Mb=t((()=>{O_(),Ab(),Y(),H(),Tv(),Dv(),Fy(),Ky(),Jy(),Lv(),Dy()}));async function Nb(e,t,n){if(e instanceof Uint8Array&&(e=T_.decode(e)),typeof e!=`string`)throw new J(`Compact JWS must be a string or Uint8Array`);let{0:r,1:i,2:a,length:o}=e.split(`.`);if(o!==3)throw new J(`Invalid Compact JWS`);let s=await jb({payload:i,protected:r,signature:a},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return typeof t==`function`?{...c,key:s.key}:c}var Pb=t((()=>{Mb(),Y(),H()}));async function Fb(e,t,n){if(!Q(e))throw new J(`General JWS must be an object`);if(!Array.isArray(e.signatures)||!e.signatures.every(Q))throw new J(`JWS Signatures missing or incorrect type`);for(let r of e.signatures)try{return await jb({header:r.header,payload:e.payload,protected:r.protected,signature:r.signature},t,n)}catch{}throw new B_}var Ib=t((()=>{Mb(),Y(),Dv()})),Lb,Rb=t((()=>{Lb=e=>Math.floor(e.getTime()/1e3)})),zb,Bb,Vb,Hb,Ub,Wb,Gb,Kb=t((()=>{zb=60,Bb=zb*60,Vb=Bb*24,Hb=Vb*7,Ub=Vb*365.25,Wb=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Gb=e=>{let t=Wb.exec(e);if(!t||t[4]&&t[1])throw TypeError(`Invalid time period format`);let n=parseFloat(t[2]),r=t[3].toLowerCase(),i;switch(r){case`sec`:case`secs`:case`second`:case`seconds`:case`s`:i=Math.round(n);break;case`minute`:case`minutes`:case`min`:case`mins`:case`m`:i=Math.round(n*zb);break;case`hour`:case`hours`:case`hr`:case`hrs`:case`h`:i=Math.round(n*Bb);break;case`day`:case`days`:case`d`:i=Math.round(n*Vb);break;case`week`:case`weeks`:case`w`:i=Math.round(n*Hb);break;default:i=Math.round(n*Ub);break}return t[1]===`-`||t[4]===`ago`?-i:i}})),qb,Jb,Yb,Xb=t((()=>{Y(),H(),Rb(),Kb(),Dv(),qb=e=>e.toLowerCase().replace(/^application\//,``),Jb=(e,t)=>typeof e==`string`?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1,Yb=(e,t,n={})=>{let r;try{r=JSON.parse(T_.decode(t))}catch{}if(!Q(r))throw new P_(`JWT Claims Set must be a top-level JSON object`);let{typ:i}=n;if(i&&(typeof e.typ!=`string`||qb(e.typ)!==qb(i)))throw new A_(`unexpected "typ" JWT header value`,r,`typ`,`check_failed`);let{requiredClaims:a=[],issuer:o,subject:s,audience:c,maxTokenAge:l}=n,u=[...a];l!==void 0&&u.push(`iat`),c!==void 0&&u.push(`aud`),s!==void 0&&u.push(`sub`),o!==void 0&&u.push(`iss`);for(let e of new Set(u.reverse()))if(!(e in r))throw new A_(`missing required "${e}" claim`,r,e,`missing`);if(o&&!(Array.isArray(o)?o:[o]).includes(r.iss))throw new A_(`unexpected "iss" claim value`,r,`iss`,`check_failed`);if(s&&r.sub!==s)throw new A_(`unexpected "sub" claim value`,r,`sub`,`check_failed`);if(c&&!Jb(r.aud,typeof c==`string`?[c]:c))throw new A_(`unexpected "aud" claim value`,r,`aud`,`check_failed`);let d;switch(typeof n.clockTolerance){case`string`:d=Gb(n.clockTolerance);break;case`number`:d=n.clockTolerance;break;case`undefined`:d=0;break;default:throw TypeError(`Invalid clockTolerance option type`)}let{currentDate:f}=n,p=Lb(f||new Date);if((r.iat!==void 0||l)&&typeof r.iat!=`number`)throw new A_(`"iat" claim must be a number`,r,`iat`,`invalid`);if(r.nbf!==void 0){if(typeof r.nbf!=`number`)throw new A_(`"nbf" claim must be a number`,r,`nbf`,`invalid`);if(r.nbf>p+d)throw new A_(`"nbf" claim timestamp check failed`,r,`nbf`,`check_failed`)}if(r.exp!==void 0){if(typeof r.exp!=`number`)throw new A_(`"exp" claim must be a number`,r,`exp`,`invalid`);if(r.exp<=p-d)throw new j_(`"exp" claim timestamp check failed`,r,`exp`,`check_failed`)}if(l){let e=p-r.iat,t=typeof l==`number`?l:Gb(l);if(e-d>t)throw new j_(`"iat" claim timestamp check failed (too far in the past)`,r,`iat`,`check_failed`);if(e<0-d)throw new A_(`"iat" claim timestamp check failed (it should be in the past)`,r,`iat`,`check_failed`)}return r}}));async function Zb(e,t,n){let r=await Nb(e,t,n);if(r.protectedHeader.crit?.includes(`b64`)&&r.protectedHeader.b64===!1)throw new P_(`JWTs MUST NOT use unencoded payload`);let i={payload:Yb(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return typeof t==`function`?{...i,key:r.key}:i}var Qb=t((()=>{Pb(),Xb(),Y()}));async function $b(e,t,n){let r=await Zy(e,t,n),i=Yb(r.protectedHeader,r.plaintext,n),{protectedHeader:a}=r;if(a.iss!==void 0&&a.iss!==i.iss)throw new A_(`replicated "iss" claim header parameter mismatch`,i,`iss`,`mismatch`);if(a.sub!==void 0&&a.sub!==i.sub)throw new A_(`replicated "sub" claim header parameter mismatch`,i,`sub`,`mismatch`);if(a.aud!==void 0&&JSON.stringify(a.aud)!==JSON.stringify(i.aud))throw new A_(`replicated "aud" claim header parameter mismatch`,i,`aud`,`mismatch`);let o={payload:i,protectedHeader:a};return typeof t==`function`?{...o,key:r.key}:o}var ex=t((()=>{Qy(),Xb(),Y()})),tx,nx=t((()=>{fb(),tx=class{_flattened;constructor(e){this._flattened=new db(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){let n=await this._flattened.encrypt(e,t);return[n.protected,n.encrypted_key,n.iv,n.ciphertext,n.tag].join(`.`)}}})),rx,ix=t((()=>{O_(),Db(),Tv(),Y(),H(),Fy(),Ky(),rx=class{_payload;_protectedHeader;_unprotectedHeader;constructor(e){if(!(e instanceof Uint8Array))throw TypeError(`payload must be an instance of Uint8Array`);this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new J(`either setProtectedHeader or setUnprotectedHeader must be called before #sign()`);if(!wv(this._protectedHeader,this._unprotectedHeader))throw new J(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let n={...this._protectedHeader,...this._unprotectedHeader},r=Gy(J,new Map([[`b64`,!0]]),t?.crit,this._protectedHeader,n),i=!0;if(r.has(`b64`)&&(i=this._protectedHeader.b64,typeof i!=`boolean`))throw new J(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:a}=n;if(typeof a!=`string`||!a)throw new J(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);Py(a,e,`sign`);let o=this._payload;i&&(o=V.encode(U(o)));let s;s=this._protectedHeader?V.encode(U(JSON.stringify(this._protectedHeader))):V.encode(``);let c={signature:U(await Eb(a,e,v_(s,V.encode(`.`),o))),payload:``};return i&&(c.payload=T_.decode(o)),this._unprotectedHeader&&(c.header=this._unprotectedHeader),this._protectedHeader&&(c.protected=T_.decode(s)),c}}})),ax,ox=t((()=>{ix(),ax=class{_flattened;constructor(e){this._flattened=new rx(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){let n=await this._flattened.sign(e,t);if(n.payload===void 0)throw TypeError(`use the flattened module for creating JWS with b64: false`);return`${n.protected}.${n.payload}.${n.signature}`}}})),sx,cx,lx=t((()=>{ix(),Y(),sx=class{parent;protectedHeader;unprotectedHeader;options;key;constructor(e,t,n){this.parent=e,this.key=t,this.options=n}setProtectedHeader(e){if(this.protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw TypeError(`setUnprotectedHeader can only be called once`);return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}},cx=class{_payload;_signatures=[];constructor(e){this._payload=e}addSignature(e,t){let n=new sx(this,e,t);return this._signatures.push(n),n}async sign(){if(!this._signatures.length)throw new J(`at least one signature must be added`);let e={signatures:[],payload:``};for(let t=0;t<this._signatures.length;t++){let n=this._signatures[t],r=new rx(this._payload);r.setProtectedHeader(n.protectedHeader),r.setUnprotectedHeader(n.unprotectedHeader);let{payload:i,...a}=await r.sign(n.key,n.options);if(t===0)e.payload=i;else if(e.payload!==i)throw new J(`inconsistent use of JWS Unencoded Payload (RFC7797)`);e.signatures.push(a)}return e}}}));function ux(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}var dx,fx=t((()=>{Rb(),Dv(),Kb(),dx=class{_payload;constructor(e={}){if(!Q(e))throw TypeError(`JWT Claims Set MUST be an object`);this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return typeof e==`number`?this._payload={...this._payload,nbf:ux(`setNotBefore`,e)}:e instanceof Date?this._payload={...this._payload,nbf:ux(`setNotBefore`,Lb(e))}:this._payload={...this._payload,nbf:Lb(new Date)+Gb(e)},this}setExpirationTime(e){return typeof e==`number`?this._payload={...this._payload,exp:ux(`setExpirationTime`,e)}:e instanceof Date?this._payload={...this._payload,exp:ux(`setExpirationTime`,Lb(e))}:this._payload={...this._payload,exp:Lb(new Date)+Gb(e)},this}setIssuedAt(e){return e===void 0?this._payload={...this._payload,iat:Lb(new Date)}:e instanceof Date?this._payload={...this._payload,iat:ux(`setIssuedAt`,Lb(e))}:typeof e==`string`?this._payload={...this._payload,iat:ux(`setIssuedAt`,Lb(new Date)+Gb(e))}:this._payload={...this._payload,iat:ux(`setIssuedAt`,e)},this}}})),px,mx=t((()=>{ox(),Y(),H(),fx(),px=class extends dx{_protectedHeader;setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){let n=new ax(V.encode(JSON.stringify(this._payload)));if(n.setProtectedHeader(this._protectedHeader),Array.isArray(this._protectedHeader?.crit)&&this._protectedHeader.crit.includes(`b64`)&&this._protectedHeader.b64===!1)throw new P_(`JWTs MUST NOT use unencoded payload`);return n.sign(e,t)}}})),hx,gx=t((()=>{nx(),H(),fx(),hx=class extends dx{_cek;_iv;_keyManagementParameters;_protectedHeader;_replicateIssuerAsHeader;_replicateSubjectAsHeader;_replicateAudienceAsHeader;setProtectedHeader(e){if(this._protectedHeader)throw TypeError(`setProtectedHeader can only be called once`);return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError(`setKeyManagementParameters can only be called once`);return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError(`setContentEncryptionKey can only be called once`);return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError(`setInitializationVector can only be called once`);return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){let n=new tx(V.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),n.setProtectedHeader(this._protectedHeader),this._iv&&n.setInitializationVector(this._iv),this._cek&&n.setContentEncryptionKey(this._cek),this._keyManagementParameters&&n.setKeyManagementParameters(this._keyManagementParameters),n.encrypt(e,t)}}}));async function _x(e,t){if(!Q(e))throw TypeError(`JWK must be an object`);if(t??=`sha256`,t!==`sha256`&&t!==`sha384`&&t!==`sha512`)throw TypeError(`digestAlgorithm must one of "sha256", "sha384", or "sha512"`);let n;switch(e.kty){case`EC`:yx(e.crv,`"crv" (Curve) Parameter`),yx(e.x,`"x" (X Coordinate) Parameter`),yx(e.y,`"y" (Y Coordinate) Parameter`),n={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case`OKP`:yx(e.crv,`"crv" (Subtype of Key Pair) Parameter`),yx(e.x,`"x" (Public Key) Parameter`),n={crv:e.crv,kty:e.kty,x:e.x};break;case`RSA`:yx(e.e,`"e" (Exponent) Parameter`),yx(e.n,`"n" (Modulus) Parameter`),n={e:e.e,kty:e.kty,n:e.n};break;case`oct`:yx(e.k,`"k" (Key Value) Parameter`),n={k:e.k,kty:e.kty};break;default:throw new K(`"kty" (Key Type) Parameter missing or unsupported`)}let r=V.encode(JSON.stringify(n));return U(await g_(t,r))}async function vx(e,t){t??=`sha256`;let n=await _x(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${n}`}var yx,bx=t((()=>{__(),O_(),Y(),H(),Dv(),yx=(e,t)=>{if(typeof e!=`string`||!e)throw new F_(`${t} missing or invalid`)}}));async function xx(e,t){let n={...e,...t?.header};if(!Q(n.jwk))throw new J(`"jwk" (JSON Web Key) Header Parameter must be a JSON object`);let r=await Ey({...n.jwk,ext:!0},n.alg);if(r instanceof Uint8Array||r.type!==`public`)throw new J(`"jwk" (JSON Web Key) Header Parameter must be a public key`);return r}var Sx=t((()=>{Dy(),Dv(),Y()}));function Cx(e){switch(typeof e==`string`&&e.slice(0,2)){case`RS`:case`PS`:return`RSA`;case`ES`:return`EC`;case`Ed`:return`OKP`;default:throw new K(`Unsupported "alg" value for a JSON Web Key Set`)}}function wx(e){return e&&typeof e==`object`&&Array.isArray(e.keys)&&e.keys.every(Tx)}function Tx(e){return Q(e)}function Ex(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}async function Dx(e,t,n){let r=e.get(t)||e.set(t,{}).get(t);if(r[n]===void 0){let e=await Ey({...t,ext:!0},n);if(e instanceof Uint8Array||e.type!==`public`)throw new I_(`JSON Web Key Set members must be public keys`);r[n]=e}return r[n]}function Ox(e){let t=new kx(e),n=async(e,n)=>t.getKey(e,n);return Object.defineProperties(n,{jwks:{value:()=>Ex(t._jwks),enumerable:!0,configurable:!1,writable:!1}}),n}var kx,Ax=t((()=>{Dy(),Y(),Dv(),kx=class{_jwks;_cached=new WeakMap;constructor(e){if(!wx(e))throw new I_(`JSON Web Key Set malformed`);this._jwks=Ex(e)}async getKey(e,t){let{alg:n,kid:r}={...e,...t?.header},i=Cx(n),a=this._jwks.keys.filter(e=>{let t=i===e.kty;if(t&&typeof r==`string`&&(t=r===e.kid),t&&typeof e.alg==`string`&&(t=n===e.alg),t&&typeof e.use==`string`&&(t=e.use===`sig`),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes(`verify`)),t)switch(n){case`ES256`:t=e.crv===`P-256`;break;case`ES256K`:t=e.crv===`secp256k1`;break;case`ES384`:t=e.crv===`P-384`;break;case`ES512`:t=e.crv===`P-521`;break;case`Ed25519`:t=e.crv===`Ed25519`;break;case`EdDSA`:t=e.crv===`Ed25519`||e.crv===`Ed448`;break}return t}),{0:o,length:s}=a;if(s===0)throw new L_;if(s!==1){let e=new R_,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(let e of a)try{yield await Dx(t,e,n)}catch{}},e}return Dx(this._cached,o,n)}}})),jx,Mx=t((()=>{Y(),H(),jx=async(e,t,n)=>{let r;switch(e.protocol){case`https:`:r=Pl.get;break;case`http:`:r=kl.get;break;default:throw TypeError(`Unsupported URL protocol.`)}let{agent:i,headers:a}=n,o=r(e.href,{agent:i,timeout:t,headers:a}),[s]=await Promise.race([Al(o,`response`),Al(o,`timeout`)]);if(!s)throw o.destroy(),new z_;if(s.statusCode!==200)throw new G(`Expected 200 OK from the JSON Web Key Set HTTP response`);let c=[];for await(let e of s)c.push(e);try{return JSON.parse(T_.decode(v_(...c)))}catch{throw new G(`Failed to parse the JSON Web Key Set HTTP response as JSON`)}}}));function Nx(){return typeof WebSocketPair<`u`||typeof navigator<`u`&&navigator.userAgent===`Cloudflare-Workers`||typeof EdgeRuntime<`u`&&EdgeRuntime===`vercel`}function Px(e,t){return!(typeof e!=`object`||!e||!(`uat`in e)||typeof e.uat!=`number`||Date.now()-e.uat>=t||!(`jwks`in e)||!Q(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,Q))}function Fx(e,t){let n=new Rx(e,t),r=async(e,t)=>n.getKey(e,t);return Object.defineProperties(r,{coolingDown:{get:()=>n.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>n.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>n.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>!!n._pendingFetch,enumerable:!0,configurable:!1},jwks:{value:()=>n._local?.jwks(),enumerable:!0,configurable:!1,writable:!1}}),r}var Ix,Lx,Rx,zx,Bx=t((()=>{Mx(),Y(),Ax(),Dv(),(typeof navigator>`u`||!navigator.userAgent?.startsWith?.(`Mozilla/5.0 `))&&(Ix=`jose/v5.10.0`),Lx=Symbol(),Rx=class{_url;_timeoutDuration;_cooldownDuration;_cacheMaxAge;_jwksTimestamp;_pendingFetch;_options;_local;_cache;constructor(e,t){if(!(e instanceof URL))throw TypeError(`url must be an instance of URL`);this._url=new URL(e.href),this._options={agent:t?.agent,headers:t?.headers},this._timeoutDuration=typeof t?.timeoutDuration==`number`?t?.timeoutDuration:5e3,this._cooldownDuration=typeof t?.cooldownDuration==`number`?t?.cooldownDuration:3e4,this._cacheMaxAge=typeof t?.cacheMaxAge==`number`?t?.cacheMaxAge:6e5,t?.[Lx]!==void 0&&(this._cache=t?.[Lx],Px(t?.[Lx],this._cacheMaxAge)&&(this._jwksTimestamp=this._cache.uat,this._local=Ox(this._cache.jwks)))}coolingDown(){return typeof this._jwksTimestamp==`number`&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return typeof this._jwksTimestamp==`number`&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){(!this._local||!this.fresh())&&await this.reload();try{return await this._local(e,t)}catch(n){if(n instanceof L_&&this.coolingDown()===!1)return await this.reload(),this._local(e,t);throw n}}async reload(){this._pendingFetch&&Nx()&&(this._pendingFetch=void 0);let e=new Headers(this._options.headers);Ix&&!e.has(`User-Agent`)&&(e.set(`User-Agent`,Ix),this._options.headers=Object.fromEntries(e.entries())),this._pendingFetch||=jx(this._url,this._timeoutDuration,this._options).then(e=>{this._local=Ox(e),this._cache&&(this._cache.uat=Date.now(),this._cache.jwks=e),this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(e=>{throw this._pendingFetch=void 0,e}),await this._pendingFetch}},zx=Lx})),Vx,Hx=t((()=>{O_(),H(),Y(),Xb(),fx(),Vx=class extends dx{encode(){return`${U(JSON.stringify({alg:`none`}))}.${U(JSON.stringify(this._payload))}.`}static decode(e,t){if(typeof e!=`string`)throw new P_(`Unsecured JWT must be a string`);let{0:n,1:r,2:i,length:a}=e.split(`.`);if(a!==3||i!==``)throw new P_(`Invalid Unsecured JWT`);let o;try{if(o=JSON.parse(T_.decode(W(n))),o.alg!==`none`)throw Error()}catch{throw new P_(`Invalid Unsecured JWT`)}return{payload:Yb(o,W(r),t),header:o}}}})),Ux=r({decode:()=>Gx,encode:()=>Wx}),Wx,Gx,Kx=t((()=>{O_(),Wx=U,Gx=W}));function qx(e){let t;if(typeof e==`string`){let n=e.split(`.`);(n.length===3||n.length===5)&&([t]=n)}else if(typeof e==`object`&&e)if(`protected`in e)t=e.protected;else throw TypeError(`Token does not contain a Protected Header`);try{if(typeof t!=`string`||!t)throw Error();let e=JSON.parse(T_.decode(Gx(t)));if(!Q(e))throw Error();return e}catch{throw TypeError(`Invalid Token or Protected Header formatting`)}}var Jx=t((()=>{Kx(),H(),Dv()}));function Yx(e){if(typeof e!=`string`)throw new P_(`JWTs must use Compact JWS serialization, JWT must be a string`);let{1:t,length:n}=e.split(`.`);if(n===5)throw new P_(`Only JWTs using Compact JWS serialization can be decoded`);if(n!==3)throw new P_(`Invalid JWT`);if(!t)throw new P_(`JWTs must contain a payload`);let r;try{r=Gx(t)}catch{throw new P_(`Failed to base64url decode the payload`)}let i;try{i=JSON.parse(T_.decode(r))}catch{throw new P_(`Failed to parse the decoded payload as JSON`)}if(!Q(i))throw new P_(`Invalid JWT Claims Set`);return i}var Xx=t((()=>{Kx(),H(),Dv(),Y()}));async function Zx(e,t){let n;switch(e){case`HS256`:case`HS384`:case`HS512`:case`A128CBC-HS256`:case`A192CBC-HS384`:case`A256CBC-HS512`:n=parseInt(e.slice(-3),10);break;case`A128KW`:case`A192KW`:case`A256KW`:case`A128GCMKW`:case`A192GCMKW`:case`A256GCMKW`:case`A128GCM`:case`A192GCM`:case`A256GCM`:n=parseInt(e.slice(1,4),10);break;default:throw new K(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}return pl(bl(new Uint8Array(n>>3)))}async function Qx(e,t){switch(e){case`RS256`:case`RS384`:case`RS512`:case`PS256`:case`PS384`:case`PS512`:case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:case`RSA1_5`:{let e=t?.modulusLength??2048;if(typeof e!=`number`||e<2048)throw new K(`Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used`);return await $x(`rsa`,{modulusLength:e,publicExponent:65537})}case`ES256`:return $x(`ec`,{namedCurve:`P-256`});case`ES256K`:return $x(`ec`,{namedCurve:`secp256k1`});case`ES384`:return $x(`ec`,{namedCurve:`P-384`});case`ES512`:return $x(`ec`,{namedCurve:`P-521`});case`Ed25519`:return $x(`ed25519`);case`EdDSA`:switch(t?.crv){case void 0:case`Ed25519`:return $x(`ed25519`);case`Ed448`:return $x(`ed448`);default:throw new K(`Invalid or unsupported crv option provided, supported values are Ed25519 and Ed448`)}case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{let e=t?.crv??`P-256`;switch(e){case void 0:case`P-256`:case`P-384`:case`P-521`:return $x(`ec`,{namedCurve:e});case`X25519`:return $x(`x25519`);case`X448`:return $x(`x448`);default:throw new K(`Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448`)}}default:throw new K(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}}var $x,eS=t((()=>{V_(),Y(),$x=El(hl)}));async function tS(e,t){return Qx(e,t)}var nS=t((()=>{eS()}));async function rS(e,t){return Zx(e,t)}var iS=t((()=>{eS()})),aS,oS=t((()=>{aS=`node:crypto`})),sS,cS=t((()=>{oS(),sS=aS})),lS=r({CompactEncrypt:()=>tx,CompactSign:()=>ax,EmbeddedJWK:()=>xx,EncryptJWT:()=>hx,FlattenedEncrypt:()=>db,FlattenedSign:()=>rx,GeneralEncrypt:()=>mb,GeneralSign:()=>cx,SignJWT:()=>px,UnsecuredJWT:()=>Vx,base64url:()=>Ux,calculateJwkThumbprint:()=>_x,calculateJwkThumbprintUri:()=>vx,compactDecrypt:()=>Zy,compactVerify:()=>Nb,createLocalJWKSet:()=>Ox,createRemoteJWKSet:()=>Fx,cryptoRuntime:()=>sS,decodeJwt:()=>Yx,decodeProtectedHeader:()=>qx,errors:()=>k_,experimental_jwksCache:()=>zx,exportJWK:()=>sb,exportPKCS8:()=>ob,exportSPKI:()=>ab,flattenedDecrypt:()=>Yy,flattenedVerify:()=>jb,generalDecrypt:()=>$y,generalVerify:()=>Fb,generateKeyPair:()=>tS,generateSecret:()=>rS,importJWK:()=>Ey,importPKCS8:()=>Ty,importSPKI:()=>Cy,importX509:()=>wy,jwksCache:()=>Lx,jwtDecrypt:()=>$b,jwtVerify:()=>Zb}),uS=t((()=>{Qy(),Xy(),eb(),hb(),Pb(),Mb(),Ib(),Qb(),ex(),nx(),fb(),ox(),ix(),lx(),mx(),gx(),bx(),Sx(),Ax(),Bx(),Hx(),cb(),Dy(),Jx(),Xx(),Y(),nS(),iS(),Kx(),cS()})),dS=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{verifyVercelOidcToken:()=>h}),t.exports=c(l);var u=(uS(),c(lS));let d=`https://oidc.vercel.com`,f=new URL(`https://oidc.vercel.com/.well-known/jwks`),p=[`RS256`],m=(0,u.createRemoteJWKSet)(f);async function h(e,t){let{algorithms:n,projectId:r=process.env.VERCEL_PROJECT_ID,environment:i=process.env.VERCEL_TARGET_ENV||process.env.VERCEL_ENV,ownerId:a,...o}=t??{};if(r===`*`&&a===void 0&&!g(o.audience))throw TypeError(`Expected ownerId or audience to be provided when projectId is '*'.`);let s=await(0,u.jwtVerify)(e,m,{...o,algorithms:n??p});return _(s.payload.iss),v({actual:s.payload.project_id,claim:`project_id`,env:`VERCEL_PROJECT_ID`,expected:r,option:`projectId`}),v({actual:s.payload.environment,claim:`environment`,env:`VERCEL_TARGET_ENV or VERCEL_ENV`,expected:i,option:`environment`}),y({actual:s.payload.owner_id,claim:`owner_id`,expected:a}),s}function g(e){return Array.isArray(e)?e.length>0:e!==void 0}function _(e){if(e!==d&&(typeof e!=`string`||!e.startsWith(`${d}/`)))throw TypeError(`Expected Vercel OIDC token iss claim to be "${d}" or to start with "${d}/".`)}function v({actual:e,claim:t,env:n,expected:r,option:i}){if(r!==`*`){if(r===void 0||r.length===0)throw TypeError(`Expected ${n} to be set or ${i} to be provided. Pass ${i}: '*' to allow any ${t} claim.`);if(!(Array.isArray(r)&&typeof e==`string`&&r.includes(e))&&e!==r)throw TypeError(Array.isArray(r)?`Expected Vercel OIDC token ${t} claim to be one of: ${r.map(e=>`"${e}"`).join(`, `)}.`:`Expected Vercel OIDC token ${t} claim to be "${r}".`)}}function y({actual:e,claim:t,expected:n}){if(n!==void 0&&e!==n)throw TypeError(`Expected Vercel OIDC token ${t} claim to be "${n}".`)}0&&(t.exports={verifyVercelOidcToken:h})})),fS=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{AccessTokenMissingError:()=>m.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>m.RefreshAccessTokenFailedError,exchangeVercelOidcToken:()=>h.exchangeVercelOidcToken,getContext:()=>f.getContext,getVercelOidcToken:()=>u.getVercelOidcToken,getVercelOidcTokenSync:()=>d.getVercelOidcTokenSync,getVercelToken:()=>g.getVercelToken,verifyVercelOidcToken:()=>p.verifyVercelOidcToken}),t.exports=c(l);var u=h_(),d=m_(),f=p_(),p=dS(),m=el(),h=f_(),g=tl();0&&(t.exports={AccessTokenMissingError,RefreshAccessTokenFailedError,exchangeVercelOidcToken,getContext,getVercelOidcToken,getVercelOidcTokenSync,getVercelToken,verifyVercelOidcToken})})),pS=n(u_(),1),mS=fS();async function hS(e){let t=0,n=e.getReader(),r=[];try{for(;;){let{done:e,value:i}=await n.read();if(e)break;r.push(i),t+=i.length}}finally{n.releaseLock()}return Buffer.concat(r,t)}var gS=class{contentType=`application/json`;replacer;reviver;constructor(e={}){this.replacer=e.replacer,this.reviver=e.reviver}serialize(e){return Buffer.from(JSON.stringify(e,this.replacer),`utf8`)}async deserialize(e){let t=await hS(e);return JSON.parse(t.toString(`utf8`),this.reviver)}},_S=class extends Error{constructor(e){super(`Message ${e} not found`),this.name=`MessageNotFoundError`}},vS=class extends Error{constructor(e,t){super(`Message ${e} not available for processing${t?`: ${t}`:``}`),this.name=`MessageNotAvailableError`}},yS=class extends Error{constructor(e,t){super(`Message ${e} is corrupted: ${t}`),this.name=`MessageCorruptedError`}},bS=class extends Error{retryAfter;constructor(e=`Too many requests`,t){super(e),this.name=`TooManyRequestsError`,this.retryAfter=t}},xS=class extends Error{constructor(e=`Missing or invalid authentication token`){super(e),this.name=`UnauthorizedError`}},SS=class extends Error{constructor(e=`Queue environment doesn't match token environment`){super(e),this.name=`ForbiddenError`}},CS=class extends Error{constructor(e){super(e),this.name=`BadRequestError`}},wS=class extends Error{constructor(e=`Unexpected server error`){super(e),this.name=`InternalServerError`}},TS=class extends Error{constructor(e,t=1,n=10){super(`Invalid limit: ${e}. Limit must be between ${t} and ${n}.`),this.name=`InvalidLimitError`}},ES=class extends Error{constructor(e){super(`Message ${e} has already been processed`),this.name=`MessageAlreadyProcessedError`}},DS=class extends Error{idempotencyKey;constructor(e,t){super(e),this.name=`DuplicateMessageError`,this.idempotencyKey=t}},OS=class extends Error{deploymentId;constructor(e,t){super(e),this.name=`ConsumerDiscoveryError`,this.deploymentId=t}},kS=class extends Error{constructor(e=`Consumer registry not configured`){super(e),this.name=`ConsumerRegistryNotConfiguredError`}},AS=300,jS=30,MS=60,NS=10,PS=3e3,FS=3,IS=250;function LS(e){return Math.min(MS,Math.max(NS,e/5))}var RS=class{client;topicName;consumerGroupName;visibilityTimeout;constructor(e,t,n,r={}){this.client=e,this.topicName=t,this.consumerGroupName=n,this.visibilityTimeout=Math.max(jS,r.visibilityTimeoutSeconds??AS)}isClientError(e){return e instanceof vS||e instanceof _S||e instanceof CS||e instanceof xS||e instanceof SS}isNetworkError(e){return e instanceof TypeError}async directiveCallWithRetries(e){let t;for(let n=1;n<=FS;n++)try{return await e()}catch(e){if(t=e,n===FS)throw e;if(e instanceof bS){if(e.retryAfter===void 0)throw e;await new Promise(t=>setTimeout(t,e.retryAfter*1e3));continue}if(!this.isNetworkError(e))throw e;let r=IS*n,i=r/2+r/2*Math.random();await new Promise(e=>setTimeout(e,i))}throw t}startVisibilityExtension(e,t){let n=!0,r=!1,i,a=null,o=LS(this.visibilityTimeout)*1e3,s=o;if(t?.visibilityDeadline){let e=t.visibilityDeadline.getTime()-Date.now();s=e>0?LS(e/1e3)*1e3:0}let c=new Promise(e=>{i=e}),l=()=>{r||(r=!0,i())},u=async()=>{if(!n){l();return}try{await this.client.changeVisibility({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e,visibilityTimeoutSeconds:this.visibilityTimeout}),n?a=setTimeout(()=>u(),o):l()}catch(t){if(this.isClientError(t)){console.error(`Visibility extension failed with client error for receipt handle ${e} (stopping retries):`,t),l();return}console.error(`Failed to extend visibility for receipt handle ${e} (will retry in ${PS/1e3}s):`,t),n?a=setTimeout(()=>u(),PS):l()}};return a=setTimeout(()=>u(),s),async(e=!1)=>{n=!1,a&&=(clearTimeout(a),null),e?await c:l()}}async finalizePayload(e){let t=this.client.getTransport();if(t.finalize&&e!=null)try{await t.finalize(e)}catch(e){console.warn(`Failed to finalize message payload:`,e)}}async processMessage(e,t,n){let r=this.startVisibilityExtension(e.receiptHandle,n),i={messageId:e.messageId,deliveryCount:e.deliveryCount,createdAt:e.createdAt,expiresAt:e.expiresAt??new Date(e.createdAt.getTime()+864e5),topicName:this.topicName,consumerGroup:this.consumerGroupName,region:this.client.getRegion()};try{await t(e.payload,i),await r(),await this.client.acknowledgeMessage({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e.receiptHandle})}catch(t){if(await r(),n?.retry){let r;try{r=n.retry(t,i)}catch(e){console.warn(`retry handler threw:`,e)}if(r){if(`acknowledge`in r&&r.acknowledge){try{await this.directiveCallWithRetries(()=>this.client.acknowledgeMessage({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e.receiptHandle}))}catch(e){console.warn(`Failed to acknowledge message:`,e)}await this.finalizePayload(e.payload);return}if(`afterSeconds`in r&&typeof r.afterSeconds==`number`){try{await this.directiveCallWithRetries(()=>this.client.changeVisibility({queueName:this.topicName,consumerGroup:this.consumerGroupName,receiptHandle:e.receiptHandle,visibilityTimeoutSeconds:r.afterSeconds}))}catch(e){console.warn(`Failed to reschedule message for retry:`,e)}await this.finalizePayload(e.payload);return}}}throw await this.finalizePayload(e.payload),t}}async consumeMessage(e,t,n){await this.processMessage(t,e,n)}async consume(e,t){let n=t?.retry;if(t&&`messageId`in t){let r=await this.client.receiveMessageById({queueName:this.topicName,consumerGroup:this.consumerGroupName,messageId:t.messageId,visibilityTimeoutSeconds:this.visibilityTimeout});return await this.processMessage(r.message,e,{retry:n}),1}else{let r=t&&`limit`in t?t.limit:1,i=0;for await(let t of this.client.receiveMessages({queueName:this.topicName,consumerGroup:this.consumerGroupName,visibilityTimeoutSeconds:this.visibilityTimeout,limit:r}))i++,await this.processMessage(t,e,{retry:n});return i}}get name(){return this.consumerGroupName}get topic(){return this.topicName}},zS=class{client;topicName;constructor(e,t){this.client=e,this.topicName=t}async publish(e,t){let n=await this.client.sendMessage({queueName:this.topicName,payload:e,idempotencyKey:t?.idempotencyKey,retentionSeconds:t?.retentionSeconds,delaySeconds:t?.delaySeconds,headers:t?.headers,telemetry:t?.telemetry});return n.messageId&&$S()&&zC(this.topicName,n.messageId,this.client.getRegion(),t?.delaySeconds,t?.retentionSeconds),{messageId:n.messageId}}consumerGroup(e,t){return new RS(this.client,this.topicName,e,t)}get name(){return this.topicName}},BS=`com.vercel.queue.v1beta`,VS=`com.vercel.queue.v2beta`;function HS(e,t){let n=t.slice(0,-1);return e.startsWith(n)}function US(e){return typeof e==`object`&&!!e}function WS(e,t){if(!t||!t.includes(`application/cloudevents+json`))throw Error(`Invalid content type: expected 'application/cloudevents+json'`);if(!US(e)||!e.type||!e.source||!e.id||!US(e.data))throw Error(`Invalid CloudEvent: missing required fields`);if(e.type!==`com.vercel.queue.v1beta`)throw Error(`Invalid CloudEvent type: expected '${BS}', got '${String(e.type)}'`);let{data:n}=e,r=[];if(`queueName`in n||r.push(`queueName`),`consumerGroup`in n||r.push(`consumerGroup`),`messageId`in n||r.push(`messageId`),r.length>0)throw Error(`Missing required CloudEvent data fields: ${r.join(`, `)}`);return{queueName:String(n.queueName),consumerGroup:String(n.consumerGroup),messageId:String(n.messageId)}}function GS(e,t){if(e instanceof Headers)return e.get(t);let n=e[t];return Array.isArray(n)?n[0]??null:n??null}function KS(e){let t=GS(e,`ce-type`);if(t!==`com.vercel.queue.v2beta`)throw Error(`Invalid CloudEvent type: expected '${VS}', got '${t}'`);let n=GS(e,`ce-vqsqueuename`),r=GS(e,`ce-vqsconsumergroup`),i=GS(e,`ce-vqsmessageid`),a=[];if(n||a.push(`ce-vqsqueuename`),r||a.push(`ce-vqsconsumergroup`),i||a.push(`ce-vqsmessageid`),a.length>0)throw Error(`Missing required CloudEvent headers: ${a.join(`, `)}`);let o=GS(e,`ce-vqsregion`)??void 0;if(o!==void 0&&!/^[a-z]{2,5}[0-9]{1,2}$/.test(o))throw Error(`Invalid ce-vqsregion header: ${JSON.stringify(o)}. Region must match /^[a-z]{2,5}[0-9]{1,2}$/ (e.g. "iad1", "lhr1").`);let s={queueName:n,consumerGroup:r,messageId:i,region:o},c=GS(e,`ce-vqsreceipthandle`);if(!c)return s;let l={...s,receiptHandle:c},u=GS(e,`ce-vqsdeliverycount`);u&&(l.deliveryCount=parseInt(u,10));let d=GS(e,`ce-vqscreatedat`);d&&(l.createdAt=d);let f=GS(e,`ce-vqsexpiresat`);f&&(l.expiresAt=f);let p=GS(e,`content-type`);p&&(l.contentType=p);let m=GS(e,`ce-vqsvisibilitydeadline`);return m&&(l.visibilityDeadline=m),l}function qS(e,t){if(GS(t,`ce-type`)===`com.vercel.queue.v2beta`){let n=KS(t);return`receiptHandle`in n&&(n.parsedPayload=e),n}return WS(e,GS(t,`content-type`))}async function JS(e){if(e.headers.get(`ce-type`)===`com.vercel.queue.v2beta`){let t=KS(e.headers);return`receiptHandle`in t&&e.body&&(t.rawBody=e.body),t}let t;try{t=await e.json()}catch{throw Error(`Failed to parse CloudEvent from request body`)}let n={};return e.headers.forEach((e,t)=>{n[t]=e}),qS(t,n)}async function YS(e,t,n){let{queueName:r,consumerGroup:i,messageId:a}=t;if(!n?.client)throw Error(`HandleCallbackOptions.client is required`);let o=vw(n.client);t.region&&(o=o.withRegion(t.region));let s=new zS(o,r).consumerGroup(i,n?.visibilityTimeoutSeconds===void 0?void 0:{visibilityTimeoutSeconds:n.visibilityTimeoutSeconds});if(`receiptHandle`in t){let r=o.getTransport(),i;if(t.rawBody)i=await r.deserialize(t.rawBody);else if(t.parsedPayload!==void 0)i=t.parsedPayload;else throw Error(`Binary mode callback with receipt handle is missing payload`);let c={messageId:a,payload:i,deliveryCount:t.deliveryCount??1,createdAt:t.createdAt?new Date(t.createdAt):new Date,expiresAt:t.expiresAt?new Date(t.expiresAt):void 0,contentType:t.contentType??r.contentType,receiptHandle:t.receiptHandle},l=t.visibilityDeadline?new Date(t.visibilityDeadline):void 0;await s.consumeMessage(e,c,{visibilityDeadline:l,retry:n?.retry})}else await s.consume(e,{messageId:a,retry:n?.retry})}var $=pS.default.cyan(`[queue]`),XS=pS.default.green(`✓`),ZS=pS.default.red(`✗`),QS=pS.default.yellow(`↻`);function $S(){return process.env.NODE_ENV===`development`&&process.env.VERCEL_DEPLOYMENT_ID===void 0}var eC=Symbol.for(`@vercel/queue.devRouteMappings`);function tC(e){let t=``;for(let n of e)n===`_`?t+=`__`:n===`/`?t+=`_S`:n===`.`?t+=`_D`:/[A-Za-z0-9-]/.test(n)?t+=n:t+=`_`+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`);return t}function nC(){let e=globalThis;if(eC in e)return e[eC]??null;try{let t=rl.join(process.cwd(),`vercel.json`);if(!Ml.existsSync(t))return e[eC]=null,null;let n=JSON.parse(Ml.readFileSync(t,`utf-8`));if(!n.functions)return e[eC]=null,null;let r=[];for(let[e,t]of Object.entries(n.functions))if(t.experimentalTriggers){for(let n of t.experimentalTriggers)if(!(!n.type?.startsWith(`queue/`)||!n.topic)){if(n.type!==`queue/v2beta`){console.warn(`${$} Unsupported trigger type "${n.type}" for topic "${n.topic}" in ${e}. Use "queue/v2beta" instead.`);continue}r.push({filePath:e,topic:n.topic,consumer:tC(e),retryAfterSeconds:n.retryAfterSeconds})}}return e[eC]=r.length>0?r:null,e[eC]}catch(t){return console.warn(`${$} Failed to read vercel.json:`,t),e[eC]=null,null}}function rC(e){let t=nC();return t?t.filter(t=>t.topic.includes(`*`)?HS(e,t.topic):t.topic===e):[]}function iC(e,t){return rC(e).find(e=>e.consumer===t)?.retryAfterSeconds}function aC(e){return/^src\/(app|pages|server)\//.test(e)?e.slice(4):null}function oC(e,t){return e===t||B(e,t)}function sC(e){let t=nC();if(!t)return[];let n=process.cwd(),r;try{r=rl.relative(n,e)}catch{return[]}let i=r.replace(/\\/g,`/`),a=aC(i);return t.filter(e=>oC(i,e.filePath)||a!==null&&oC(a,e.filePath))}function cC(e){let t=e.match(/\((.+?):\d+:\d+\)/);if(t||=e.match(/at\s+(.+?):\d+:\d+/),!t)return null;let n=t[1].trim();if(n===`native`||n.startsWith(`node:`)||n.startsWith(`internal`))return null;if(n.startsWith(`file://`))try{n=new URL(n).pathname}catch{return null}return/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(n)?null:(n.startsWith(`./`)&&(n=n.slice(2)),n)}var lC;function uC(){if(lC)return lC;try{let e=typeof __dirname<`u`?__dirname:rl.dirname(new URL(import.meta.url).pathname);lC=rl.resolve(e,`..`)}catch{lC=``}return lC}function dC(){let e=Error().stack;if(!e)return null;let t=e.split(`
|
|
13
|
+
`).slice(1),n=uC();for(let e of t){let t=cC(e);if(!t)continue;let r=rl.isAbsolute(t)?t:rl.resolve(process.cwd(),t),i;try{i=Ml.realpathSync(r)}catch{i=r}if(!(n&&i.startsWith(n)))return i}return null}var fC=Symbol.for(`@vercel/queue.devHandlerRegistry`);function pC(){let e=globalThis;return e[fC]||(e[fC]=new Map),e[fC]}function mC(e,t,n,r){let i=sC(rl.isAbsolute(e)?e:rl.resolve(process.cwd(),e));if(i.length===0)return!1;let a=pC();for(let e of i){let i=e.topic,o=a.get(i)??[],s={consumerGroup:e.consumer,handler:t,client:n,options:r},c=o.findIndex(t=>t.consumerGroup===e.consumer);c>=0?o[c]=s:o.push(s),a.set(i,o)}return!0}function hC(e,t,n,r){let i=r??dC();if(!i){console.warn(`${$} Could not determine caller file path for handler registration.`);return}if(!mC(i,e,t,n)){let e=nC();if(e&&e.length>0)return;let t=process.cwd(),n;try{n=rl.relative(t,i).replace(/\\/g,`/`)}catch{n=i}console.warn(`${$} handleCallback() in ${n} has no matching experimentalTriggers in vercel.json. This handler won't receive messages.
|
|
14
14
|
|
|
15
15
|
Add a trigger to vercel.json:
|
|
16
16
|
"${n}": {
|
|
17
17
|
"experimentalTriggers": [{ "type": "queue/v2beta", "topic": "your-topic" }]
|
|
18
|
-
}`)}}function
|
|
18
|
+
}`)}}function gC(e){let t=pC(),n=[];for(let[r,i]of t)(r.includes(`*`)?HS(e,r):r===e)&&n.push(...i);return n}var _C=50,vC=5e3,yC=2,bC=250,xC=[`PORT`,`NEXT_PORT`,`NEXTJS_PORT`,`NUXT_PORT`,`NITRO_PORT`,`SVELTEKIT_PORT`,`VITE_PORT`,`DEV_PORT`,`npm_config_port`],SC=[`__NEXT_PRIVATE_ORIGIN`,`NUXT_PUBLIC_SITE_URL`,`URL`];function CC(e){return e instanceof Error?e.message:String(e)}function wC(e){return e instanceof _S||e instanceof Error&&e.name===`MessageNotFoundError`}function TC(e){if(!e)return null;let t=Number.parseInt(e,10);return!Number.isFinite(t)||t<1||t>65535?null:t}function EC(e){if(!e)return null;try{let t=new URL(e).port;return TC(t)}catch{return null}}function DC(){let e=[],t=new Set,n=n=>{n&&!t.has(n)&&(t.add(n),e.push(n))};for(let e of xC)n(TC(process.env[e]));for(let e of SC)n(EC(process.env[e]));return e}function OC(e){return new Promise(t=>{let n=Nl.connect({host:`localhost`,port:e}),r=!1,i=e=>{r||(r=!0,n.destroy(),t(e))};n.once(`connect`,()=>i(!0)),n.once(`error`,()=>i(!1)),n.setTimeout(bC,()=>i(!1))})}async function kC(e,t,n){let r=0,i=_C;for(;;)try{await YS(e,t,n);return}catch(e){if(wC(e)&&r<vC){await new Promise(e=>setTimeout(e,i)),r+=i,i=Math.min(i*yC,vC-r);continue}throw e}}function AC(e){let t=e.replace(/^src\/app\//,`/`).replace(/^src\/pages\//,`/`).replace(/^src\/server\//,`/`).replace(/^src\/routes\//,`/`).replace(/^app\//,`/`).replace(/^pages\//,`/`).replace(/^server\//,`/`).replace(/\/route\.(ts|mts|js|mjs|tsx|jsx)$/,``).replace(/\/\+server\.(ts|mts|js|mjs|tsx|jsx)$/,``).replace(/\.(ts|mts|js|mjs|tsx|jsx)$/,``);return t.startsWith(`/`)||(t=`/`+t),t}async function jC(e,t={}){let n={triedPorts:DC(),listeningPorts:[],unavailablePorts:[],importFailures:[],primeFailures:[]},r=rC(e);if(r.length===0)return n;let i=t.refreshRegistered===!0;for(let e of n.triedPorts)await OC(e)?n.listeningPorts.push(e):n.unavailablePorts.push(e);for(let t of r){let r=NC(e,t.consumer);if(!(r&&!i)){if(!r){let r=rl.resolve(process.cwd(),t.filePath);try{await import(r)}catch(e){n.importFailures.push({filePath:t.filePath,reason:CC(e)})}if(NC(e,t.consumer))continue}for(let r of n.listeningPorts){let i=`http://localhost:${r}${AC(t.filePath)}`;try{let r=await fetch(i,{method:`POST`,headers:{"x-vercel-queue-prime":`1`,"x-vercel-queue-prime-file":t.filePath}});try{await r.text()}catch{}if(NC(e,t.consumer))break;n.primeFailures.push({filePath:t.filePath,url:i,reason:`HTTP ${r.status}${r.statusText?` ${r.statusText}`:``}`.trim()})}catch(e){n.primeFailures.push({filePath:t.filePath,url:i,reason:CC(e)})}}}}return n}function MC(e,t,n){let r=t.map(e=>e.filePath),i=n.listeningPorts[0]??n.triedPorts[0],a=i?t.map(e=>`http://localhost:${i}${AC(e.filePath)}`):[],o;if(n.triedPorts.length===0)o=`No local dev port detected from env. Set PORT (or NEXT_PORT/NUXT_PORT/VITE_PORT).`;else if(n.listeningPorts.length===0)o=`Detected env ports: [${n.triedPorts.join(`, `)}], but none are listening.`;else{let e=n.unavailablePorts.length>0?` Not listening: [${n.unavailablePorts.join(`, `)}].`:``;o=`Detected env ports: [${n.triedPorts.join(`, `)}]. Listening: [${n.listeningPorts.join(`, `)}].`+e}let s=n.importFailures.length>0?`
|
|
19
19
|
Import failures: `+n.importFailures.slice(0,2).map(e=>`${e.filePath} (${e.reason})`).join(`; `):``,c=n.primeFailures.length>0?`
|
|
20
20
|
Prime failures: `+n.primeFailures.slice(0,3).map(e=>`${e.url} (${e.reason})`).join(`; `):``;return`${$} No registered handler for topic "${e}". vercel.json maps this topic to [${r.join(`, `)}] but auto-loading failed.
|
|
21
21
|
${o}${s}${c}
|
|
22
22
|
Ensure your dev server is running, set PORT if needed, and confirm mapped route files call handleCallback()/handleNodeCallback() at module scope.
|
|
23
|
-
`+(a.length>0?`Try opening: ${a.join(` or `)}`:`Set PORT (or NEXT_PORT/NUXT_PORT/VITE_PORT) and try sending again.`)}function
|
|
24
|
-
Ensure vercel.json has a matching experimentalTriggers entry and the route file calls handleCallback().`);return}let o=r.map(e=>e.consumerGroup);console.log(`${$} Invoking handlers for topic="${e}" messageId="${t}" \u2192 consumers: [${o.join(`, `)}]`);let s=i??
|
|
23
|
+
`+(a.length>0?`Try opening: ${a.join(` or `)}`:`Set PORT (or NEXT_PORT/NUXT_PORT/VITE_PORT) and try sending again.`)}function NC(e,t){return gC(e).some(e=>e.consumerGroup===t)}var PC=10,FC=2,IC=10,LC=86400;function RC(e,t){let n=Math.min(Math.max(t,0),PC);console.log(`${$} ${QS} Scheduling re-delivery in ${n}s: topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}"`),setTimeout(async()=>{let t=e.deliveryCount+1,n=new Date(e.createdAt.getTime()+e.retentionSeconds*1e3);if(Date.now()>=n.getTime()){console.log(`${$} Message expired, stopping retries: topic="${e.topicName}" messageId="${e.messageId}"`);return}if(t>IC){console.log(`${$} Max re-deliveries (${IC}) reached: topic="${e.topicName}" messageId="${e.messageId}"`);return}let r={messageId:e.messageId,deliveryCount:t,createdAt:e.createdAt,expiresAt:n,topicName:e.topicName,consumerGroup:e.consumerGroup,region:e.region};console.log(`${$} Re-delivering: topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}" deliveryCount=${t}`);let i=!0,a=null,o=!1;try{await e.handler(e.payload,r)}catch(t){if(i=!1,e.retry){let n;try{n=e.retry(t,r)}catch(e){console.warn(`${$} retry handler threw:`,e)}n&&`afterSeconds`in n?a=n.afterSeconds:n&&`acknowledge`in n&&(o=!0)}o||console.error(`${$} ${ZS} Handler error on re-delivery: topic="${e.topicName}" messageId="${e.messageId}"`,t)}if(i)console.log(`${$} ${XS} Message processed on re-delivery: topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}"`);else if(o)console.log(`${$} ${XS} Message acknowledged (will not retry): topic="${e.topicName}" consumer="${e.consumerGroup}" messageId="${e.messageId}"`);else{let n=a??e.defaultRetryDelayS;RC({...e,deliveryCount:t},n)}},n*1e3)}function zC(e,t,n,r,i){if(r&&r>0){console.log(`${$} Message sent with delay: topic="${e}" messageId="${t}" delay=${r}s`),setTimeout(()=>{zC(e,t,n,void 0,i)},r*1e3);return}console.log(`${$} Message sent: topic="${e}" messageId="${t}"`),(async()=>{let r=gC(e),a=null;if(r.length>0?(await jC(e,{refreshRegistered:!0}),r=gC(e)):(a=await jC(e),r=gC(e)),r.length===0){let t=rC(e);if(t.length>0){let n=a??{triedPorts:DC(),listeningPorts:[],unavailablePorts:[],importFailures:[],primeFailures:[]};console.warn(MC(e,t,n))}else console.warn(`${$} No registered handler for topic "${e}".
|
|
24
|
+
Ensure vercel.json has a matching experimentalTriggers entry and the route file calls handleCallback().`);return}let o=r.map(e=>e.consumerGroup);console.log(`${$} Invoking handlers for topic="${e}" messageId="${t}" \u2192 consumers: [${o.join(`, `)}]`);let s=i??LC;for(let i of r){let r,a=new Date,o=1,c=!0,l=null,u=!1,d=async(e,t)=>{r=e,a=t.createdAt,o=t.deliveryCount;try{await i.handler(e,t)}catch(e){throw c=!1,e}},f=i.options?.retry?(e,t)=>{let n=i.options.retry(e,t);return n&&`afterSeconds`in n?l=n.afterSeconds:n&&`acknowledge`in n&&(u=!0),n}:void 0,p={queueName:e,consumerGroup:i.consumerGroup,messageId:t,region:n},m={client:i.client,visibilityTimeoutSeconds:i.options?.visibilityTimeoutSeconds,retry:f},h=Math.min(iC(e,i.consumerGroup)??FC,PC),g=()=>({handler:i.handler,retry:i.options?.retry,payload:r,topicName:e,consumerGroup:i.consumerGroup,messageId:t,region:n,createdAt:a,retentionSeconds:s,deliveryCount:o,defaultRetryDelayS:h});try{if(await kC(d,p,m),c)console.log(`${$} ${XS} Message processed: topic="${e}" consumer="${i.consumerGroup}" messageId="${t}"`);else if(u)console.log(`${$} ${XS} Message acknowledged (will not retry): topic="${e}" consumer="${i.consumerGroup}" messageId="${t}"`);else if(l!==null){let e=Math.min(l,PC);RC(g(),e)}}catch(n){console.error(`${$} ${ZS} Handler failed: topic="${e}" consumer="${i.consumerGroup}" messageId="${t}"`,n),c||RC(g(),h)}}})()}function BC(){let e=globalThis;delete e[eC],delete e[fC]}(process.env.NODE_ENV===`test`||process.env.VITEST)&&(globalThis.__clearDevState=BC,globalThis.__filePathToConsumerGroup=tC,globalThis.__filePathToUrlPath=AC,globalThis.__matchesFunctionsPattern=oC,globalThis.__stripSrcPrefix=aC);function VC(e,t){let n={...e?.metadata,...t?.metadata};return{isEnabled:t?.isEnabled??e?.isEnabled??!0,tracer:e?.tracer,metadata:Object.keys(n).length>0?n:void 0}}var HC;function UC(){return HC||=import(`../../_chunks/workflow/src-Cj3P1ChQ.js`).then(e=>n(e.t(),1)).then(e=>e,()=>null),HC}function WC(){let e=process.env.VERCEL_QUEUE_TRACE_PROPAGATION?.toLowerCase();return e===`off`||e===`0`||e===`false`}var GC=[`traceparent`,`tracestate`,`baggage`];async function KC(e,t){if(WC()||t&&!t.isEnabled)return;let n=await UC();if(n)try{let t={};n.propagation.inject(n.context.active(),t);for(let n of GC){let r=t[n];r!==void 0&&e.set(n,r)}}catch{}}function qC(e,t,n){try{t.setStatus({code:e.SpanStatusCode.ERROR,message:n instanceof Error?n.message:String(n)})}catch{}}function JC(e){try{e.end()}catch{}}async function YC(e,t,n){if(WC()||n&&!n.isEnabled)return t(null);let r=await UC();if(!r)return t(null);let i=null;try{let t=n?.tracer??r.trace.getTracer(`@vercel/queue`),a={"messaging.system":`vercel-queue`,"messaging.destination.name":e};if(n?.metadata)for(let[e,t]of Object.entries(n.metadata))a[`vqs.metadata.${e}`]=t;let o=t.startSpan(`vqs.send`,{kind:r.SpanKind.PRODUCER,attributes:a});i={span:o,ctx:r.trace.setSpan(r.context.active(),o)}}catch{}if(!i)return t(null);let{span:a,ctx:o}=i;try{return await r.context.with(o,()=>t({setMessageId(e){try{a.setAttribute(`messaging.message.id`,e)}catch{}}}))}catch(e){throw qC(r,a,e),e}finally{JC(a)}}var XC=`x-vercel-queue-traceparent`,ZC=`x-vercel-queue-tracestate`,QC=`x-vercel-queue-baggage`;async function $C(e,t,n){if(WC()||n&&!n.isEnabled)return t();let r=await UC();if(!r)return t();let i=null;try{let t=ew(r,tw(e)),a=n?.tracer??r.trace.getTracer(`@vercel/queue`),o={"messaging.system":`vercel-queue`,"messaging.operation":`process`};if(n?.metadata)for(let[e,t]of Object.entries(n.metadata))o[`vqs.metadata.${e}`]=t;let s=a.startSpan(`vqs.process`,{kind:r.SpanKind.CONSUMER,attributes:o,links:t});i={span:s,ctx:r.trace.setSpan(r.context.active(),s)}}catch{}if(!i)return t();let{span:a,ctx:o}=i;try{return await r.context.with(o,t)}catch(e){throw qC(r,a,e),e}finally{JC(a)}}function ew(e,t){let n=t[XC];if(!n)return[];let r={traceparent:n},i=t[ZC];i&&(r.tracestate=i);let a=t[QC];a&&(r.baggage=a);let o=e.propagation.extract(e.ROOT_CONTEXT,r),s=e.trace.getSpanContext(o);return!s||!e.trace.isSpanContextValid(s)?[]:[{context:s}]}function tw(e){let t={};if(e instanceof Headers)return e.forEach((e,n)=>{t[n.toLowerCase()]=e}),t;for(let[n,r]of Object.entries(e)){let e=Array.isArray(r)?r[0]:r;e!==void 0&&(t[n.toLowerCase()]=e)}return t}function nw(){return process.env.VERCEL_QUEUE_DEBUG===`1`||process.env.VERCEL_QUEUE_DEBUG===`true`}async function rw(e){let t=e.getReader();try{for(;;){let{done:e}=await t.read();if(e)break}}finally{t.releaseLock()}}function iw(e){if(!e)return;let t=Number(e);if(Number.isFinite(t)&&t>=0)return t;let n=Date.parse(e);if(!Number.isNaN(n))return Math.max(0,(n-Date.now())/1e3)}function aw(e,t,n,r,i=`Invalid parameters`,a){throw e===400?new CS(n||i):e===429?new bS(n||`Too many requests: ${r}`,iw(a)):e===401?new xS(n||void 0):e===403?new SS(n||void 0):e>=500?new wS(n||`Server error: ${e} ${t}`):Error(`Failed to ${r}: ${e} ${t}`)}function ow(e){let t=e.get(`Vqs-Message-Id`),n=e.get(`Vqs-Delivery-Count`)||`0`,r=e.get(`Vqs-Timestamp`),i=e.get(`Content-Type`)||`application/octet-stream`,a=e.get(`Vqs-Receipt-Handle`),o=e.get(`Vqs-Expires-At`);if(!t||!r||!a)return null;let s=parseInt(n,10);return Number.isNaN(s)?null:{messageId:t,deliveryCount:s,createdAt:new Date(r),expiresAt:o?new Date(o):void 0,contentType:i,receiptHandle:a}}var sw=/^[a-z]{2,5}[0-9]{1,2}$/;function cw(e){if(!sw.test(e))throw Error(`Invalid region code: ${JSON.stringify(e)}. Region must match the pattern /^[a-z]{2,5}[0-9]{1,2}$/ (e.g. "iad1", "lhr1").`)}var lw=e=>new URL(`https://${e}.vercel-queue.com`);function uw(e,t){return(t??lw)(e)}var dw=`/api/v3/topic`,fw=class e{baseUrl;customHeaders;providedToken;resolvedDeploymentId;pinSends;explicitlyUnpinned;transport;region;baseUrlResolver;dispatcher;telemetry;constructor(e){cw(e.region),this.region=e.region,this.baseUrlResolver=e.resolveBaseUrl,this.baseUrl=uw(this.region,this.baseUrlResolver),this.customHeaders=e.headers||{},this.providedToken=e.token,this.transport=e.transport||new gS,this.dispatcher=e.dispatcher,this.telemetry=e.telemetry,e.deploymentId===null?(this.pinSends=!1,this.explicitlyUnpinned=!0):(this.resolvedDeploymentId=e.deploymentId||process.env.VERCEL_DEPLOYMENT_ID,this.pinSends=!0,this.explicitlyUnpinned=!1)}withRegion(t){return new e({region:t,resolveBaseUrl:this.baseUrlResolver,token:this.providedToken,headers:{...this.customHeaders},deploymentId:this.explicitlyUnpinned?null:this.resolvedDeploymentId,transport:this.transport,dispatcher:this.dispatcher,telemetry:this.telemetry})}getRegion(){return this.region}getTransport(){return this.transport}getTelemetry(){return this.telemetry}requireDeploymentId(){if(!($S()||this.explicitlyUnpinned||this.resolvedDeploymentId))throw Error(`No deployment ID available. VERCEL_DEPLOYMENT_ID is not set.
|
|
25
25
|
|
|
26
26
|
This usually means the code is running outside a Vercel deployment (e.g. during build or in a non-Vercel environment).
|
|
27
27
|
|
|
28
28
|
To fix this, create a client with an explicit deploymentId:
|
|
29
29
|
new QueueClient({ deploymentId: "dpl_xxx" })
|
|
30
30
|
Or explicitly opt out of deployment pinning:
|
|
31
|
-
new QueueClient({ deploymentId: null })`)}getSendDeploymentId(){if(
|
|
31
|
+
new QueueClient({ deploymentId: null })`)}getSendDeploymentId(){if(!$S())return this.requireDeploymentId(),this.pinSends?this.resolvedDeploymentId:void 0}getConsumeDeploymentId(){if(!$S())return this.requireDeploymentId(),this.resolvedDeploymentId}async getToken(){if(this.providedToken)return this.providedToken;try{return await(0,mS.getVercelOidcToken)()}catch(e){let t=e instanceof Error?e.message:String(e);throw Error($S()?`Failed to get OIDC token for local development.
|
|
32
32
|
|
|
33
33
|
To fix this, pull your environment variables with Vercel CLI:
|
|
34
34
|
\`vercel env pull\`
|
|
@@ -39,4 +39,4 @@ To fix this, either:
|
|
|
39
39
|
- Deploy to Vercel (OIDC tokens are provisioned automatically)
|
|
40
40
|
- Provide a token explicitly: \`new QueueClient({ token: '...' })\`
|
|
41
41
|
|
|
42
|
-
Cause: ${t}`)}}buildUrl(e,...t){let n=encodeURIComponent(e),r=t.map(e=>encodeURIComponent(e)),i=r.length>0?`/`+r.join(`/`):``,a=this.baseUrl.pathname.replace(/\/+$/,``);return`${this.baseUrl.origin}${a}${sw}/${n}${i}`}async fetch(e,t){let n=t.method||`GET`;if(QC()){let r={method:n,url:e,headers:t.headers},i=t.body;i!=null&&(i instanceof ArrayBuffer||i instanceof Uint8Array?r.bodySize=i.byteLength:typeof i==`string`?r.bodySize=i.length:r.bodyType=typeof i),console.debug(`[VQS Debug] Request:`,JSON.stringify(r,null,2))}t.headers.set(`User-Agent`,`@vercel/queue/0.4.0`),t.headers.set(`Vqs-Client-Ts`,new Date().toISOString());let r=this.dispatcher?{...t,dispatcher:this.dispatcher}:t,i=await fetch(e,r);if(QC()){let t={method:n,url:e,status:i.status,statusText:i.statusText,headers:i.headers};console.debug(`[VQS Debug] Response:`,JSON.stringify(t,null,2))}return i}async sendMessage(e){let t=this.transport,{queueName:n,payload:r,idempotencyKey:i,retentionSeconds:a,delaySeconds:o,headers:s,telemetry:c}=e,l=new Headers;if(this.customHeaders)for(let[e,t]of Object.entries(this.customHeaders))l.append(e,t);if(s){let e=new Set([`authorization`,`content-type`]),t=t=>{let n=t.toLowerCase();return e.has(n)?!0:n.startsWith(`vqs-`)};for(let[e,n]of Object.entries(s))!t(e)&&n!==void 0&&l.append(e,n)}l.set(`Authorization`,`Bearer ${await this.getToken()}`),l.set(`Content-Type`,t.contentType);let u=this.getSendDeploymentId();u&&l.set(`Vqs-Deployment-Id`,u),i&&l.set(`Vqs-Idempotency-Key`,i),a!==void 0&&l.set(`Vqs-Retention-Seconds`,a.toString()),o!==void 0&&l.set(`Vqs-Delay-Seconds`,o.toString());let d=t.serialize(r),f=Buffer.isBuffer(d)?new Uint8Array(d):d,p=LC(this.telemetry,c);return GC(n,async e=>{await HC(l,p);let t=await this.fetch(this.buildUrl(n),{method:`POST`,body:f,headers:l});if(!t.ok){let e=await t.text();if(t.status===409)throw new CS(e||`Duplicate idempotency key detected`,i);if(t.status===502)throw new wS(e||`Consumer discovery failed`,u);if(t.status===503)throw new TS(e||`Consumer registry not configured`);tw(t.status,t.statusText,e,`send message`)}if(t.status===202)return await t.text(),{messageId:null};let r=await t.json();return e&&r.messageId&&e.setMessageId(r.messageId),r},p)}async*receiveMessages(e){let t=this.transport,{queueName:n,consumerGroup:r,visibilityTimeoutSeconds:i,limit:a}=e;if(a!==void 0&&(a<1||a>10))throw new xS(a);let o=new Headers({Authorization:`Bearer ${await this.getToken()}`,Accept:`multipart/mixed`,...this.customHeaders});i!==void 0&&o.set(`Vqs-Visibility-Timeout-Seconds`,i.toString()),a!==void 0&&o.set(`Vqs-Max-Messages`,a.toString());let s=this.getConsumeDeploymentId();s&&o.set(`Vqs-Deployment-Id`,s);let c=await this.fetch(this.buildUrl(n,`consumer`,r),{method:`POST`,headers:o});if(c.status===204){await c.text();return}if(!c.ok){let e=await c.text();tw(c.status,c.statusText,e,`receive messages`)}for await(let e of Mh(c))try{let n=nw(e.headers);if(!n){console.warn(`Missing required queue headers in multipart part`),await $C(e.payload);continue}let r=await t.deserialize(e.payload);yield{...n,payload:r}}catch(t){console.warn(`Failed to process multipart message:`,t),await $C(e.payload)}}async receiveMessageById(e){let t=this.transport,{queueName:n,consumerGroup:r,messageId:i,visibilityTimeoutSeconds:a}=e,o=new Headers({Authorization:`Bearer ${await this.getToken()}`,Accept:`multipart/mixed`,...this.customHeaders});a!==void 0&&o.set(`Vqs-Visibility-Timeout-Seconds`,a.toString());let s=this.getConsumeDeploymentId();s&&o.set(`Vqs-Deployment-Id`,s);let c=await this.fetch(this.buildUrl(n,`consumer`,r,`id`,i),{method:`POST`,headers:o});if(!c.ok){let e=await c.text();if(c.status===404)throw new pS(i);if(c.status===409){let t={};try{t=JSON.parse(e)}catch{}throw t.originalMessageId?new mS(i,`This message was a duplicate - use originalMessageId: ${t.originalMessageId}`):new mS(i)}if(c.status===410)throw new SS(i);tw(c.status,c.statusText,e,`receive message by ID`)}for await(let e of Mh(c)){let n=nw(e.headers);if(!n)throw await $C(e.payload),new hS(i,`Missing required queue headers in response`);let r=await t.deserialize(e.payload);return{message:{...n,payload:r}}}throw new pS(i)}async acknowledgeMessage(e){let{queueName:t,consumerGroup:n,receiptHandle:r}=e,i=new Headers({Authorization:`Bearer ${await this.getToken()}`,...this.customHeaders}),a=this.getConsumeDeploymentId();a&&i.set(`Vqs-Deployment-Id`,a);let o=await this.fetch(this.buildUrl(t,`consumer`,n,`lease`,r),{method:`DELETE`,headers:i});if(!o.ok){let e=await o.text();if(o.status===404)throw new pS(r);if(o.status===409)throw new mS(r,e||`Invalid receipt handle, message not in correct state, or already processed`);tw(o.status,o.statusText,e,`acknowledge message`,`Missing or invalid receipt handle`,o.headers?.get(`Retry-After`)??null)}return await o.text(),{acknowledged:!0}}async changeVisibility(e){let{queueName:t,consumerGroup:n,receiptHandle:r,visibilityTimeoutSeconds:i}=e,a=new Headers({Authorization:`Bearer ${await this.getToken()}`,"Content-Type":`application/json`,...this.customHeaders}),o=this.getConsumeDeploymentId();o&&a.set(`Vqs-Deployment-Id`,o);let s=await this.fetch(this.buildUrl(t,`consumer`,n,`lease`,r),{method:`PATCH`,headers:a,body:JSON.stringify({visibilityTimeoutSeconds:i})});if(!s.ok){let e=await s.text();if(s.status===404)throw new pS(r);if(s.status===409)throw new mS(r,e||`Invalid receipt handle, message not in correct state, or already processed`);tw(s.status,s.statusText,e,`change visibility`,`Missing receipt handle or invalid visibility timeout`,s.headers?.get(`Retry-After`)??null)}return await s.text(),{success:!0}}},lw=new WeakMap,uw=Symbol.for(`@vercel/queue.apiClient`);function dw(e,t){lw.set(e,t),Object.defineProperty(e,uw,{value:t,writable:!1,enumerable:!1,configurable:!1})}function fw(e){let t=lw.get(e);if(t)return t;let n=e[uw];if(typeof n==`object`&&n){let t=n;return lw.set(e,t),t}throw Error(`QueueClient not initialized. This may happen when multiple bundled copies of @vercel/queue are loaded in local dev.`)}function pw(e){return`request`in e?e.request:e}function mw(e){return fw(e)}var hw=`iad1`;function gw(e){return e||process.env.VERCEL_REGION||(YS()||console.warn(`[QueueClient] Region not detected \u2014 defaulting to "${hw}". On Vercel this is set automatically via VERCEL_REGION. To silence this warning, pass region explicitly: new QueueClient({ region: "iad1" })`),hw)}var _w=class{constructor(e={}){let t=gw(e.region);dw(this,new cw({...e,region:t}))}send=async(e,t,n)=>{let r=fw(this),i=await r.sendMessage({queueName:e,payload:t,idempotencyKey:n?.idempotencyKey,retentionSeconds:n?.retentionSeconds,delaySeconds:n?.delaySeconds,headers:n?.headers,telemetry:n?.telemetry});return i.messageId&&YS()&&FC(e,i.messageId,r.getRegion(),n?.delaySeconds,n?.retentionSeconds),{messageId:i.messageId}};handleCallback=(e,t)=>{YS()&&dC(e,this,t);let n=LC(fw(this).getTelemetry?.());return async r=>{let i=pw(r);if(YS()&&i.headers.get(`x-vercel-queue-prime`)===`1`){let n=i.headers.get(`x-vercel-queue-prime-file`);return n&&dC(e,this,t,n),Response.json({status:`primed`})}try{let r=await WS(i);return await YC(i.headers,()=>GS(e,r,{client:this,visibilityTimeoutSeconds:t?.visibilityTimeoutSeconds,retry:t?.retry}),n),Response.json({status:`success`})}catch(e){return console.error(`Queue callback error:`,e),e instanceof Error&&(e.message.includes(`Invalid content type`)||e.message.includes(`Invalid CloudEvent`)||e.message.includes(`Missing required CloudEvent`)||e.message.includes(`Failed to parse CloudEvent`)||e.message.includes(`Binary mode callback`))?Response.json({error:e.message},{status:400}):Response.json({error:`Failed to process queue message`},{status:500})}}};handleNodeCallback=(e,t)=>{YS()&&dC(e,this,t);let n=LC(fw(this).getTelemetry?.());return async(r,i)=>{if(r.method!==`POST`){i.status(200).end();return}let a=r.headers[`x-vercel-queue-prime`];if(YS()&&a===`1`){let n=r.headers[`x-vercel-queue-prime-file`],a=Array.isArray(n)?n[0]:n;a&&dC(e,this,t,a),i.status(200).json({status:`primed`});return}try{let a=US(r.body,r.headers);await YC(r.headers,()=>GS(e,a,{client:this,visibilityTimeoutSeconds:t?.visibilityTimeoutSeconds,retry:t?.retry}),n),i.status(200).json({status:`success`})}catch(e){if(console.error(`Queue callback error:`,e),e instanceof Error&&(e.message.includes(`Invalid content type`)||e.message.includes(`Invalid CloudEvent`)||e.message.includes(`Missing required CloudEvent`)||e.message.includes(`Failed to parse CloudEvent`)||e.message.includes(`Binary mode callback`))){i.status(400).json({error:e.message});return}i.status(500).json({error:`Failed to process queue message`})}}}};function vw(e){return`${e} requires VERCEL_DEPLOYMENT_ID, which Vercel sets in every deployment, so this process is not running inside one. The Vercel world is only selected automatically when that variable is set, so it was requested explicitly here — most often by WORKFLOW_TARGET_WORLD=vercel in a process that is not a deployment, such as a production server started locally or in CI. To use the local filesystem world instead, set WORKFLOW_TARGET_WORLD=local or unset it.`}var yw=class{contentType=`application/cbor`;serialize(e){return Buffer.from(_p(e))}async deserialize(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)break;r&&t.push(r)}return Wf(Buffer.concat(t))}},bw=class{contentType=`application/json`;serialize(e){return Buffer.from(JSON.stringify(e))}async deserialize(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)break;r&&t.push(r)}return JSON.parse(Buffer.concat(t).toString())}},xw=class{contentType=`application/cbor`;serialize(e){return Buffer.from(_p(e))}async deserialize(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)break;r&&t.push(r)}let r=Buffer.concat(t);try{return Wf(r)}catch{return JSON.parse(r.toString())}}};const Sw=new wl,Cw=Dc({payload:yo,queueName:Da,deploymentId:en().optional()}),ww=Number(process.env.VERCEL_QUEUE_MAX_DELAY_SECONDS||82800);function Tw(e){let t=Math.min(Math.max(1,2**(e-1)),900),n=Math.floor(Math.random()*(Math.ceil(t*.25)+1));return Math.max(1,t-n)}function Ew(e){if(`runId`in e&&typeof e.runId==`string`)return e.runId}function Dw(e){if(!e)return;let t=e.startsWith(`wrun_`)?e.slice(5):e;try{let e=Gc(t);return!e.tagged||e.regionId===Bc.unknown?void 0:e.region??void 0}catch{return}}function Ow(e,t){if(zc(t?.region))return t.region;let n=Dw(Ew(e));if(n)return n;let r=process.env.VERCEL_REGION;return zc(r)?r:`iad1`}function kw(e){let t={};return`runId`in e&&typeof e.runId==`string`&&(t[`x-vercel-workflow-run-id`]=e.runId),`stepId`in e&&typeof e.stepId==`string`&&(t[`x-vercel-workflow-step-id`]=e.stepId),Object.keys(t).length>0?t:void 0}const Aw=/^__([a-z][a-z0-9]*_)?wkf_workflow_/;let jw=!1;function Mw(){return process.env.WORKFLOW_SEQUENTIAL_REPLAYS===`1`}function Nw(e,t){return!Mw()||!Aw.test(e)?e:(jw||(jw=!0,console.warn(`[workflow] WORKFLOW_SEQUENTIAL_REPLAYS=1: routing flow messages to per-run queue topics`)),`__healthCheck`in t&&typeof t.correlationId==`string`?`${e}_${t.correlationId}`:`runId`in t&&typeof t.runId==`string`?`stepId`in t&&typeof t.stepId==`string`?`${e}_${t.runId}_${t.stepId}`:`${e}_${t.runId}`:e)}function Pw(e){let{baseUrl:t,usingProxy:n}=Zm(e),r=$m(e,{usingProxy:n}),i=new yw,a=new bw,o=new xw,s={dispatcher:Wp(e),transport:o,...n&&{resolveBaseUrl:()=>new URL(`${t}/queues-proxy`),token:e?.token},headers:Object.fromEntries(r.entries())},c=async(e,t,r)=>{let o=r?.deploymentId??process.env.VERCEL_DEPLOYMENT_ID;if(!o)throw Error(`${vw(`Enqueuing a workflow message`)} Callers outside a deployment can instead pass an explicit deploymentId in options.`);let c=(r?.specVersion??5)>=3?i:a,l=Ow(t,r),u=new _w({...s,...n&&{headers:{...s.headers,"x-vercel-queue-region":l}},region:l,deploymentId:o,transport:c}),d={payload:t,queueName:e,deploymentId:r?.deploymentId},f=Nw(e,t).replace(/[^A-Za-z0-9-_]/g,`-`);try{let{messageId:e}=await u.send(f,d,{idempotencyKey:r?.idempotencyKey,delaySeconds:r?.delaySeconds,headers:{...kw(t),...r?.headers}});return{messageId:e?Jo.parse(e):null}}catch(e){if(e instanceof CS)return{messageId:Jo.parse(`msg_duplicate_${e.idempotencyKey??r?.idempotencyKey??`unknown`}`)};throw e}};return{queue:c,createQueueHandler:(e,t)=>{let n=new _w(s).handleCallback(async(e,n)=>{if(!e||!n)return;let r=Sw.getStore(),{payload:i,queueName:a,deploymentId:o}=Cw.parse(e),s=await t(i,{queueName:a,messageId:Jo.parse(n.messageId),attempt:n.deliveryCount,requestId:r});if(typeof s?.timeoutSeconds==`number`){let e=s.timeoutSeconds>0?Math.min(s.timeoutSeconds,ww):void 0;await c(a,i,{deploymentId:o,delaySeconds:e})}},{retry:(e,{messageId:t,deliveryCount:n})=>{let r=Tw(n);return console.error(`[workflow] Queue handler failed for message "${t}" on delivery attempt ${n}; retrying in ${r}s:`,e),{afterSeconds:r}}});return async e=>{let t=e.headers.get(`x-vercel-id`)?.trim()||void 0;return Sw.run(t,()=>n(e))}},getDeploymentId:async()=>{let e=process.env.VERCEL_DEPLOYMENT_ID;if(!e)throw Error(vw(`Starting a workflow run`));return e}}}const Fw=Dc({id:en()});function Iw(e){return async function(){let t=process.env.VERCEL_DEPLOYMENT_ID;if(!t)throw Error(vw(`Resolving the latest deployment for deploymentId: 'latest'`));let n=await Rm(e);if(!n)throw Error(`Cannot resolve latest deployment: no OIDC token or VERCEL_TOKEN available`);let r=await(await Vm({method:`GET`,url:`https://api.vercel.com/v1/workflow/resolve-latest-deployment/${encodeURIComponent(t)}`,headers:new Headers({Authorization:`Bearer ${n}`}),dispatcher:Wp(e),peerService:`vercel-api`,timeoutMs:null,buildError:async e=>{let n;try{n=await e.text()}catch{n=`<unable to read response body>`}return Error(`Failed to resolve latest deployment for ${t}: HTTP ${e.status} ${e.statusText}${n?` — ${n}`:``}`)}})).json(),i=Fw.safeParse(r);if(!i.success)throw Error(`Invalid response from Vercel API: expected { id: string }. Zod error: ${i.error.message}`);return i.data.id}}function Lw(e){let t=Jt.safeParse(e);return t.success?t.data:(rn.safeParse(e.eventType).success&&console.debug(`[workflow:world-vercel] v4 event ${e.eventId} failed EventSchema parse for known eventType '${e.eventType}'; passing through unparsed: ${t.error.message}`),e)}const Rw={run_created:{retryable:!0,reason:`conditional create → 409 if exists`},step_created:{retryable:!0,reason:`conditional create → 409 if exists`},wait_created:{retryable:!0,reason:`conditional create → 409 if exists`},hook_created:{retryable:!0,reason:`transactional token uniqueness → 409 if exists`},run_started:{retryable:!0,reason:`early-returns if already running, no duplicate row`},run_completed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},run_failed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},run_cancelled:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},step_completed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},step_failed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},wait_completed:{retryable:!0,reason:`waiting-state guard → 409, no duplicate row`},hook_disposed:{retryable:!0,reason:`conditional delete (exists) → 409, no duplicate row`},attr_set:{retryable:!0,reason:`correlationId constraint reuses eventId (idempotent replay)`},step_started:{retryable:!1,reason:`unconditional attempt increment → a retry double-counts attempts`},step_retrying:{retryable:!1,reason:`no duplicate guard → a retry appends a second event row`},hook_received:{retryable:!1,reason:`no server guard → a retry duplicates the row / re-delivers payload`},hook_conflict:{retryable:!1,reason:`server-originated; never POSTed by the SDK`}},zw=new Set([`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`ENETDOWN`,`ENETUNREACH`,`EHOSTDOWN`,`EHOSTUNREACH`,`EPIPE`,`ETIMEDOUT`,`UND_ERR_SOCKET`,`UND_ERR_REQ_RETRY`,`UND_ERR_CONNECT_TIMEOUT`,`UND_ERR_HEADERS_TIMEOUT`,`UND_ERR_BODY_TIMEOUT`,`TimeoutError`,`RequestRetryError`]);function Bw(e,t=0){if(t>5||typeof e!=`object`||!e)return[];let n=[],r=e;return typeof r.code==`string`&&n.push(r.code),typeof r.name==`string`&&n.push(r.name),r.cause&&n.push(...Bw(r.cause,t+1)),n}function Vw(e){if(f.is(e)||l.is(e)||s.is(e)||u.is(e))return!1;if(a.is(e)){if(e.code===`PARSE_ERROR`)return!0;if(typeof e.status==`number`)return e.status>=500&&e.status<=599}return Bw(e).some(e=>zw.has(e))}const Hw=e=>new Promise(t=>setTimeout(t,e)),Uw=typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`);function Ww(e,t){if(!Uw)return;let n=Object.entries(t).map(([e,t])=>`${e}=${t}`).join(` `);console.debug(`[workflow:world-vercel:event-retry] ${e} ${n}`)}function Gw(e){return a.is(e)?e.code??(e.status==null?e.name:`status_${e.status}`):Bw(e)[0]??(e instanceof Error?e.name:`unknown`)}async function Kw(e,t){let n=Rw[t]?.retryable??!1;for(let r=0;;r++)try{return await e()}catch(e){let i=n&&Vw(e);if(i&&r<2){let n=100*2**r+Math.floor(Math.random()*50);Ww(`retrying event POST after transient failure`,{eventType:t,attempt:r+1,backoffMs:n,error:Gw(e)}),await Hw(n);continue}throw i&&Ww(`exhausted in-process retries; surfacing for queue redelivery`,{eventType:t,attempts:r+1,error:Gw(e)}),e}}const qw=`application/vnd.workflow.v4-frames`;function Jw(e,t){let n=new Uint8Array(_p(e)),r=new Uint8Array(4+n.byteLength+4+t.byteLength),i=new DataView(r.buffer);return i.setUint32(0,n.byteLength,!1),r.set(n,4),i.setUint32(4+n.byteLength,t.byteLength,!1),r.set(t,4+n.byteLength+4),r}async function*Yw(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():Zw(e.getReader()),n=new Uint8Array,r=async e=>{for(;n.byteLength<e;){let{done:e,value:r}=await t.next();if(e)return!1;if(!r||r.byteLength===0)continue;let i=new Uint8Array(n.byteLength+r.byteLength);i.set(n,0),i.set(r,n.byteLength),n=i}return!0},i=e=>{let t=n.subarray(0,e);return n=n.subarray(e),t};try{for(;;){if(!await r(4))return;let e=new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(i(4),!await r(e))throw Error(`decodeFrames: truncated meta block`);let t=Wf(i(e));if(!await r(4))throw Error(`decodeFrames: truncated body length`);let a=new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(i(4),a>0&&!await r(a))throw Error(`decodeFrames: truncated body bytes`);if(yield{meta:t,body:n.slice(0,a)},i(a),t._end===1)return}}finally{Xw(()=>t.return?.())}}function Xw(e){try{Promise.resolve(e()).catch(()=>{})}catch{}}async function*Zw(e){try{for(;;){let{done:t,value:n}=await e.read();if(t)return;n&&(yield n)}}finally{Xw(()=>e.cancel())}}async function Qw(e,t,n,r){return Vm({method:t.method,url:e,headers:t.headers,body:t.body,dispatcher:Gp(n),timeoutMs:null,logLabel:r,buildError:async t=>nT(t.status,$w(t.headers),await t.text(),r,e)})}function $w(e){let t={};return e.forEach((e,n)=>{t[n]=e}),t}const eT={eventId:`x-wf-event-id`,runId:`x-wf-run-id`,createdAt:`x-wf-created-at`};function tT(e){let t={eventType:e.eventType,specVersion:e.specVersion};return e.correlationId!==void 0&&(t.correlationId=e.correlationId),e.vercelId!==void 0&&(t.vercelId=e.vercelId),e.computeInstanceId!==void 0&&(t.computeInstanceId=e.computeInstanceId),e.occurredAt!==void 0&&(t.occurredAt=e.occurredAt),e.remoteRefBehavior!==void 0&&(t.remoteRefBehavior=e.remoteRefBehavior),e.deploymentId!==void 0&&(t.deploymentId=e.deploymentId),e.workflowName!==void 0&&(t.workflowName=e.workflowName),e.stepName!==void 0&&(t.stepName=e.stepName),e.attempt!==void 0&&(t.attempt=e.attempt),e.resumeAt!==void 0&&(t.resumeAt=e.resumeAt),e.retryAfter!==void 0&&(t.retryAfter=e.retryAfter),e.hookToken!==void 0&&(t.hookToken=e.hookToken),e.hookTokenRetentionUntil!==void 0&&(t.hookTokenRetentionUntil=e.hookTokenRetentionUntil),e.hookIsWebhook!==void 0&&(t.hookIsWebhook=e.hookIsWebhook),e.hookIsSystem!==void 0&&(t.hookIsSystem=e.hookIsSystem),e.resumeId!==void 0&&(t.resumeId=e.resumeId),e.errorCode!==void 0&&(t.errorCode=e.errorCode),e.cancelReason!==void 0&&(t.cancelReason=e.cancelReason),e.ownerMessageId!==void 0&&(t.ownerMessageId=e.ownerMessageId),e.executionContext!==void 0&&(t.executionContext=e.executionContext),e.attributes!==void 0&&(t.attributes=e.attributes),e.changes!==void 0&&(t.changes=e.changes),e.writer!==void 0&&(t.writer=e.writer),e.allowReservedAttributes!==void 0&&(t.allowReservedAttributes=e.allowReservedAttributes),e.encryptionPublicKey!==void 0&&(t.encryptionPublicKey=e.encryptionPublicKey),e.ttfs!==void 0&&(t.ttfs=e.ttfs),e.stso!==void 0&&(t.stso=e.stso),e.stepCount!==void 0&&(t.stepCount=e.stepCount),e.eventCount!==void 0&&(t.eventCount=e.eventCount),e.rsfs!==void 0&&(t.rsfs=e.rsfs),e.finalSchedulingReplay!==void 0&&(t.finalSchedulingReplay=e.finalSchedulingReplay),e.optimizations!==void 0&&(t.optimizations=e.optimizations),e.sinceCursor!==void 0&&(t.sinceCursor=e.sinceCursor),e.skipPreload!==void 0&&(t.skipPreload=e.skipPreload),e.stateUpdatedAt!==void 0&&(t.stateUpdatedAt=e.stateUpdatedAt),e.stateEventCount!==void 0&&(t.stateEventCount=e.stateEventCount),e.stateCursor!==void 0&&(t.stateCursor=e.stateCursor),e.replayDivergenceCount!==void 0&&(t.replayDivergenceCount=e.replayDivergenceCount),e.resumePayloadDigest!==void 0&&(t.resumePayloadDigest=e.resumePayloadDigest),t}function nT(e,t,n,r,i){let a=`v4 ${r} failed: HTTP ${e}`,o,s;try{let t=JSON.parse(n);typeof t.message==`string`&&(a=t.message),typeof t.code==`string`&&(o=t.code),e===412&&(s=rT(t))}catch{n&&(a+=` ${n}`)}let c=Fm(oT(t,`retry-after`));return Im(e,a,{retryAfter:c,code:o,url:i,mitigated:oT(t,`x-vercel-mitigated`),...s===void 0?{}:{details:s}})}function rT(e){if(!Array.isArray(e.events)||e.events.length===0)return;let t=[];for(let n of e.events){if(typeof n!=`object`||!n)return;let e=n;if(typeof e.eventId!=`string`||iT(e))return;t.push(Lw(e))}return{events:t,...typeof e.cursor==`string`?{cursor:e.cursor}:{}}}function iT(e){let t=e.eventType;if(typeof t!=`string`)return!1;let n=xn(t);if(!n)return!1;let r=e.eventData;if(typeof r!=`object`||!r)return!1;let i=r[n];return i!==void 0&&!(i instanceof Uint8Array)}async function aT(e,t){let{baseUrl:n,headers:r}=await eh(t),i=new Headers(r);i.set(`Content-Type`,`application/octet-stream`);let a=Jw(tT(e),e.payload??new Uint8Array),o=await Qw(`${n}/v4/runs/${encodeURIComponent(e.runId)}/events/${encodeURIComponent(e.eventType)}`,{method:`POST`,headers:i,body:a},t,`createEvent`),s=o.headers.get(eT.eventId),c=o.headers.get(eT.runId),l=o.headers.get(eT.createdAt);if(typeof s!=`string`||typeof c!=`string`||typeof l!=`string`)throw Error(`v4 createEvent: response missing required x-wf-* headers`);let u=new Uint8Array(await o.arrayBuffer());return{eventId:s,runId:c,createdAt:l,body:u.byteLength>0?Wf(u):{}}}function oT(e,t){let n=e[t];if(typeof n==`string`)return n;if(Array.isArray(n)&&n.length>0)return n[0]}async function sT(e,t,n){let{baseUrl:r,headers:i}=await eh(n),a=await Qw(`${r}/v4/runs/${encodeURIComponent(e)}/events/${encodeURIComponent(t)}`,{method:`GET`,headers:i},n,`getEvent`),o=a.headers.get(`content-type`);if(!o?.startsWith(`application/vnd.workflow.v4-frames`))throw Error(`v4 getEvent: expected ${qw}, got ${o??`(none)`}`);let s=a.body;for await(let e of Yw(s))return{event:e.meta,body:e.body};throw Error(`v4 getEvent: empty frame stream for ${t}`)}async function cT(e,t,n,r){let i=await Qw(e,{method:`GET`,headers:t},n,r),a=i.headers.get(`content-type`);if(!a?.startsWith(`application/vnd.workflow.v4-frames`))throw Error(`v4 ${r}: expected ${qw}, got ${a??`(none)`}`);let o=i.body,s=[],c,l,u=!1;for await(let e of Yw(o)){if(e.meta._end===1){typeof e.meta.next==`string`&&(c=e.meta.next),typeof e.meta.hasMore==`boolean`&&(l=e.meta.hasMore),u=!0;break}s.push({event:e.meta,body:e.body})}if(!u)throw Error(`v4 ${r}: frame stream ended without the end-of-stream sentinel (${s.length} events read) — truncated response?`);return{events:s,...c?{next:c}:{},...l===void 0?{}:{hasMore:l}}}function lT(e,t){t.cursor&&e.set(`cursor`,t.cursor),t.limit!==void 0&&e.set(`limit`,String(t.limit)),t.sortOrder&&e.set(`sortOrder`,t.sortOrder),t.remoteRefBehavior&&e.set(`remoteRefBehavior`,t.remoteRefBehavior)}function uT(e){let t=new URLSearchParams;lT(t,e);let n=t.toString();return n?`?${n}`:``}async function dT(e,t={},n){let{baseUrl:r,headers:i}=await eh(n);return cT(`${r}/v4/runs/${encodeURIComponent(e)}/events`+uT(t),i,n,`listEvents`)}async function fT(e,t={},n){let{baseUrl:r,headers:i}=await eh(n),a=new URLSearchParams;return a.set(`correlationId`,e),lT(a,t),cT(`${r}/v4/events?${a.toString()}`,i,n,`listEventsByCorrelationId`)}const pT=`gzip`,mT=`zstd`,hT=new TextDecoder,gT=new Set([`devl`,`encr`,pT,mT]);function _T(){try{return globalThis.process?.getBuiltinModule?.(`node:zlib`)}catch{return}}function vT(e){return!(e instanceof Uint8Array)||e.byteLength<4?null:hT.decode(e.subarray(0,4))}function yT(e){let t=vT(e);return t!==null&&gT.has(t)}function bT(e,t){let n=_T(),r=e===mT?n?.zstdDecompressSync:n?.gunzipSync;if(!r)throw new a(`Received ${e}-compressed workflow data, but this Node.js runtime does not support ${e} decompression. Use a compatible Node.js runtime or request unresolved data.`);return new Uint8Array(r(t))}function xT(e){let t=vT(e);return t!==mT&&t!==pT?e:bT(t,e.subarray(4))}function ST(e){return{...e,input:xT(e.input),output:xT(e.output),error:xT(e.error)}}function CT(e){return{...e,input:xT(e.input),output:xT(e.output),error:xT(e.error)}}function wT(e){return{...e,metadata:xT(e.metadata)}}function TT(e){let t=e.eventData;if(!t||typeof t!=`object`)return e;let n=Ue(typeof e.eventType==`string`?e.eventType:``);if(n.length===0)return e;let r={...t},i=!1;for(let e of n){if(!(e in r))continue;let t=r[e],n=xT(t);n!==t&&(r[e]=n,i=!0)}return i?{...e,eventData:r}:e}const ET=eo.omit({error:!0,errorCode:!0}).extend({error:Nr([dr,Ai()]).optional(),errorCode:en().optional(),blobStorageBytes:ec().optional(),streamStorageBytes:ec().optional()}),DT=ET,OT=ET.omit({input:!0,output:!0}).extend({inputRef:Ai().optional(),outputRef:Ai().optional(),input:Nr([Sa(Uint8Array),Ai()]).optional(),output:Nr([Sa(Uint8Array),Ai()]).optional()});function kT(e,t){if(t===`none`){let{inputRef:t,outputRef:n,...r}=e;return{...ST(Jm(r)),input:void 0,output:void 0}}return ST(Jm(e))}async function AT(e={},t){let{workflowName:n,status:r,pagination:i,resolveData:a=`all`}=e,o=new URLSearchParams;n&&o.set(`workflowName`,n),r&&o.set(`status`,r),i?.limit&&o.set(`limit`,i.limit.toString()),i?.cursor&&o.set(`cursor`,i.cursor),i?.sortOrder&&o.set(`sortOrder`,i.sortOrder);let s=a===`none`?`lazy`:`resolve`;o.set(`remoteRefBehavior`,s);let c=o.toString(),l=await R({endpoint:`/v2/runs${c?`?${c}`:``}`,options:{method:`GET`},config:t,schema:Fi(s===`lazy`?OT:DT)});return{...l,data:l.data.map(e=>kT(e,a))}}async function jT(e,t){return Jm(await R({endpoint:`/v1/runs/create`,options:{method:`POST`},data:e,config:t,schema:DT}))}async function MT(e,t,n){let r=t?.resolveData??`all`,i=r===`none`?`lazy`:`resolve`,s=new URLSearchParams;s.set(`remoteRefBehavior`,i);let c=s.toString(),l=`/v2/runs/${encodeURIComponent(e)}${c?`?${c}`:``}`;try{return kT(await R({endpoint:l,options:{method:`GET`},config:n,retryConnectTimeout:!0,schema:i===`lazy`?OT:DT}),r)}catch(t){throw t instanceof a&&t.status===404?new o(e):t}}async function NT(e,t,n){let r=[...new Set(e)],i=await Promise.all(r.map(async e=>{try{return await MT(e,t,n)}catch(e){if(e instanceof o)return null;throw e}})),a=new Map(r.map((e,t)=>[e,i[t]]));return e.map(e=>a.get(e)??null)}async function PT(e,t,n){let r=t?.resolveData??`all`,i=r===`none`?`lazy`:`resolve`,s=new URLSearchParams;s.set(`remoteRefBehavior`,i);let c=s.toString(),l=`/v1/runs/${encodeURIComponent(e)}/cancel${c?`?${c}`:``}`;try{return kT(await R({endpoint:l,options:{method:`PUT`},config:n,schema:i===`lazy`?OT:DT}),r)}catch(t){throw t instanceof a&&t.status===404?new o(e):t}}const FT=Dc({attributes:Me(en(),en())});async function IT(e,t,n,r){try{return{attributes:(await R({endpoint:`/v2/runs/${encodeURIComponent(e)}/attributes`,options:{method:`POST`},data:n?.allowReservedAttributes?{changes:t,allowReservedAttributes:!0}:{changes:t},config:r,schema:FT})).attributes}}catch(t){throw t instanceof a&&t.status===404?new o(e):t}}const LT=Ee.omit({error:!0}).extend({error:Nr([dr,Ai()]).optional(),errorRef:Ai().optional()}),RT=LT.omit({input:!0,output:!0}).extend({inputRef:Ai().optional(),outputRef:Ai().optional(),input:Sa(Uint8Array).optional(),output:Sa(Uint8Array).optional()});function zT(e){let{error:t,errorRef:n,...r}=e,i={...r},a=t??n;return a!=null&&(i.error=a),i}function BT(e,t){if(t===`none`){let{inputRef:t,outputRef:n,...r}=e;return{...CT(zT(r)),input:void 0,output:void 0}}return CT(zT(e))}async function VT(e,t){let{runId:n,pagination:r,resolveData:i=`all`}=e,a=new URLSearchParams;r?.cursor&&a.set(`cursor`,r.cursor),r?.limit&&a.set(`limit`,r.limit.toString()),r?.sortOrder&&a.set(`sortOrder`,r.sortOrder);let o=i===`none`?`lazy`:`resolve`;a.set(`remoteRefBehavior`,o);let s=a.toString(),c=await R({endpoint:`/v2/runs/${encodeURIComponent(n)}/steps${s?`?${s}`:``}`,options:{method:`GET`},config:t,schema:Fi(o===`lazy`?RT:LT)});return{...c,data:c.data.map(e=>BT(e,i))}}async function HT(e,t,n,r){let i=n?.resolveData??`all`,a=i===`none`?`lazy`:`resolve`,o=new URLSearchParams;o.set(`remoteRefBehavior`,a);let s=o.toString();return BT(await R({endpoint:`/v2/runs/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}${s?`?${s}`:``}`,options:{method:`GET`},config:r,schema:a===`lazy`?RT:LT}),i)}function UT(e){let t=e.startsWith(`wrun_`)?e.slice(5):e;try{return fs(`wrun_${Gc(t).ulid}`,`wrun_`)}catch{return fs(e,`wrun_`)}}const WT=new Set([`run_created`,`run_started`,`step_started`]),GT=new Set([`run_failed`,`step_failed`,`step_retrying`]);function KT(e){let t=e.eventData??{},n=xn(e.eventType),r={};if(typeof t.deploymentId==`string`&&(r.deploymentId=t.deploymentId),typeof t.workflowName==`string`&&(r.workflowName=t.workflowName),typeof t.stepName==`string`&&(r.stepName=t.stepName),typeof t.attempt==`number`&&(r.attempt=t.attempt),t.resumeAt instanceof Date)r.resumeAt=t.resumeAt;else if(typeof t.resumeAt==`string`){let e=new Date(t.resumeAt);Number.isNaN(e.getTime())||(r.resumeAt=e)}if(t.retryAfter instanceof Date)r.retryAfter=t.retryAfter;else if(typeof t.retryAfter==`string`){let e=new Date(t.retryAfter);Number.isNaN(e.getTime())||(r.retryAfter=e)}typeof t.token==`string`&&(r.hookToken=t.token),t.tokenRetentionUntil instanceof Date&&(r.hookTokenRetentionUntil=t.tokenRetentionUntil),typeof t.isWebhook==`boolean`&&(r.hookIsWebhook=t.isWebhook),typeof t.isSystem==`boolean`&&(r.hookIsSystem=t.isSystem),typeof t.errorCode==`string`&&(r.errorCode=t.errorCode),typeof t.cancelReason==`string`&&(r.cancelReason=t.cancelReason),typeof t.ownerMessageId==`string`&&(r.ownerMessageId=t.ownerMessageId),t.executionContext!==void 0&&t.executionContext!==null&&typeof t.executionContext==`object`&&(r.executionContext=t.executionContext),t.attributes!==void 0&&t.attributes!==null&&typeof t.attributes==`object`&&(r.attributes=t.attributes),Array.isArray(t.changes)&&(r.changes=t.changes),t.writer!==void 0&&t.writer!==null&&typeof t.writer==`object`&&(r.writer=t.writer),typeof t.allowReservedAttributes==`boolean`&&(r.allowReservedAttributes=t.allowReservedAttributes),typeof t.encryptionPublicKey==`string`&&(r.encryptionPublicKey=t.encryptionPublicKey),typeof t.ttfs==`number`&&(r.ttfs=t.ttfs),typeof t.stso==`number`&&(r.stso=t.stso),typeof t.stepCount==`number`&&Number.isSafeInteger(t.stepCount)&&t.stepCount>0&&(r.stepCount=t.stepCount),typeof t.eventCount==`number`&&Number.isSafeInteger(t.eventCount)&&t.eventCount>0&&(r.eventCount=t.eventCount),typeof t.rsfs==`number`&&(r.rsfs=t.rsfs),typeof t.finalSchedulingReplay==`number`&&(r.finalSchedulingReplay=t.finalSchedulingReplay),Array.isArray(t.optimizations)&&t.optimizations.every(e=>typeof e==`string`)&&(r.optimizations=t.optimizations);let i;if(n&&n in t){let r=t[n];if(r!==void 0){if(!(r instanceof Uint8Array))throw TypeError(`world-vercel v4: eventData.${n} for ${e.eventType} must be a Uint8Array (the runtime's dehydrated wire form); got ${typeof r==`object`?r===null?`null`:r.constructor?.name??typeof r:typeof r}.`);i=r}}return{payload:i,meta:r}}function qT(e){return Lw(TT(e))}function JT(e){if(yT(e))return e;try{let t=lo.safeParse(Wf(e.slice()));return t.success?t.data:e}catch{return e}}function YT(e,t,n){let r=e.eventData??{};if(t.byteLength>0){let n=xn(e.eventType),i=xT(t);n&&i instanceof Uint8Array&&(r[n]=GT.has(e.eventType)?JT(i):i)}let i=qT({eventId:e.eventId,runId:e.runId,eventType:e.eventType,createdAt:e.createdAt instanceof Date?e.createdAt:new Date(e.createdAt),...e.occurredAt===void 0?{}:{occurredAt:e.occurredAt instanceof Date?e.occurredAt:new Date(e.occurredAt)},...e.correlationId?{correlationId:e.correlationId}:{},eventData:r,...e.specVersion===void 0?{}:{specVersion:e.specVersion}});return n===`none`?ot(i,`none`):i}async function XT(e,t,n,r){let i=n?.resolveData??`all`,{event:a,body:o}=await sT(e,t,r);return YT(a,o,i)}async function ZT(e,t){let{pagination:n,resolveData:r=`all`}=e,i={cursor:n?.cursor??void 0,limit:n?.limit,sortOrder:n?.sortOrder,remoteRefBehavior:r===`none`?`lazy`:`resolve`},a=await(`correlationId`in e?fT(e.correlationId,i,t):dT(e.runId,i,t));return{data:a.events.map(e=>YT(e.event,e.body,r)),cursor:a.next??null,hasMore:typeof a.hasMore==`boolean`?a.hasMore:!!a.next}}async function QT(e,t,n,r){try{return await Kw(()=>$T(e,t,n,r),t.eventType)}catch(e){throw zt(t.eventType)&&a.is(e)&&e.status===404&&t.correlationId?new d(t.correlationId):e}}async function $T(e,t,n,r){if(n?.v1Compat){if(t.eventType===`run_cancelled`&&e)return{run:await PT(e,n,r)};if(t.eventType===`run_created`)return{run:await jT(t.eventData,r)};if(e===null)throw new a(`world-vercel: v1Compat=true requires a runId for ${t.eventType}`,{status:400});return{event:await R({endpoint:`/v1/runs/${encodeURIComponent(e)}/events`,options:{method:`POST`},data:t,config:r,schema:Jt})}}if(e===null)throw new a(`world-vercel v4: createWorkflowRunEvent requires a client-generated runId for run_created (the runId is part of the payload storage ref key). Generate a wrun_ ULID before calling.`,{status:400});if(t.eventType===`run_created`){let t=UT(e);if(t)throw new a(t,{status:400})}let i=WT.has(t.eventType)?`resolve`:`lazy`,{payload:o,meta:s}=KT(t),c=await aT({runId:e,eventType:t.eventType,specVersion:t.specVersion??2,...t.correlationId?{correlationId:t.correlationId}:{},...n?.requestId?{vercelId:n.requestId}:{},...n?.computeInstanceId?{computeInstanceId:n.computeInstanceId}:{},...n?.stateUpdatedAt===void 0?{}:{stateUpdatedAt:n.stateUpdatedAt},...n?.stateEventCount===void 0?{}:{stateEventCount:n.stateEventCount},...n?.stateCursor?{stateCursor:n.stateCursor}:{},...n?.replayDivergenceCount===void 0?{}:{replayDivergenceCount:n.replayDivergenceCount},occurredAt:n?.occurredAt??new Date,...n?.sinceCursor?{sinceCursor:n.sinceCursor}:{},...n?.skipPreload?{skipPreload:!0}:{},...n?.resumeId?{resumeId:n.resumeId}:{},...n?.resumePayloadDigest?{resumePayloadDigest:n.resumePayloadDigest}:{},remoteRefBehavior:i,payload:o,...s},r),l=n?.resolveData??`all`,u=c.body;return{event:u.event?ot(Lw(u.event),l):void 0,run:u.run?Jm(u.run):void 0,step:u.step?zT(u.step):void 0,hook:u.hook,wait:u.wait,events:u.events?u.events.map(Lw):void 0,cursor:u.cursor??void 0,hasMore:u.hasMore,...u.stepCreated?{stepCreated:!0}:{},...typeof u.maxEvents==`number`?{maxEvents:u.maxEvents}:{}}}function eE(e,t){if(t===`none`){let{metadataRef:t,...n}=e;return n}return wT(e)}const tE=Gi.omit({metadata:!0}).extend({metadataRef:Hd.any().optional()});async function nE(e,t){let{runId:n,pagination:r,resolveData:i=`all`}=e,a=new URLSearchParams;r?.limit&&a.set(`limit`,r.limit.toString()),r?.cursor&&a.set(`cursor`,r.cursor),r?.sortOrder&&a.set(`sortOrder`,r.sortOrder);let o=i===`none`?`lazy`:`resolve`;a.set(`remoteRefBehavior`,o),n&&a.set(`runId`,n);let s=a.toString(),c=await R({endpoint:`/v2/hooks${s?`?${s}`:``}`,options:{method:`GET`},config:t,schema:Fi(o===`lazy`?tE:Gi)});return{...c,data:c.data.map(e=>eE(e,i))}}async function rE(e,t,n){let r=t?.resolveData||`all`;return eE(await R({endpoint:`/v2/hooks/${encodeURIComponent(e)}`,options:{method:`GET`},config:n,schema:Gi}),r)}async function iE(e,t){try{return await R({endpoint:`/v2/hooks/by-token?token=${encodeURIComponent(e)}`,options:{method:`GET`},config:t,schema:Gi})}catch(t){throw a.is(t)&&t.status===404?new d(e):t}}function aE(e){let t={runs:{get:((t,n)=>MT(t,n,e)),getMany:((t,n)=>NT(t,n,e)),list:(t=>AT(t,e)),experimentalSetAttributes:(t,n,r)=>IT(t,n,r,e)},steps:{get:((t,n,r)=>HT(t,n,r,e)),list:(t=>VT(t,e))},events:{create:(t,n,r)=>QT(t,n,r,e),get:(t,n,r)=>XT(t,n,r,e),list:t=>ZT(t,e),listByCorrelationId:t=>ZT(t,e)},hooks:{get:(t,n)=>rE(t,n,e),getByToken:t=>iE(t,e),list:t=>nE(t,e)}};return{runs:Eh(`world.runs`,t.runs),steps:Eh(`world.steps`,t.steps),events:Eh(`world.events`,t.events),hooks:Eh(`world.hooks`,t.hooks)}}const oE=()=>Rc(`WORKFLOW_MAX_CHUNKS_PER_REQUEST`,1e3,{integer:!0,min:1});function sE(e,t,n){return new URL(`${n.baseUrl}/v2/runs/${encodeURIComponent(t)}/stream/${encodeURIComponent(e)}`)}function cE(e,t,n){return new URL(`${n.baseUrl}/v3/runs/${encodeURIComponent(t)}/stream/${encodeURIComponent(e)}`)}function lE(e){return{...Cm(e.runId),...Tm(e.name),...Em(e.operation),...typeof e.startIndex==`number`?Dm(e.startIndex):{}}}function uE(e,t,n,r){let i=[`PUT ${t.origin}${t.pathname}`,...jm(n.headers)];return Error(`Stream ${e} failed: HTTP ${n.status} (${i.join(`; `)}): ${r}`)}function dE(e){let t=new TextEncoder,n=[],r=0;for(let i of e){let e=typeof i==`string`?t.encode(i):i;n.push(e),r+=4+e.length}let i=new Uint8Array(r),a=new DataView(i.buffer),o=0;for(let e of n)a.setUint32(o,e.length,!1),o+=4,i.set(e,o),o+=e.length;return i}const fE=Dc({tailIndex:ec(),done:or()}),pE=Dc({data:gc(Dc({index:ec(),data:Sa(Uint8Array)})),cursor:en().nullable(),hasMore:or(),done:or()});function mE(e){return{streams:{async write(t,n,r){let i=await t,a=await eh(e),o=sE(n,i,a);await(await Vm({method:`PUT`,url:o.toString(),body:r,headers:a.headers,dispatcher:Kp(e),timeoutMs:null,logLabel:o.pathname,spanName:`workflow.stream.write`,durationAttribute:`workflow.stream.write.chunk_rtt`,attributes:lE({runId:i,name:n,operation:`write`}),buildError:async e=>uE(`write`,o,e,await e.text())})).text()},async writeMulti(t,n,r){if(r.length===0)return;let i=await t,a=await eh(e);a.headers.set(`X-Stream-Multi`,`true`);let o=oE();for(let t=0;t<r.length;t+=o){let s=dE(r.slice(t,t+o)),c=sE(n,i,a);await(await Vm({method:`PUT`,url:c.toString(),body:s,headers:a.headers,dispatcher:Kp(e),timeoutMs:null,logLabel:c.pathname,spanName:`workflow.stream.write`,durationAttribute:`workflow.stream.write.chunk_rtt`,attributes:lE({runId:i,name:n,operation:`write_multi`}),buildError:async e=>uE(`write`,c,e,await e.text())})).text()}},async close(t,n){let r=await t,i=await eh(e);i.headers.set(`X-Stream-Done`,`true`);let a=sE(n,r,i);await(await Vm({method:`PUT`,url:a.toString(),headers:i.headers,dispatcher:qp(e),timeoutMs:null,logLabel:a.pathname,spanName:`workflow.stream.write`,durationAttribute:`workflow.stream.write.chunk_rtt`,attributes:lE({runId:r,name:n,operation:`close`}),buildError:async e=>uE(`close`,a,e,await e.text())})).text()},async get(t,n,r){let i=await eh(e),a=cE(n,t,i);typeof r==`number`&&a.searchParams.set(`startIndex`,String(r));let o=await Vm({method:`GET`,url:a.toString(),headers:i.headers,dispatcher:void 0,timeoutMs:null,logLabel:a.pathname,spanName:`workflow.stream.read.connect`,attributes:lE({runId:t,name:n,operation:`read`,startIndex:r}),buildError:e=>Error(`Failed to fetch stream: ${e.status}`)});if(!o.body)throw Error(`No response body for stream`);return o.body},async getChunks(t,n,r){let i=new URLSearchParams;r?.limit!=null&&i.set(`limit`,String(r.limit)),r?.cursor&&i.set(`cursor`,r.cursor);let a=i.toString();return R({endpoint:`/v2/runs/${encodeURIComponent(t)}/streams/${encodeURIComponent(n)}/chunks${a?`?${a}`:``}`,config:e,schema:pE})},async getInfo(t,n){return R({endpoint:`/v2/runs/${encodeURIComponent(t)}/streams/${encodeURIComponent(n)}/info`,config:e,schema:fE})},async list(t){let n=await eh(e),r=new URL(`${n.baseUrl}/v2/runs/${encodeURIComponent(t)}/streams`);return await(await Vm({method:`GET`,url:r.toString(),headers:n.headers,dispatcher:void 0,timeoutMs:null,logLabel:r.pathname,buildError:e=>Error(`Failed to list streams: ${e.status}`)})).json()}}}}function hE(e){let t=e?.projectConfig?.projectId||process.env.VERCEL_PROJECT_ID;return{specVersion:5,capabilities:{preconditionGuard:!0,maxConcurrency:!0},processExitTriggersQueueRedelivery:!0,...Pw(e),...aE(e),analytics:process.env.WORKFLOW_DISABLE_ANALYTICS_READS===`1`?void 0:oh(e),...Eh(`world.streams`,mE(e)),createRunId:fh,describeRun:mh,getEnvironment:()=>Qm(e),getEncryptionKeyForRun:_h(t,e?.projectConfig?.teamId,e?.token,e?.dispatcher),resolveLatestDeploymentId:Iw(e)}}export{oh as createAnalytics,_h as createGetEncryptionKeyForRun,Pw as createQueue,fh as createRunId,aE as createStorage,mE as createStreamer,hE as createWorld,hh as deriveRunKey,mh as describeRun,gh as fetchRunKey,ph as regionForRunId};
|
|
42
|
+
Cause: ${t}`)}}buildUrl(e,...t){let n=encodeURIComponent(e),r=t.map(e=>encodeURIComponent(e)),i=r.length>0?`/`+r.join(`/`):``,a=this.baseUrl.pathname.replace(/\/+$/,``);return`${this.baseUrl.origin}${a}${dw}/${n}${i}`}async fetch(e,t){let n=t.method||`GET`;if(nw()){let r={method:n,url:e,headers:t.headers},i=t.body;i!=null&&(i instanceof ArrayBuffer||i instanceof Uint8Array?r.bodySize=i.byteLength:typeof i==`string`?r.bodySize=i.length:r.bodyType=typeof i),console.debug(`[VQS Debug] Request:`,JSON.stringify(r,null,2))}t.headers.set(`User-Agent`,`@vercel/queue/0.4.0`),t.headers.set(`Vqs-Client-Ts`,new Date().toISOString());let r=this.dispatcher?{...t,dispatcher:this.dispatcher}:t,i=await fetch(e,r);if(nw()){let t={method:n,url:e,status:i.status,statusText:i.statusText,headers:i.headers};console.debug(`[VQS Debug] Response:`,JSON.stringify(t,null,2))}return i}async sendMessage(e){let t=this.transport,{queueName:n,payload:r,idempotencyKey:i,retentionSeconds:a,delaySeconds:o,headers:s,telemetry:c}=e,l=new Headers;if(this.customHeaders)for(let[e,t]of Object.entries(this.customHeaders))l.append(e,t);if(s){let e=new Set([`authorization`,`content-type`]),t=t=>{let n=t.toLowerCase();return e.has(n)?!0:n.startsWith(`vqs-`)};for(let[e,n]of Object.entries(s))!t(e)&&n!==void 0&&l.append(e,n)}l.set(`Authorization`,`Bearer ${await this.getToken()}`),l.set(`Content-Type`,t.contentType);let u=this.getSendDeploymentId();u&&l.set(`Vqs-Deployment-Id`,u),i&&l.set(`Vqs-Idempotency-Key`,i),a!==void 0&&l.set(`Vqs-Retention-Seconds`,a.toString()),o!==void 0&&l.set(`Vqs-Delay-Seconds`,o.toString());let d=t.serialize(r),f=Buffer.isBuffer(d)?new Uint8Array(d):d,p=VC(this.telemetry,c);return YC(n,async e=>{await KC(l,p);let t=await this.fetch(this.buildUrl(n),{method:`POST`,body:f,headers:l});if(!t.ok){let e=await t.text();if(t.status===409)throw new DS(e||`Duplicate idempotency key detected`,i);if(t.status===502)throw new OS(e||`Consumer discovery failed`,u);if(t.status===503)throw new kS(e||`Consumer registry not configured`);aw(t.status,t.statusText,e,`send message`)}if(t.status===202)return await t.text(),{messageId:null};let r=await t.json();return e&&r.messageId&&e.setMessageId(r.messageId),r},p)}async*receiveMessages(e){let t=this.transport,{queueName:n,consumerGroup:r,visibilityTimeoutSeconds:i,limit:a}=e;if(a!==void 0&&(a<1||a>10))throw new TS(a);let o=new Headers({Authorization:`Bearer ${await this.getToken()}`,Accept:`multipart/mixed`,...this.customHeaders});i!==void 0&&o.set(`Vqs-Visibility-Timeout-Seconds`,i.toString()),a!==void 0&&o.set(`Vqs-Max-Messages`,a.toString());let s=this.getConsumeDeploymentId();s&&o.set(`Vqs-Deployment-Id`,s);let c=await this.fetch(this.buildUrl(n,`consumer`,r),{method:`POST`,headers:o});if(c.status===204){await c.text();return}if(!c.ok){let e=await c.text();aw(c.status,c.statusText,e,`receive messages`)}for await(let e of Ih(c))try{let n=ow(e.headers);if(!n){console.warn(`Missing required queue headers in multipart part`),await rw(e.payload);continue}let r=await t.deserialize(e.payload);yield{...n,payload:r}}catch(t){console.warn(`Failed to process multipart message:`,t),await rw(e.payload)}}async receiveMessageById(e){let t=this.transport,{queueName:n,consumerGroup:r,messageId:i,visibilityTimeoutSeconds:a}=e,o=new Headers({Authorization:`Bearer ${await this.getToken()}`,Accept:`multipart/mixed`,...this.customHeaders});a!==void 0&&o.set(`Vqs-Visibility-Timeout-Seconds`,a.toString());let s=this.getConsumeDeploymentId();s&&o.set(`Vqs-Deployment-Id`,s);let c=await this.fetch(this.buildUrl(n,`consumer`,r,`id`,i),{method:`POST`,headers:o});if(!c.ok){let e=await c.text();if(c.status===404)throw new _S(i);if(c.status===409){let t={};try{t=JSON.parse(e)}catch{}throw t.originalMessageId?new vS(i,`This message was a duplicate - use originalMessageId: ${t.originalMessageId}`):new vS(i)}if(c.status===410)throw new ES(i);aw(c.status,c.statusText,e,`receive message by ID`)}for await(let e of Ih(c)){let n=ow(e.headers);if(!n)throw await rw(e.payload),new yS(i,`Missing required queue headers in response`);let r=await t.deserialize(e.payload);return{message:{...n,payload:r}}}throw new _S(i)}async acknowledgeMessage(e){let{queueName:t,consumerGroup:n,receiptHandle:r}=e,i=new Headers({Authorization:`Bearer ${await this.getToken()}`,...this.customHeaders}),a=this.getConsumeDeploymentId();a&&i.set(`Vqs-Deployment-Id`,a);let o=await this.fetch(this.buildUrl(t,`consumer`,n,`lease`,r),{method:`DELETE`,headers:i});if(!o.ok){let e=await o.text();if(o.status===404)throw new _S(r);if(o.status===409)throw new vS(r,e||`Invalid receipt handle, message not in correct state, or already processed`);aw(o.status,o.statusText,e,`acknowledge message`,`Missing or invalid receipt handle`,o.headers?.get(`Retry-After`)??null)}return await o.text(),{acknowledged:!0}}async changeVisibility(e){let{queueName:t,consumerGroup:n,receiptHandle:r,visibilityTimeoutSeconds:i}=e,a=new Headers({Authorization:`Bearer ${await this.getToken()}`,"Content-Type":`application/json`,...this.customHeaders}),o=this.getConsumeDeploymentId();o&&a.set(`Vqs-Deployment-Id`,o);let s=await this.fetch(this.buildUrl(t,`consumer`,n,`lease`,r),{method:`PATCH`,headers:a,body:JSON.stringify({visibilityTimeoutSeconds:i})});if(!s.ok){let e=await s.text();if(s.status===404)throw new _S(r);if(s.status===409)throw new vS(r,e||`Invalid receipt handle, message not in correct state, or already processed`);aw(s.status,s.statusText,e,`change visibility`,`Missing receipt handle or invalid visibility timeout`,s.headers?.get(`Retry-After`)??null)}return await s.text(),{success:!0}}},pw=new WeakMap,mw=Symbol.for(`@vercel/queue.apiClient`);function hw(e,t){pw.set(e,t),Object.defineProperty(e,mw,{value:t,writable:!1,enumerable:!1,configurable:!1})}function gw(e){let t=pw.get(e);if(t)return t;let n=e[mw];if(typeof n==`object`&&n){let t=n;return pw.set(e,t),t}throw Error(`QueueClient not initialized. This may happen when multiple bundled copies of @vercel/queue are loaded in local dev.`)}function _w(e){return`request`in e?e.request:e}function vw(e){return gw(e)}var yw=`iad1`;function bw(e){return e||process.env.VERCEL_REGION||($S()||console.warn(`[QueueClient] Region not detected \u2014 defaulting to "${yw}". On Vercel this is set automatically via VERCEL_REGION. To silence this warning, pass region explicitly: new QueueClient({ region: "iad1" })`),yw)}var xw=class{constructor(e={}){let t=bw(e.region);hw(this,new fw({...e,region:t}))}send=async(e,t,n)=>{let r=gw(this),i=await r.sendMessage({queueName:e,payload:t,idempotencyKey:n?.idempotencyKey,retentionSeconds:n?.retentionSeconds,delaySeconds:n?.delaySeconds,headers:n?.headers,telemetry:n?.telemetry});return i.messageId&&$S()&&zC(e,i.messageId,r.getRegion(),n?.delaySeconds,n?.retentionSeconds),{messageId:i.messageId}};handleCallback=(e,t)=>{$S()&&hC(e,this,t);let n=VC(gw(this).getTelemetry?.());return async r=>{let i=_w(r);if($S()&&i.headers.get(`x-vercel-queue-prime`)===`1`){let n=i.headers.get(`x-vercel-queue-prime-file`);return n&&hC(e,this,t,n),Response.json({status:`primed`})}try{let r=await JS(i);return await $C(i.headers,()=>YS(e,r,{client:this,visibilityTimeoutSeconds:t?.visibilityTimeoutSeconds,retry:t?.retry}),n),Response.json({status:`success`})}catch(e){return console.error(`Queue callback error:`,e),e instanceof Error&&(e.message.includes(`Invalid content type`)||e.message.includes(`Invalid CloudEvent`)||e.message.includes(`Missing required CloudEvent`)||e.message.includes(`Failed to parse CloudEvent`)||e.message.includes(`Binary mode callback`))?Response.json({error:e.message},{status:400}):Response.json({error:`Failed to process queue message`},{status:500})}}};handleNodeCallback=(e,t)=>{$S()&&hC(e,this,t);let n=VC(gw(this).getTelemetry?.());return async(r,i)=>{if(r.method!==`POST`){i.status(200).end();return}let a=r.headers[`x-vercel-queue-prime`];if($S()&&a===`1`){let n=r.headers[`x-vercel-queue-prime-file`],a=Array.isArray(n)?n[0]:n;a&&hC(e,this,t,a),i.status(200).json({status:`primed`});return}try{let a=qS(r.body,r.headers);await $C(r.headers,()=>YS(e,a,{client:this,visibilityTimeoutSeconds:t?.visibilityTimeoutSeconds,retry:t?.retry}),n),i.status(200).json({status:`success`})}catch(e){if(console.error(`Queue callback error:`,e),e instanceof Error&&(e.message.includes(`Invalid content type`)||e.message.includes(`Invalid CloudEvent`)||e.message.includes(`Missing required CloudEvent`)||e.message.includes(`Failed to parse CloudEvent`)||e.message.includes(`Binary mode callback`))){i.status(400).json({error:e.message});return}i.status(500).json({error:`Failed to process queue message`})}}}};function Sw(e){return`${e} requires VERCEL_DEPLOYMENT_ID, which Vercel sets in every deployment, so this process is not running inside one. The Vercel world is only selected automatically when that variable is set, so it was requested explicitly here — most often by WORKFLOW_TARGET_WORLD=vercel in a process that is not a deployment, such as a production server started locally or in CI. To use the local filesystem world instead, set WORKFLOW_TARGET_WORLD=local or unset it.`}var Cw=class{contentType=`application/cbor`;serialize(e){return Buffer.from(bp(e))}async deserialize(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)break;r&&t.push(r)}return qf(Buffer.concat(t))}},ww=class{contentType=`application/json`;serialize(e){return Buffer.from(JSON.stringify(e))}async deserialize(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)break;r&&t.push(r)}return JSON.parse(Buffer.concat(t).toString())}},Tw=class{contentType=`application/cbor`;serialize(e){return Buffer.from(bp(e))}async deserialize(e){let t=[],n=e.getReader();for(;;){let{done:e,value:r}=await n.read();if(e)break;r&&t.push(r)}let r=Buffer.concat(t);try{return qf(r)}catch{return JSON.parse(r.toString())}}};const Ew=new Dl,Dw=dc({payload:ba,queueName:li,deploymentId:qt().optional()}),Ow=Number(process.env.VERCEL_QUEUE_MAX_DELAY_SECONDS||82800);function kw(e){let t=Math.min(Math.max(1,2**(e-1)),900),n=Math.floor(Math.random()*(Math.ceil(t*.25)+1));return Math.max(1,t-n)}function Aw(e){if(`runId`in e&&typeof e.runId==`string`)return e.runId}function jw(e){if(!e)return;let t=e.startsWith(`wrun_`)?e.slice(5):e;try{let e=Jc(t);return!e.tagged||e.regionId===Uc.unknown?void 0:e.region??void 0}catch{return}}function Mw(e,t){if(Hc(t?.region))return t.region;let n=jw(Aw(e));if(n)return n;let r=process.env.VERCEL_REGION;return Hc(r)?r:`iad1`}function Nw(e){let t={};return`runId`in e&&typeof e.runId==`string`&&(t[`x-vercel-workflow-run-id`]=e.runId),`stepId`in e&&typeof e.stepId==`string`&&(t[`x-vercel-workflow-step-id`]=e.stepId),Object.keys(t).length>0?t:void 0}const Pw=/^__([a-z][a-z0-9]*_)?wkf_workflow_/;let Fw=!1;function Iw(){return process.env.WORKFLOW_SEQUENTIAL_REPLAYS===`1`}function Lw(e,t){return!Iw()||!Pw.test(e)?e:(Fw||(Fw=!0,console.warn(`[workflow] WORKFLOW_SEQUENTIAL_REPLAYS=1: routing flow messages to per-run queue topics`)),`__healthCheck`in t&&typeof t.correlationId==`string`?`${e}_${t.correlationId}`:`runId`in t&&typeof t.runId==`string`?`stepId`in t&&typeof t.stepId==`string`?`${e}_${t.runId}_${t.stepId}`:`${e}_${t.runId}`:e)}function Rw(e){let{baseUrl:t,usingProxy:n}=eh(e),r=nh(e,{usingProxy:n}),i=new Cw,a=new ww,o=new Tw,s={dispatcher:qp(e),transport:o,...n&&{resolveBaseUrl:()=>new URL(`${t}/queues-proxy`),token:e?.token},headers:Object.fromEntries(r.entries())},c=async(e,t,r)=>{let o=r?.deploymentId??process.env.VERCEL_DEPLOYMENT_ID;if(!o)throw Error(`${Sw(`Enqueuing a workflow message`)} Callers outside a deployment can instead pass an explicit deploymentId in options.`);let c=(r?.specVersion??5)>=3?i:a,l=Mw(t,r),u=new xw({...s,...n&&{headers:{...s.headers,"x-vercel-queue-region":l}},region:l,deploymentId:o,transport:c}),d={payload:t,queueName:e,deploymentId:r?.deploymentId},f=Lw(e,t).replace(/[^A-Za-z0-9-_]/g,`-`);try{let{messageId:e}=await u.send(f,d,{idempotencyKey:r?.idempotencyKey,delaySeconds:r?.delaySeconds,headers:{...Nw(t),...r?.headers}});return{messageId:e?ka.parse(e):null}}catch(e){if(e instanceof DS)return{messageId:ka.parse(`msg_duplicate_${e.idempotencyKey??r?.idempotencyKey??`unknown`}`)};throw e}};return{queue:c,createQueueHandler:(e,t)=>{let n=new xw(s).handleCallback(async(e,n)=>{if(!e||!n)return;let r=Ew.getStore(),{payload:i,queueName:a,deploymentId:o}=Dw.parse(e),s=await t(i,{queueName:a,messageId:ka.parse(n.messageId),attempt:n.deliveryCount,requestId:r});if(typeof s?.timeoutSeconds==`number`){let e=s.timeoutSeconds>0?Math.min(s.timeoutSeconds,Ow):void 0;await c(a,i,{deploymentId:o,delaySeconds:e})}},{retry:(e,{messageId:t,deliveryCount:n})=>{let r=kw(n);return console.error(`[workflow] Queue handler failed for message "${t}" on delivery attempt ${n}; retrying in ${r}s:`,e),{afterSeconds:r}}});return async e=>{let t=e.headers.get(`x-vercel-id`)?.trim()||void 0;return Ew.run(t,()=>n(e))}},getDeploymentId:async()=>{let e=process.env.VERCEL_DEPLOYMENT_ID;if(!e)throw Error(Sw(`Starting a workflow run`));return e},isDeploymentUnavailableError:e=>e instanceof OS}}const zw=dc({id:qt()});function Bw(e){return async function(){let t=process.env.VERCEL_DEPLOYMENT_ID;if(!t)throw Error(Sw(`Resolving the latest deployment for deploymentId: 'latest'`));let n=await Vm(e);if(!n)throw Error(`Cannot resolve latest deployment: no OIDC token or VERCEL_TOKEN available`);let r=await(await Wm({method:`GET`,url:`https://api.vercel.com/v1/workflow/resolve-latest-deployment/${encodeURIComponent(t)}`,headers:new Headers({Authorization:`Bearer ${n}`}),dispatcher:qp(e),peerService:`vercel-api`,timeoutMs:null,buildError:async e=>{let n;try{n=await e.text()}catch{n=`<unable to read response body>`}return Error(`Failed to resolve latest deployment for ${t}: HTTP ${e.status} ${e.statusText}${n?` — ${n}`:``}`)}})).json(),i=zw.safeParse(r);if(!i.success)throw Error(`Invalid response from Vercel API: expected { id: string }. Zod error: ${i.error.message}`);return i.data.id}}function Vw(e){let t=ht.safeParse(e);return t.success?t.data:(Vt.safeParse(e.eventType).success&&console.debug(`[workflow:world-vercel] v4 event ${e.eventId} failed EventSchema parse for known eventType '${e.eventType}'; passing through unparsed: ${t.error.message}`),e)}const Hw={run_created:{retryable:!0,reason:`conditional create → 409 if exists`},step_created:{retryable:!0,reason:`conditional create → 409 if exists`},wait_created:{retryable:!0,reason:`conditional create → 409 if exists`},hook_created:{retryable:!0,reason:`transactional token uniqueness → 409 if exists`},run_started:{retryable:!0,reason:`early-returns if already running, no duplicate row`},run_completed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},run_failed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},run_cancelled:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},step_completed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},step_failed:{retryable:!0,reason:`terminal-state guard → 409, no duplicate row`},wait_completed:{retryable:!0,reason:`waiting-state guard → 409, no duplicate row`},hook_disposed:{retryable:!0,reason:`conditional delete (exists) → 409, no duplicate row`},attr_set:{retryable:!0,reason:`correlationId constraint reuses eventId (idempotent replay)`},step_started:{retryable:!1,reason:`unconditional attempt increment → a retry double-counts attempts`},step_retrying:{retryable:!1,reason:`no duplicate guard → a retry appends a second event row`},hook_received:{retryable:!1,reason:`no server guard → a retry duplicates the row / re-delivers payload. EXCEPTION: the atomic lazy-resume shape (resumeId + digest) is deduplicated server-side by the (runId, resumeId) claim, so those writes opt in via withEventPostRetry({ idempotentHookResume })`},hook_conflict:{retryable:!1,reason:`server-originated; never POSTed by the SDK`}},Uw=new Set([`ECONNRESET`,`ECONNREFUSED`,`ENOTFOUND`,`ENETDOWN`,`ENETUNREACH`,`EHOSTDOWN`,`EHOSTUNREACH`,`EPIPE`,`ETIMEDOUT`,`UND_ERR_SOCKET`,`UND_ERR_REQ_RETRY`,`UND_ERR_CONNECT_TIMEOUT`,`UND_ERR_HEADERS_TIMEOUT`,`UND_ERR_BODY_TIMEOUT`,`TimeoutError`,`RequestRetryError`]);function Ww(e,t=0){if(t>5||typeof e!=`object`||!e)return[];let n=[],r=e;return typeof r.code==`string`&&n.push(r.code),typeof r.name==`string`&&n.push(r.name),r.cause&&n.push(...Ww(r.cause,t+1)),n}function Gw(e){if(f.is(e)||l.is(e)||s.is(e)||u.is(e))return!1;if(o.is(e)){if(e.code===`PARSE_ERROR`)return!0;if(typeof e.status==`number`)return e.status>=500&&e.status<=599}return Ww(e).some(e=>Uw.has(e))}const Kw=e=>new Promise(t=>setTimeout(t,e)),qw=typeof process<`u`&&typeof process.env.DEBUG==`string`&&(process.env.DEBUG.includes(`workflow:`)||process.env.DEBUG===`*`);function Jw(e,t){if(!qw)return;let n=Object.entries(t).map(([e,t])=>`${e}=${t}`).join(` `);console.debug(`[workflow:world-vercel:event-retry] ${e} ${n}`)}function Yw(e){return o.is(e)?e.code??(e.status==null?e.name:`status_${e.status}`):Ww(e)[0]??(e instanceof Error?e.name:`unknown`)}async function Xw(e,t,n){let r=t===`hook_received`&&n?.idempotentHookResume===!0||(Hw[t]?.retryable??!1);for(let n=0;;n++)try{return await e()}catch(e){let i=r&&Gw(e);if(i&&n<2){let r=100*2**n+Math.floor(Math.random()*50);Jw(`retrying event POST after transient failure`,{eventType:t,attempt:n+1,backoffMs:r,error:Yw(e)}),await Kw(r);continue}throw i&&Jw(`exhausted in-process retries; surfacing for queue redelivery`,{eventType:t,attempts:n+1,error:Yw(e)}),e}}const Zw=`application/vnd.workflow.v4-frames`;function Qw(e,t){let n=new Uint8Array(bp(e)),r=new Uint8Array(4+n.byteLength+4+t.byteLength),i=new DataView(r.buffer);return i.setUint32(0,n.byteLength,!1),r.set(n,4),i.setUint32(4+n.byteLength,t.byteLength,!1),r.set(t,4+n.byteLength+4),r}async function*$w(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():tT(e.getReader()),n=new Uint8Array,r=async e=>{for(;n.byteLength<e;){let{done:e,value:r}=await t.next();if(e)return!1;if(!r||r.byteLength===0)continue;let i=new Uint8Array(n.byteLength+r.byteLength);i.set(n,0),i.set(r,n.byteLength),n=i}return!0},i=e=>{let t=n.subarray(0,e);return n=n.subarray(e),t};try{for(;;){if(!await r(4))return;let e=new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(i(4),!await r(e))throw Error(`decodeFrames: truncated meta block`);let t=qf(i(e));if(!await r(4))throw Error(`decodeFrames: truncated body length`);let a=new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(i(4),a>0&&!await r(a))throw Error(`decodeFrames: truncated body bytes`);if(yield{meta:t,body:n.slice(0,a)},i(a),t._end===1)return}}finally{eT(()=>t.return?.())}}function eT(e){try{Promise.resolve(e()).catch(()=>{})}catch{}}async function*tT(e){try{for(;;){let{done:t,value:n}=await e.read();if(t)return;n&&(yield n)}}finally{eT(()=>e.cancel())}}async function nT(e,t,n,r){return Wm({method:t.method,url:e,headers:t.headers,body:t.body,dispatcher:Jp(n),timeoutMs:null,logLabel:r,buildError:async t=>oT(t.status,rT(t.headers),await t.text(),r,e)})}function rT(e){let t={};return e.forEach((e,n)=>{t[n]=e}),t}const iT={eventId:`x-wf-event-id`,runId:`x-wf-run-id`,createdAt:`x-wf-created-at`,maxEvents:`x-wf-max-events`};function aT(e){let t={eventType:e.eventType,specVersion:e.specVersion};return e.correlationId!==void 0&&(t.correlationId=e.correlationId),e.vercelId!==void 0&&(t.vercelId=e.vercelId),e.computeInstanceId!==void 0&&(t.computeInstanceId=e.computeInstanceId),e.occurredAt!==void 0&&(t.occurredAt=e.occurredAt),e.remoteRefBehavior!==void 0&&(t.remoteRefBehavior=e.remoteRefBehavior),e.deploymentId!==void 0&&(t.deploymentId=e.deploymentId),e.workflowName!==void 0&&(t.workflowName=e.workflowName),e.stepName!==void 0&&(t.stepName=e.stepName),e.attempt!==void 0&&(t.attempt=e.attempt),e.resumeAt!==void 0&&(t.resumeAt=e.resumeAt),e.retryAfter!==void 0&&(t.retryAfter=e.retryAfter),e.hookToken!==void 0&&(t.hookToken=e.hookToken),e.hookTokenRetentionUntil!==void 0&&(t.hookTokenRetentionUntil=e.hookTokenRetentionUntil),e.hookIsWebhook!==void 0&&(t.hookIsWebhook=e.hookIsWebhook),e.hookIsSystem!==void 0&&(t.hookIsSystem=e.hookIsSystem),e.resumeId!==void 0&&(t.resumeId=e.resumeId),e.errorCode!==void 0&&(t.errorCode=e.errorCode),e.cancelReason!==void 0&&(t.cancelReason=e.cancelReason),e.ownerMessageId!==void 0&&(t.ownerMessageId=e.ownerMessageId),e.executionContext!==void 0&&(t.executionContext=e.executionContext),e.attributes!==void 0&&(t.attributes=e.attributes),e.changes!==void 0&&(t.changes=e.changes),e.writer!==void 0&&(t.writer=e.writer),e.allowReservedAttributes!==void 0&&(t.allowReservedAttributes=e.allowReservedAttributes),e.encryptionPublicKey!==void 0&&(t.encryptionPublicKey=e.encryptionPublicKey),e.ttfs!==void 0&&(t.ttfs=e.ttfs),e.stso!==void 0&&(t.stso=e.stso),e.stepCount!==void 0&&(t.stepCount=e.stepCount),e.eventCount!==void 0&&(t.eventCount=e.eventCount),e.rsfs!==void 0&&(t.rsfs=e.rsfs),e.finalSchedulingReplay!==void 0&&(t.finalSchedulingReplay=e.finalSchedulingReplay),e.optimizations!==void 0&&(t.optimizations=e.optimizations),e.sinceCursor!==void 0&&(t.sinceCursor=e.sinceCursor),e.skipPreload!==void 0&&(t.skipPreload=e.skipPreload),e.stateUpdatedAt!==void 0&&(t.stateUpdatedAt=e.stateUpdatedAt),e.stateEventCount!==void 0&&(t.stateEventCount=e.stateEventCount),e.stateCursor!==void 0&&(t.stateCursor=e.stateCursor),e.replayDivergenceCount!==void 0&&(t.replayDivergenceCount=e.replayDivergenceCount),e.resumePayloadDigest!==void 0&&(t.resumePayloadDigest=e.resumePayloadDigest),t}function oT(e,t,n,r,i){let a=`v4 ${r} failed: HTTP ${e}`,o,s;try{let t=JSON.parse(n);typeof t.message==`string`&&(a=t.message),typeof t.code==`string`&&(o=t.code),e===412&&(s=sT(t))}catch{n&&(a+=` ${n}`)}let c=Rm(fT(t,`retry-after`));return zm(e,a,{retryAfter:c,code:o,url:i,mitigated:fT(t,`x-vercel-mitigated`),...s===void 0?{}:{details:s}})}function sT(e){if(!Array.isArray(e.events)||e.events.length===0)return;let t=[];for(let n of e.events){if(typeof n!=`object`||!n)return;let e=n;if(typeof e.eventId!=`string`||cT(e))return;t.push(Vw(e))}return{events:t,...typeof e.cursor==`string`?{cursor:e.cursor}:{}}}function cT(e){let t=e.eventType;if(typeof t!=`string`)return!1;let n=zn(t);if(!n)return!1;let r=e.eventData;if(typeof r!=`object`||!r)return!1;let i=r[n];return i!==void 0&&!(i instanceof Uint8Array)}async function lT(e,t){let{baseUrl:n,headers:r}=await rh(t),i=new Headers(r);i.set(`Content-Type`,`application/octet-stream`);let a=Qw(aT(e),e.payload??new Uint8Array);return uT(await nT(`${n}/v4/runs/${encodeURIComponent(e.runId)}/events/${encodeURIComponent(e.eventType)}`,{method:`POST`,headers:i,body:a},t,`createEvent`))}async function uT(e){let t=e.headers.get(iT.eventId),n=e.headers.get(iT.runId),r=e.headers.get(iT.createdAt);if(typeof t!=`string`||typeof n!=`string`||typeof r!=`string`)throw Error(`v4 createEvent: response missing required x-wf-* headers`);let i=new Uint8Array(await e.arrayBuffer());return{eventId:t,runId:n,createdAt:r,body:i.byteLength>0?qf(i):{}}}async function dT(e,t){let{baseUrl:n,headers:r}=await rh(t),i=new Headers(r);i.set(`Content-Type`,`application/octet-stream`),i.set(`Accept`,Zw);let a=Qw(aT(e),e.payload??new Uint8Array),o=await nT(`${n}/v4/runs/${encodeURIComponent(e.runId)}/events/${encodeURIComponent(e.eventType)}`,{method:`POST`,headers:i,body:a},t,`createEvent`);if(!o.headers.get(`content-type`)?.startsWith(`application/vnd.workflow.v4-frames`))return{kind:`materialized`,result:await uT(o)};let s=await hT(o,`createEvent`),c=o.headers.get(iT.maxEvents),l=c===null?NaN:Number(c);return{kind:`stream`,...s,canonicalEventId:o.headers.get(iT.eventId)??void 0,maxEvents:Number.isInteger(l)&&l>0?l:void 0}}function fT(e,t){let n=e[t];if(typeof n==`string`)return n;if(Array.isArray(n)&&n.length>0)return n[0]}async function pT(e,t,n){let{baseUrl:r,headers:i}=await rh(n),a=await nT(`${r}/v4/runs/${encodeURIComponent(e)}/events/${encodeURIComponent(t)}`,{method:`GET`,headers:i},n,`getEvent`),o=a.headers.get(`content-type`);if(!o?.startsWith(`application/vnd.workflow.v4-frames`))throw Error(`v4 getEvent: expected ${Zw}, got ${o??`(none)`}`);let s=a.body;for await(let e of $w(s))return{event:e.meta,body:e.body};throw Error(`v4 getEvent: empty frame stream for ${t}`)}async function mT(e,t,n,r){return hT(await nT(e,{method:`GET`,headers:t},n,r),r)}async function hT(e,t){let n=e.headers.get(`content-type`);if(!n?.startsWith(`application/vnd.workflow.v4-frames`))throw Error(`v4 ${t}: expected ${Zw}, got ${n??`(none)`}`);let r=e.body,i=[],a,o,s=!1;for await(let e of $w(r)){if(e.meta._end===1){typeof e.meta.next==`string`&&(a=e.meta.next),typeof e.meta.hasMore==`boolean`&&(o=e.meta.hasMore),s=!0;break}i.push({event:e.meta,body:e.body})}if(!s)throw Error(`v4 ${t}: frame stream ended without the end-of-stream sentinel (${i.length} events read) — truncated response?`);return{events:i,...a?{next:a}:{},...o===void 0?{}:{hasMore:o}}}function gT(e,t){t.cursor&&e.set(`cursor`,t.cursor),t.limit!==void 0&&e.set(`limit`,String(t.limit)),t.sortOrder&&e.set(`sortOrder`,t.sortOrder),t.remoteRefBehavior&&e.set(`remoteRefBehavior`,t.remoteRefBehavior)}function _T(e){let t=new URLSearchParams;gT(t,e);let n=t.toString();return n?`?${n}`:``}async function vT(e,t={},n){let{baseUrl:r,headers:i}=await rh(n);return mT(`${r}/v4/runs/${encodeURIComponent(e)}/events`+_T(t),i,n,`listEvents`)}async function yT(e,t,n={},r){let{baseUrl:i,headers:a}=await rh(r),o=new URLSearchParams;return o.set(`correlationId`,e),o.set(`runId`,t),gT(o,n),mT(`${i}/v4/events?${o.toString()}`,a,r,`listEventsByCorrelationId`)}const bT=`gzip`,xT=`zstd`,ST=new TextDecoder,CT=new Set([`devl`,`encr`,bT,xT]);function wT(){try{return globalThis.process?.getBuiltinModule?.(`node:zlib`)}catch{return}}function TT(e){return!(e instanceof Uint8Array)||e.byteLength<4?null:ST.decode(e.subarray(0,4))}function ET(e){let t=TT(e);return t!==null&&CT.has(t)}function DT(e,t){let n=wT(),r=e===xT?n?.zstdDecompressSync:n?.gunzipSync;if(!r)throw new o(`Received ${e}-compressed workflow data, but this Node.js runtime does not support ${e} decompression. Use a compatible Node.js runtime or request unresolved data.`);return new Uint8Array(r(t))}function OT(e){let t=TT(e);return t!==xT&&t!==bT?e:DT(t,e.subarray(4))}function kT(e){return{...e,input:OT(e.input),output:OT(e.output),error:OT(e.error)}}function AT(e){return{...e,input:OT(e.input),output:OT(e.output),error:OT(e.error)}}function jT(e){return{...e,metadata:OT(e.metadata)}}function MT(e){let t=e.eventData;if(!t||typeof t!=`object`)return e;let n=Mc(typeof e.eventType==`string`?e.eventType:``);if(n.length===0)return e;let r={...t},i=!1;for(let e of n){if(!(e in r))continue;let t=r[e],n=OT(t);n!==t&&(r[e]=n,i=!0)}return i?{...e,eventData:r}:e}const NT=on.omit({error:!0,errorCode:!0}).extend({error:Zr([rs,cr()]).optional(),errorCode:qt().optional(),blobStorageBytes:we().optional(),streamStorageBytes:we().optional()}),PT=NT,FT=NT.omit({input:!0,output:!0}).extend({inputRef:cr().optional(),outputRef:cr().optional(),input:Zr([vc(Uint8Array),cr()]).optional(),output:Zr([vc(Uint8Array),cr()]).optional()});function IT(e,t){if(t===`none`){let{inputRef:t,outputRef:n,...r}=e;return{...kT(Zm(r)),input:void 0,output:void 0}}return kT(Zm(e))}async function LT(e={},t){let{workflowName:n,status:r,pagination:i,resolveData:a=`all`}=e,o=new URLSearchParams;n&&o.set(`workflowName`,n),r&&o.set(`status`,r),i?.limit&&o.set(`limit`,i.limit.toString()),i?.cursor&&o.set(`cursor`,i.cursor),i?.sortOrder&&o.set(`sortOrder`,i.sortOrder);let s=a===`none`?`lazy`:`resolve`;o.set(`remoteRefBehavior`,s);let c=o.toString(),l=await R({endpoint:`/v2/runs${c?`?${c}`:``}`,options:{method:`GET`},config:t,schema:zs(s===`lazy`?FT:PT)});return{...l,data:l.data.map(e=>IT(e,a))}}async function RT(e,t){return Zm(await R({endpoint:`/v1/runs/create`,options:{method:`POST`},data:e,config:t,schema:PT}))}async function zT(e,t,n){let r=t?.resolveData??`all`,i=r===`none`?`lazy`:`resolve`,s=new URLSearchParams;s.set(`remoteRefBehavior`,i);let c=s.toString(),l=`/v2/runs/${encodeURIComponent(e)}${c?`?${c}`:``}`;try{return IT(await R({endpoint:l,options:{method:`GET`},config:n,retryConnectTimeout:!0,schema:i===`lazy`?FT:PT}),r)}catch(t){throw t instanceof o&&t.status===404?new a(e):t}}async function BT(e,t,n){let r=[...new Set(e)],i=await Promise.all(r.map(async e=>{try{return await zT(e,t,n)}catch(e){if(e instanceof a)return null;throw e}})),o=new Map(r.map((e,t)=>[e,i[t]]));return e.map(e=>o.get(e)??null)}async function VT(e,t,n){let r=t?.resolveData??`all`,i=r===`none`?`lazy`:`resolve`,s=new URLSearchParams;s.set(`remoteRefBehavior`,i);let c=s.toString(),l=`/v1/runs/${encodeURIComponent(e)}/cancel${c?`?${c}`:``}`;try{return IT(await R({endpoint:l,options:{method:`PUT`},config:n,schema:i===`lazy`?FT:PT}),r)}catch(t){throw t instanceof o&&t.status===404?new a(e):t}}async function HT(e,t){let{runIds:n,cancelReason:r}=qa.parse(e),i=await R({endpoint:`/v4/runs/cancel`,options:{method:`POST`},data:r===void 0?{runIds:n}:{runIds:n,cancelReason:r},config:t,schema:Xt}),a=new Map(i.results.map(e=>[e.runId,e]));if(!(a.size===i.results.length&&i.results.length===n.length&&n.every(e=>a.has(e))))throw new o(`Bulk cancel response did not contain exactly one result per requested run ID (requested ${n.length}, received ${i.results.length}).`);let s=n.map(e=>a.get(e));return{summary:i.summary,results:s}}const UT=dc({attributes:nn(qt(),qt())});async function WT(e,t,n,r){try{return{attributes:(await R({endpoint:`/v2/runs/${encodeURIComponent(e)}/attributes`,options:{method:`POST`},data:n?.allowReservedAttributes?{changes:t,allowReservedAttributes:!0}:{changes:t},config:r,schema:UT})).attributes}}catch(t){throw t instanceof o&&t.status===404?new a(e):t}}const GT=no.omit({error:!0}).extend({error:Zr([rs,cr()]).optional(),errorRef:cr().optional()}),KT=GT.omit({input:!0,output:!0}).extend({inputRef:cr().optional(),outputRef:cr().optional(),input:vc(Uint8Array).optional(),output:vc(Uint8Array).optional()});function qT(e){let{error:t,errorRef:n,...r}=e,i={...r},a=t??n;return a!=null&&(i.error=a),i}function JT(e,t){if(t===`none`){let{inputRef:t,outputRef:n,...r}=e;return{...AT(qT(r)),input:void 0,output:void 0}}return AT(qT(e))}async function YT(e,t){let{runId:n,pagination:r,resolveData:i=`all`}=e,a=new URLSearchParams;r?.cursor&&a.set(`cursor`,r.cursor),r?.limit&&a.set(`limit`,r.limit.toString()),r?.sortOrder&&a.set(`sortOrder`,r.sortOrder);let o=i===`none`?`lazy`:`resolve`;a.set(`remoteRefBehavior`,o);let s=a.toString(),c=await R({endpoint:`/v2/runs/${encodeURIComponent(n)}/steps${s?`?${s}`:``}`,options:{method:`GET`},config:t,schema:zs(o===`lazy`?KT:GT)});return{...c,data:c.data.map(e=>JT(e,i))}}async function XT(e,t,n,r){let i=n?.resolveData??`all`,a=i===`none`?`lazy`:`resolve`,o=new URLSearchParams;o.set(`remoteRefBehavior`,a);let s=o.toString();return JT(await R({endpoint:`/v2/runs/${encodeURIComponent(e)}/steps/${encodeURIComponent(t)}${s?`?${s}`:``}`,options:{method:`GET`},config:r,schema:a===`lazy`?KT:GT}),i)}function ZT(e){let t=e.startsWith(`wrun_`)?e.slice(5):e;try{return fs(`wrun_${Jc(t).ulid}`,`wrun_`)}catch{return fs(e,`wrun_`)}}const QT=new Set([`run_created`,`run_started`,`step_started`]),$T=new Set([`run_failed`,`step_failed`,`step_retrying`]);function eE(e){let t=e.eventData??{},n=zn(e.eventType),r={};if(typeof t.deploymentId==`string`&&(r.deploymentId=t.deploymentId),typeof t.workflowName==`string`&&(r.workflowName=t.workflowName),typeof t.stepName==`string`&&(r.stepName=t.stepName),typeof t.attempt==`number`&&(r.attempt=t.attempt),t.resumeAt instanceof Date)r.resumeAt=t.resumeAt;else if(typeof t.resumeAt==`string`){let e=new Date(t.resumeAt);Number.isNaN(e.getTime())||(r.resumeAt=e)}if(t.retryAfter instanceof Date)r.retryAfter=t.retryAfter;else if(typeof t.retryAfter==`string`){let e=new Date(t.retryAfter);Number.isNaN(e.getTime())||(r.retryAfter=e)}typeof t.token==`string`&&(r.hookToken=t.token),t.tokenRetentionUntil instanceof Date&&(r.hookTokenRetentionUntil=t.tokenRetentionUntil),typeof t.isWebhook==`boolean`&&(r.hookIsWebhook=t.isWebhook),typeof t.isSystem==`boolean`&&(r.hookIsSystem=t.isSystem),typeof t.errorCode==`string`&&(r.errorCode=t.errorCode),typeof t.cancelReason==`string`&&(r.cancelReason=t.cancelReason),typeof t.ownerMessageId==`string`&&(r.ownerMessageId=t.ownerMessageId),t.executionContext!==void 0&&t.executionContext!==null&&typeof t.executionContext==`object`&&(r.executionContext=t.executionContext),t.attributes!==void 0&&t.attributes!==null&&typeof t.attributes==`object`&&(r.attributes=t.attributes),Array.isArray(t.changes)&&(r.changes=t.changes),t.writer!==void 0&&t.writer!==null&&typeof t.writer==`object`&&(r.writer=t.writer),typeof t.allowReservedAttributes==`boolean`&&(r.allowReservedAttributes=t.allowReservedAttributes),typeof t.encryptionPublicKey==`string`&&(r.encryptionPublicKey=t.encryptionPublicKey),typeof t.ttfs==`number`&&(r.ttfs=t.ttfs),typeof t.stso==`number`&&(r.stso=t.stso),typeof t.stepCount==`number`&&Number.isSafeInteger(t.stepCount)&&t.stepCount>0&&(r.stepCount=t.stepCount),typeof t.eventCount==`number`&&Number.isSafeInteger(t.eventCount)&&t.eventCount>0&&(r.eventCount=t.eventCount),typeof t.rsfs==`number`&&(r.rsfs=t.rsfs),typeof t.finalSchedulingReplay==`number`&&(r.finalSchedulingReplay=t.finalSchedulingReplay),Array.isArray(t.optimizations)&&t.optimizations.every(e=>typeof e==`string`)&&(r.optimizations=t.optimizations);let i;if(n&&n in t){let r=t[n];if(r!==void 0){if(!(r instanceof Uint8Array))throw TypeError(`world-vercel v4: eventData.${n} for ${e.eventType} must be a Uint8Array (the runtime's dehydrated wire form); got ${typeof r==`object`?r===null?`null`:r.constructor?.name??typeof r:typeof r}.`);i=r}}return{payload:i,meta:r}}function tE(e){return Vw(MT(e))}function nE(e){if(ET(e))return e;try{let t=qi.safeParse(qf(e.slice()));return t.success?t.data:e}catch{return e}}function rE(e,t,n){let r=e.eventData??{};if(t.byteLength>0){let n=zn(e.eventType),i=OT(t);n&&i instanceof Uint8Array&&(r[n]=$T.has(e.eventType)?nE(i):i)}let i=tE({eventId:e.eventId,runId:e.runId,eventType:e.eventType,createdAt:e.createdAt instanceof Date?e.createdAt:new Date(e.createdAt),...e.occurredAt===void 0?{}:{occurredAt:e.occurredAt instanceof Date?e.occurredAt:new Date(e.occurredAt)},...e.correlationId?{correlationId:e.correlationId}:{},eventData:r,...e.specVersion===void 0?{}:{specVersion:e.specVersion},...e.resumeId?{resumeId:e.resumeId}:{}});return n===`none`?Mt(i,`none`):i}async function iE(e,t,n,r){let i=n?.resolveData??`all`,{event:a,body:o}=await pT(e,t,r);return rE(a,o,i)}async function aE(e,t){let{pagination:n,resolveData:r=`all`}=e,i={cursor:n?.cursor??void 0,limit:n?.limit,sortOrder:n?.sortOrder,remoteRefBehavior:r===`none`?`lazy`:`resolve`},a=await(`correlationId`in e?yT(e.correlationId,e.runId,i,t):vT(e.runId,i,t)),o=a.events.map(e=>rE(e.event,e.body,r));return{data:`correlationId`in e?o.filter(t=>t.runId===e.runId):o,cursor:a.next??null,hasMore:typeof a.hasMore==`boolean`?a.hasMore:!!a.next}}async function oE(e,t,n,r){try{return await Xw(()=>sE(e,t,n,r),t.eventType,{idempotentHookResume:t.eventType===`hook_received`&&n?.resumeId!==void 0&&n?.resumePayloadDigest!==void 0})}catch(e){throw xr(t.eventType)&&o.is(e)&&e.status===404&&t.correlationId?new d(t.correlationId):e}}async function sE(e,t,n,r){if(n?.v1Compat){if(t.eventType===`run_cancelled`&&e)return{run:await VT(e,n,r)};if(t.eventType===`run_created`)return{run:await RT(t.eventData,r)};if(e===null)throw new o(`world-vercel: v1Compat=true requires a runId for ${t.eventType}`,{status:400});return{event:await R({endpoint:`/v1/runs/${encodeURIComponent(e)}/events`,options:{method:`POST`},data:t,config:r,schema:ht})}}if(e===null)throw new o(`world-vercel v4: createWorkflowRunEvent requires a client-generated runId for run_created (the runId is part of the payload storage ref key). Generate a wrun_ ULID before calling.`,{status:400});if(t.eventType===`run_created`){let t=ZT(e);if(t)throw new o(t,{status:400})}let i=QT.has(t.eventType)?`resolve`:`lazy`,{payload:a,meta:s}=eE(t),c=n?.resolveData??`all`,l={runId:e,eventType:t.eventType,specVersion:t.specVersion??2,...t.correlationId?{correlationId:t.correlationId}:{},...n?.requestId?{vercelId:n.requestId}:{},...n?.computeInstanceId?{computeInstanceId:n.computeInstanceId}:{},...n?.stateUpdatedAt===void 0?{}:{stateUpdatedAt:n.stateUpdatedAt},...n?.stateEventCount===void 0?{}:{stateEventCount:n.stateEventCount},...n?.stateCursor?{stateCursor:n.stateCursor}:{},...n?.replayDivergenceCount===void 0?{}:{replayDivergenceCount:n.replayDivergenceCount},occurredAt:n?.occurredAt??new Date,...n?.sinceCursor?{sinceCursor:n.sinceCursor}:{},...n?.skipPreload?{skipPreload:!0}:{},...n?.resumeId?{resumeId:n.resumeId}:{},...n?.resumePayloadDigest?{resumePayloadDigest:n.resumePayloadDigest}:{},remoteRefBehavior:i,payload:a,...s};if(t.eventType===`hook_received`&&n?.preloadEvents===!0&&n.resumeId!==void 0&&n.resumePayloadDigest!==void 0){let e=await dT({...l,remoteRefBehavior:`lazy`},r);if(e.kind===`materialized`)return cE(e.result,c);let{canonicalEventId:t,maxEvents:n,next:i,hasMore:a}=e,o=e.events.map(e=>rE(e.event,e.body,`all`)),s=o.find(e=>e.eventId===t),u=lE(o);return{...s?{event:s}:{},...u?{run:u}:{},events:o,cursor:i??null,hasMore:a??!0,...n===void 0?{}:{maxEvents:n}}}return cE(await lT(l,r),c)}function cE(e,t){let n=e.body;return{event:n.event?Mt(Vw(n.event),t):void 0,run:n.run?Zm(n.run):void 0,step:n.step?qT(n.step):void 0,hook:n.hook,wait:n.wait,events:n.events?n.events.map(Vw):void 0,cursor:n.cursor??void 0,hasMore:n.hasMore,...n.stepCreated?{stepCreated:!0}:{},...typeof n.maxEvents==`number`?{maxEvents:n.maxEvents}:{}}}function lE(e){let t=e.find(e=>e.eventType===`run_created`),n=e.find(e=>e.eventType===`run_started`);if(!t||!n)return;let r=t.eventData.attributes??{},i=n.createdAt;for(let t of e)t.eventType===`attr_set`&&(r=ei(r,t.eventData.changes),i=t.createdAt);return{runId:t.runId,status:`running`,deploymentId:t.eventData.deploymentId,workflowName:t.eventData.workflowName,specVersion:t.specVersion,executionContext:t.eventData.executionContext,input:t.eventData.input,attributes:r,encryptionPublicKey:t.eventData.encryptionPublicKey,startedAt:n.createdAt,createdAt:t.createdAt,updatedAt:i}}function uE(e,t){if(t===`none`){let{metadataRef:t,...n}=e;return n}return jT(e)}const dE=qo.omit({metadata:!0}).extend({metadataRef:Gd.any().optional()});async function fE(e,t){let{runId:n,pagination:r,resolveData:i=`all`}=e,a=new URLSearchParams;r?.limit&&a.set(`limit`,r.limit.toString()),r?.cursor&&a.set(`cursor`,r.cursor),r?.sortOrder&&a.set(`sortOrder`,r.sortOrder);let o=i===`none`?`lazy`:`resolve`;a.set(`remoteRefBehavior`,o),n&&a.set(`runId`,n);let s=a.toString(),c=await R({endpoint:`/v2/hooks${s?`?${s}`:``}`,options:{method:`GET`},config:t,schema:zs(o===`lazy`?dE:qo)});return{...c,data:c.data.map(e=>uE(e,i))}}async function pE(e,t,n){let r=t?.resolveData||`all`;return uE(await R({endpoint:`/v2/hooks/${encodeURIComponent(e)}`,options:{method:`GET`},config:n,schema:qo}),r)}async function mE(e,t){try{return await R({endpoint:`/v2/hooks/by-token?token=${encodeURIComponent(e)}`,options:{method:`GET`},config:t,schema:qo})}catch(t){throw o.is(t)&&t.status===404?new d(e):t}}function hE(e){let t={runs:{get:((t,n)=>zT(t,n,e)),getMany:((t,n)=>BT(t,n,e)),list:(t=>LT(t,e)),experimentalSetAttributes:(t,n,r)=>WT(t,n,r,e),cancelMany:t=>HT(t,e)},steps:{get:((t,n,r)=>XT(t,n,r,e)),list:(t=>YT(t,e))},events:{create:(t,n,r)=>oE(t,n,r,e),get:(t,n,r)=>iE(t,n,r,e),list:t=>aE(t,e),listByCorrelationId:t=>aE(t,e)},hooks:{get:(t,n)=>pE(t,n,e),getByToken:t=>mE(t,e),list:t=>fE(t,e)}};return{runs:Ah(`world.runs`,t.runs),steps:Ah(`world.steps`,t.steps),events:Ah(`world.events`,t.events),hooks:Ah(`world.hooks`,t.hooks)}}const gE=()=>Vc(`WORKFLOW_MAX_CHUNKS_PER_REQUEST`,1e3,{integer:!0,min:1});function _E(e,t,n){return new URL(`${n.baseUrl}/v2/runs/${encodeURIComponent(t)}/stream/${encodeURIComponent(e)}`)}function vE(e,t,n){return new URL(`${n.baseUrl}/v3/runs/${encodeURIComponent(t)}/stream/${encodeURIComponent(e)}`)}function yE(e){return{...Em(e.runId),...Om(e.name),...km(e.operation),...typeof e.startIndex==`number`?Am(e.startIndex):{}}}function bE(e,t,n,r){let i=[`PUT ${t.origin}${t.pathname}`,...Pm(n.headers)];return Error(`Stream ${e} failed: HTTP ${n.status} (${i.join(`; `)}): ${r}`)}function xE(e){let t=new TextEncoder,n=[],r=0;for(let i of e){let e=typeof i==`string`?t.encode(i):i;n.push(e),r+=4+e.length}let i=new Uint8Array(r),a=new DataView(i.buffer),o=0;for(let e of n)a.setUint32(o,e.length,!1),o+=4,i.set(e,o),o+=e.length;return i}const SE=dc({tailIndex:we(),done:ie()}),CE=dc({data:Be(dc({index:we(),data:vc(Uint8Array)})),cursor:qt().nullable(),hasMore:ie(),done:ie()});function wE(e){return{streams:{async write(t,n,r){let i=await t,a=await rh(e),o=_E(n,i,a);await(await Wm({method:`PUT`,url:o.toString(),body:r,headers:a.headers,dispatcher:Yp(e),timeoutMs:null,logLabel:o.pathname,spanName:`workflow.stream.write`,durationAttribute:`workflow.stream.write.chunk_rtt`,attributes:yE({runId:i,name:n,operation:`write`}),buildError:async e=>bE(`write`,o,e,await e.text())})).text()},async writeMulti(t,n,r){if(r.length===0)return;let i=await t,a=await rh(e);a.headers.set(`X-Stream-Multi`,`true`);let o=gE();for(let t=0;t<r.length;t+=o){let s=xE(r.slice(t,t+o)),c=_E(n,i,a);await(await Wm({method:`PUT`,url:c.toString(),body:s,headers:a.headers,dispatcher:Yp(e),timeoutMs:null,logLabel:c.pathname,spanName:`workflow.stream.write`,durationAttribute:`workflow.stream.write.chunk_rtt`,attributes:yE({runId:i,name:n,operation:`write_multi`}),buildError:async e=>bE(`write`,c,e,await e.text())})).text()}},async close(t,n){let r=await t,i=await rh(e);i.headers.set(`X-Stream-Done`,`true`);let a=_E(n,r,i);await(await Wm({method:`PUT`,url:a.toString(),headers:i.headers,dispatcher:Xp(e),timeoutMs:null,logLabel:a.pathname,spanName:`workflow.stream.write`,durationAttribute:`workflow.stream.write.chunk_rtt`,attributes:yE({runId:r,name:n,operation:`close`}),buildError:async e=>bE(`close`,a,e,await e.text())})).text()},async get(t,n,r){let i=await rh(e),a=vE(n,t,i);typeof r==`number`&&a.searchParams.set(`startIndex`,String(r));let o=await Wm({method:`GET`,url:a.toString(),headers:i.headers,dispatcher:void 0,timeoutMs:null,logLabel:a.pathname,spanName:`workflow.stream.read.connect`,attributes:yE({runId:t,name:n,operation:`read`,startIndex:r}),buildError:e=>Error(`Failed to fetch stream: ${e.status}`)});if(!o.body)throw Error(`No response body for stream`);return o.body},async getChunks(t,n,r){let i=new URLSearchParams;r?.limit!=null&&i.set(`limit`,String(r.limit)),r?.cursor&&i.set(`cursor`,r.cursor);let a=i.toString();return R({endpoint:`/v2/runs/${encodeURIComponent(t)}/streams/${encodeURIComponent(n)}/chunks${a?`?${a}`:``}`,config:e,schema:CE})},async getInfo(t,n){return R({endpoint:`/v2/runs/${encodeURIComponent(t)}/streams/${encodeURIComponent(n)}/info`,config:e,schema:SE})},async list(t){let n=await rh(e),r=new URL(`${n.baseUrl}/v2/runs/${encodeURIComponent(t)}/streams`);return await(await Wm({method:`GET`,url:r.toString(),headers:n.headers,dispatcher:void 0,timeoutMs:null,logLabel:r.pathname,buildError:e=>Error(`Failed to list streams: ${e.status}`)})).json()}}}}function TE(e){let t=e?.projectConfig?.projectId||process.env.VERCEL_PROJECT_ID;return{specVersion:5,capabilities:{preconditionGuard:!0,maxConcurrency:!0,deploymentAffinity:!0},processExitTriggersQueueRedelivery:!0,getRuntimeDeadline:xh,...Rw(e),...hE(e),analytics:process.env.WORKFLOW_DISABLE_ANALYTICS_READS===`1`?void 0:lh(e),...Ah(`world.streams`,wE(e)),createRunId:hh,describeRun:_h,getEnvironment:()=>th(e),getEncryptionKeyForRun:bh(t,e?.projectConfig?.teamId,e?.token,e?.dispatcher),resolveLatestDeploymentId:Bw(e)}}export{lh as createAnalytics,bh as createGetEncryptionKeyForRun,Rw as createQueue,hh as createRunId,hE as createStorage,wE as createStreamer,TE as createWorld,vh as deriveRunKey,_h as describeRun,yh as fetchRunKey,gh as regionForRunId};
|