@qitqode/qitqode-android-arm64 0.2.10 → 0.2.11
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/bundle/chunk-06j0gaen.js +2 -0
- package/bundle/{chunk-1r81q7m3.js → chunk-075gkea2.js} +1 -1
- package/bundle/{chunk-9fjcgdea.js → chunk-09n24ztn.js} +1 -1
- package/bundle/chunk-0bn86djg.js +3 -0
- package/bundle/chunk-0mm40z8g.js +2 -0
- package/bundle/{chunk-mn5cacf6.js → chunk-0tya4pqb.js} +2 -2
- package/bundle/{chunk-ff8q10gk.js → chunk-1dnvdeat.js} +2 -2
- package/bundle/{chunk-kcqeh1e5.js → chunk-1h9sc0gy.js} +1 -1
- package/bundle/chunk-1mqfhw0f.js +2 -0
- package/bundle/{chunk-gq3zb4wv.js → chunk-1p39y33b.js} +2 -2
- package/bundle/{chunk-tg1f56s3.js → chunk-1pd943m9.js} +1 -1
- package/bundle/{chunk-qbewhcsz.js → chunk-1rsabv4p.js} +1 -1
- package/bundle/{chunk-vsfj16v9.js → chunk-1tdy73ha.js} +2 -2
- package/bundle/{chunk-3zzrdpsx.js → chunk-1yh1f9yj.js} +1 -1
- package/bundle/{chunk-62y6zk9x.js → chunk-22wa8zty.js} +1 -1
- package/bundle/chunk-28kte9rt.js +2 -0
- package/bundle/chunk-2dhjehxe.js +2 -0
- package/bundle/{chunk-dz3kcsb6.js → chunk-2h8b0csf.js} +2 -2
- package/bundle/chunk-2nnfxbd2.js +2 -0
- package/bundle/{chunk-g08qj9z3.js → chunk-2ts74cgq.js} +2 -2
- package/bundle/{chunk-0mwzxqt5.js → chunk-2vsqsxe1.js} +3 -3
- package/bundle/chunk-2w5zmgpb.js +2 -0
- package/bundle/{chunk-6wjdhvdf.js → chunk-32x2901e.js} +1 -1
- package/bundle/chunk-34qt3fqj.js +2 -0
- package/bundle/{chunk-by1kwg4r.js → chunk-3amgvg81.js} +2 -2
- package/bundle/{chunk-ge7csm6m.js → chunk-3hawwbw6.js} +2 -2
- package/bundle/chunk-3p0xvt47.js +2 -0
- package/bundle/chunk-3pzx5ret.js +2 -0
- package/bundle/{chunk-f6vy70p6.js → chunk-3tf7xfw5.js} +2 -2
- package/bundle/chunk-3y4rmqmm.js +2 -0
- package/bundle/{chunk-q0xgxygw.js → chunk-42gd2vx4.js} +1 -1
- package/bundle/{chunk-8rkszwxq.js → chunk-43eqr0ds.js} +6 -6
- package/bundle/{chunk-d1xfv4d3.js → chunk-43x9n8rp.js} +1 -1
- package/bundle/{chunk-kk850sdw.js → chunk-44685nzw.js} +2 -2
- package/bundle/{chunk-z023h7t8.js → chunk-46ewdxgh.js} +1 -1
- package/bundle/{chunk-v8bxj01h.js → chunk-4805mxf7.js} +1 -1
- package/bundle/chunk-486874bd.js +2 -0
- package/bundle/{chunk-0tkznq75.js → chunk-48y4n9ne.js} +1 -1
- package/bundle/{chunk-56yp5v0w.js → chunk-49brdmgp.js} +1 -1
- package/bundle/{chunk-ngyv4fhn.js → chunk-49we3vy1.js} +2 -2
- package/bundle/chunk-4bcbvfsw.js +2 -0
- package/bundle/{chunk-d0dsgxk4.js → chunk-4c6d1wy1.js} +2 -2
- package/bundle/{chunk-9tz18e54.js → chunk-4d9s7cgr.js} +1 -1
- package/bundle/{chunk-kec1xw1n.js → chunk-4ngvj758.js} +1 -1
- package/bundle/{chunk-pwsajn96.js → chunk-4q14whpc.js} +1 -1
- package/bundle/chunk-4t1ysdag.js +2 -0
- package/bundle/{chunk-nh4zk07t.js → chunk-50knjq36.js} +1 -1
- package/bundle/{chunk-9zy5tsry.js → chunk-51vn4f06.js} +3 -3
- package/bundle/{chunk-5fcyb122.js → chunk-5mgmq6yz.js} +1 -1
- package/bundle/chunk-5q7a4h2w.js +2 -0
- package/bundle/{chunk-dx7rexx3.js → chunk-5qydhr42.js} +3 -3
- package/bundle/{chunk-je8fcsa9.js → chunk-611wfdn3.js} +1 -1
- package/bundle/{chunk-9pj10pgd.js → chunk-63t0rhc9.js} +2 -2
- package/bundle/chunk-63vamhf7.js +2 -0
- package/bundle/chunk-6hhv3n7c.js +2 -0
- package/bundle/{chunk-gbkz04ke.js → chunk-6p848y99.js} +1 -1
- package/bundle/{chunk-tjfer79w.js → chunk-6xx66mr1.js} +1 -1
- package/bundle/{chunk-mmqyter3.js → chunk-71h3pmnn.js} +1 -1
- package/bundle/{chunk-yzd6cyep.js → chunk-78e76m4h.js} +1 -1
- package/bundle/{chunk-z0m1qm7j.js → chunk-78yvbv9b.js} +2 -2
- package/bundle/chunk-7a9kfb2n.js +2 -0
- package/bundle/{chunk-eme9xmh3.js → chunk-7b5vney6.js} +1 -1
- package/bundle/{chunk-yexzxx6f.js → chunk-7jvx29js.js} +1 -1
- package/bundle/{chunk-vy93mn7d.js → chunk-7wshaze9.js} +2 -2
- package/bundle/{chunk-q26s0wb5.js → chunk-7x4g7h04.js} +1 -1
- package/bundle/chunk-7x9m1smk.js +2 -0
- package/bundle/chunk-82mnr6sf.js +2 -0
- package/bundle/{chunk-mp1x10t5.js → chunk-84qx54nf.js} +2 -2
- package/bundle/{chunk-c1c8ch3g.js → chunk-88hmeyf5.js} +8 -8
- package/bundle/{chunk-vk35g121.js → chunk-89b6ttzs.js} +2 -2
- package/bundle/chunk-8bea2r6p.js +2 -0
- package/bundle/{chunk-fvv1cret.js → chunk-8gn7r4kb.js} +1 -1
- package/bundle/chunk-8h6mhzhg.js +2 -0
- package/bundle/chunk-8n1cmvr7.js +2 -0
- package/bundle/{chunk-e10c0crf.js → chunk-8qbhnwej.js} +1 -1
- package/bundle/{chunk-at4dge22.js → chunk-8rbbt1s8.js} +1 -1
- package/bundle/{chunk-6gbdvz6p.js → chunk-8rc7cvex.js} +1 -1
- package/bundle/{chunk-cdenq7jb.js → chunk-8t17w67q.js} +1 -1
- package/bundle/{chunk-qq9yc2tp.js → chunk-8y03p2md.js} +2 -2
- package/bundle/{chunk-m01h6kk1.js → chunk-8z65v9c9.js} +1 -1
- package/bundle/{chunk-f17se3hh.js → chunk-92xxg12q.js} +1 -1
- package/bundle/chunk-955zj1y6.js +2 -0
- package/bundle/{chunk-vbb1jg02.js → chunk-95tec4gm.js} +1 -1
- package/bundle/chunk-95vp9bvk.js +2 -0
- package/bundle/{chunk-eqpep2m2.js → chunk-96nmxprr.js} +1 -1
- package/bundle/{chunk-9nf5650d.js → chunk-98z5pfvj.js} +1 -1
- package/bundle/{chunk-xcmbxny8.js → chunk-9d2mtevw.js} +1 -1
- package/bundle/{chunk-c3ey896z.js → chunk-9d8meavf.js} +1 -1
- package/bundle/{chunk-fsndgr9a.js → chunk-9gs4en9v.js} +1 -1
- package/bundle/{chunk-djfrkbd5.js → chunk-9svh74gt.js} +1 -1
- package/bundle/chunk-9wzxnwv7.js +2 -0
- package/bundle/chunk-9zve998d.js +2 -0
- package/bundle/{chunk-yspstxkq.js → chunk-a2pd7nt5.js} +1 -1
- package/bundle/{chunk-pky8h8rh.js → chunk-a4cmpa56.js} +1 -1
- package/bundle/chunk-a9bkr9x4.js +2 -0
- package/bundle/chunk-ac5vzpzt.js +2 -0
- package/bundle/{chunk-532fnfmw.js → chunk-ajgwyrcf.js} +2 -2
- package/bundle/{chunk-c8k32724.js → chunk-ajyfms68.js} +1 -1
- package/bundle/{chunk-q7s6z0nz.js → chunk-akrcbxfa.js} +1 -1
- package/bundle/{chunk-ajnzv5jt.js → chunk-aykvrqrp.js} +2 -2
- package/bundle/{chunk-rk21wv4k.js → chunk-b274mb6v.js} +1 -1
- package/bundle/{chunk-5p2r8bxx.js → chunk-b79bb2g3.js} +1 -1
- package/bundle/{chunk-8nnajdwf.js → chunk-bd66q24j.js} +3 -3
- package/bundle/{chunk-qdbx1qkr.js → chunk-bffm0wv9.js} +1 -1
- package/bundle/{chunk-se8d5xg9.js → chunk-bh1zbz62.js} +1 -1
- package/bundle/{chunk-f3y5kr76.js → chunk-bqqxvagz.js} +2 -2
- package/bundle/{chunk-h6z86aay.js → chunk-bw0951fs.js} +1 -1
- package/bundle/{chunk-8peby2d1.js → chunk-bwzbcwff.js} +1 -1
- package/bundle/{chunk-wh2qqhep.js → chunk-bxc3z38f.js} +2 -2
- package/bundle/{chunk-ztvkzex1.js → chunk-bzz2expb.js} +1 -1
- package/bundle/chunk-c1exgasy.js +2 -0
- package/bundle/{chunk-qm9fm5ja.js → chunk-c53ev0da.js} +2 -2
- package/bundle/{chunk-wd2xmkdp.js → chunk-c5n49vrd.js} +2 -2
- package/bundle/{chunk-m4j6t713.js → chunk-ccghr6pm.js} +1 -1
- package/bundle/{chunk-j7637cwg.js → chunk-cg7zeppb.js} +2 -2
- package/bundle/chunk-cgxzmkkf.js +2 -0
- package/bundle/{chunk-1m78yy4k.js → chunk-cm7yp259.js} +1 -1
- package/bundle/chunk-cs3cbfm8.js +2 -0
- package/bundle/{chunk-x308f9j4.js → chunk-cshsqavb.js} +2 -2
- package/bundle/{chunk-vbfc0wgv.js → chunk-csmdhh7r.js} +2 -2
- package/bundle/{chunk-8v60bqm0.js → chunk-cydpdkx7.js} +1 -1
- package/bundle/{chunk-f6btedtt.js → chunk-czfjmrrq.js} +1 -1
- package/bundle/{chunk-a70m6kyn.js → chunk-d1j8frtq.js} +1 -1
- package/bundle/chunk-d29te4c1.js +2 -0
- package/bundle/{chunk-snf6ahg7.js → chunk-d39e4fa8.js} +1 -1
- package/bundle/chunk-d6q42p18.js +2 -0
- package/bundle/{chunk-f0ab2f28.js → chunk-d6qs2pbx.js} +1 -1
- package/bundle/{chunk-0bhzhh7s.js → chunk-datctfgt.js} +2 -2
- package/bundle/chunk-dfbexagg.js +2 -0
- package/bundle/chunk-dfkcp43a.js +2 -0
- package/bundle/chunk-dps1p1g1.js +2 -0
- package/bundle/{chunk-9d0exvey.js → chunk-dzw0j790.js} +2 -2
- package/bundle/chunk-e1fzgez5.js +2 -0
- package/bundle/{chunk-141p12c4.js → chunk-e5cds19n.js} +1 -1
- package/bundle/{chunk-nqk8d62j.js → chunk-e6ckxkj8.js} +1 -1
- package/bundle/{chunk-v0hnn7nb.js → chunk-e7a50j2w.js} +1 -1
- package/bundle/chunk-e9vh8d52.js +8 -0
- package/bundle/{chunk-j5z95b6f.js → chunk-eftk07r3.js} +1 -1
- package/bundle/chunk-egcvm4x2.js +3 -0
- package/bundle/chunk-ek3b08ed.js +2 -0
- package/bundle/{chunk-s27cz24e.js → chunk-ep92grvg.js} +52 -52
- package/bundle/{chunk-dnjyepb2.js → chunk-ex47pb9n.js} +2 -2
- package/bundle/{chunk-b9f78x5g.js → chunk-eya9c81t.js} +1 -1
- package/bundle/chunk-f78yth0b.js +2 -0
- package/bundle/{chunk-gbnf7zf9.js → chunk-fd6qxjtf.js} +1 -1
- package/bundle/{chunk-c8080519.js → chunk-fnmq42y5.js} +1 -1
- package/bundle/{chunk-nnkfdhh9.js → chunk-fqvrxy41.js} +1 -1
- package/bundle/{chunk-3sj0jv91.js → chunk-fqvsxg00.js} +1 -1
- package/bundle/{chunk-5w7ebtcd.js → chunk-fsagyvkz.js} +1 -1
- package/bundle/{chunk-gb51fn3r.js → chunk-fzxqn4j0.js} +1 -1
- package/bundle/{chunk-p506eydh.js → chunk-g7jwp73v.js} +1 -1
- package/bundle/{chunk-xnxw5zz9.js → chunk-g83d3a0t.js} +2 -2
- package/bundle/chunk-gamnnfna.js +2 -0
- package/bundle/{chunk-dp6ms01y.js → chunk-gfer8ch3.js} +2 -2
- package/bundle/{chunk-c2ns2csn.js → chunk-ghdegwnr.js} +1 -1
- package/bundle/chunk-gjxhz1a6.js +2 -0
- package/bundle/chunk-gpm39v12.js +2 -0
- package/bundle/chunk-gr8emzzx.js +2 -0
- package/bundle/chunk-gt6h68pk.js +2 -0
- package/bundle/{chunk-e72jwbfc.js → chunk-gz8k40ty.js} +1 -1
- package/bundle/{chunk-xvvt886p.js → chunk-h6kmpgak.js} +2 -2
- package/bundle/{chunk-2y5bthrp.js → chunk-h8yf5e2e.js} +1 -1
- package/bundle/{chunk-v8rqgt7h.js → chunk-hama2v6a.js} +1 -1
- package/bundle/{chunk-7a3txs9f.js → chunk-hav9pgf3.js} +2 -2
- package/bundle/chunk-hj588j4f.js +2 -0
- package/bundle/{chunk-c9cngded.js → chunk-hntsg7q4.js} +1 -1
- package/bundle/chunk-hqtex91e.js +2 -0
- package/bundle/{chunk-0sfc21qe.js → chunk-hts68y73.js} +2 -2
- package/bundle/{chunk-kc8n5cgb.js → chunk-j5dnzqjy.js} +1 -1
- package/bundle/{chunk-r81w6skn.js → chunk-j7d3v0x2.js} +1 -1
- package/bundle/{chunk-4a9jqe5s.js → chunk-jcn8bg31.js} +1 -1
- package/bundle/{chunk-2dmcpqak.js → chunk-jf4zyy7r.js} +1 -1
- package/bundle/{chunk-h0pvxre5.js → chunk-jfe9f2wv.js} +1 -1
- package/bundle/{chunk-8gpjmj42.js → chunk-jh2za7y4.js} +3 -3
- package/bundle/chunk-jmgpr5th.js +2 -0
- package/bundle/chunk-jt79yt0t.js +2 -0
- package/bundle/{chunk-7rbg6mg9.js → chunk-jt7g0r2j.js} +2 -2
- package/bundle/chunk-jtz5re73.js +2 -0
- package/bundle/{chunk-81dvy370.js → chunk-k232ny9m.js} +1 -1
- package/bundle/{chunk-t9pq363q.js → chunk-k4ajben7.js} +2 -2
- package/bundle/chunk-k4bj677f.js +3 -0
- package/bundle/{chunk-brk1jca3.js → chunk-k4d8gwxe.js} +1 -1
- package/bundle/{chunk-zskdxbbh.js → chunk-k558fr15.js} +1 -1
- package/bundle/{chunk-eabbrt1p.js → chunk-k56zj08h.js} +1 -1
- package/bundle/{chunk-61t4g8bh.js → chunk-k5swnh8m.js} +4 -4
- package/bundle/{chunk-gksbv613.js → chunk-k8zbhj2p.js} +2 -2
- package/bundle/{chunk-c8yc8qcd.js → chunk-kr975sx0.js} +1 -1
- package/bundle/{chunk-qdafm7qg.js → chunk-krk24aqm.js} +2 -2
- package/bundle/{chunk-3mtjxmw1.js → chunk-kt982884.js} +1 -1
- package/bundle/chunk-kw5z5awx.js +2 -0
- package/bundle/{chunk-vjt6mh10.js → chunk-kxdw2vtq.js} +2 -2
- package/bundle/{chunk-rxnd79h7.js → chunk-m8phqgxp.js} +1 -1
- package/bundle/{chunk-psqtptrs.js → chunk-mazakqr7.js} +1 -1
- package/bundle/{chunk-cxtwavyf.js → chunk-mnxcykeq.js} +2 -2
- package/bundle/chunk-mp42gb6q.js +2 -0
- package/bundle/{chunk-yh1t6jrj.js → chunk-mp5m0acf.js} +1 -1
- package/bundle/chunk-mq0733qh.js +2 -0
- package/bundle/chunk-mrcsatmn.js +2 -0
- package/bundle/{chunk-qtyapmy7.js → chunk-n230jbn9.js} +1 -1
- package/bundle/chunk-n24yx79r.js +5 -0
- package/bundle/{chunk-acsqvgdw.js → chunk-n2ytaxyn.js} +1 -1
- package/bundle/{chunk-819qr675.js → chunk-n4fwztya.js} +1 -1
- package/bundle/{chunk-z69tt390.js → chunk-n5dxwryh.js} +1 -1
- package/bundle/{chunk-xv03hbgj.js → chunk-n9969djm.js} +1 -1
- package/bundle/{chunk-pxm0x3e0.js → chunk-ncvr75f6.js} +2 -2
- package/bundle/chunk-ng2g9kkk.js +2 -0
- package/bundle/chunk-ngfhfyjs.js +2 -0
- package/bundle/{chunk-mn0pshpv.js → chunk-nvvja3ch.js} +1 -1
- package/bundle/{chunk-6axm2qtj.js → chunk-nwkp2f8e.js} +1 -1
- package/bundle/{chunk-d9w2bn2e.js → chunk-nwygsfhk.js} +2 -2
- package/bundle/chunk-p0dnmrqp.js +2 -0
- package/bundle/{chunk-x0hhw46n.js → chunk-p5p4jh9s.js} +1 -1
- package/bundle/chunk-p6h2ydcp.js +2 -0
- package/bundle/{chunk-e1x1mp9m.js → chunk-pcmsxhrb.js} +1 -1
- package/bundle/{chunk-rpdgn9z3.js → chunk-pdcj2rfz.js} +2 -2
- package/bundle/{chunk-t2r51r6v.js → chunk-pfd8gzy4.js} +1 -1
- package/bundle/{chunk-6y58jzak.js → chunk-ph46s66y.js} +1 -1
- package/bundle/{chunk-s05hqtx1.js → chunk-pkm3w0ks.js} +1 -1
- package/bundle/{chunk-dd461rg3.js → chunk-pnmadk2h.js} +1 -1
- package/bundle/{chunk-jt6bvxtr.js → chunk-q65qzc9w.js} +1 -1
- package/bundle/{chunk-qjw2zcq5.js → chunk-q8qx38kz.js} +1 -1
- package/bundle/chunk-qhakedgs.js +2 -0
- package/bundle/{chunk-xj0zc9za.js → chunk-qsgpbt4t.js} +1 -1
- package/bundle/{chunk-ccdjzn2m.js → chunk-qtdxy2q1.js} +3 -3
- package/bundle/chunk-r18zetwf.js +2 -0
- package/bundle/{chunk-3yfjgks3.js → chunk-r1936yb5.js} +1 -1
- package/bundle/{chunk-32xd626h.js → chunk-r4qpsa4e.js} +2 -2
- package/bundle/{chunk-azss4acq.js → chunk-r6055kk0.js} +2 -2
- package/bundle/chunk-r6rgrz25.js +2 -0
- package/bundle/{chunk-t5wdstzv.js → chunk-r9ng8xx5.js} +1 -1
- package/bundle/chunk-rk4vp09j.js +2 -0
- package/bundle/{chunk-e3mrw0k7.js → chunk-rkmg0gbq.js} +1 -1
- package/bundle/{chunk-9s5h0f1y.js → chunk-rpc0he6b.js} +2 -2
- package/bundle/{chunk-h2p984qb.js → chunk-rvev3cy6.js} +2 -2
- package/bundle/{chunk-waa781eh.js → chunk-rx29zmw2.js} +1 -1
- package/bundle/{chunk-5nm5egq0.js → chunk-rxh160jr.js} +2 -2
- package/bundle/{chunk-k10rtgsk.js → chunk-s3hbwksw.js} +1 -1
- package/bundle/{chunk-atacnspd.js → chunk-s3zmxfz2.js} +2 -2
- package/bundle/chunk-s4jp4zce.js +2 -0
- package/bundle/{chunk-qyan69nb.js → chunk-s6vhscvd.js} +2 -2
- package/bundle/{chunk-hgm8yfcb.js → chunk-s81ck6bw.js} +1 -1
- package/bundle/{chunk-3vae1s42.js → chunk-sbj816s8.js} +1 -1
- package/bundle/chunk-sec9y622.js +2 -0
- package/bundle/{chunk-dzma8zvf.js → chunk-seda5sfd.js} +2 -2
- package/bundle/{chunk-tm79yrf3.js → chunk-sjtq9bbb.js} +2 -2
- package/bundle/chunk-sn7q178t.js +2 -0
- package/bundle/chunk-st0h54dm.js +2 -0
- package/bundle/{chunk-b8rzn48q.js → chunk-sxtfssjv.js} +1 -1
- package/bundle/chunk-sz75fx13.js +2 -0
- package/bundle/{chunk-pbanj1gk.js → chunk-t076hwsv.js} +2 -2
- package/bundle/{chunk-p6jf1fyt.js → chunk-t3e19wdp.js} +1 -1
- package/bundle/{chunk-v16n1fep.js → chunk-t7s475b2.js} +2 -2
- package/bundle/chunk-tefh2cgk.js +2 -0
- package/bundle/chunk-tfez99qv.js +2 -0
- package/bundle/chunk-tjk1hymv.js +2 -0
- package/bundle/{chunk-9bbwxp5d.js → chunk-tpw1ewqn.js} +1 -1
- package/bundle/{chunk-wecs14rz.js → chunk-tqnf1p88.js} +1 -1
- package/bundle/{chunk-pyf649pz.js → chunk-tyk97q7c.js} +1 -1
- package/bundle/chunk-tz1sv9kt.js +3 -0
- package/bundle/{chunk-2zjet9tx.js → chunk-tz60e15h.js} +2 -2
- package/bundle/{chunk-xstxdw7v.js → chunk-tzwm08yc.js} +1 -1
- package/bundle/chunk-v1098rqc.js +2 -0
- package/bundle/chunk-v30ezr68.js +11 -0
- package/bundle/{chunk-q8fjktv4.js → chunk-v5j3ypfv.js} +1 -1
- package/bundle/chunk-v5wn741w.js +2 -0
- package/bundle/{chunk-tdevq564.js → chunk-vamwvx0x.js} +1 -1
- package/bundle/{chunk-yce8ph5b.js → chunk-vbcekkw2.js} +2 -2
- package/bundle/{chunk-te91d271.js → chunk-vf75j9wd.js} +1 -1
- package/bundle/{chunk-4sa9t0vx.js → chunk-vhh80d5j.js} +2 -2
- package/bundle/{chunk-5rqjze1g.js → chunk-vm8htc6d.js} +1 -1
- package/bundle/{chunk-cs825mxr.js → chunk-vnz9n9z0.js} +1 -1
- package/bundle/chunk-vp6ttkct.js +2 -0
- package/bundle/chunk-vpcsmwsb.js +2 -0
- package/bundle/{chunk-gmq1kwn0.js → chunk-vrt8wd3r.js} +1 -1
- package/bundle/{chunk-1q10jyka.js → chunk-vyf77kq1.js} +2 -2
- package/bundle/{chunk-pchv413c.js → chunk-w32xhz0x.js} +2 -2
- package/bundle/{chunk-xqwk2zsx.js → chunk-wdy0fsp8.js} +2 -2
- package/bundle/{chunk-gqgjybjc.js → chunk-wkepvmgt.js} +1 -1
- package/bundle/{chunk-g52wmt1v.js → chunk-wp0xd7at.js} +1 -1
- package/bundle/{chunk-x50adh71.js → chunk-wpkr3vzf.js} +1 -1
- package/bundle/{chunk-npdgfqaw.js → chunk-wpx2vmf5.js} +1 -1
- package/bundle/{chunk-2fbkw84y.js → chunk-wqkvsj5y.js} +2 -2
- package/bundle/{chunk-nk5vrenn.js → chunk-wspbjh74.js} +2 -2
- package/bundle/{chunk-qdh2dm62.js → chunk-wzfb19t6.js} +1 -1
- package/bundle/chunk-x23s1s8k.js +2 -0
- package/bundle/{chunk-7s0nq2aa.js → chunk-x28chfpz.js} +2 -2
- package/bundle/{chunk-gx4v8z64.js → chunk-xf1y0sc6.js} +2 -2
- package/bundle/{chunk-h91zmzs5.js → chunk-xfsccqsm.js} +1 -1
- package/bundle/{chunk-pf2vq6t1.js → chunk-xmt17jd4.js} +2 -2
- package/bundle/{chunk-q4mtwv1w.js → chunk-xphzr4wg.js} +2 -2
- package/bundle/chunk-xr6js4ek.js +2 -0
- package/bundle/chunk-y078gb3n.js +2 -0
- package/bundle/{chunk-yydqavgh.js → chunk-y24yxs9g.js} +2 -2
- package/bundle/{chunk-wbt31xap.js → chunk-y565z8n2.js} +2 -2
- package/bundle/{chunk-nq4x6792.js → chunk-y7cqyeve.js} +2 -2
- package/bundle/{chunk-d1fv2c7s.js → chunk-y8bxvp3c.js} +2 -2
- package/bundle/{chunk-zfqgh9h7.js → chunk-y8tx9x5b.js} +1 -1
- package/bundle/{chunk-kds2g7r2.js → chunk-ya6r72ng.js} +1 -1
- package/bundle/chunk-yewjnqee.js +2 -0
- package/bundle/{chunk-2cvwrabw.js → chunk-yg0rs4g1.js} +2 -2
- package/bundle/{chunk-jbcqhw3x.js → chunk-yhr7s8qm.js} +2 -2
- package/bundle/chunk-ykk9e9as.js +2 -0
- package/bundle/chunk-yqn88gjf.js +2 -0
- package/bundle/chunk-yrxg3dex.js +2 -0
- package/bundle/{chunk-7hdb1fhq.js → chunk-yvtbt12y.js} +2 -2
- package/bundle/chunk-z1xeqrgd.js +2 -0
- package/bundle/chunk-z5j46dem.js +2 -0
- package/bundle/{chunk-dm447tgc.js → chunk-zj5snrsa.js} +2 -2
- package/bundle/{chunk-asxmkyz2.js → chunk-zjfdptdj.js} +1 -1
- package/bundle/chunk-zq0hpja9.js +2 -0
- package/bundle/{chunk-td9hm9be.js → chunk-zqzh5hp3.js} +1 -1
- package/bundle/{chunk-ev6jwt7q.js → chunk-zr1cvkpb.js} +1 -1
- package/bundle/{chunk-6mnk5sg3.js → chunk-zr89enb8.js} +1 -1
- package/bundle/{chunk-ecz4h0a2.js → chunk-zskjqrmc.js} +1 -1
- package/bundle/{chunk-1h96bk6p.js → chunk-ztjrm8m0.js} +2 -2
- package/bundle/chunk-zv89qwjc.js +2 -0
- package/bundle/index.js +3 -3
- package/bundle/parser.worker.js +2 -2
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-062chtrq.js +0 -2
- package/bundle/chunk-062vs7bp.js +0 -2
- package/bundle/chunk-08g14hmz.js +0 -2
- package/bundle/chunk-0w2v8dfy.js +0 -2
- package/bundle/chunk-10fr7a2y.js +0 -2
- package/bundle/chunk-15bjhfav.js +0 -3
- package/bundle/chunk-1hv61m11.js +0 -2
- package/bundle/chunk-2mkvx8b2.js +0 -2
- package/bundle/chunk-2rykfc3a.js +0 -2
- package/bundle/chunk-2w5hx4fs.js +0 -2
- package/bundle/chunk-2yy63sxz.js +0 -2
- package/bundle/chunk-2z3fe4qw.js +0 -2
- package/bundle/chunk-361cmmrp.js +0 -2
- package/bundle/chunk-3r6dq1h3.js +0 -2
- package/bundle/chunk-4a12wv2m.js +0 -2
- package/bundle/chunk-547a55ba.js +0 -2
- package/bundle/chunk-5ztmc770.js +0 -2
- package/bundle/chunk-62x3r2q8.js +0 -2
- package/bundle/chunk-6th7vpwm.js +0 -2
- package/bundle/chunk-6ybh5smv.js +0 -2
- package/bundle/chunk-73kprndw.js +0 -2
- package/bundle/chunk-79fr19xf.js +0 -2
- package/bundle/chunk-7ezr478e.js +0 -2
- package/bundle/chunk-7gj1vqyj.js +0 -2
- package/bundle/chunk-7ywfkwb4.js +0 -2
- package/bundle/chunk-85fnnwm2.js +0 -2
- package/bundle/chunk-89fwh84w.js +0 -2
- package/bundle/chunk-8e724g3k.js +0 -2
- package/bundle/chunk-9894a2yn.js +0 -2
- package/bundle/chunk-98ye2nwt.js +0 -2
- package/bundle/chunk-9s4excg8.js +0 -2
- package/bundle/chunk-aetgcegz.js +0 -2
- package/bundle/chunk-agas0nay.js +0 -2
- package/bundle/chunk-ayknzc4m.js +0 -2
- package/bundle/chunk-b2ybst88.js +0 -2
- package/bundle/chunk-bd5vtjd7.js +0 -2
- package/bundle/chunk-bjqqk6jt.js +0 -2
- package/bundle/chunk-cpkcdykz.js +0 -2
- package/bundle/chunk-cyafm8d6.js +0 -2
- package/bundle/chunk-d4316r53.js +0 -2
- package/bundle/chunk-d8ym7mcg.js +0 -2
- package/bundle/chunk-dnpjxjkp.js +0 -2
- package/bundle/chunk-e5gjqtby.js +0 -2
- package/bundle/chunk-ee3mqzms.js +0 -2
- package/bundle/chunk-er5f61s5.js +0 -2
- package/bundle/chunk-er716522.js +0 -2
- package/bundle/chunk-ez3gacqe.js +0 -2
- package/bundle/chunk-fkc7wf1p.js +0 -2
- package/bundle/chunk-fm6z8nqb.js +0 -2
- package/bundle/chunk-g0qwm23d.js +0 -2
- package/bundle/chunk-g4yn8cj8.js +0 -2
- package/bundle/chunk-gsez13bg.js +0 -3
- package/bundle/chunk-h1spsy3y.js +0 -2
- package/bundle/chunk-h8gkv40j.js +0 -2
- package/bundle/chunk-j59kmb49.js +0 -2
- package/bundle/chunk-jv37ghev.js +0 -2
- package/bundle/chunk-k3hcb6qf.js +0 -2
- package/bundle/chunk-k5d822n2.js +0 -3
- package/bundle/chunk-m8ytbq04.js +0 -2
- package/bundle/chunk-mf9nc4xz.js +0 -2
- package/bundle/chunk-mxby91bj.js +0 -2
- package/bundle/chunk-mzv1gh6f.js +0 -2
- package/bundle/chunk-n0hsvvw8.js +0 -2
- package/bundle/chunk-nm1v9z14.js +0 -2
- package/bundle/chunk-p7nstcxa.js +0 -2
- package/bundle/chunk-pfwkvv7g.js +0 -2
- package/bundle/chunk-pn1jz8qj.js +0 -2
- package/bundle/chunk-pqvmtfk7.js +0 -2
- package/bundle/chunk-prgw26g3.js +0 -2
- package/bundle/chunk-pv9ty6v7.js +0 -2
- package/bundle/chunk-q4rstre7.js +0 -2
- package/bundle/chunk-q6jk2v6g.js +0 -2
- package/bundle/chunk-qd43npx3.js +0 -2
- package/bundle/chunk-qdb21y83.js +0 -2
- package/bundle/chunk-qeksaefy.js +0 -2
- package/bundle/chunk-r7t9yb9d.js +0 -2
- package/bundle/chunk-sdv3a4w3.js +0 -2
- package/bundle/chunk-sk89becn.js +0 -2
- package/bundle/chunk-tc0996xz.js +0 -2
- package/bundle/chunk-tfs50mgj.js +0 -2
- package/bundle/chunk-thecq33z.js +0 -3
- package/bundle/chunk-tjvtp9d9.js +0 -2
- package/bundle/chunk-tkm9m3n0.js +0 -2
- package/bundle/chunk-v03xq38e.js +0 -5
- package/bundle/chunk-v1s1rcqx.js +0 -2
- package/bundle/chunk-v4dt4062.js +0 -2
- package/bundle/chunk-wgrq86kd.js +0 -2
- package/bundle/chunk-x8ks2bn7.js +0 -2
- package/bundle/chunk-xgf4k9q7.js +0 -10
- package/bundle/chunk-xy2ty5h5.js +0 -8
- package/bundle/chunk-z0383stv.js +0 -2
- package/bundle/chunk-zewrmk8x.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Rd as b}from"./chunk-t9pq363q.js";import{ce as f}from"./chunk-rk21wv4k.js";import{xh as S}from"./chunk-c1c8ch3g.js";import"./chunk-ajnzv5jt.js";import"./chunk-dz3kcsb6.js";import"./chunk-pwsajn96.js";import"./chunk-hgm8yfcb.js";import"./chunk-7rbg6mg9.js";import"./chunk-mp1x10t5.js";import{_k as v}from"./chunk-s27cz24e.js";import"./chunk-gx4v8z64.js";import{Jl as k,rl as U,zl as R}from"./chunk-v03xq38e.js";import"./chunk-dx7rexx3.js";import"./chunk-xgf4k9q7.js";import"./chunk-dnjyepb2.js";import"./chunk-8gpjmj42.js";import"./chunk-atacnspd.js";import"./chunk-qdafm7qg.js";import"./chunk-r81w6skn.js";import"./chunk-ge7csm6m.js";import"./chunk-d0dsgxk4.js";import"./chunk-1q10jyka.js";import"./chunk-wh2qqhep.js";import"./chunk-vy93mn7d.js";import"./chunk-yce8ph5b.js";import"./chunk-kec1xw1n.js";import"./chunk-cqtkxwd8.js";import"./chunk-x50adh71.js";import"./chunk-ngyv4fhn.js";import"./chunk-nq4x6792.js";import"./chunk-f17se3hh.js";import"./chunk-2y5bthrp.js";import"./chunk-7hdb1fhq.js";import"./chunk-xnxw5zz9.js";import"./chunk-gq3zb4wv.js";import"./chunk-2cvwrabw.js";import"./chunk-4sa9t0vx.js";import{Cs as Z}from"./chunk-g52wmt1v.js";import"./chunk-9d0exvey.js";import"./chunk-h2p984qb.js";import"./chunk-qm9fm5ja.js";import"./chunk-z0m1qm7j.js";import"./chunk-wd2xmkdp.js";import"./chunk-8peby2d1.js";import"./chunk-azss4acq.js";import"./chunk-0bhzhh7s.js";import"./chunk-7s0nq2aa.js";import"./chunk-cxtwavyf.js";import"./chunk-15bjhfav.js";import"./chunk-q4mtwv1w.js";import"./chunk-7a3txs9f.js";import"./chunk-x308f9j4.js";import"./chunk-2zjet9tx.js";import"./chunk-mn5cacf6.js";import"./chunk-9pj10pgd.js";import"./chunk-djfrkbd5.js";var i=f({command:"stats",describe:"show token usage and cost statistics",builder:(z)=>{return z.option("days",{describe:"show stats for the last N days (default: all time)",type:"number"}).option("tools",{describe:"number of tools to show (default: all)",type:"number"}).option("models",{describe:"show model statistics (default: hidden). Pass a number to show top N, otherwise shows all"}).option("project",{describe:"filter by project (default: all projects, empty string: current project)",type:"string"})},handler:async(z)=>{await b(process.cwd(),async()=>{let E=await y(z.days,z.project),_;if(z.models===!0)_=1/0;else if(typeof z.models==="number")_=z.models;u(E,z.tools,_)})}});async function w(){return k.project}async function p(){return R.use((E)=>E.select().from(U).all()).map((E)=>v.fromRow(E))}async function y(z,E){let _=await p(),L=86400000,J=(()=>{if(z===void 0)return 0;if(z===0){let V=new Date;return V.setHours(0,0,0,0),V.getTime()}return Date.now()-z*86400000})(),K=(()=>{if(z===void 0)return;if(z===0)return 1;return z})(),Y=J>0?_.filter((V)=>V.time.updated>=J):_;if(E!==void 0)if(E===""){let V=await w();Y=Y.filter((F)=>F.projectID===V.id)}else Y=Y.filter((V)=>V.projectID===E);let G={totalSessions:Y.length,totalMessages:0,totalCost:0,totalTokens:{input:0,output:0,reasoning:0,cache:{read:0,write:0}},toolUsage:{},modelUsage:{},dateRange:{earliest:Date.now(),latest:Date.now()},days:0,costPerDay:0,tokensPerSession:0,medianTokensPerSession:0};if(Y.length>1000)console.log(`Large dataset detected (${Y.length} sessions). This may take a while...`);if(Y.length===0)return G.days=K??0,G;let C=Date.now(),x=0,X=[],h=20;for(let V=0;V<Y.length;V+=h){let D=Y.slice(V,V+h).map(async(Q)=>{let W=await S.runPromise(v.Service.use((O)=>O.messages({sessionID:Q.id,agentID:"*"}))),N=0,H={input:0,output:0,reasoning:0,cache:{read:0,write:0}},j={},A={};for(let O of W){if(O.info.role==="assistant"){N+=O.info.cost||0;let B=`${O.info.providerID}/${O.info.modelID}`;if(!A[B])A[B]={messages:0,tokens:{input:0,output:0,cache:{read:0,write:0}},cost:0};if(A[B].messages++,A[B].cost+=O.info.cost||0,O.info.tokens)H.input+=O.info.tokens.input||0,H.output+=O.info.tokens.output||0,H.reasoning+=O.info.tokens.reasoning||0,H.cache.read+=O.info.tokens.cache?.read||0,H.cache.write+=O.info.tokens.cache?.write||0,A[B].tokens.input+=O.info.tokens.input||0,A[B].tokens.output+=(O.info.tokens.output||0)+(O.info.tokens.reasoning||0),A[B].tokens.cache.read+=O.info.tokens.cache?.read||0,A[B].tokens.cache.write+=O.info.tokens.cache?.write||0}for(let B of O.parts)if(B.type==="tool"&&B.tool)j[B.tool]=(j[B.tool]||0)+1}return{messageCount:W.length,sessionCost:N,sessionTokens:H,sessionTotalTokens:H.input+H.output+H.reasoning+H.cache.read+H.cache.write,sessionToolUsage:j,sessionModelUsage:A,earliestTime:J>0?Q.time.updated:Q.time.created,latestTime:Q.time.updated}}),M=await Promise.all(D);for(let Q of M){C=Math.min(C,Q.earliestTime),x=Math.max(x,Q.latestTime),X.push(Q.sessionTotalTokens),G.totalMessages+=Q.messageCount,G.totalCost+=Q.sessionCost,G.totalTokens.input+=Q.sessionTokens.input,G.totalTokens.output+=Q.sessionTokens.output,G.totalTokens.reasoning+=Q.sessionTokens.reasoning,G.totalTokens.cache.read+=Q.sessionTokens.cache.read,G.totalTokens.cache.write+=Q.sessionTokens.cache.write;for(let[W,N]of Object.entries(Q.sessionToolUsage))G.toolUsage[W]=(G.toolUsage[W]||0)+N;for(let[W,N]of Object.entries(Q.sessionModelUsage)){if(!G.modelUsage[W])G.modelUsage[W]={messages:0,tokens:{input:0,output:0,cache:{read:0,write:0}},cost:0};G.modelUsage[W].messages+=N.messages,G.modelUsage[W].tokens.input+=N.tokens.input,G.modelUsage[W].tokens.output+=N.tokens.output,G.modelUsage[W].tokens.cache.read+=N.tokens.cache.read,G.modelUsage[W].tokens.cache.write+=N.tokens.cache.write,G.modelUsage[W].cost+=N.cost}}}let $=Math.max(1,Math.ceil((x-C)/86400000)),q=K??$;G.dateRange={earliest:C,latest:x},G.days=q,G.costPerDay=G.totalCost/q;let I=G.totalTokens.input+G.totalTokens.output+G.totalTokens.reasoning+G.totalTokens.cache.read+G.totalTokens.cache.write;G.tokensPerSession=Y.length>0?I/Y.length:0,X.sort((V,F)=>V-F);let P=Math.floor(X.length/2);return G.medianTokensPerSession=X.length===0?0:X.length%2===0?(X[P-1]+X[P])/2:X[P],G}function u(z,E,_){function J(x,X){let $=55-x.length-X.length,q=Math.max(0,$);return`\u2502${x}${" ".repeat(q)}${X} \u2502`}console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 OVERVIEW \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log(J("Sessions",z.totalSessions.toLocaleString())),console.log(J("Messages",z.totalMessages.toLocaleString())),console.log(J("Days",z.days.toString())),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),console.log(),console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 COST & TOKENS \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let K=isNaN(z.totalCost)?0:z.totalCost,Y=isNaN(z.costPerDay)?0:z.costPerDay,G=isNaN(z.tokensPerSession)?0:z.tokensPerSession;console.log(J("Total Cost",`$${K.toFixed(2)}`)),console.log(J("Avg Cost/Day",`$${Y.toFixed(2)}`)),console.log(J("Avg Tokens/Session",Z.number(Math.round(G))));let C=isNaN(z.medianTokensPerSession)?0:z.medianTokensPerSession;if(console.log(J("Median Tokens/Session",Z.number(Math.round(C)))),console.log(J("Input",Z.number(z.totalTokens.input))),console.log(J("Output",Z.number(z.totalTokens.output))),console.log(J("Cache Read",Z.number(z.totalTokens.cache.read))),console.log(J("Cache Write",Z.number(z.totalTokens.cache.write))),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),console.log(),_!==void 0&&Object.keys(z.modelUsage).length>0){let x=Object.entries(z.modelUsage).sort(([,h],[,$])=>$.messages-h.messages),X=_===1/0?x:x.slice(0,_);console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 MODEL USAGE \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");for(let[h,$]of X)console.log(`\u2502 ${h.padEnd(54)} \u2502`),console.log(J(" Messages",$.messages.toLocaleString())),console.log(J(" Input Tokens",Z.number($.tokens.input))),console.log(J(" Output Tokens",Z.number($.tokens.output))),console.log(J(" Cache Read",Z.number($.tokens.cache.read))),console.log(J(" Cache Write",Z.number($.tokens.cache.write))),console.log(J(" Cost",`$${$.cost.toFixed(4)}`)),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");process.stdout.write("\x1B[1A"),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")}if(console.log(),Object.keys(z.toolUsage).length>0){let x=Object.entries(z.toolUsage).sort(([,q],[,I])=>I-q),X=E?x.slice(0,E):x;console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 TOOL USAGE \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let h=Math.max(...X.map(([,q])=>q)),$=Object.values(z.toolUsage).reduce((q,I)=>q+I,0);for(let[q,I]of X){let P=Math.max(1,Math.floor(I/h*20)),V="\u2588".repeat(P),F=(I/$*100).toFixed(1),D=18,W=` ${(q.length>18?q.substring(0,16)+"..":q).padEnd(18)} ${V.padEnd(20)} ${I.toString().padStart(3)} (${F.padStart(4)}%)`,N=Math.max(0,56-W.length-1);console.log(`\u2502${W}${" ".repeat(N)} \u2502`)}console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")}console.log()}export{u as displayStats,y as aggregateSessionStats,i as StatsCommand};
|
|
2
|
+
import{Sd as b}from"./chunk-k4ajben7.js";import{de as f}from"./chunk-b274mb6v.js";import{yh as S}from"./chunk-88hmeyf5.js";import"./chunk-aykvrqrp.js";import"./chunk-2h8b0csf.js";import"./chunk-4q14whpc.js";import"./chunk-s81ck6bw.js";import"./chunk-jt7g0r2j.js";import"./chunk-84qx54nf.js";import{$k as v}from"./chunk-ep92grvg.js";import"./chunk-xf1y0sc6.js";import{Al as R,Kl as k,sl as U}from"./chunk-n24yx79r.js";import"./chunk-5qydhr42.js";import"./chunk-v30ezr68.js";import"./chunk-ex47pb9n.js";import"./chunk-jh2za7y4.js";import"./chunk-s3zmxfz2.js";import"./chunk-krk24aqm.js";import"./chunk-j7d3v0x2.js";import"./chunk-3hawwbw6.js";import"./chunk-4c6d1wy1.js";import"./chunk-vyf77kq1.js";import"./chunk-bxc3z38f.js";import"./chunk-7wshaze9.js";import"./chunk-vbcekkw2.js";import"./chunk-4ngvj758.js";import"./chunk-cqtkxwd8.js";import"./chunk-wpkr3vzf.js";import"./chunk-49we3vy1.js";import"./chunk-y7cqyeve.js";import"./chunk-92xxg12q.js";import"./chunk-h8yf5e2e.js";import"./chunk-yvtbt12y.js";import"./chunk-g83d3a0t.js";import"./chunk-1p39y33b.js";import"./chunk-yg0rs4g1.js";import"./chunk-vhh80d5j.js";import{au as Z}from"./chunk-wp0xd7at.js";import"./chunk-dzw0j790.js";import"./chunk-rvev3cy6.js";import"./chunk-c53ev0da.js";import"./chunk-78yvbv9b.js";import"./chunk-c5n49vrd.js";import"./chunk-bwzbcwff.js";import"./chunk-r6055kk0.js";import"./chunk-datctfgt.js";import"./chunk-x28chfpz.js";import"./chunk-mnxcykeq.js";import"./chunk-0bn86djg.js";import"./chunk-xphzr4wg.js";import"./chunk-hav9pgf3.js";import"./chunk-cshsqavb.js";import"./chunk-tz60e15h.js";import"./chunk-0tya4pqb.js";import"./chunk-63t0rhc9.js";import"./chunk-9svh74gt.js";var i=f({command:"stats",describe:"show token usage and cost statistics",builder:(z)=>{return z.option("days",{describe:"show stats for the last N days (default: all time)",type:"number"}).option("tools",{describe:"number of tools to show (default: all)",type:"number"}).option("models",{describe:"show model statistics (default: hidden). Pass a number to show top N, otherwise shows all"}).option("project",{describe:"filter by project (default: all projects, empty string: current project)",type:"string"})},handler:async(z)=>{await b(process.cwd(),async()=>{let E=await y(z.days,z.project),_;if(z.models===!0)_=1/0;else if(typeof z.models==="number")_=z.models;u(E,z.tools,_)})}});async function w(){return k.project}async function p(){return R.use((E)=>E.select().from(U).all()).map((E)=>v.fromRow(E))}async function y(z,E){let _=await p(),L=86400000,J=(()=>{if(z===void 0)return 0;if(z===0){let V=new Date;return V.setHours(0,0,0,0),V.getTime()}return Date.now()-z*86400000})(),K=(()=>{if(z===void 0)return;if(z===0)return 1;return z})(),Y=J>0?_.filter((V)=>V.time.updated>=J):_;if(E!==void 0)if(E===""){let V=await w();Y=Y.filter((F)=>F.projectID===V.id)}else Y=Y.filter((V)=>V.projectID===E);let G={totalSessions:Y.length,totalMessages:0,totalCost:0,totalTokens:{input:0,output:0,reasoning:0,cache:{read:0,write:0}},toolUsage:{},modelUsage:{},dateRange:{earliest:Date.now(),latest:Date.now()},days:0,costPerDay:0,tokensPerSession:0,medianTokensPerSession:0};if(Y.length>1000)console.log(`Large dataset detected (${Y.length} sessions). This may take a while...`);if(Y.length===0)return G.days=K??0,G;let C=Date.now(),x=0,X=[],h=20;for(let V=0;V<Y.length;V+=h){let D=Y.slice(V,V+h).map(async(Q)=>{let W=await S.runPromise(v.Service.use((O)=>O.messages({sessionID:Q.id,agentID:"*"}))),N=0,H={input:0,output:0,reasoning:0,cache:{read:0,write:0}},j={},A={};for(let O of W){if(O.info.role==="assistant"){N+=O.info.cost||0;let B=`${O.info.providerID}/${O.info.modelID}`;if(!A[B])A[B]={messages:0,tokens:{input:0,output:0,cache:{read:0,write:0}},cost:0};if(A[B].messages++,A[B].cost+=O.info.cost||0,O.info.tokens)H.input+=O.info.tokens.input||0,H.output+=O.info.tokens.output||0,H.reasoning+=O.info.tokens.reasoning||0,H.cache.read+=O.info.tokens.cache?.read||0,H.cache.write+=O.info.tokens.cache?.write||0,A[B].tokens.input+=O.info.tokens.input||0,A[B].tokens.output+=(O.info.tokens.output||0)+(O.info.tokens.reasoning||0),A[B].tokens.cache.read+=O.info.tokens.cache?.read||0,A[B].tokens.cache.write+=O.info.tokens.cache?.write||0}for(let B of O.parts)if(B.type==="tool"&&B.tool)j[B.tool]=(j[B.tool]||0)+1}return{messageCount:W.length,sessionCost:N,sessionTokens:H,sessionTotalTokens:H.input+H.output+H.reasoning+H.cache.read+H.cache.write,sessionToolUsage:j,sessionModelUsage:A,earliestTime:J>0?Q.time.updated:Q.time.created,latestTime:Q.time.updated}}),M=await Promise.all(D);for(let Q of M){C=Math.min(C,Q.earliestTime),x=Math.max(x,Q.latestTime),X.push(Q.sessionTotalTokens),G.totalMessages+=Q.messageCount,G.totalCost+=Q.sessionCost,G.totalTokens.input+=Q.sessionTokens.input,G.totalTokens.output+=Q.sessionTokens.output,G.totalTokens.reasoning+=Q.sessionTokens.reasoning,G.totalTokens.cache.read+=Q.sessionTokens.cache.read,G.totalTokens.cache.write+=Q.sessionTokens.cache.write;for(let[W,N]of Object.entries(Q.sessionToolUsage))G.toolUsage[W]=(G.toolUsage[W]||0)+N;for(let[W,N]of Object.entries(Q.sessionModelUsage)){if(!G.modelUsage[W])G.modelUsage[W]={messages:0,tokens:{input:0,output:0,cache:{read:0,write:0}},cost:0};G.modelUsage[W].messages+=N.messages,G.modelUsage[W].tokens.input+=N.tokens.input,G.modelUsage[W].tokens.output+=N.tokens.output,G.modelUsage[W].tokens.cache.read+=N.tokens.cache.read,G.modelUsage[W].tokens.cache.write+=N.tokens.cache.write,G.modelUsage[W].cost+=N.cost}}}let $=Math.max(1,Math.ceil((x-C)/86400000)),q=K??$;G.dateRange={earliest:C,latest:x},G.days=q,G.costPerDay=G.totalCost/q;let I=G.totalTokens.input+G.totalTokens.output+G.totalTokens.reasoning+G.totalTokens.cache.read+G.totalTokens.cache.write;G.tokensPerSession=Y.length>0?I/Y.length:0,X.sort((V,F)=>V-F);let P=Math.floor(X.length/2);return G.medianTokensPerSession=X.length===0?0:X.length%2===0?(X[P-1]+X[P])/2:X[P],G}function u(z,E,_){function J(x,X){let $=55-x.length-X.length,q=Math.max(0,$);return`\u2502${x}${" ".repeat(q)}${X} \u2502`}console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 OVERVIEW \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log(J("Sessions",z.totalSessions.toLocaleString())),console.log(J("Messages",z.totalMessages.toLocaleString())),console.log(J("Days",z.days.toString())),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),console.log(),console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 COST & TOKENS \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let K=isNaN(z.totalCost)?0:z.totalCost,Y=isNaN(z.costPerDay)?0:z.costPerDay,G=isNaN(z.tokensPerSession)?0:z.tokensPerSession;console.log(J("Total Cost",`$${K.toFixed(2)}`)),console.log(J("Avg Cost/Day",`$${Y.toFixed(2)}`)),console.log(J("Avg Tokens/Session",Z.number(Math.round(G))));let C=isNaN(z.medianTokensPerSession)?0:z.medianTokensPerSession;if(console.log(J("Median Tokens/Session",Z.number(Math.round(C)))),console.log(J("Input",Z.number(z.totalTokens.input))),console.log(J("Output",Z.number(z.totalTokens.output))),console.log(J("Cache Read",Z.number(z.totalTokens.cache.read))),console.log(J("Cache Write",Z.number(z.totalTokens.cache.write))),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),console.log(),_!==void 0&&Object.keys(z.modelUsage).length>0){let x=Object.entries(z.modelUsage).sort(([,h],[,$])=>$.messages-h.messages),X=_===1/0?x:x.slice(0,_);console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 MODEL USAGE \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");for(let[h,$]of X)console.log(`\u2502 ${h.padEnd(54)} \u2502`),console.log(J(" Messages",$.messages.toLocaleString())),console.log(J(" Input Tokens",Z.number($.tokens.input))),console.log(J(" Output Tokens",Z.number($.tokens.output))),console.log(J(" Cache Read",Z.number($.tokens.cache.read))),console.log(J(" Cache Write",Z.number($.tokens.cache.write))),console.log(J(" Cost",`$${$.cost.toFixed(4)}`)),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");process.stdout.write("\x1B[1A"),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")}if(console.log(),Object.keys(z.toolUsage).length>0){let x=Object.entries(z.toolUsage).sort(([,q],[,I])=>I-q),X=E?x.slice(0,E):x;console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 TOOL USAGE \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let h=Math.max(...X.map(([,q])=>q)),$=Object.values(z.toolUsage).reduce((q,I)=>q+I,0);for(let[q,I]of X){let P=Math.max(1,Math.floor(I/h*20)),V="\u2588".repeat(P),F=(I/$*100).toFixed(1),D=18,W=` ${(q.length>18?q.substring(0,16)+"..":q).padEnd(18)} ${V.padEnd(20)} ${I.toString().padStart(3)} (${F.padStart(4)}%)`,N=Math.max(0,56-W.length-1);console.log(`\u2502${W}${" ".repeat(N)} \u2502`)}console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")}console.log()}export{u as displayStats,y as aggregateSessionStats,i as StatsCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{hr as yZ,ir as N0,jr as ZQ,kr as ZJ,lr as p0,mr as n0,nr as i0,pr as s0,qr as o0}from"./chunk-7hdb1fhq.js";import{rr as AQ,sr as E}from"./chunk-xnxw5zz9.js";import{$C as $Q,$F as c0,$G as S0,AF as u0,EA as g0,ED as E0,HF as A0,NG as t,PG as e,UO as C0,VA as h0,YE as k0,ZC as WQ,ZE as I0,ZF as x0,bP as L0,cP as P0,dG as r,hG as u,iH as JJ,kC as O0,kD as _0,mG as g,qC as D0,qH as QJ,tF as NJ,tG as y0,uF as PJ,wF as d0,xF as l0,yF as m0,zF as XQ}from"./chunk-2zjet9tx.js";import{pP as M}from"./chunk-9pj10pgd.js";import{qP as d,rP as K,uP as TJ}from"./chunk-djfrkbd5.js";var bJ=K((GQ)=>{Object.defineProperty(GQ,"__esModule",{value:!0});GQ.AbstractAsyncHooksContextManager=void 0;var t0=TJ("events"),e0=["addListener","on","once","prependListener","prependOnceListener"];class KQ{bind(J,Q){if(Q instanceof t0.EventEmitter)return this._bindEventEmitter(J,Q);if(typeof Q==="function")return this._bindFunction(J,Q);return Q}_bindFunction(J,Q){let Z=this,$=function(...q){return Z.with(J,()=>Q.apply(this,q))};return Object.defineProperty($,"length",{enumerable:!1,configurable:!0,writable:!1,value:Q.length}),$}_bindEventEmitter(J,Q){if(this._getPatchMap(Q)!==void 0)return Q;if(this._createPatchMap(Q),e0.forEach(($)=>{if(Q[$]===void 0)return;Q[$]=this._patchAddListener(Q,Q[$],J)}),typeof Q.removeListener==="function")Q.removeListener=this._patchRemoveListener(Q,Q.removeListener);if(typeof Q.off==="function")Q.off=this._patchRemoveListener(Q,Q.off);if(typeof Q.removeAllListeners==="function")Q.removeAllListeners=this._patchRemoveAllListeners(Q,Q.removeAllListeners);return Q}_patchRemoveListener(J,Q){let Z=this;return function($,q){let W=Z._getPatchMap(J)?.[$];if(W===void 0)return Q.call(this,$,q);let X=W.get(q);return Q.call(this,$,X||q)}}_patchRemoveAllListeners(J,Q){let Z=this;return function($){let q=Z._getPatchMap(J);if(q!==void 0){if(arguments.length===0)Z._createPatchMap(J);else if(q[$]!==void 0)delete q[$]}return Q.apply(this,arguments)}}_patchAddListener(J,Q,Z){let $=this;return function(q,W){if($._wrapped)return Q.call(this,q,W);let X=$._getPatchMap(J);if(X===void 0)X=$._createPatchMap(J);let H=X[q];if(H===void 0)H=new WeakMap,X[q]=H;let Y=$.bind(Z,W);H.set(W,Y),$._wrapped=!0;try{return Q.call(this,q,Y)}finally{$._wrapped=!1}}}_createPatchMap(J){let Q=Object.create(null);return J[this._kOtListeners]=Q,Q}_getPatchMap(J){return J[this._kOtListeners]}_kOtListeners=Symbol("OtListeners");_wrapped=!1}GQ.AbstractAsyncHooksContextManager=KQ});var jQ=K((UQ)=>{Object.defineProperty(UQ,"__esModule",{value:!0});UQ.AsyncHooksContextManager=void 0;var J6=M(),Q6=TJ("async_hooks"),Z6=bJ();class VQ extends Z6.AbstractAsyncHooksContextManager{_asyncHook;_contexts=new Map;_stack=[];constructor(){super();this._asyncHook=Q6.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){return this._stack[this._stack.length-1]??J6.ROOT_CONTEXT}with(J,Q,Z,...$){this._enterContext(J);try{return Q.call(Z,...$)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(J,Q){if(Q==="TIMERWRAP")return;let Z=this._stack[this._stack.length-1];if(Z!==void 0)this._contexts.set(J,Z)}_destroy(J){this._contexts.delete(J)}_before(J){let Q=this._contexts.get(J);if(Q!==void 0)this._enterContext(Q)}_after(){this._exitContext()}_enterContext(J){this._stack.push(J)}_exitContext(){this._stack.pop()}}UQ.AsyncHooksContextManager=VQ});var DQ=K((hQ)=>{Object.defineProperty(hQ,"__esModule",{value:!0});hQ.AsyncLocalStorageContextManager=void 0;var $6=M(),q6=TJ("async_hooks"),W6=bJ();class FQ extends W6.AbstractAsyncHooksContextManager{_asyncLocalStorage;constructor(){super();this._asyncLocalStorage=new q6.AsyncLocalStorage}active(){return this._asyncLocalStorage.getStore()??$6.ROOT_CONTEXT}with(J,Q,Z,...$){let q=Z==null?Q:Q.bind(Z);return this._asyncLocalStorage.run(J,q,...$)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}}hQ.AsyncLocalStorageContextManager=FQ});var EQ=K((GJ)=>{Object.defineProperty(GJ,"__esModule",{value:!0});GJ.AsyncLocalStorageContextManager=GJ.AsyncHooksContextManager=void 0;var z6=jQ();Object.defineProperty(GJ,"AsyncHooksContextManager",{enumerable:!0,get:function(){return z6.AsyncHooksContextManager}});var X6=DQ();Object.defineProperty(GJ,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return X6.AsyncLocalStorageContextManager}})});var MQ=K((kQ)=>{Object.defineProperty(kQ,"__esModule",{value:!0});kQ.ExceptionEventName=void 0;kQ.ExceptionEventName="exception"});var PQ=K((CQ)=>{Object.defineProperty(CQ,"__esModule",{value:!0});CQ.SpanImpl=void 0;var h=M(),O=E(),m=AQ(),H6=MQ();class RQ{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:h.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(J){let Q=Date.now();if(this._spanContext=J.spanContext,this._performanceStartTime=O.otperformance.now(),this._performanceOffset=Q-(this._performanceStartTime+O.otperformance.timeOrigin),this._startTimeProvided=J.startTime!=null,this._spanLimits=J.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=J.spanProcessor,this.name=J.name,this.parentSpanContext=J.parentSpanContext,this.kind=J.kind,J.links)for(let Z of J.links)this.addLink(Z);if(this.startTime=this._getTime(J.startTime??Q),this.resource=J.resource,this.instrumentationScope=J.scope,this._recordEndMetrics=J.recordEndMetrics,J.attributes!=null)this.setAttributes(J.attributes);this._spanProcessor.onStart(this,J.context)}spanContext(){return this._spanContext}setAttribute(J,Q){if(Q==null||this._isSpanEnded())return this;if(J.length===0)return h.diag.warn(`Invalid attribute key: ${J}`),this;if(!(0,O.isAttributeValue)(Q))return h.diag.warn(`Invalid attribute value set for key: ${J}`),this;let{attributeCountLimit:Z}=this._spanLimits,$=!Object.prototype.hasOwnProperty.call(this.attributes,J);if(Z!==void 0&&this._attributesCount>=Z&&$)return this._droppedAttributesCount++,this;if(this.attributes[J]=this._truncateToSize(Q),$)this._attributesCount++;return this}setAttributes(J){for(let Q in J)if(Object.prototype.hasOwnProperty.call(J,Q))this.setAttribute(Q,J[Q]);return this}addEvent(J,Q,Z){if(this._isSpanEnded())return this;let{eventCountLimit:$}=this._spanLimits;if($===0)return h.diag.warn("No events allowed."),this._droppedEventsCount++,this;if($!==void 0&&this.events.length>=$){if(this._droppedEventsCount===0)h.diag.debug("Dropping extra events.");this.events.shift(),this._droppedEventsCount++}if((0,O.isTimeInput)(Q)){if(!(0,O.isTimeInput)(Z))Z=Q;Q=void 0}let q=(0,O.sanitizeAttributes)(Q),{attributePerEventCountLimit:W}=this._spanLimits,X={},H=0,Y=0;for(let V in q){if(!Object.prototype.hasOwnProperty.call(q,V))continue;let R=q[V];if(W!==void 0&&Y>=W){H++;continue}X[V]=this._truncateToSize(R),Y++}return this.events.push({name:J,attributes:X,time:this._getTime(Z),droppedAttributesCount:H}),this}addLink(J){if(this._isSpanEnded())return this;let{linkCountLimit:Q}=this._spanLimits;if(Q===0)return this._droppedLinksCount++,this;if(Q!==void 0&&this.links.length>=Q){if(this._droppedLinksCount===0)h.diag.debug("Dropping extra links.");this.links.shift(),this._droppedLinksCount++}let{attributePerLinkCountLimit:Z}=this._spanLimits,$=(0,O.sanitizeAttributes)(J.attributes),q={},W=0,X=0;for(let Y in $){if(!Object.prototype.hasOwnProperty.call($,Y))continue;let V=$[Y];if(Z!==void 0&&X>=Z){W++;continue}q[Y]=this._truncateToSize(V),X++}let H={context:J.context};if(X>0)H.attributes=q;if(W>0)H.droppedAttributesCount=W;return this.links.push(H),this}addLinks(J){for(let Q of J)this.addLink(Q);return this}setStatus(J){if(this._isSpanEnded())return this;if(J.code===h.SpanStatusCode.UNSET)return this;if(this.status.code===h.SpanStatusCode.OK)return this;let Q={code:J.code};if(J.code===h.SpanStatusCode.ERROR){if(typeof J.message==="string")Q.message=J.message;else if(J.message!=null)h.diag.warn(`Dropping invalid status.message of type '${typeof J.message}', expected 'string'`)}return this.status=Q,this}updateName(J){if(this._isSpanEnded())return this;return this.name=J,this}end(J){if(this._isSpanEnded()){h.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}if(this.endTime=this._getTime(J),this._duration=(0,O.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0)h.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0];if(this._droppedEventsCount>0)h.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`);if(this._droppedLinksCount>0)h.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`);if(this._spanProcessor.onEnding)this._spanProcessor.onEnding(this);this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(J){if(typeof J==="number"&&J<=O.otperformance.now())return(0,O.hrTime)(J+this._performanceOffset);if(typeof J==="number")return(0,O.millisToHrTime)(J);if(J instanceof Date)return(0,O.millisToHrTime)(J.getTime());if((0,O.isTimeInputHrTime)(J))return J;if(this._startTimeProvided)return(0,O.millisToHrTime)(Date.now());let Q=O.otperformance.now()-this._performanceStartTime;return(0,O.addHrTimes)(this.startTime,(0,O.millisToHrTime)(Q))}isRecording(){return this._ended===!1}recordException(J,Q){let Z={};if(typeof J==="string")Z[m.ATTR_EXCEPTION_MESSAGE]=J;else if(J){if(J.code)Z[m.ATTR_EXCEPTION_TYPE]=J.code.toString();else if(J.name)Z[m.ATTR_EXCEPTION_TYPE]=J.name;if(J.message)Z[m.ATTR_EXCEPTION_MESSAGE]=J.message;if(J.stack)Z[m.ATTR_EXCEPTION_STACKTRACE]=J.stack}if(Z[m.ATTR_EXCEPTION_TYPE]||Z[m.ATTR_EXCEPTION_MESSAGE])this.addEvent(H6.ExceptionEventName,Z,Q);else h.diag.warn(`Failed to record an exception ${J}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let J=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);h.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,J)}return this._ended}_truncateToLimitUtil(J,Q){if(J.length<=Q)return J;return J.substring(0,Q)}_truncateToSize(J){let Q=this._attributeValueLengthLimit;if(Q<=0)return h.diag.warn(`Attribute value limit must be positive, got ${Q}`),J;if(typeof J==="string")return this._truncateToLimitUtil(J,Q);if(Array.isArray(J))return J.map((Z)=>typeof Z==="string"?this._truncateToLimitUtil(Z,Q):Z);return J}}CQ.SpanImpl=RQ});var i=K((NQ)=>{Object.defineProperty(NQ,"__esModule",{value:!0});NQ.SamplingDecision=void 0;var K6;(function(J){J[J.NOT_RECORD=0]="NOT_RECORD",J[J.RECORD=1]="RECORD",J[J.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(K6=NQ.SamplingDecision||(NQ.SamplingDecision={}))});var wJ=K((TQ)=>{Object.defineProperty(TQ,"__esModule",{value:!0});TQ.AlwaysOffSampler=void 0;var G6=i();class fQ{shouldSample(){return{decision:G6.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}TQ.AlwaysOffSampler=fQ});var VJ=K((xQ)=>{Object.defineProperty(xQ,"__esModule",{value:!0});xQ.AlwaysOnSampler=void 0;var w6=i();class _Q{shouldSample(){return{decision:w6.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}xQ.AlwaysOnSampler=_Q});var dJ=K((vQ)=>{Object.defineProperty(vQ,"__esModule",{value:!0});vQ.ParentBasedSampler=void 0;var UJ=M(),V6=E(),yQ=wJ(),xJ=VJ();class SQ{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(J){if(this._root=J.root,!this._root)(0,V6.globalErrorHandler)(Error("ParentBasedSampler must have a root sampler configured")),this._root=new xJ.AlwaysOnSampler;this._remoteParentSampled=J.remoteParentSampled??new xJ.AlwaysOnSampler,this._remoteParentNotSampled=J.remoteParentNotSampled??new yQ.AlwaysOffSampler,this._localParentSampled=J.localParentSampled??new xJ.AlwaysOnSampler,this._localParentNotSampled=J.localParentNotSampled??new yQ.AlwaysOffSampler}shouldSample(J,Q,Z,$,q,W){let X=UJ.trace.getSpanContext(J);if(!X||!(0,UJ.isSpanContextValid)(X))return this._root.shouldSample(J,Q,Z,$,q,W);if(X.isRemote){if(X.traceFlags&UJ.TraceFlags.SAMPLED)return this._remoteParentSampled.shouldSample(J,Q,Z,$,q,W);return this._remoteParentNotSampled.shouldSample(J,Q,Z,$,q,W)}if(X.traceFlags&UJ.TraceFlags.SAMPLED)return this._localParentSampled.shouldSample(J,Q,Z,$,q,W);return this._localParentNotSampled.shouldSample(J,Q,Z,$,q,W)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}vQ.ParentBasedSampler=SQ});var yJ=K((uQ)=>{Object.defineProperty(uQ,"__esModule",{value:!0});uQ.TraceIdRatioBasedSampler=void 0;var U6=M(),lQ=i();class mQ{_ratio;_upperBound;constructor(J=0){this._ratio=this._normalize(J),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(J,Q){return{decision:(0,U6.isValidTraceId)(Q)&&this._accumulate(Q)<this._upperBound?lQ.SamplingDecision.RECORD_AND_SAMPLED:lQ.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(J){if(typeof J!=="number"||isNaN(J))return 0;return J>=1?1:J<=0?0:J}_accumulate(J){let Q=0;for(let Z=0;Z<J.length/8;Z++){let $=Z*8,q=parseInt(J.slice($,$+8),16);Q=(Q^q)>>>0}return Q}}uQ.TraceIdRatioBasedSampler=mQ});var gJ=K((oQ)=>{Object.defineProperty(oQ,"__esModule",{value:!0});oQ.buildSamplerFromEnv=oQ.loadDefaultConfig=void 0;var vJ=M(),_=E(),pQ=wJ(),SJ=VJ(),BJ=dJ(),nQ=yJ(),x;(function(J){J.AlwaysOff="always_off",J.AlwaysOn="always_on",J.ParentBasedAlwaysOff="parentbased_always_off",J.ParentBasedAlwaysOn="parentbased_always_on",J.ParentBasedTraceIdRatio="parentbased_traceidratio",J.TraceIdRatio="traceidratio"})(x||(x={}));var jJ=1;function B6(){return{sampler:sQ(),forceFlushTimeoutMillis:30000,generalLimits:{attributeValueLengthLimit:(0,_.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,_.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:(0,_.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,_.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:(0,_.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:(0,_.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:(0,_.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:(0,_.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}oQ.loadDefaultConfig=B6;function sQ(){let J=(0,_.getStringFromEnv)("OTEL_TRACES_SAMPLER")??x.ParentBasedAlwaysOn;switch(J){case x.AlwaysOn:return new SJ.AlwaysOnSampler;case x.AlwaysOff:return new pQ.AlwaysOffSampler;case x.ParentBasedAlwaysOn:return new BJ.ParentBasedSampler({root:new SJ.AlwaysOnSampler});case x.ParentBasedAlwaysOff:return new BJ.ParentBasedSampler({root:new pQ.AlwaysOffSampler});case x.TraceIdRatio:return new nQ.TraceIdRatioBasedSampler(iQ());case x.ParentBasedTraceIdRatio:return new BJ.ParentBasedSampler({root:new nQ.TraceIdRatioBasedSampler(iQ())});default:return vJ.diag.error(`OTEL_TRACES_SAMPLER value "${J}" invalid, defaulting to "${x.ParentBasedAlwaysOn}".`),new BJ.ParentBasedSampler({root:new SJ.AlwaysOnSampler})}}oQ.buildSamplerFromEnv=sQ;function iQ(){let J=(0,_.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG");if(J==null)return vJ.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${jJ}.`),jJ;if(J<0||J>1)return vJ.diag.error(`OTEL_TRACES_SAMPLER_ARG=${J} was given, but it is out of range ([0..1]), defaulting to ${jJ}.`),jJ;return J}});var lJ=K((tQ)=>{Object.defineProperty(tQ,"__esModule",{value:!0});tQ.reconfigureLimits=tQ.mergeConfig=tQ.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=tQ.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;var rQ=gJ(),FJ=E();tQ.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;tQ.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function F6(J){let Q={sampler:(0,rQ.buildSamplerFromEnv)()},Z=(0,rQ.loadDefaultConfig)(),$=Object.assign({},Z,Q,J);return $.generalLimits=Object.assign({},Z.generalLimits,J.generalLimits||{}),$.spanLimits=Object.assign({},Z.spanLimits,J.spanLimits||{}),$}tQ.mergeConfig=F6;function h6(J){let Q=Object.assign({},J.spanLimits);return Q.attributeCountLimit=J.spanLimits?.attributeCountLimit??J.generalLimits?.attributeCountLimit??(0,FJ.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??(0,FJ.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??tQ.DEFAULT_ATTRIBUTE_COUNT_LIMIT,Q.attributeValueLengthLimit=J.spanLimits?.attributeValueLengthLimit??J.generalLimits?.attributeValueLengthLimit??(0,FJ.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??(0,FJ.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??tQ.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},J,{spanLimits:Q})}tQ.reconfigureLimits=h6});var WZ=K(($Z)=>{Object.defineProperty($Z,"__esModule",{value:!0});$Z.BatchSpanProcessorBase=void 0;var s=M(),S=E();class ZZ{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(J,Q){if(this._exporter=J,this._maxExportBatchSize=typeof Q?.maxExportBatchSize==="number"?Q.maxExportBatchSize:(0,S.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=typeof Q?.maxQueueSize==="number"?Q.maxQueueSize:(0,S.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=typeof Q?.scheduledDelayMillis==="number"?Q.scheduledDelayMillis:(0,S.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY")??5000,this._exportTimeoutMillis=typeof Q?.exportTimeoutMillis==="number"?Q.exportTimeoutMillis:(0,S.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT")??30000,this._shutdownOnce=new S.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize)s.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize}forceFlush(){if(this._shutdownOnce.isCalled)return this._shutdownOnce.promise;return this._flushAll()}onStart(J,Q){}onEnd(J){if(this._shutdownOnce.isCalled)return;if((J.spanContext().traceFlags&s.TraceFlags.SAMPLED)===0)return;this._addToBuffer(J)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>{return this.onShutdown()}).then(()=>{return this._flushAll()}).then(()=>{return this._exporter.shutdown()})}_addToBuffer(J){if(this._finishedSpans.length>=this._maxQueueSize){if(this._droppedSpansCount===0)s.diag.debug("maxQueueSize reached, dropping spans");this._droppedSpansCount++;return}if(this._droppedSpansCount>0)s.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0;this._finishedSpans.push(J),this._maybeStartTimer()}_flushAll(){return new Promise((J,Q)=>{let Z=[],$=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let q=0,W=$;q<W;q++)Z.push(this._flushOneBatch());Promise.all(Z).then(()=>{J()}).catch(Q)})}_flushOneBatch(){if(this._clearTimer(),this._finishedSpans.length===0)return Promise.resolve();return new Promise((J,Q)=>{let Z=setTimeout(()=>{Q(Error("Timeout"))},this._exportTimeoutMillis);s.context.with((0,S.suppressTracing)(s.context.active()),()=>{let $;if(this._finishedSpans.length<=this._maxExportBatchSize)$=this._finishedSpans,this._finishedSpans=[];else $=this._finishedSpans.splice(0,this._maxExportBatchSize);let q=()=>this._exporter.export($,(X)=>{if(clearTimeout(Z),X.code===S.ExportResultCode.SUCCESS)J();else Q(X.error??Error("BatchSpanProcessor: span export failed"))}),W=null;for(let X=0,H=$.length;X<H;X++){let Y=$[X];if(Y.resource.asyncAttributesPending&&Y.resource.waitForAsyncAttributes)W??=[],W.push(Y.resource.waitForAsyncAttributes())}if(W===null)q();else Promise.all(W).then(q,(X)=>{(0,S.globalErrorHandler)(X),Q(X)})})})}_maybeStartTimer(){if(this._isExporting)return;let J=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{if(this._isExporting=!1,this._finishedSpans.length>0)this._clearTimer(),this._maybeStartTimer()}).catch((Q)=>{this._isExporting=!1,(0,S.globalErrorHandler)(Q)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return J();if(this._timer!==void 0)return;if(this._timer=setTimeout(()=>J(),this._scheduledDelayMillis),typeof this._timer!=="number")this._timer.unref()}_clearTimer(){if(this._timer!==void 0)clearTimeout(this._timer),this._timer=void 0}}$Z.BatchSpanProcessorBase=ZZ});var HZ=K((XZ)=>{Object.defineProperty(XZ,"__esModule",{value:!0});XZ.BatchSpanProcessor=void 0;var D6=WZ();class zZ extends D6.BatchSpanProcessorBase{onShutdown(){}}XZ.BatchSpanProcessor=zZ});var BZ=K((VZ)=>{Object.defineProperty(VZ,"__esModule",{value:!0});VZ.RandomIdGenerator=void 0;var E6=8,GZ=16;class wZ{generateTraceId=KZ(GZ);generateSpanId=KZ(E6)}VZ.RandomIdGenerator=wZ;var hJ=Buffer.allocUnsafe(GZ);function KZ(J){return function(){for(let Z=0;Z<J/4;Z++)hJ.writeUInt32BE(Math.random()*4294967296>>>0,Z*4);for(let Z=0;Z<J;Z++)if(hJ[Z]>0)break;else if(Z===J-1)hJ[J-1]=1;return hJ.toString("hex",0,J)}}});var jZ=K((OJ)=>{Object.defineProperty(OJ,"__esModule",{value:!0});OJ.RandomIdGenerator=OJ.BatchSpanProcessor=void 0;var k6=HZ();Object.defineProperty(OJ,"BatchSpanProcessor",{enumerable:!0,get:function(){return k6.BatchSpanProcessor}});var I6=BZ();Object.defineProperty(OJ,"RandomIdGenerator",{enumerable:!0,get:function(){return I6.RandomIdGenerator}})});var mJ=K((DJ)=>{Object.defineProperty(DJ,"__esModule",{value:!0});DJ.RandomIdGenerator=DJ.BatchSpanProcessor=void 0;var FZ=jZ();Object.defineProperty(DJ,"BatchSpanProcessor",{enumerable:!0,get:function(){return FZ.BatchSpanProcessor}});Object.defineProperty(DJ,"RandomIdGenerator",{enumerable:!0,get:function(){return FZ.RandomIdGenerator}})});var DZ=K((hZ)=>{Object.defineProperty(hZ,"__esModule",{value:!0});hZ.METRIC_OTEL_SDK_SPAN_STARTED=hZ.METRIC_OTEL_SDK_SPAN_LIVE=hZ.ATTR_OTEL_SPAN_SAMPLING_RESULT=hZ.ATTR_OTEL_SPAN_PARENT_ORIGIN=void 0;hZ.ATTR_OTEL_SPAN_PARENT_ORIGIN="otel.span.parent.origin";hZ.ATTR_OTEL_SPAN_SAMPLING_RESULT="otel.span.sampling_result";hZ.METRIC_OTEL_SDK_SPAN_LIVE="otel.sdk.span.live";hZ.METRIC_OTEL_SDK_SPAN_STARTED="otel.sdk.span.started"});var MZ=K((kZ)=>{Object.defineProperty(kZ,"__esModule",{value:!0});kZ.TracerMetrics=void 0;var EJ=i(),qJ=DZ();class EZ{startedSpans;liveSpans;constructor(J){this.startedSpans=J.createCounter(qJ.METRIC_OTEL_SDK_SPAN_STARTED,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=J.createUpDownCounter(qJ.METRIC_OTEL_SDK_SPAN_LIVE,{unit:"{span}",description:"The number of currently live spans."})}startSpan(J,Q){let Z=N6(Q);if(this.startedSpans.add(1,{[qJ.ATTR_OTEL_SPAN_PARENT_ORIGIN]:P6(J),[qJ.ATTR_OTEL_SPAN_SAMPLING_RESULT]:Z}),Q===EJ.SamplingDecision.NOT_RECORD)return()=>{};let $={[qJ.ATTR_OTEL_SPAN_SAMPLING_RESULT]:Z};return this.liveSpans.add(1,$),()=>{this.liveSpans.add(-1,$)}}}kZ.TracerMetrics=EZ;function P6(J){if(!J)return"none";if(J.isRemote)return"remote";return"local"}function N6(J){switch(J){case EJ.SamplingDecision.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case EJ.SamplingDecision.RECORD:return"RECORD_ONLY";case EJ.SamplingDecision.NOT_RECORD:return"DROP"}}});var CZ=K((AZ)=>{Object.defineProperty(AZ,"__esModule",{value:!0});AZ.VERSION=void 0;AZ.VERSION="2.6.1"});var fZ=K((PZ)=>{Object.defineProperty(PZ,"__esModule",{value:!0});PZ.Tracer=void 0;var F=M(),kJ=E(),f6=PQ(),T6=lJ(),b6=mJ(),_6=MZ(),x6=CZ();class LZ{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(J,Q,Z,$){let q=(0,T6.mergeConfig)(Q);this._sampler=q.sampler,this._generalLimits=q.generalLimits,this._spanLimits=q.spanLimits,this._idGenerator=Q.idGenerator||new b6.RandomIdGenerator,this._resource=Z,this._spanProcessor=$,this.instrumentationScope=J;let W=q.meterProvider?q.meterProvider.getMeter("@opentelemetry/sdk-trace",x6.VERSION):F.createNoopMeter();this._tracerMetrics=new _6.TracerMetrics(W)}startSpan(J,Q={},Z=F.context.active()){if(Q.root)Z=F.trace.deleteSpan(Z);let $=F.trace.getSpan(Z);if((0,kJ.isTracingSuppressed)(Z))return F.diag.debug("Instrumentation suppressed, returning Noop Span"),F.trace.wrapSpanContext(F.INVALID_SPAN_CONTEXT);let q=$?.spanContext(),W=this._idGenerator.generateSpanId(),X,H,Y;if(!q||!F.trace.isSpanContextValid(q))H=this._idGenerator.generateTraceId();else H=q.traceId,Y=q.traceState,X=q;let V=Q.kind??F.SpanKind.INTERNAL,R=(Q.links??[]).map((D)=>{return{context:D.context,attributes:(0,kJ.sanitizeAttributes)(D.attributes)}}),z=(0,kJ.sanitizeAttributes)(Q.attributes),U=this._sampler.shouldSample(Z,H,J,V,z,R),I=this._tracerMetrics.startSpan(q,U.decision);Y=U.traceState??Y;let G=U.decision===F.SamplingDecision.RECORD_AND_SAMPLED?F.TraceFlags.SAMPLED:F.TraceFlags.NONE,w={traceId:H,spanId:W,traceFlags:G,traceState:Y};if(U.decision===F.SamplingDecision.NOT_RECORD)return F.diag.debug("Recording is off, propagating context in a non-recording span"),F.trace.wrapSpanContext(w);let B=(0,kJ.sanitizeAttributes)(Object.assign(z,U.attributes));return new f6.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:Z,spanContext:w,name:J,kind:V,links:R,parentSpanContext:X,attributes:B,startTime:Q.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:I})}startActiveSpan(J,Q,Z,$){let q,W,X;if(arguments.length<2)return;else if(arguments.length===2)X=Q;else if(arguments.length===3)q=Q,X=Z;else q=Q,W=Z,X=$;let H=W??F.context.active(),Y=this.startSpan(J,q,H),V=F.trace.setSpan(H,Y);return F.context.with(V,X,void 0,Y)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}PZ.Tracer=LZ});var xZ=K((bZ)=>{Object.defineProperty(bZ,"__esModule",{value:!0});bZ.MultiSpanProcessor=void 0;var d6=E();class TZ{_spanProcessors;constructor(J){this._spanProcessors=J}forceFlush(){let J=[];for(let Q of this._spanProcessors)J.push(Q.forceFlush());return new Promise((Q)=>{Promise.all(J).then(()=>{Q()}).catch((Z)=>{(0,d6.globalErrorHandler)(Z||Error("MultiSpanProcessor: forceFlush failed")),Q()})})}onStart(J,Q){for(let Z of this._spanProcessors)Z.onStart(J,Q)}onEnding(J){for(let Q of this._spanProcessors)if(Q.onEnding)Q.onEnding(J)}onEnd(J){for(let Q of this._spanProcessors)Q.onEnd(J)}shutdown(){let J=[];for(let Q of this._spanProcessors)J.push(Q.shutdown());return new Promise((Q,Z)=>{Promise.all(J).then(()=>{Q()},Z)})}}bZ.MultiSpanProcessor=TZ});var lZ=K((vZ)=>{Object.defineProperty(vZ,"__esModule",{value:!0});vZ.BasicTracerProvider=vZ.ForceFlushState=void 0;var y6=E(),S6=yZ(),v6=fZ(),g6=gJ(),l6=xZ(),m6=lJ(),o;(function(J){J[J.resolved=0]="resolved",J[J.timeout=1]="timeout",J[J.error=2]="error",J[J.unresolved=3]="unresolved"})(o=vZ.ForceFlushState||(vZ.ForceFlushState={}));class SZ{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(J={}){let Q=(0,y6.merge)({},(0,g6.loadDefaultConfig)(),(0,m6.reconfigureLimits)(J));this._resource=Q.resource??(0,S6.defaultResource)(),this._config=Object.assign({},Q,{resource:this._resource});let Z=[];if(J.spanProcessors?.length)Z.push(...J.spanProcessors);this._activeSpanProcessor=new l6.MultiSpanProcessor(Z)}getTracer(J,Q,Z){let $=`${J}@${Q||""}:${Z?.schemaUrl||""}`;if(!this._tracers.has($))this._tracers.set($,new v6.Tracer({name:J,version:Q,schemaUrl:Z?.schemaUrl},this._config,this._resource,this._activeSpanProcessor));return this._tracers.get($)}forceFlush(){let J=this._config.forceFlushTimeoutMillis,Q=this._activeSpanProcessor._spanProcessors.map((Z)=>{return new Promise(($)=>{let q,W=setTimeout(()=>{$(Error(`Span processor did not completed within timeout period of ${J} ms`)),q=o.timeout},J);Z.forceFlush().then(()=>{if(clearTimeout(W),q!==o.timeout)q=o.resolved,$(q)}).catch((X)=>{clearTimeout(W),q=o.error,$(X)})})});return new Promise((Z,$)=>{Promise.all(Q).then((q)=>{let W=q.filter((X)=>X!==o.resolved);if(W.length>0)$(W);else Z()}).catch((q)=>$([q]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}vZ.BasicTracerProvider=SZ});var pZ=K((uZ)=>{Object.defineProperty(uZ,"__esModule",{value:!0});uZ.ConsoleSpanExporter=void 0;var uJ=E();class mZ{export(J,Q){return this._sendSpans(J,Q)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(J){return{resource:{attributes:J.resource.attributes},instrumentationScope:J.instrumentationScope,traceId:J.spanContext().traceId,parentSpanContext:J.parentSpanContext,traceState:J.spanContext().traceState?.serialize(),name:J.name,id:J.spanContext().spanId,kind:J.kind,timestamp:(0,uJ.hrTimeToMicroseconds)(J.startTime),duration:(0,uJ.hrTimeToMicroseconds)(J.duration),attributes:J.attributes,status:J.status,events:J.events,links:J.links}}_sendSpans(J,Q){for(let Z of J)console.dir(this._exportInfo(Z),{depth:3});if(Q)return Q({code:uJ.ExportResultCode.SUCCESS})}}uZ.ConsoleSpanExporter=mZ});var aZ=K((sZ)=>{Object.defineProperty(sZ,"__esModule",{value:!0});sZ.InMemorySpanExporter=void 0;var nZ=E();class iZ{_finishedSpans=[];_stopped=!1;export(J,Q){if(this._stopped)return Q({code:nZ.ExportResultCode.FAILED,error:Error("Exporter has been stopped")});this._finishedSpans.push(...J),setTimeout(()=>Q({code:nZ.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}sZ.InMemorySpanExporter=iZ});var J0=K((tZ)=>{Object.defineProperty(tZ,"__esModule",{value:!0});tZ.SimpleSpanProcessor=void 0;var u6=M(),IJ=E();class rZ{_exporter;_shutdownOnce;_pendingExports;constructor(J){this._exporter=J,this._shutdownOnce=new IJ.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){if(await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush)await this._exporter.forceFlush()}onStart(J,Q){}onEnd(J){if(this._shutdownOnce.isCalled)return;if((J.spanContext().traceFlags&u6.TraceFlags.SAMPLED)===0)return;let Q=this._doExport(J).catch((Z)=>(0,IJ.globalErrorHandler)(Z));this._pendingExports.add(Q),Q.finally(()=>this._pendingExports.delete(Q))}async _doExport(J){if(J.resource.asyncAttributesPending)await J.resource.waitForAsyncAttributes?.();let Q=await IJ.internal._export(this._exporter,[J]);if(Q.code!==IJ.ExportResultCode.SUCCESS)throw Q.error??Error(`SimpleSpanProcessor: span export failed (status ${Q})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}tZ.SimpleSpanProcessor=rZ});var q0=K((Z0)=>{Object.defineProperty(Z0,"__esModule",{value:!0});Z0.NoopSpanProcessor=void 0;class Q0{onStart(J,Q){}onEnd(J){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}Z0.NoopSpanProcessor=Q0});var cJ=K((A)=>{Object.defineProperty(A,"__esModule",{value:!0});A.SamplingDecision=A.TraceIdRatioBasedSampler=A.ParentBasedSampler=A.AlwaysOnSampler=A.AlwaysOffSampler=A.NoopSpanProcessor=A.SimpleSpanProcessor=A.InMemorySpanExporter=A.ConsoleSpanExporter=A.RandomIdGenerator=A.BatchSpanProcessor=A.BasicTracerProvider=void 0;var c6=lZ();Object.defineProperty(A,"BasicTracerProvider",{enumerable:!0,get:function(){return c6.BasicTracerProvider}});var W0=mJ();Object.defineProperty(A,"BatchSpanProcessor",{enumerable:!0,get:function(){return W0.BatchSpanProcessor}});Object.defineProperty(A,"RandomIdGenerator",{enumerable:!0,get:function(){return W0.RandomIdGenerator}});var p6=pZ();Object.defineProperty(A,"ConsoleSpanExporter",{enumerable:!0,get:function(){return p6.ConsoleSpanExporter}});var n6=aZ();Object.defineProperty(A,"InMemorySpanExporter",{enumerable:!0,get:function(){return n6.InMemorySpanExporter}});var i6=J0();Object.defineProperty(A,"SimpleSpanProcessor",{enumerable:!0,get:function(){return i6.SimpleSpanProcessor}});var s6=q0();Object.defineProperty(A,"NoopSpanProcessor",{enumerable:!0,get:function(){return s6.NoopSpanProcessor}});var o6=wJ();Object.defineProperty(A,"AlwaysOffSampler",{enumerable:!0,get:function(){return o6.AlwaysOffSampler}});var a6=VJ();Object.defineProperty(A,"AlwaysOnSampler",{enumerable:!0,get:function(){return a6.AlwaysOnSampler}});var r6=dJ();Object.defineProperty(A,"ParentBasedSampler",{enumerable:!0,get:function(){return r6.ParentBasedSampler}});var t6=yJ();Object.defineProperty(A,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return t6.TraceIdRatioBasedSampler}});var e6=i();Object.defineProperty(A,"SamplingDecision",{enumerable:!0,get:function(){return e6.SamplingDecision}})});var H0=K((X0)=>{Object.defineProperty(X0,"__esModule",{value:!0});X0.NodeTracerProvider=void 0;var Q7=EQ(),Z7=cJ(),WJ=M(),pJ=E();function $7(J){if(J===null)return;if(J===void 0){let Q=new Q7.AsyncLocalStorageContextManager;Q.enable(),WJ.context.setGlobalContextManager(Q);return}J.enable(),WJ.context.setGlobalContextManager(J)}function q7(J){if(J===null)return;if(J===void 0){WJ.propagation.setGlobalPropagator(new pJ.CompositePropagator({propagators:[new pJ.W3CTraceContextPropagator,new pJ.W3CBaggagePropagator]}));return}WJ.propagation.setGlobalPropagator(J)}class z0 extends Z7.BasicTracerProvider{constructor(J={}){super(J)}register(J={}){WJ.trace.setGlobalTracerProvider(this),$7(J.contextManager),q7(J.propagator)}}X0.NodeTracerProvider=z0});var K0=K((k)=>{Object.defineProperty(k,"__esModule",{value:!0});k.TraceIdRatioBasedSampler=k.SimpleSpanProcessor=k.SamplingDecision=k.RandomIdGenerator=k.ParentBasedSampler=k.NoopSpanProcessor=k.InMemorySpanExporter=k.ConsoleSpanExporter=k.BatchSpanProcessor=k.BasicTracerProvider=k.AlwaysOnSampler=k.AlwaysOffSampler=k.NodeTracerProvider=void 0;var W7=H0();Object.defineProperty(k,"NodeTracerProvider",{enumerable:!0,get:function(){return W7.NodeTracerProvider}});var L=cJ();Object.defineProperty(k,"AlwaysOffSampler",{enumerable:!0,get:function(){return L.AlwaysOffSampler}});Object.defineProperty(k,"AlwaysOnSampler",{enumerable:!0,get:function(){return L.AlwaysOnSampler}});Object.defineProperty(k,"BasicTracerProvider",{enumerable:!0,get:function(){return L.BasicTracerProvider}});Object.defineProperty(k,"BatchSpanProcessor",{enumerable:!0,get:function(){return L.BatchSpanProcessor}});Object.defineProperty(k,"ConsoleSpanExporter",{enumerable:!0,get:function(){return L.ConsoleSpanExporter}});Object.defineProperty(k,"InMemorySpanExporter",{enumerable:!0,get:function(){return L.InMemorySpanExporter}});Object.defineProperty(k,"NoopSpanProcessor",{enumerable:!0,get:function(){return L.NoopSpanProcessor}});Object.defineProperty(k,"ParentBasedSampler",{enumerable:!0,get:function(){return L.ParentBasedSampler}});Object.defineProperty(k,"RandomIdGenerator",{enumerable:!0,get:function(){return L.RandomIdGenerator}});Object.defineProperty(k,"SamplingDecision",{enumerable:!0,get:function(){return L.SamplingDecision}});Object.defineProperty(k,"SimpleSpanProcessor",{enumerable:!0,get:function(){return L.SimpleSpanProcessor}});Object.defineProperty(k,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return L.TraceIdRatioBasedSampler}})});var a0=d(K0(),1);var MJ=(J)=>J!==void 0&&!(Array.isArray(J)&&J.length===0);var HJ=d(M(),1);var v;(function(J){J[J.UNSPECIFIED=0]="UNSPECIFIED",J[J.TRACE=1]="TRACE",J[J.TRACE2=2]="TRACE2",J[J.TRACE3=3]="TRACE3",J[J.TRACE4=4]="TRACE4",J[J.DEBUG=5]="DEBUG",J[J.DEBUG2=6]="DEBUG2",J[J.DEBUG3=7]="DEBUG3",J[J.DEBUG4=8]="DEBUG4",J[J.INFO=9]="INFO",J[J.INFO2=10]="INFO2",J[J.INFO3=11]="INFO3",J[J.INFO4=12]="INFO4",J[J.WARN=13]="WARN",J[J.WARN2=14]="WARN2",J[J.WARN3=15]="WARN3",J[J.WARN4=16]="WARN4",J[J.ERROR=17]="ERROR",J[J.ERROR2=18]="ERROR2",J[J.ERROR3=19]="ERROR3",J[J.ERROR4=20]="ERROR4",J[J.FATAL=21]="FATAL",J[J.FATAL2=22]="FATAL2",J[J.FATAL3=23]="FATAL3",J[J.FATAL4=24]="FATAL4"})(v||(v={}));class zJ{emit(J){}}var XJ=new zJ;var YJ=Symbol.for("io.opentelemetry.js.api.logs"),a=globalThis;function G0(J,Q,Z){return($)=>$===J?Q:Z}var nJ=1;class w0{getLogger(J,Q,Z){return new zJ}}var AJ=new w0;class iJ{constructor(J,Q,Z,$){this._provider=J,this.name=Q,this.version=Z,this.options=$}emit(J){this._getLogger().emit(J)}_getLogger(){if(this._delegate)return this._delegate;let J=this._provider._getDelegateLogger(this.name,this.version,this.options);if(!J)return XJ;return this._delegate=J,this._delegate}}class RJ{getLogger(J,Q,Z){var $;return($=this._getDelegateLogger(J,Q,Z))!==null&&$!==void 0?$:new iJ(this,J,Q,Z)}_getDelegate(){var J;return(J=this._delegate)!==null&&J!==void 0?J:AJ}_setDelegate(J){this._delegate=J}_getDelegateLogger(J,Q,Z){var $;return($=this._delegate)===null||$===void 0?void 0:$.getLogger(J,Q,Z)}}class CJ{constructor(){this._proxyLoggerProvider=new RJ}static getInstance(){if(!this._instance)this._instance=new CJ;return this._instance}setGlobalLoggerProvider(J){if(a[YJ])return this.getLoggerProvider();return a[YJ]=G0(nJ,J,AJ),this._proxyLoggerProvider._setDelegate(J),J}getLoggerProvider(){var J,Q;return(Q=(J=a[YJ])===null||J===void 0?void 0:J.call(a,nJ))!==null&&Q!==void 0?Q:this._proxyLoggerProvider}getLogger(J,Q,Z){return this.getLoggerProvider().getLogger(J,Q,Z)}disable(){delete a[YJ],this._proxyLoggerProvider=new RJ}}var l8=CJ.getInstance();var j0=d(yZ(),1),F0=d(E(),1);var T=d(M(),1);var f=d(M(),1),oJ=d(E(),1),C=d(AQ(),1);function V0(J){return sJ(J,new WeakSet)}function sJ(J,Q){if(J==null)return!0;if(typeof J==="string"||typeof J==="number"||typeof J==="boolean")return!0;if(J instanceof Uint8Array)return!0;if(typeof J==="object"){if(Q.has(J))return!1;if(Q.add(J),Array.isArray(J))return J.every(($)=>sJ($,Q));let Z=J;if(Z.constructor!==Object&&Z.constructor!==void 0)return!1;return Object.values(Z).every(($)=>sJ($,Q))}return!1}class aJ{hrTime;hrTimeObserved;spanContext;resource;instrumentationScope;attributes={};_severityText;_severityNumber;_body;_eventName;_attributesCount=0;_droppedAttributesCount=0;_isReadonly=!1;_logRecordLimits;set severityText(J){if(this._isLogRecordReadonly())return;this._severityText=J}get severityText(){return this._severityText}set severityNumber(J){if(this._isLogRecordReadonly())return;this._severityNumber=J}get severityNumber(){return this._severityNumber}set body(J){if(this._isLogRecordReadonly())return;this._body=J}get body(){return this._body}get eventName(){return this._eventName}set eventName(J){if(this._isLogRecordReadonly())return;this._eventName=J}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(J,Q,Z){let{timestamp:$,observedTimestamp:q,eventName:W,severityNumber:X,severityText:H,body:Y,attributes:V={},exception:R,context:z}=Z,U=Date.now();if(this.hrTime=oJ.timeInputToHrTime($??U),this.hrTimeObserved=oJ.timeInputToHrTime(q??U),z){let I=f.trace.getSpanContext(z);if(I&&f.isSpanContextValid(I))this.spanContext=I}if(this.severityNumber=X,this.severityText=H,this.body=Y,this.resource=J.resource,this.instrumentationScope=Q,this._logRecordLimits=J.logRecordLimits,this._eventName=W,this.setAttributes(V),R!=null)this._setException(R)}setAttribute(J,Q){if(this._isLogRecordReadonly())return this;if(J.length===0)return f.diag.warn(`Invalid attribute key: ${J}`),this;if(!V0(Q))return f.diag.warn(`Invalid attribute value set for key: ${J}`),this;let Z=!Object.prototype.hasOwnProperty.call(this.attributes,J);if(Z&&this._attributesCount>=this._logRecordLimits.attributeCountLimit){if(this._droppedAttributesCount++,this._droppedAttributesCount===1)f.diag.warn("Dropping extra attributes.");return this}if(this.attributes[J]=this._truncateToSize(Q),Z)this._attributesCount++;return this}setAttributes(J){for(let[Q,Z]of Object.entries(J))this.setAttribute(Q,Z);return this}setBody(J){return this.body=J,this}setEventName(J){return this.eventName=J,this}setSeverityNumber(J){return this.severityNumber=J,this}setSeverityText(J){return this.severityText=J,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(J){let Q=this._logRecordLimits.attributeValueLengthLimit;if(Q<=0)return f.diag.warn(`Attribute value limit must be positive, got ${Q}`),J;if(J==null)return J;if(typeof J==="string")return this._truncateToLimitUtil(J,Q);if(J instanceof Uint8Array)return J;if(Array.isArray(J))return J.map((Z)=>this._truncateToSize(Z));if(typeof J==="object"){let Z={};for(let[$,q]of Object.entries(J))Z[$]=this._truncateToSize(q);return Z}return J}_setException(J){let Q=!1;if(typeof J==="string"||typeof J==="number"){if(!Object.hasOwn(this.attributes,C.ATTR_EXCEPTION_MESSAGE))this.setAttribute(C.ATTR_EXCEPTION_MESSAGE,String(J));Q=!0}else if(J&&typeof J==="object"){let Z=J;if(Z.code){if(!Object.hasOwn(this.attributes,C.ATTR_EXCEPTION_TYPE))this.setAttribute(C.ATTR_EXCEPTION_TYPE,Z.code.toString());Q=!0}else if(Z.name){if(!Object.hasOwn(this.attributes,C.ATTR_EXCEPTION_TYPE))this.setAttribute(C.ATTR_EXCEPTION_TYPE,Z.name);Q=!0}if(Z.message){if(!Object.hasOwn(this.attributes,C.ATTR_EXCEPTION_MESSAGE))this.setAttribute(C.ATTR_EXCEPTION_MESSAGE,Z.message);Q=!0}if(Z.stack){if(!Object.hasOwn(this.attributes,C.ATTR_EXCEPTION_STACKTRACE))this.setAttribute(C.ATTR_EXCEPTION_STACKTRACE,Z.stack);Q=!0}}if(!Q)f.diag.warn(`Failed to record an exception ${J}`)}_truncateToLimitUtil(J,Q){if(J.length<=Q)return J;return J.substring(0,Q)}_isLogRecordReadonly(){if(this._isReadonly)f.diag.warn("Can not execute the operation on emitted log record");return this._isReadonly}}class rJ{instrumentationScope;_sharedState;_loggerConfig;constructor(J,Q){this.instrumentationScope=J,this._sharedState=Q,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(J){let Q=this._loggerConfig,Z=J.context||T.context.active(),$=J.severityNumber??v.UNSPECIFIED;if($!==v.UNSPECIFIED&&$<Q.minimumSeverity)return;if(Q.traceBased){let W=T.trace.getSpanContext(Z);if(W&&T.isSpanContextValid(W)){if((W.traceFlags&T.TraceFlags.SAMPLED)!==T.TraceFlags.SAMPLED)return}}let q=new aJ(this._sharedState,this.instrumentationScope,{context:Z,...J});this._sharedState.activeProcessor.onEmit(q,Z),q._makeReadonly()}}class tJ{forceFlush(){return Promise.resolve()}onEmit(J,Q){}shutdown(){return Promise.resolve()}}var U0=d(E(),1);class eJ{processors;forceFlushTimeoutMillis;constructor(J,Q){this.processors=J,this.forceFlushTimeoutMillis=Q}async forceFlush(){let J=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map((Q)=>U0.callWithTimeout(Q.forceFlush(),J)))}onEmit(J,Q){this.processors.forEach((Z)=>Z.onEmit(J,Q))}async shutdown(){await Promise.all(this.processors.map((J)=>J.shutdown()))}}function B0(J){return`${J.name}@${J.version||""}:${J.schemaUrl||""}`}var X7={disabled:!1,minimumSeverity:v.UNSPECIFIED,traceBased:!1},JQ=()=>({...X7});class QQ{loggers=new Map;activeProcessor;registeredLogRecordProcessors=[];resource;forceFlushTimeoutMillis;logRecordLimits;processors;_loggerConfigurator;_loggerConfigs=new Map;constructor(J,Q,Z,$,q){if(this.resource=J,this.forceFlushTimeoutMillis=Q,this.logRecordLimits=Z,this.processors=$,$.length>0)this.registeredLogRecordProcessors=$,this.activeProcessor=new eJ(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis);else this.activeProcessor=new tJ;this._loggerConfigurator=q??JQ}getLoggerConfig(J){let Q=B0(J),Z=this._loggerConfigs.get(Q);if(Z)return Z;return Z=this._loggerConfigurator(J),this._loggerConfigs.set(Q,Z),Z}}var Y7="unknown";class LJ{_shutdownOnce;_sharedState;constructor(J={}){let Q={resource:J.resource??j0.defaultResource(),forceFlushTimeoutMillis:J.forceFlushTimeoutMillis??30000,logRecordLimits:{attributeCountLimit:J.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:J.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:J.loggerConfigurator??JQ,processors:J.processors??[]};this._sharedState=new QQ(Q.resource,Q.forceFlushTimeoutMillis,Q.logRecordLimits,Q.processors,Q.loggerConfigurator),this._shutdownOnce=new F0.BindOnceFuture(this._shutdown,this)}getLogger(J,Q,Z){if(this._shutdownOnce.isCalled)return HJ.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),XJ;if(!J)HJ.diag.warn("Logger requested without instrumentation scope name.");let $=J||Y7,q=`${$}@${Q||""}:${Z?.schemaUrl||""}`;if(!this._sharedState.loggers.has(q))this._sharedState.loggers.set(q,new rJ({name:$,version:Q,schemaUrl:Z?.schemaUrl},this._sharedState));return this._sharedState.loggers.get(q)}forceFlush(){if(this._shutdownOnce.isCalled)return HJ.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise;return this._sharedState.activeProcessor.forceFlush()}shutdown(){if(this._shutdownOnce.isCalled)return HJ.diag.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise;return this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}class qQ extends O0()("@effect/opentelemetry/Logger/OtelLoggerProvider"){}var G7=g(function*(){let J=yield*qQ,Q=yield*A0,Z=J.getLogger("@effect/opentelemetry");return L0(($)=>{let q={fiberId:$.fiber.id},W=D0($.fiber.context,E0);if(h0(W))q.spanId=W.spanId,q.traceId=W.traceId;for(let[V,R]of Object.entries($.fiber.getRef(k0)))q[V]=ZQ(R);let X=$.date.getTime();for(let[V,R]of $.fiber.getRef(I0))q[`logSpan.${V}`]=`${X-R}ms`;let H=$Q($.message).map(ZQ),Y=N0(Q.currentTimeNanosUnsafe());Z.emit({body:H.length===1?H[0]:H,severityText:$.logLevel,severityNumber:C0($.logLevel),timestamp:Y,observedTimestamp:Y,attributes:q})})}),f0=(J)=>P0([G7],{mergeWithExisting:J.mergeWithExisting??!0}),T0=(J,Q)=>PJ(qQ,g(function*(){let Z=yield*ZJ;return yield*JJ(u(()=>new LJ({...Q??void 0,processors:$Q(J),resource:Z})),($)=>r(()=>$.forceFlush().then(()=>$.shutdown())).pipe(t,QJ,e(Q?.shutdownTimeout??3000)))}));var l=d(M(),1);var c;(function(J){J[J.DELTA=0]="DELTA",J[J.CUMULATIVE=1]="CUMULATIVE"})(c||(c={}));var P;(function(J){J.COUNTER="COUNTER",J.GAUGE="GAUGE",J.HISTOGRAM="HISTOGRAM",J.UP_DOWN_COUNTER="UP_DOWN_COUNTER",J.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",J.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",J.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(P||(P={}));var b;(function(J){J[J.HISTOGRAM=0]="HISTOGRAM",J[J.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",J[J.GAUGE=2]="GAUGE",J[J.SUM=3]="SUM"})(b||(b={}));var V7="@effect/opentelemetry/Metrics";class zQ{resource;context;temporality;startTimes;startTimeNanos;previousExportTimeNanos;previousCounterState;previousHistogramState;previousFrequencyState;previousSummaryState;constructor(J,Q,Z="cumulative"){this.resource=J,this.context=Q,this.temporality=Z,this.startTimes=new Map,this.startTimeNanos=b0(),this.previousExportTimeNanos=this.startTimeNanos,this.previousCounterState=new Map,this.previousHistogramState=new Map,this.previousFrequencyState=new Map,this.previousSummaryState=new Map}startTimeFor(J,Q){if(this.startTimes.has(J))return this.startTimes.get(J);return this.startTimes.set(J,Q),Q}collect(J){let Q=x0(this.context),Z=b0(),$=[],q=new Map,W=(V)=>{$.push(V),q.set(V.descriptor.name,V)},X=this.temporality==="delta",H=X?c.DELTA:c.CUMULATIVE,Y=X?this.previousExportTimeNanos:this.startTimeNanos;for(let V=0,R=Q.length;V<R;V++){let z=Q[V],U=z.attributes?_0(Object.entries(z.attributes),{},(G,[w,B])=>{return G[w]=String(B),G}):{},I=U7(z.id,z.attributes);switch(z.type){case"Counter":{let G=z.state.count,w=G;if(X){let j=this.previousCounterState.get(I);if(j!==void 0)if(typeof G==="bigint"&&typeof j==="bigint"){if(w=G-j,w<0n)w=G}else{let y=Number(G),p=Number(j);if(w=y-p,w<0)w=y}this.previousCounterState.set(I,G)}let B=$J(z,U),D={startTime:this.startTimeFor(B.name,Y),endTime:Z,attributes:U,value:Number(w)};if(q.has(z.id))q.get(z.id).dataPoints.push(D);else W({dataPointType:b.SUM,descriptor:B,isMonotonic:z.state.incremental,aggregationTemporality:H,dataPoints:[D]});break}case"Gauge":{let G=$J(z,U),B={startTime:this.startTimeFor(G.name,this.startTimeNanos),endTime:Z,attributes:U,value:Number(z.state.value)};if(q.has(z.id))q.get(z.id).dataPoints.push(B);else W({dataPointType:b.GAUGE,descriptor:G,aggregationTemporality:c.CUMULATIVE,dataPoints:[B]});break}case"Histogram":{let G=z.state.buckets.length,w={boundaries:WQ(G-1),counts:WQ(G)},B=0,N=0;for(let[n,KJ]of z.state.buckets){if(B<G-1)w.boundaries[B]=n;w.counts[B]=KJ-N,N=KJ,B++}let D=z.state.count,j=z.state.sum,y=w.counts,p=z.state.min,fJ=z.state.max;if(X){let n=this.previousHistogramState.get(I);if(n!==void 0)D=z.state.count-n.count,j=z.state.sum-n.sum,y=w.counts.map((KJ,r0)=>Math.max(0,KJ-(n.bucketCounts[r0]??0)));this.previousHistogramState.set(I,{count:z.state.count,sum:z.state.sum,bucketCounts:w.counts.slice(),min:z.state.min,max:z.state.max})}let YQ=$J(z,U),HQ={startTime:this.startTimeFor(YQ.name,Y),endTime:Z,attributes:U,value:{buckets:{boundaries:w.boundaries,counts:y},count:D,min:p,max:fJ,sum:j}};if(q.has(z.id))q.get(z.id).dataPoints.push(HQ);else W({dataPointType:b.HISTOGRAM,descriptor:YQ,aggregationTemporality:H,dataPoints:[HQ]});break}case"Frequency":{let G=[],w=new Map;for(let[B,N]of z.state.occurrences){w.set(B,N);let D=N;if(X){let p=this.previousFrequencyState.get(I);if(p!==void 0){let fJ=p.get(B)??0;D=Math.max(0,N-fJ)}}let j=$J(z,U),y=this.startTimeFor(j.name,Y);G.push({startTime:y,endTime:Z,attributes:{...U,key:B},value:D})}if(X)this.previousFrequencyState.set(I,w);if(q.has(z.id))q.get(z.id).dataPoints.push(...G);else{let B=$J(z,U);W({dataPointType:b.SUM,descriptor:B,aggregationTemporality:H,isMonotonic:!0,dataPoints:G})}break}case"Summary":{let G=[{startTime:Y,endTime:Z,attributes:{...U,quantile:"min"},value:z.state.min}];for(let[j,y]of z.state.quantiles)G.push({startTime:Y,endTime:Z,attributes:{...U,quantile:j.toString()},value:y??0});G.push({startTime:Y,endTime:Z,attributes:{...U,quantile:"max"},value:z.state.max});let w=z.state.count,B=z.state.sum;if(X){let j=this.previousSummaryState.get(I);if(j!==void 0)w=z.state.count-j.count,B=z.state.sum-j.sum;this.previousSummaryState.set(I,{count:z.state.count,sum:z.state.sum})}let N={startTime:Y,endTime:Z,attributes:U,value:w},D={startTime:Y,endTime:Z,attributes:U,value:B};if(q.has(`${z.id}_quantiles`))q.get(`${z.id}_quantiles`).dataPoints.push(...G),q.get(`${z.id}_count`).dataPoints.push(N),q.get(`${z.id}_sum`).dataPoints.push(D);else{let j=$J(z,U);W({dataPointType:b.SUM,descriptor:{...j,name:`${j.name}_quantiles`},aggregationTemporality:H,isMonotonic:!1,dataPoints:G}),W({dataPointType:b.SUM,descriptor:{name:`${z.id}_count`,description:z.description??"",unit:"1",type:P.COUNTER,valueType:l.ValueType.INT,advice:{}},aggregationTemporality:H,isMonotonic:!0,dataPoints:[N]}),W({dataPointType:b.SUM,descriptor:{name:`${z.id}_sum`,description:z.description??"",unit:"1",type:P.COUNTER,valueType:l.ValueType.DOUBLE,advice:{}},aggregationTemporality:H,isMonotonic:!0,dataPoints:[D]})}break}}}if(X)this.previousExportTimeNanos=Z;return Promise.resolve({resourceMetrics:{resource:this.resource,scopeMetrics:[{scope:{name:V7},metrics:$}]},errors:[]})}}var U7=(J,Q)=>{if(Q===void 0||Object.keys(Q).length===0)return J;let Z=Object.entries(Q).sort(($,q)=>$[0].localeCompare(q[0]));return`${J}:${JSON.stringify(Z)}`},b0=()=>{let J=Date.now();return[Math.floor(J/1000),J%1000*1e6]},$J=(J,Q)=>{let Z=Q.unit??Q.time_unit??"1";return{name:J.id,description:J.description??"",unit:Z,type:B7(J),valueType:j7(J),advice:{}}},B7=(J)=>{switch(J.type){case"Histogram":return P.HISTOGRAM;case"Gauge":return P.OBSERVABLE_GAUGE;case"Frequency":return P.COUNTER;case"Counter":return J.state.incremental?P.COUNTER:P.UP_DOWN_COUNTER;case"Summary":return P.COUNTER}},j7=(J)=>{if(J.type==="Counter")return typeof J.state.count==="bigint"?l.ValueType.INT:l.ValueType.DOUBLE;else if(J.type==="Gauge")return typeof J.state.value==="bigint"?l.ValueType.INT:l.ValueType.DOUBLE;return l.ValueType.DOUBLE};var F7=(J)=>g(function*(){let Q=yield*ZJ,Z=yield*S0();return new zQ(Q,Z,J)}),h7=(J,Q,Z)=>JJ(u(()=>{let $=Q(),q=Array.isArray($)?$:[$];return q.forEach((W)=>W.setMetricProducer(J)),q}),($)=>r(()=>Promise.all($.map((q)=>q.shutdown()))).pipe(t,QJ,e(Z?.shutdownTimeout??3000))),v0=(J,Q)=>d0(y0(F7(Q?.temporality),(Z)=>h7(Z,J,Q)));var D7=(J,Q)=>PJ(s0,g(function*(){let Z=yield*ZJ;return yield*JJ(u(()=>{return new a0.NodeTracerProvider({...Q??void 0,resource:Z,spanProcessors:Array.isArray(J)?J:[J]})}),($)=>r(()=>$.forceFlush().then(()=>$.shutdown())).pipe(t,QJ,e(Q?.shutdownTimeout??3000)))})),a9=(J)=>l0(g(function*(){let Q=yield*c0(J)?J:u(J),Z=n0(Q.resource&&p0(Q.resource)),$=MJ(Q.spanProcessor)?XQ(o0,D7(Q.spanProcessor,{...Q.tracerConfig,shutdownTimeout:Q.shutdownTimeout})):NJ,q=MJ(Q.metricReader)?v0(g0(Q.metricReader),{shutdownTimeout:Q.shutdownTimeout,temporality:Q.metricTemporality}):NJ,W=MJ(Q.logRecordProcessor)?XQ(f0({mergeWithExisting:Q.loggerMergeWithExisting}),T0(Q.logRecordProcessor,{...Q.loggerProviderConfig,shutdownTimeout:Q.shutdownTimeout})):NJ;return m0($,q,W).pipe(u0(Z))})),r9=i0;export{D7 as layerTracerProvider,r9 as layerEmpty,a9 as layer};
|
|
2
|
+
import{Hs as yZ,Is as N0,Js as ZQ,Ks as ZJ,Ls as p0,Ms as n0,Ns as i0,Ps as s0,Qs as o0}from"./chunk-yvtbt12y.js";import{Rs as AQ,Ss as E}from"./chunk-g83d3a0t.js";import{BQ as L0,CQ as P0,DH as r,HH as u,II as JJ,KD as O0,KE as _0,MH as g,QD as D0,QI as QJ,TG as NJ,TH as y0,UG as PJ,WG as d0,XG as l0,YG as m0,ZG as XQ,_G as u0,cC as g0,cF as E0,fH as A0,lI as t,nI as e,sQ as C0,tC as h0,wG as k0,xE as WQ,xG as I0,xH as x0,zE as $Q,zH as c0,zI as S0}from"./chunk-tz60e15h.js";import{PQ as M}from"./chunk-63t0rhc9.js";import{QQ as d,RQ as K,UQ as TJ}from"./chunk-9svh74gt.js";var bJ=K((GQ)=>{Object.defineProperty(GQ,"__esModule",{value:!0});GQ.AbstractAsyncHooksContextManager=void 0;var t0=TJ("events"),e0=["addListener","on","once","prependListener","prependOnceListener"];class KQ{bind(J,Q){if(Q instanceof t0.EventEmitter)return this._bindEventEmitter(J,Q);if(typeof Q==="function")return this._bindFunction(J,Q);return Q}_bindFunction(J,Q){let Z=this,$=function(...q){return Z.with(J,()=>Q.apply(this,q))};return Object.defineProperty($,"length",{enumerable:!1,configurable:!0,writable:!1,value:Q.length}),$}_bindEventEmitter(J,Q){if(this._getPatchMap(Q)!==void 0)return Q;if(this._createPatchMap(Q),e0.forEach(($)=>{if(Q[$]===void 0)return;Q[$]=this._patchAddListener(Q,Q[$],J)}),typeof Q.removeListener==="function")Q.removeListener=this._patchRemoveListener(Q,Q.removeListener);if(typeof Q.off==="function")Q.off=this._patchRemoveListener(Q,Q.off);if(typeof Q.removeAllListeners==="function")Q.removeAllListeners=this._patchRemoveAllListeners(Q,Q.removeAllListeners);return Q}_patchRemoveListener(J,Q){let Z=this;return function($,q){let W=Z._getPatchMap(J)?.[$];if(W===void 0)return Q.call(this,$,q);let X=W.get(q);return Q.call(this,$,X||q)}}_patchRemoveAllListeners(J,Q){let Z=this;return function($){let q=Z._getPatchMap(J);if(q!==void 0){if(arguments.length===0)Z._createPatchMap(J);else if(q[$]!==void 0)delete q[$]}return Q.apply(this,arguments)}}_patchAddListener(J,Q,Z){let $=this;return function(q,W){if($._wrapped)return Q.call(this,q,W);let X=$._getPatchMap(J);if(X===void 0)X=$._createPatchMap(J);let H=X[q];if(H===void 0)H=new WeakMap,X[q]=H;let Y=$.bind(Z,W);H.set(W,Y),$._wrapped=!0;try{return Q.call(this,q,Y)}finally{$._wrapped=!1}}}_createPatchMap(J){let Q=Object.create(null);return J[this._kOtListeners]=Q,Q}_getPatchMap(J){return J[this._kOtListeners]}_kOtListeners=Symbol("OtListeners");_wrapped=!1}GQ.AbstractAsyncHooksContextManager=KQ});var jQ=K((UQ)=>{Object.defineProperty(UQ,"__esModule",{value:!0});UQ.AsyncHooksContextManager=void 0;var J6=M(),Q6=TJ("async_hooks"),Z6=bJ();class VQ extends Z6.AbstractAsyncHooksContextManager{_asyncHook;_contexts=new Map;_stack=[];constructor(){super();this._asyncHook=Q6.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){return this._stack[this._stack.length-1]??J6.ROOT_CONTEXT}with(J,Q,Z,...$){this._enterContext(J);try{return Q.call(Z,...$)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(J,Q){if(Q==="TIMERWRAP")return;let Z=this._stack[this._stack.length-1];if(Z!==void 0)this._contexts.set(J,Z)}_destroy(J){this._contexts.delete(J)}_before(J){let Q=this._contexts.get(J);if(Q!==void 0)this._enterContext(Q)}_after(){this._exitContext()}_enterContext(J){this._stack.push(J)}_exitContext(){this._stack.pop()}}UQ.AsyncHooksContextManager=VQ});var DQ=K((hQ)=>{Object.defineProperty(hQ,"__esModule",{value:!0});hQ.AsyncLocalStorageContextManager=void 0;var $6=M(),q6=TJ("async_hooks"),W6=bJ();class FQ extends W6.AbstractAsyncHooksContextManager{_asyncLocalStorage;constructor(){super();this._asyncLocalStorage=new q6.AsyncLocalStorage}active(){return this._asyncLocalStorage.getStore()??$6.ROOT_CONTEXT}with(J,Q,Z,...$){let q=Z==null?Q:Q.bind(Z);return this._asyncLocalStorage.run(J,q,...$)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}}hQ.AsyncLocalStorageContextManager=FQ});var EQ=K((GJ)=>{Object.defineProperty(GJ,"__esModule",{value:!0});GJ.AsyncLocalStorageContextManager=GJ.AsyncHooksContextManager=void 0;var z6=jQ();Object.defineProperty(GJ,"AsyncHooksContextManager",{enumerable:!0,get:function(){return z6.AsyncHooksContextManager}});var X6=DQ();Object.defineProperty(GJ,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return X6.AsyncLocalStorageContextManager}})});var MQ=K((kQ)=>{Object.defineProperty(kQ,"__esModule",{value:!0});kQ.ExceptionEventName=void 0;kQ.ExceptionEventName="exception"});var PQ=K((CQ)=>{Object.defineProperty(CQ,"__esModule",{value:!0});CQ.SpanImpl=void 0;var h=M(),O=E(),m=AQ(),H6=MQ();class RQ{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:h.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(J){let Q=Date.now();if(this._spanContext=J.spanContext,this._performanceStartTime=O.otperformance.now(),this._performanceOffset=Q-(this._performanceStartTime+O.otperformance.timeOrigin),this._startTimeProvided=J.startTime!=null,this._spanLimits=J.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=J.spanProcessor,this.name=J.name,this.parentSpanContext=J.parentSpanContext,this.kind=J.kind,J.links)for(let Z of J.links)this.addLink(Z);if(this.startTime=this._getTime(J.startTime??Q),this.resource=J.resource,this.instrumentationScope=J.scope,this._recordEndMetrics=J.recordEndMetrics,J.attributes!=null)this.setAttributes(J.attributes);this._spanProcessor.onStart(this,J.context)}spanContext(){return this._spanContext}setAttribute(J,Q){if(Q==null||this._isSpanEnded())return this;if(J.length===0)return h.diag.warn(`Invalid attribute key: ${J}`),this;if(!(0,O.isAttributeValue)(Q))return h.diag.warn(`Invalid attribute value set for key: ${J}`),this;let{attributeCountLimit:Z}=this._spanLimits,$=!Object.prototype.hasOwnProperty.call(this.attributes,J);if(Z!==void 0&&this._attributesCount>=Z&&$)return this._droppedAttributesCount++,this;if(this.attributes[J]=this._truncateToSize(Q),$)this._attributesCount++;return this}setAttributes(J){for(let Q in J)if(Object.prototype.hasOwnProperty.call(J,Q))this.setAttribute(Q,J[Q]);return this}addEvent(J,Q,Z){if(this._isSpanEnded())return this;let{eventCountLimit:$}=this._spanLimits;if($===0)return h.diag.warn("No events allowed."),this._droppedEventsCount++,this;if($!==void 0&&this.events.length>=$){if(this._droppedEventsCount===0)h.diag.debug("Dropping extra events.");this.events.shift(),this._droppedEventsCount++}if((0,O.isTimeInput)(Q)){if(!(0,O.isTimeInput)(Z))Z=Q;Q=void 0}let q=(0,O.sanitizeAttributes)(Q),{attributePerEventCountLimit:W}=this._spanLimits,X={},H=0,Y=0;for(let V in q){if(!Object.prototype.hasOwnProperty.call(q,V))continue;let R=q[V];if(W!==void 0&&Y>=W){H++;continue}X[V]=this._truncateToSize(R),Y++}return this.events.push({name:J,attributes:X,time:this._getTime(Z),droppedAttributesCount:H}),this}addLink(J){if(this._isSpanEnded())return this;let{linkCountLimit:Q}=this._spanLimits;if(Q===0)return this._droppedLinksCount++,this;if(Q!==void 0&&this.links.length>=Q){if(this._droppedLinksCount===0)h.diag.debug("Dropping extra links.");this.links.shift(),this._droppedLinksCount++}let{attributePerLinkCountLimit:Z}=this._spanLimits,$=(0,O.sanitizeAttributes)(J.attributes),q={},W=0,X=0;for(let Y in $){if(!Object.prototype.hasOwnProperty.call($,Y))continue;let V=$[Y];if(Z!==void 0&&X>=Z){W++;continue}q[Y]=this._truncateToSize(V),X++}let H={context:J.context};if(X>0)H.attributes=q;if(W>0)H.droppedAttributesCount=W;return this.links.push(H),this}addLinks(J){for(let Q of J)this.addLink(Q);return this}setStatus(J){if(this._isSpanEnded())return this;if(J.code===h.SpanStatusCode.UNSET)return this;if(this.status.code===h.SpanStatusCode.OK)return this;let Q={code:J.code};if(J.code===h.SpanStatusCode.ERROR){if(typeof J.message==="string")Q.message=J.message;else if(J.message!=null)h.diag.warn(`Dropping invalid status.message of type '${typeof J.message}', expected 'string'`)}return this.status=Q,this}updateName(J){if(this._isSpanEnded())return this;return this.name=J,this}end(J){if(this._isSpanEnded()){h.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}if(this.endTime=this._getTime(J),this._duration=(0,O.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0)h.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0];if(this._droppedEventsCount>0)h.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`);if(this._droppedLinksCount>0)h.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`);if(this._spanProcessor.onEnding)this._spanProcessor.onEnding(this);this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(J){if(typeof J==="number"&&J<=O.otperformance.now())return(0,O.hrTime)(J+this._performanceOffset);if(typeof J==="number")return(0,O.millisToHrTime)(J);if(J instanceof Date)return(0,O.millisToHrTime)(J.getTime());if((0,O.isTimeInputHrTime)(J))return J;if(this._startTimeProvided)return(0,O.millisToHrTime)(Date.now());let Q=O.otperformance.now()-this._performanceStartTime;return(0,O.addHrTimes)(this.startTime,(0,O.millisToHrTime)(Q))}isRecording(){return this._ended===!1}recordException(J,Q){let Z={};if(typeof J==="string")Z[m.ATTR_EXCEPTION_MESSAGE]=J;else if(J){if(J.code)Z[m.ATTR_EXCEPTION_TYPE]=J.code.toString();else if(J.name)Z[m.ATTR_EXCEPTION_TYPE]=J.name;if(J.message)Z[m.ATTR_EXCEPTION_MESSAGE]=J.message;if(J.stack)Z[m.ATTR_EXCEPTION_STACKTRACE]=J.stack}if(Z[m.ATTR_EXCEPTION_TYPE]||Z[m.ATTR_EXCEPTION_MESSAGE])this.addEvent(H6.ExceptionEventName,Z,Q);else h.diag.warn(`Failed to record an exception ${J}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let J=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);h.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,J)}return this._ended}_truncateToLimitUtil(J,Q){if(J.length<=Q)return J;return J.substring(0,Q)}_truncateToSize(J){let Q=this._attributeValueLengthLimit;if(Q<=0)return h.diag.warn(`Attribute value limit must be positive, got ${Q}`),J;if(typeof J==="string")return this._truncateToLimitUtil(J,Q);if(Array.isArray(J))return J.map((Z)=>typeof Z==="string"?this._truncateToLimitUtil(Z,Q):Z);return J}}CQ.SpanImpl=RQ});var i=K((NQ)=>{Object.defineProperty(NQ,"__esModule",{value:!0});NQ.SamplingDecision=void 0;var K6;(function(J){J[J.NOT_RECORD=0]="NOT_RECORD",J[J.RECORD=1]="RECORD",J[J.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(K6=NQ.SamplingDecision||(NQ.SamplingDecision={}))});var wJ=K((TQ)=>{Object.defineProperty(TQ,"__esModule",{value:!0});TQ.AlwaysOffSampler=void 0;var G6=i();class fQ{shouldSample(){return{decision:G6.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}TQ.AlwaysOffSampler=fQ});var VJ=K((xQ)=>{Object.defineProperty(xQ,"__esModule",{value:!0});xQ.AlwaysOnSampler=void 0;var w6=i();class _Q{shouldSample(){return{decision:w6.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}xQ.AlwaysOnSampler=_Q});var dJ=K((vQ)=>{Object.defineProperty(vQ,"__esModule",{value:!0});vQ.ParentBasedSampler=void 0;var UJ=M(),V6=E(),yQ=wJ(),xJ=VJ();class SQ{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(J){if(this._root=J.root,!this._root)(0,V6.globalErrorHandler)(Error("ParentBasedSampler must have a root sampler configured")),this._root=new xJ.AlwaysOnSampler;this._remoteParentSampled=J.remoteParentSampled??new xJ.AlwaysOnSampler,this._remoteParentNotSampled=J.remoteParentNotSampled??new yQ.AlwaysOffSampler,this._localParentSampled=J.localParentSampled??new xJ.AlwaysOnSampler,this._localParentNotSampled=J.localParentNotSampled??new yQ.AlwaysOffSampler}shouldSample(J,Q,Z,$,q,W){let X=UJ.trace.getSpanContext(J);if(!X||!(0,UJ.isSpanContextValid)(X))return this._root.shouldSample(J,Q,Z,$,q,W);if(X.isRemote){if(X.traceFlags&UJ.TraceFlags.SAMPLED)return this._remoteParentSampled.shouldSample(J,Q,Z,$,q,W);return this._remoteParentNotSampled.shouldSample(J,Q,Z,$,q,W)}if(X.traceFlags&UJ.TraceFlags.SAMPLED)return this._localParentSampled.shouldSample(J,Q,Z,$,q,W);return this._localParentNotSampled.shouldSample(J,Q,Z,$,q,W)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}vQ.ParentBasedSampler=SQ});var yJ=K((uQ)=>{Object.defineProperty(uQ,"__esModule",{value:!0});uQ.TraceIdRatioBasedSampler=void 0;var U6=M(),lQ=i();class mQ{_ratio;_upperBound;constructor(J=0){this._ratio=this._normalize(J),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(J,Q){return{decision:(0,U6.isValidTraceId)(Q)&&this._accumulate(Q)<this._upperBound?lQ.SamplingDecision.RECORD_AND_SAMPLED:lQ.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(J){if(typeof J!=="number"||isNaN(J))return 0;return J>=1?1:J<=0?0:J}_accumulate(J){let Q=0;for(let Z=0;Z<J.length/8;Z++){let $=Z*8,q=parseInt(J.slice($,$+8),16);Q=(Q^q)>>>0}return Q}}uQ.TraceIdRatioBasedSampler=mQ});var gJ=K((oQ)=>{Object.defineProperty(oQ,"__esModule",{value:!0});oQ.buildSamplerFromEnv=oQ.loadDefaultConfig=void 0;var vJ=M(),_=E(),pQ=wJ(),SJ=VJ(),BJ=dJ(),nQ=yJ(),x;(function(J){J.AlwaysOff="always_off",J.AlwaysOn="always_on",J.ParentBasedAlwaysOff="parentbased_always_off",J.ParentBasedAlwaysOn="parentbased_always_on",J.ParentBasedTraceIdRatio="parentbased_traceidratio",J.TraceIdRatio="traceidratio"})(x||(x={}));var jJ=1;function B6(){return{sampler:sQ(),forceFlushTimeoutMillis:30000,generalLimits:{attributeValueLengthLimit:(0,_.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,_.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:(0,_.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,_.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:(0,_.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:(0,_.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:(0,_.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:(0,_.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}oQ.loadDefaultConfig=B6;function sQ(){let J=(0,_.getStringFromEnv)("OTEL_TRACES_SAMPLER")??x.ParentBasedAlwaysOn;switch(J){case x.AlwaysOn:return new SJ.AlwaysOnSampler;case x.AlwaysOff:return new pQ.AlwaysOffSampler;case x.ParentBasedAlwaysOn:return new BJ.ParentBasedSampler({root:new SJ.AlwaysOnSampler});case x.ParentBasedAlwaysOff:return new BJ.ParentBasedSampler({root:new pQ.AlwaysOffSampler});case x.TraceIdRatio:return new nQ.TraceIdRatioBasedSampler(iQ());case x.ParentBasedTraceIdRatio:return new BJ.ParentBasedSampler({root:new nQ.TraceIdRatioBasedSampler(iQ())});default:return vJ.diag.error(`OTEL_TRACES_SAMPLER value "${J}" invalid, defaulting to "${x.ParentBasedAlwaysOn}".`),new BJ.ParentBasedSampler({root:new SJ.AlwaysOnSampler})}}oQ.buildSamplerFromEnv=sQ;function iQ(){let J=(0,_.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG");if(J==null)return vJ.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${jJ}.`),jJ;if(J<0||J>1)return vJ.diag.error(`OTEL_TRACES_SAMPLER_ARG=${J} was given, but it is out of range ([0..1]), defaulting to ${jJ}.`),jJ;return J}});var lJ=K((tQ)=>{Object.defineProperty(tQ,"__esModule",{value:!0});tQ.reconfigureLimits=tQ.mergeConfig=tQ.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=tQ.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;var rQ=gJ(),FJ=E();tQ.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;tQ.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function F6(J){let Q={sampler:(0,rQ.buildSamplerFromEnv)()},Z=(0,rQ.loadDefaultConfig)(),$=Object.assign({},Z,Q,J);return $.generalLimits=Object.assign({},Z.generalLimits,J.generalLimits||{}),$.spanLimits=Object.assign({},Z.spanLimits,J.spanLimits||{}),$}tQ.mergeConfig=F6;function h6(J){let Q=Object.assign({},J.spanLimits);return Q.attributeCountLimit=J.spanLimits?.attributeCountLimit??J.generalLimits?.attributeCountLimit??(0,FJ.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??(0,FJ.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??tQ.DEFAULT_ATTRIBUTE_COUNT_LIMIT,Q.attributeValueLengthLimit=J.spanLimits?.attributeValueLengthLimit??J.generalLimits?.attributeValueLengthLimit??(0,FJ.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??(0,FJ.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??tQ.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},J,{spanLimits:Q})}tQ.reconfigureLimits=h6});var WZ=K(($Z)=>{Object.defineProperty($Z,"__esModule",{value:!0});$Z.BatchSpanProcessorBase=void 0;var s=M(),S=E();class ZZ{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(J,Q){if(this._exporter=J,this._maxExportBatchSize=typeof Q?.maxExportBatchSize==="number"?Q.maxExportBatchSize:(0,S.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=typeof Q?.maxQueueSize==="number"?Q.maxQueueSize:(0,S.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=typeof Q?.scheduledDelayMillis==="number"?Q.scheduledDelayMillis:(0,S.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY")??5000,this._exportTimeoutMillis=typeof Q?.exportTimeoutMillis==="number"?Q.exportTimeoutMillis:(0,S.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT")??30000,this._shutdownOnce=new S.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize)s.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize}forceFlush(){if(this._shutdownOnce.isCalled)return this._shutdownOnce.promise;return this._flushAll()}onStart(J,Q){}onEnd(J){if(this._shutdownOnce.isCalled)return;if((J.spanContext().traceFlags&s.TraceFlags.SAMPLED)===0)return;this._addToBuffer(J)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>{return this.onShutdown()}).then(()=>{return this._flushAll()}).then(()=>{return this._exporter.shutdown()})}_addToBuffer(J){if(this._finishedSpans.length>=this._maxQueueSize){if(this._droppedSpansCount===0)s.diag.debug("maxQueueSize reached, dropping spans");this._droppedSpansCount++;return}if(this._droppedSpansCount>0)s.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0;this._finishedSpans.push(J),this._maybeStartTimer()}_flushAll(){return new Promise((J,Q)=>{let Z=[],$=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let q=0,W=$;q<W;q++)Z.push(this._flushOneBatch());Promise.all(Z).then(()=>{J()}).catch(Q)})}_flushOneBatch(){if(this._clearTimer(),this._finishedSpans.length===0)return Promise.resolve();return new Promise((J,Q)=>{let Z=setTimeout(()=>{Q(Error("Timeout"))},this._exportTimeoutMillis);s.context.with((0,S.suppressTracing)(s.context.active()),()=>{let $;if(this._finishedSpans.length<=this._maxExportBatchSize)$=this._finishedSpans,this._finishedSpans=[];else $=this._finishedSpans.splice(0,this._maxExportBatchSize);let q=()=>this._exporter.export($,(X)=>{if(clearTimeout(Z),X.code===S.ExportResultCode.SUCCESS)J();else Q(X.error??Error("BatchSpanProcessor: span export failed"))}),W=null;for(let X=0,H=$.length;X<H;X++){let Y=$[X];if(Y.resource.asyncAttributesPending&&Y.resource.waitForAsyncAttributes)W??=[],W.push(Y.resource.waitForAsyncAttributes())}if(W===null)q();else Promise.all(W).then(q,(X)=>{(0,S.globalErrorHandler)(X),Q(X)})})})}_maybeStartTimer(){if(this._isExporting)return;let J=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{if(this._isExporting=!1,this._finishedSpans.length>0)this._clearTimer(),this._maybeStartTimer()}).catch((Q)=>{this._isExporting=!1,(0,S.globalErrorHandler)(Q)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return J();if(this._timer!==void 0)return;if(this._timer=setTimeout(()=>J(),this._scheduledDelayMillis),typeof this._timer!=="number")this._timer.unref()}_clearTimer(){if(this._timer!==void 0)clearTimeout(this._timer),this._timer=void 0}}$Z.BatchSpanProcessorBase=ZZ});var HZ=K((XZ)=>{Object.defineProperty(XZ,"__esModule",{value:!0});XZ.BatchSpanProcessor=void 0;var D6=WZ();class zZ extends D6.BatchSpanProcessorBase{onShutdown(){}}XZ.BatchSpanProcessor=zZ});var BZ=K((VZ)=>{Object.defineProperty(VZ,"__esModule",{value:!0});VZ.RandomIdGenerator=void 0;var E6=8,GZ=16;class wZ{generateTraceId=KZ(GZ);generateSpanId=KZ(E6)}VZ.RandomIdGenerator=wZ;var hJ=Buffer.allocUnsafe(GZ);function KZ(J){return function(){for(let Z=0;Z<J/4;Z++)hJ.writeUInt32BE(Math.random()*4294967296>>>0,Z*4);for(let Z=0;Z<J;Z++)if(hJ[Z]>0)break;else if(Z===J-1)hJ[J-1]=1;return hJ.toString("hex",0,J)}}});var jZ=K((OJ)=>{Object.defineProperty(OJ,"__esModule",{value:!0});OJ.RandomIdGenerator=OJ.BatchSpanProcessor=void 0;var k6=HZ();Object.defineProperty(OJ,"BatchSpanProcessor",{enumerable:!0,get:function(){return k6.BatchSpanProcessor}});var I6=BZ();Object.defineProperty(OJ,"RandomIdGenerator",{enumerable:!0,get:function(){return I6.RandomIdGenerator}})});var mJ=K((DJ)=>{Object.defineProperty(DJ,"__esModule",{value:!0});DJ.RandomIdGenerator=DJ.BatchSpanProcessor=void 0;var FZ=jZ();Object.defineProperty(DJ,"BatchSpanProcessor",{enumerable:!0,get:function(){return FZ.BatchSpanProcessor}});Object.defineProperty(DJ,"RandomIdGenerator",{enumerable:!0,get:function(){return FZ.RandomIdGenerator}})});var DZ=K((hZ)=>{Object.defineProperty(hZ,"__esModule",{value:!0});hZ.METRIC_OTEL_SDK_SPAN_STARTED=hZ.METRIC_OTEL_SDK_SPAN_LIVE=hZ.ATTR_OTEL_SPAN_SAMPLING_RESULT=hZ.ATTR_OTEL_SPAN_PARENT_ORIGIN=void 0;hZ.ATTR_OTEL_SPAN_PARENT_ORIGIN="otel.span.parent.origin";hZ.ATTR_OTEL_SPAN_SAMPLING_RESULT="otel.span.sampling_result";hZ.METRIC_OTEL_SDK_SPAN_LIVE="otel.sdk.span.live";hZ.METRIC_OTEL_SDK_SPAN_STARTED="otel.sdk.span.started"});var MZ=K((kZ)=>{Object.defineProperty(kZ,"__esModule",{value:!0});kZ.TracerMetrics=void 0;var EJ=i(),qJ=DZ();class EZ{startedSpans;liveSpans;constructor(J){this.startedSpans=J.createCounter(qJ.METRIC_OTEL_SDK_SPAN_STARTED,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=J.createUpDownCounter(qJ.METRIC_OTEL_SDK_SPAN_LIVE,{unit:"{span}",description:"The number of currently live spans."})}startSpan(J,Q){let Z=N6(Q);if(this.startedSpans.add(1,{[qJ.ATTR_OTEL_SPAN_PARENT_ORIGIN]:P6(J),[qJ.ATTR_OTEL_SPAN_SAMPLING_RESULT]:Z}),Q===EJ.SamplingDecision.NOT_RECORD)return()=>{};let $={[qJ.ATTR_OTEL_SPAN_SAMPLING_RESULT]:Z};return this.liveSpans.add(1,$),()=>{this.liveSpans.add(-1,$)}}}kZ.TracerMetrics=EZ;function P6(J){if(!J)return"none";if(J.isRemote)return"remote";return"local"}function N6(J){switch(J){case EJ.SamplingDecision.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case EJ.SamplingDecision.RECORD:return"RECORD_ONLY";case EJ.SamplingDecision.NOT_RECORD:return"DROP"}}});var CZ=K((AZ)=>{Object.defineProperty(AZ,"__esModule",{value:!0});AZ.VERSION=void 0;AZ.VERSION="2.6.1"});var fZ=K((PZ)=>{Object.defineProperty(PZ,"__esModule",{value:!0});PZ.Tracer=void 0;var F=M(),kJ=E(),f6=PQ(),T6=lJ(),b6=mJ(),_6=MZ(),x6=CZ();class LZ{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(J,Q,Z,$){let q=(0,T6.mergeConfig)(Q);this._sampler=q.sampler,this._generalLimits=q.generalLimits,this._spanLimits=q.spanLimits,this._idGenerator=Q.idGenerator||new b6.RandomIdGenerator,this._resource=Z,this._spanProcessor=$,this.instrumentationScope=J;let W=q.meterProvider?q.meterProvider.getMeter("@opentelemetry/sdk-trace",x6.VERSION):F.createNoopMeter();this._tracerMetrics=new _6.TracerMetrics(W)}startSpan(J,Q={},Z=F.context.active()){if(Q.root)Z=F.trace.deleteSpan(Z);let $=F.trace.getSpan(Z);if((0,kJ.isTracingSuppressed)(Z))return F.diag.debug("Instrumentation suppressed, returning Noop Span"),F.trace.wrapSpanContext(F.INVALID_SPAN_CONTEXT);let q=$?.spanContext(),W=this._idGenerator.generateSpanId(),X,H,Y;if(!q||!F.trace.isSpanContextValid(q))H=this._idGenerator.generateTraceId();else H=q.traceId,Y=q.traceState,X=q;let V=Q.kind??F.SpanKind.INTERNAL,R=(Q.links??[]).map((D)=>{return{context:D.context,attributes:(0,kJ.sanitizeAttributes)(D.attributes)}}),z=(0,kJ.sanitizeAttributes)(Q.attributes),U=this._sampler.shouldSample(Z,H,J,V,z,R),I=this._tracerMetrics.startSpan(q,U.decision);Y=U.traceState??Y;let G=U.decision===F.SamplingDecision.RECORD_AND_SAMPLED?F.TraceFlags.SAMPLED:F.TraceFlags.NONE,w={traceId:H,spanId:W,traceFlags:G,traceState:Y};if(U.decision===F.SamplingDecision.NOT_RECORD)return F.diag.debug("Recording is off, propagating context in a non-recording span"),F.trace.wrapSpanContext(w);let B=(0,kJ.sanitizeAttributes)(Object.assign(z,U.attributes));return new f6.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:Z,spanContext:w,name:J,kind:V,links:R,parentSpanContext:X,attributes:B,startTime:Q.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:I})}startActiveSpan(J,Q,Z,$){let q,W,X;if(arguments.length<2)return;else if(arguments.length===2)X=Q;else if(arguments.length===3)q=Q,X=Z;else q=Q,W=Z,X=$;let H=W??F.context.active(),Y=this.startSpan(J,q,H),V=F.trace.setSpan(H,Y);return F.context.with(V,X,void 0,Y)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}PZ.Tracer=LZ});var xZ=K((bZ)=>{Object.defineProperty(bZ,"__esModule",{value:!0});bZ.MultiSpanProcessor=void 0;var d6=E();class TZ{_spanProcessors;constructor(J){this._spanProcessors=J}forceFlush(){let J=[];for(let Q of this._spanProcessors)J.push(Q.forceFlush());return new Promise((Q)=>{Promise.all(J).then(()=>{Q()}).catch((Z)=>{(0,d6.globalErrorHandler)(Z||Error("MultiSpanProcessor: forceFlush failed")),Q()})})}onStart(J,Q){for(let Z of this._spanProcessors)Z.onStart(J,Q)}onEnding(J){for(let Q of this._spanProcessors)if(Q.onEnding)Q.onEnding(J)}onEnd(J){for(let Q of this._spanProcessors)Q.onEnd(J)}shutdown(){let J=[];for(let Q of this._spanProcessors)J.push(Q.shutdown());return new Promise((Q,Z)=>{Promise.all(J).then(()=>{Q()},Z)})}}bZ.MultiSpanProcessor=TZ});var lZ=K((vZ)=>{Object.defineProperty(vZ,"__esModule",{value:!0});vZ.BasicTracerProvider=vZ.ForceFlushState=void 0;var y6=E(),S6=yZ(),v6=fZ(),g6=gJ(),l6=xZ(),m6=lJ(),o;(function(J){J[J.resolved=0]="resolved",J[J.timeout=1]="timeout",J[J.error=2]="error",J[J.unresolved=3]="unresolved"})(o=vZ.ForceFlushState||(vZ.ForceFlushState={}));class SZ{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(J={}){let Q=(0,y6.merge)({},(0,g6.loadDefaultConfig)(),(0,m6.reconfigureLimits)(J));this._resource=Q.resource??(0,S6.defaultResource)(),this._config=Object.assign({},Q,{resource:this._resource});let Z=[];if(J.spanProcessors?.length)Z.push(...J.spanProcessors);this._activeSpanProcessor=new l6.MultiSpanProcessor(Z)}getTracer(J,Q,Z){let $=`${J}@${Q||""}:${Z?.schemaUrl||""}`;if(!this._tracers.has($))this._tracers.set($,new v6.Tracer({name:J,version:Q,schemaUrl:Z?.schemaUrl},this._config,this._resource,this._activeSpanProcessor));return this._tracers.get($)}forceFlush(){let J=this._config.forceFlushTimeoutMillis,Q=this._activeSpanProcessor._spanProcessors.map((Z)=>{return new Promise(($)=>{let q,W=setTimeout(()=>{$(Error(`Span processor did not completed within timeout period of ${J} ms`)),q=o.timeout},J);Z.forceFlush().then(()=>{if(clearTimeout(W),q!==o.timeout)q=o.resolved,$(q)}).catch((X)=>{clearTimeout(W),q=o.error,$(X)})})});return new Promise((Z,$)=>{Promise.all(Q).then((q)=>{let W=q.filter((X)=>X!==o.resolved);if(W.length>0)$(W);else Z()}).catch((q)=>$([q]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}vZ.BasicTracerProvider=SZ});var pZ=K((uZ)=>{Object.defineProperty(uZ,"__esModule",{value:!0});uZ.ConsoleSpanExporter=void 0;var uJ=E();class mZ{export(J,Q){return this._sendSpans(J,Q)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(J){return{resource:{attributes:J.resource.attributes},instrumentationScope:J.instrumentationScope,traceId:J.spanContext().traceId,parentSpanContext:J.parentSpanContext,traceState:J.spanContext().traceState?.serialize(),name:J.name,id:J.spanContext().spanId,kind:J.kind,timestamp:(0,uJ.hrTimeToMicroseconds)(J.startTime),duration:(0,uJ.hrTimeToMicroseconds)(J.duration),attributes:J.attributes,status:J.status,events:J.events,links:J.links}}_sendSpans(J,Q){for(let Z of J)console.dir(this._exportInfo(Z),{depth:3});if(Q)return Q({code:uJ.ExportResultCode.SUCCESS})}}uZ.ConsoleSpanExporter=mZ});var aZ=K((sZ)=>{Object.defineProperty(sZ,"__esModule",{value:!0});sZ.InMemorySpanExporter=void 0;var nZ=E();class iZ{_finishedSpans=[];_stopped=!1;export(J,Q){if(this._stopped)return Q({code:nZ.ExportResultCode.FAILED,error:Error("Exporter has been stopped")});this._finishedSpans.push(...J),setTimeout(()=>Q({code:nZ.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}sZ.InMemorySpanExporter=iZ});var J0=K((tZ)=>{Object.defineProperty(tZ,"__esModule",{value:!0});tZ.SimpleSpanProcessor=void 0;var u6=M(),IJ=E();class rZ{_exporter;_shutdownOnce;_pendingExports;constructor(J){this._exporter=J,this._shutdownOnce=new IJ.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){if(await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush)await this._exporter.forceFlush()}onStart(J,Q){}onEnd(J){if(this._shutdownOnce.isCalled)return;if((J.spanContext().traceFlags&u6.TraceFlags.SAMPLED)===0)return;let Q=this._doExport(J).catch((Z)=>(0,IJ.globalErrorHandler)(Z));this._pendingExports.add(Q),Q.finally(()=>this._pendingExports.delete(Q))}async _doExport(J){if(J.resource.asyncAttributesPending)await J.resource.waitForAsyncAttributes?.();let Q=await IJ.internal._export(this._exporter,[J]);if(Q.code!==IJ.ExportResultCode.SUCCESS)throw Q.error??Error(`SimpleSpanProcessor: span export failed (status ${Q})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}tZ.SimpleSpanProcessor=rZ});var q0=K((Z0)=>{Object.defineProperty(Z0,"__esModule",{value:!0});Z0.NoopSpanProcessor=void 0;class Q0{onStart(J,Q){}onEnd(J){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}Z0.NoopSpanProcessor=Q0});var cJ=K((A)=>{Object.defineProperty(A,"__esModule",{value:!0});A.SamplingDecision=A.TraceIdRatioBasedSampler=A.ParentBasedSampler=A.AlwaysOnSampler=A.AlwaysOffSampler=A.NoopSpanProcessor=A.SimpleSpanProcessor=A.InMemorySpanExporter=A.ConsoleSpanExporter=A.RandomIdGenerator=A.BatchSpanProcessor=A.BasicTracerProvider=void 0;var c6=lZ();Object.defineProperty(A,"BasicTracerProvider",{enumerable:!0,get:function(){return c6.BasicTracerProvider}});var W0=mJ();Object.defineProperty(A,"BatchSpanProcessor",{enumerable:!0,get:function(){return W0.BatchSpanProcessor}});Object.defineProperty(A,"RandomIdGenerator",{enumerable:!0,get:function(){return W0.RandomIdGenerator}});var p6=pZ();Object.defineProperty(A,"ConsoleSpanExporter",{enumerable:!0,get:function(){return p6.ConsoleSpanExporter}});var n6=aZ();Object.defineProperty(A,"InMemorySpanExporter",{enumerable:!0,get:function(){return n6.InMemorySpanExporter}});var i6=J0();Object.defineProperty(A,"SimpleSpanProcessor",{enumerable:!0,get:function(){return i6.SimpleSpanProcessor}});var s6=q0();Object.defineProperty(A,"NoopSpanProcessor",{enumerable:!0,get:function(){return s6.NoopSpanProcessor}});var o6=wJ();Object.defineProperty(A,"AlwaysOffSampler",{enumerable:!0,get:function(){return o6.AlwaysOffSampler}});var a6=VJ();Object.defineProperty(A,"AlwaysOnSampler",{enumerable:!0,get:function(){return a6.AlwaysOnSampler}});var r6=dJ();Object.defineProperty(A,"ParentBasedSampler",{enumerable:!0,get:function(){return r6.ParentBasedSampler}});var t6=yJ();Object.defineProperty(A,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return t6.TraceIdRatioBasedSampler}});var e6=i();Object.defineProperty(A,"SamplingDecision",{enumerable:!0,get:function(){return e6.SamplingDecision}})});var H0=K((X0)=>{Object.defineProperty(X0,"__esModule",{value:!0});X0.NodeTracerProvider=void 0;var Q7=EQ(),Z7=cJ(),WJ=M(),pJ=E();function $7(J){if(J===null)return;if(J===void 0){let Q=new Q7.AsyncLocalStorageContextManager;Q.enable(),WJ.context.setGlobalContextManager(Q);return}J.enable(),WJ.context.setGlobalContextManager(J)}function q7(J){if(J===null)return;if(J===void 0){WJ.propagation.setGlobalPropagator(new pJ.CompositePropagator({propagators:[new pJ.W3CTraceContextPropagator,new pJ.W3CBaggagePropagator]}));return}WJ.propagation.setGlobalPropagator(J)}class z0 extends Z7.BasicTracerProvider{constructor(J={}){super(J)}register(J={}){WJ.trace.setGlobalTracerProvider(this),$7(J.contextManager),q7(J.propagator)}}X0.NodeTracerProvider=z0});var K0=K((k)=>{Object.defineProperty(k,"__esModule",{value:!0});k.TraceIdRatioBasedSampler=k.SimpleSpanProcessor=k.SamplingDecision=k.RandomIdGenerator=k.ParentBasedSampler=k.NoopSpanProcessor=k.InMemorySpanExporter=k.ConsoleSpanExporter=k.BatchSpanProcessor=k.BasicTracerProvider=k.AlwaysOnSampler=k.AlwaysOffSampler=k.NodeTracerProvider=void 0;var W7=H0();Object.defineProperty(k,"NodeTracerProvider",{enumerable:!0,get:function(){return W7.NodeTracerProvider}});var L=cJ();Object.defineProperty(k,"AlwaysOffSampler",{enumerable:!0,get:function(){return L.AlwaysOffSampler}});Object.defineProperty(k,"AlwaysOnSampler",{enumerable:!0,get:function(){return L.AlwaysOnSampler}});Object.defineProperty(k,"BasicTracerProvider",{enumerable:!0,get:function(){return L.BasicTracerProvider}});Object.defineProperty(k,"BatchSpanProcessor",{enumerable:!0,get:function(){return L.BatchSpanProcessor}});Object.defineProperty(k,"ConsoleSpanExporter",{enumerable:!0,get:function(){return L.ConsoleSpanExporter}});Object.defineProperty(k,"InMemorySpanExporter",{enumerable:!0,get:function(){return L.InMemorySpanExporter}});Object.defineProperty(k,"NoopSpanProcessor",{enumerable:!0,get:function(){return L.NoopSpanProcessor}});Object.defineProperty(k,"ParentBasedSampler",{enumerable:!0,get:function(){return L.ParentBasedSampler}});Object.defineProperty(k,"RandomIdGenerator",{enumerable:!0,get:function(){return L.RandomIdGenerator}});Object.defineProperty(k,"SamplingDecision",{enumerable:!0,get:function(){return L.SamplingDecision}});Object.defineProperty(k,"SimpleSpanProcessor",{enumerable:!0,get:function(){return L.SimpleSpanProcessor}});Object.defineProperty(k,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return L.TraceIdRatioBasedSampler}})});var a0=d(K0(),1);var MJ=(J)=>J!==void 0&&!(Array.isArray(J)&&J.length===0);var HJ=d(M(),1);var v;(function(J){J[J.UNSPECIFIED=0]="UNSPECIFIED",J[J.TRACE=1]="TRACE",J[J.TRACE2=2]="TRACE2",J[J.TRACE3=3]="TRACE3",J[J.TRACE4=4]="TRACE4",J[J.DEBUG=5]="DEBUG",J[J.DEBUG2=6]="DEBUG2",J[J.DEBUG3=7]="DEBUG3",J[J.DEBUG4=8]="DEBUG4",J[J.INFO=9]="INFO",J[J.INFO2=10]="INFO2",J[J.INFO3=11]="INFO3",J[J.INFO4=12]="INFO4",J[J.WARN=13]="WARN",J[J.WARN2=14]="WARN2",J[J.WARN3=15]="WARN3",J[J.WARN4=16]="WARN4",J[J.ERROR=17]="ERROR",J[J.ERROR2=18]="ERROR2",J[J.ERROR3=19]="ERROR3",J[J.ERROR4=20]="ERROR4",J[J.FATAL=21]="FATAL",J[J.FATAL2=22]="FATAL2",J[J.FATAL3=23]="FATAL3",J[J.FATAL4=24]="FATAL4"})(v||(v={}));class zJ{emit(J){}}var XJ=new zJ;var YJ=Symbol.for("io.opentelemetry.js.api.logs"),a=globalThis;function G0(J,Q,Z){return($)=>$===J?Q:Z}var nJ=1;class w0{getLogger(J,Q,Z){return new zJ}}var AJ=new w0;class iJ{constructor(J,Q,Z,$){this._provider=J,this.name=Q,this.version=Z,this.options=$}emit(J){this._getLogger().emit(J)}_getLogger(){if(this._delegate)return this._delegate;let J=this._provider._getDelegateLogger(this.name,this.version,this.options);if(!J)return XJ;return this._delegate=J,this._delegate}}class RJ{getLogger(J,Q,Z){var $;return($=this._getDelegateLogger(J,Q,Z))!==null&&$!==void 0?$:new iJ(this,J,Q,Z)}_getDelegate(){var J;return(J=this._delegate)!==null&&J!==void 0?J:AJ}_setDelegate(J){this._delegate=J}_getDelegateLogger(J,Q,Z){var $;return($=this._delegate)===null||$===void 0?void 0:$.getLogger(J,Q,Z)}}class CJ{constructor(){this._proxyLoggerProvider=new RJ}static getInstance(){if(!this._instance)this._instance=new CJ;return this._instance}setGlobalLoggerProvider(J){if(a[YJ])return this.getLoggerProvider();return a[YJ]=G0(nJ,J,AJ),this._proxyLoggerProvider._setDelegate(J),J}getLoggerProvider(){var J,Q;return(Q=(J=a[YJ])===null||J===void 0?void 0:J.call(a,nJ))!==null&&Q!==void 0?Q:this._proxyLoggerProvider}getLogger(J,Q,Z){return this.getLoggerProvider().getLogger(J,Q,Z)}disable(){delete a[YJ],this._proxyLoggerProvider=new RJ}}var l8=CJ.getInstance();var j0=d(yZ(),1),F0=d(E(),1);var T=d(M(),1);var f=d(M(),1),oJ=d(E(),1),C=d(AQ(),1);function V0(J){return sJ(J,new WeakSet)}function sJ(J,Q){if(J==null)return!0;if(typeof J==="string"||typeof J==="number"||typeof J==="boolean")return!0;if(J instanceof Uint8Array)return!0;if(typeof J==="object"){if(Q.has(J))return!1;if(Q.add(J),Array.isArray(J))return J.every(($)=>sJ($,Q));let Z=J;if(Z.constructor!==Object&&Z.constructor!==void 0)return!1;return Object.values(Z).every(($)=>sJ($,Q))}return!1}class aJ{hrTime;hrTimeObserved;spanContext;resource;instrumentationScope;attributes={};_severityText;_severityNumber;_body;_eventName;_attributesCount=0;_droppedAttributesCount=0;_isReadonly=!1;_logRecordLimits;set severityText(J){if(this._isLogRecordReadonly())return;this._severityText=J}get severityText(){return this._severityText}set severityNumber(J){if(this._isLogRecordReadonly())return;this._severityNumber=J}get severityNumber(){return this._severityNumber}set body(J){if(this._isLogRecordReadonly())return;this._body=J}get body(){return this._body}get eventName(){return this._eventName}set eventName(J){if(this._isLogRecordReadonly())return;this._eventName=J}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(J,Q,Z){let{timestamp:$,observedTimestamp:q,eventName:W,severityNumber:X,severityText:H,body:Y,attributes:V={},exception:R,context:z}=Z,U=Date.now();if(this.hrTime=oJ.timeInputToHrTime($??U),this.hrTimeObserved=oJ.timeInputToHrTime(q??U),z){let I=f.trace.getSpanContext(z);if(I&&f.isSpanContextValid(I))this.spanContext=I}if(this.severityNumber=X,this.severityText=H,this.body=Y,this.resource=J.resource,this.instrumentationScope=Q,this._logRecordLimits=J.logRecordLimits,this._eventName=W,this.setAttributes(V),R!=null)this._setException(R)}setAttribute(J,Q){if(this._isLogRecordReadonly())return this;if(J.length===0)return f.diag.warn(`Invalid attribute key: ${J}`),this;if(!V0(Q))return f.diag.warn(`Invalid attribute value set for key: ${J}`),this;let Z=!Object.prototype.hasOwnProperty.call(this.attributes,J);if(Z&&this._attributesCount>=this._logRecordLimits.attributeCountLimit){if(this._droppedAttributesCount++,this._droppedAttributesCount===1)f.diag.warn("Dropping extra attributes.");return this}if(this.attributes[J]=this._truncateToSize(Q),Z)this._attributesCount++;return this}setAttributes(J){for(let[Q,Z]of Object.entries(J))this.setAttribute(Q,Z);return this}setBody(J){return this.body=J,this}setEventName(J){return this.eventName=J,this}setSeverityNumber(J){return this.severityNumber=J,this}setSeverityText(J){return this.severityText=J,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(J){let Q=this._logRecordLimits.attributeValueLengthLimit;if(Q<=0)return f.diag.warn(`Attribute value limit must be positive, got ${Q}`),J;if(J==null)return J;if(typeof J==="string")return this._truncateToLimitUtil(J,Q);if(J instanceof Uint8Array)return J;if(Array.isArray(J))return J.map((Z)=>this._truncateToSize(Z));if(typeof J==="object"){let Z={};for(let[$,q]of Object.entries(J))Z[$]=this._truncateToSize(q);return Z}return J}_setException(J){let Q=!1;if(typeof J==="string"||typeof J==="number"){if(!Object.hasOwn(this.attributes,C.ATTR_EXCEPTION_MESSAGE))this.setAttribute(C.ATTR_EXCEPTION_MESSAGE,String(J));Q=!0}else if(J&&typeof J==="object"){let Z=J;if(Z.code){if(!Object.hasOwn(this.attributes,C.ATTR_EXCEPTION_TYPE))this.setAttribute(C.ATTR_EXCEPTION_TYPE,Z.code.toString());Q=!0}else if(Z.name){if(!Object.hasOwn(this.attributes,C.ATTR_EXCEPTION_TYPE))this.setAttribute(C.ATTR_EXCEPTION_TYPE,Z.name);Q=!0}if(Z.message){if(!Object.hasOwn(this.attributes,C.ATTR_EXCEPTION_MESSAGE))this.setAttribute(C.ATTR_EXCEPTION_MESSAGE,Z.message);Q=!0}if(Z.stack){if(!Object.hasOwn(this.attributes,C.ATTR_EXCEPTION_STACKTRACE))this.setAttribute(C.ATTR_EXCEPTION_STACKTRACE,Z.stack);Q=!0}}if(!Q)f.diag.warn(`Failed to record an exception ${J}`)}_truncateToLimitUtil(J,Q){if(J.length<=Q)return J;return J.substring(0,Q)}_isLogRecordReadonly(){if(this._isReadonly)f.diag.warn("Can not execute the operation on emitted log record");return this._isReadonly}}class rJ{instrumentationScope;_sharedState;_loggerConfig;constructor(J,Q){this.instrumentationScope=J,this._sharedState=Q,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(J){let Q=this._loggerConfig,Z=J.context||T.context.active(),$=J.severityNumber??v.UNSPECIFIED;if($!==v.UNSPECIFIED&&$<Q.minimumSeverity)return;if(Q.traceBased){let W=T.trace.getSpanContext(Z);if(W&&T.isSpanContextValid(W)){if((W.traceFlags&T.TraceFlags.SAMPLED)!==T.TraceFlags.SAMPLED)return}}let q=new aJ(this._sharedState,this.instrumentationScope,{context:Z,...J});this._sharedState.activeProcessor.onEmit(q,Z),q._makeReadonly()}}class tJ{forceFlush(){return Promise.resolve()}onEmit(J,Q){}shutdown(){return Promise.resolve()}}var U0=d(E(),1);class eJ{processors;forceFlushTimeoutMillis;constructor(J,Q){this.processors=J,this.forceFlushTimeoutMillis=Q}async forceFlush(){let J=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map((Q)=>U0.callWithTimeout(Q.forceFlush(),J)))}onEmit(J,Q){this.processors.forEach((Z)=>Z.onEmit(J,Q))}async shutdown(){await Promise.all(this.processors.map((J)=>J.shutdown()))}}function B0(J){return`${J.name}@${J.version||""}:${J.schemaUrl||""}`}var X7={disabled:!1,minimumSeverity:v.UNSPECIFIED,traceBased:!1},JQ=()=>({...X7});class QQ{loggers=new Map;activeProcessor;registeredLogRecordProcessors=[];resource;forceFlushTimeoutMillis;logRecordLimits;processors;_loggerConfigurator;_loggerConfigs=new Map;constructor(J,Q,Z,$,q){if(this.resource=J,this.forceFlushTimeoutMillis=Q,this.logRecordLimits=Z,this.processors=$,$.length>0)this.registeredLogRecordProcessors=$,this.activeProcessor=new eJ(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis);else this.activeProcessor=new tJ;this._loggerConfigurator=q??JQ}getLoggerConfig(J){let Q=B0(J),Z=this._loggerConfigs.get(Q);if(Z)return Z;return Z=this._loggerConfigurator(J),this._loggerConfigs.set(Q,Z),Z}}var Y7="unknown";class LJ{_shutdownOnce;_sharedState;constructor(J={}){let Q={resource:J.resource??j0.defaultResource(),forceFlushTimeoutMillis:J.forceFlushTimeoutMillis??30000,logRecordLimits:{attributeCountLimit:J.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:J.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:J.loggerConfigurator??JQ,processors:J.processors??[]};this._sharedState=new QQ(Q.resource,Q.forceFlushTimeoutMillis,Q.logRecordLimits,Q.processors,Q.loggerConfigurator),this._shutdownOnce=new F0.BindOnceFuture(this._shutdown,this)}getLogger(J,Q,Z){if(this._shutdownOnce.isCalled)return HJ.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),XJ;if(!J)HJ.diag.warn("Logger requested without instrumentation scope name.");let $=J||Y7,q=`${$}@${Q||""}:${Z?.schemaUrl||""}`;if(!this._sharedState.loggers.has(q))this._sharedState.loggers.set(q,new rJ({name:$,version:Q,schemaUrl:Z?.schemaUrl},this._sharedState));return this._sharedState.loggers.get(q)}forceFlush(){if(this._shutdownOnce.isCalled)return HJ.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise;return this._sharedState.activeProcessor.forceFlush()}shutdown(){if(this._shutdownOnce.isCalled)return HJ.diag.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise;return this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}class qQ extends O0()("@effect/opentelemetry/Logger/OtelLoggerProvider"){}var G7=g(function*(){let J=yield*qQ,Q=yield*A0,Z=J.getLogger("@effect/opentelemetry");return L0(($)=>{let q={fiberId:$.fiber.id},W=D0($.fiber.context,E0);if(h0(W))q.spanId=W.spanId,q.traceId=W.traceId;for(let[V,R]of Object.entries($.fiber.getRef(k0)))q[V]=ZQ(R);let X=$.date.getTime();for(let[V,R]of $.fiber.getRef(I0))q[`logSpan.${V}`]=`${X-R}ms`;let H=$Q($.message).map(ZQ),Y=N0(Q.currentTimeNanosUnsafe());Z.emit({body:H.length===1?H[0]:H,severityText:$.logLevel,severityNumber:C0($.logLevel),timestamp:Y,observedTimestamp:Y,attributes:q})})}),f0=(J)=>P0([G7],{mergeWithExisting:J.mergeWithExisting??!0}),T0=(J,Q)=>PJ(qQ,g(function*(){let Z=yield*ZJ;return yield*JJ(u(()=>new LJ({...Q??void 0,processors:$Q(J),resource:Z})),($)=>r(()=>$.forceFlush().then(()=>$.shutdown())).pipe(t,QJ,e(Q?.shutdownTimeout??3000)))}));var l=d(M(),1);var c;(function(J){J[J.DELTA=0]="DELTA",J[J.CUMULATIVE=1]="CUMULATIVE"})(c||(c={}));var P;(function(J){J.COUNTER="COUNTER",J.GAUGE="GAUGE",J.HISTOGRAM="HISTOGRAM",J.UP_DOWN_COUNTER="UP_DOWN_COUNTER",J.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",J.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",J.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(P||(P={}));var b;(function(J){J[J.HISTOGRAM=0]="HISTOGRAM",J[J.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",J[J.GAUGE=2]="GAUGE",J[J.SUM=3]="SUM"})(b||(b={}));var V7="@effect/opentelemetry/Metrics";class zQ{resource;context;temporality;startTimes;startTimeNanos;previousExportTimeNanos;previousCounterState;previousHistogramState;previousFrequencyState;previousSummaryState;constructor(J,Q,Z="cumulative"){this.resource=J,this.context=Q,this.temporality=Z,this.startTimes=new Map,this.startTimeNanos=b0(),this.previousExportTimeNanos=this.startTimeNanos,this.previousCounterState=new Map,this.previousHistogramState=new Map,this.previousFrequencyState=new Map,this.previousSummaryState=new Map}startTimeFor(J,Q){if(this.startTimes.has(J))return this.startTimes.get(J);return this.startTimes.set(J,Q),Q}collect(J){let Q=x0(this.context),Z=b0(),$=[],q=new Map,W=(V)=>{$.push(V),q.set(V.descriptor.name,V)},X=this.temporality==="delta",H=X?c.DELTA:c.CUMULATIVE,Y=X?this.previousExportTimeNanos:this.startTimeNanos;for(let V=0,R=Q.length;V<R;V++){let z=Q[V],U=z.attributes?_0(Object.entries(z.attributes),{},(G,[w,B])=>{return G[w]=String(B),G}):{},I=U7(z.id,z.attributes);switch(z.type){case"Counter":{let G=z.state.count,w=G;if(X){let j=this.previousCounterState.get(I);if(j!==void 0)if(typeof G==="bigint"&&typeof j==="bigint"){if(w=G-j,w<0n)w=G}else{let y=Number(G),p=Number(j);if(w=y-p,w<0)w=y}this.previousCounterState.set(I,G)}let B=$J(z,U),D={startTime:this.startTimeFor(B.name,Y),endTime:Z,attributes:U,value:Number(w)};if(q.has(z.id))q.get(z.id).dataPoints.push(D);else W({dataPointType:b.SUM,descriptor:B,isMonotonic:z.state.incremental,aggregationTemporality:H,dataPoints:[D]});break}case"Gauge":{let G=$J(z,U),B={startTime:this.startTimeFor(G.name,this.startTimeNanos),endTime:Z,attributes:U,value:Number(z.state.value)};if(q.has(z.id))q.get(z.id).dataPoints.push(B);else W({dataPointType:b.GAUGE,descriptor:G,aggregationTemporality:c.CUMULATIVE,dataPoints:[B]});break}case"Histogram":{let G=z.state.buckets.length,w={boundaries:WQ(G-1),counts:WQ(G)},B=0,N=0;for(let[n,KJ]of z.state.buckets){if(B<G-1)w.boundaries[B]=n;w.counts[B]=KJ-N,N=KJ,B++}let D=z.state.count,j=z.state.sum,y=w.counts,p=z.state.min,fJ=z.state.max;if(X){let n=this.previousHistogramState.get(I);if(n!==void 0)D=z.state.count-n.count,j=z.state.sum-n.sum,y=w.counts.map((KJ,r0)=>Math.max(0,KJ-(n.bucketCounts[r0]??0)));this.previousHistogramState.set(I,{count:z.state.count,sum:z.state.sum,bucketCounts:w.counts.slice(),min:z.state.min,max:z.state.max})}let YQ=$J(z,U),HQ={startTime:this.startTimeFor(YQ.name,Y),endTime:Z,attributes:U,value:{buckets:{boundaries:w.boundaries,counts:y},count:D,min:p,max:fJ,sum:j}};if(q.has(z.id))q.get(z.id).dataPoints.push(HQ);else W({dataPointType:b.HISTOGRAM,descriptor:YQ,aggregationTemporality:H,dataPoints:[HQ]});break}case"Frequency":{let G=[],w=new Map;for(let[B,N]of z.state.occurrences){w.set(B,N);let D=N;if(X){let p=this.previousFrequencyState.get(I);if(p!==void 0){let fJ=p.get(B)??0;D=Math.max(0,N-fJ)}}let j=$J(z,U),y=this.startTimeFor(j.name,Y);G.push({startTime:y,endTime:Z,attributes:{...U,key:B},value:D})}if(X)this.previousFrequencyState.set(I,w);if(q.has(z.id))q.get(z.id).dataPoints.push(...G);else{let B=$J(z,U);W({dataPointType:b.SUM,descriptor:B,aggregationTemporality:H,isMonotonic:!0,dataPoints:G})}break}case"Summary":{let G=[{startTime:Y,endTime:Z,attributes:{...U,quantile:"min"},value:z.state.min}];for(let[j,y]of z.state.quantiles)G.push({startTime:Y,endTime:Z,attributes:{...U,quantile:j.toString()},value:y??0});G.push({startTime:Y,endTime:Z,attributes:{...U,quantile:"max"},value:z.state.max});let w=z.state.count,B=z.state.sum;if(X){let j=this.previousSummaryState.get(I);if(j!==void 0)w=z.state.count-j.count,B=z.state.sum-j.sum;this.previousSummaryState.set(I,{count:z.state.count,sum:z.state.sum})}let N={startTime:Y,endTime:Z,attributes:U,value:w},D={startTime:Y,endTime:Z,attributes:U,value:B};if(q.has(`${z.id}_quantiles`))q.get(`${z.id}_quantiles`).dataPoints.push(...G),q.get(`${z.id}_count`).dataPoints.push(N),q.get(`${z.id}_sum`).dataPoints.push(D);else{let j=$J(z,U);W({dataPointType:b.SUM,descriptor:{...j,name:`${j.name}_quantiles`},aggregationTemporality:H,isMonotonic:!1,dataPoints:G}),W({dataPointType:b.SUM,descriptor:{name:`${z.id}_count`,description:z.description??"",unit:"1",type:P.COUNTER,valueType:l.ValueType.INT,advice:{}},aggregationTemporality:H,isMonotonic:!0,dataPoints:[N]}),W({dataPointType:b.SUM,descriptor:{name:`${z.id}_sum`,description:z.description??"",unit:"1",type:P.COUNTER,valueType:l.ValueType.DOUBLE,advice:{}},aggregationTemporality:H,isMonotonic:!0,dataPoints:[D]})}break}}}if(X)this.previousExportTimeNanos=Z;return Promise.resolve({resourceMetrics:{resource:this.resource,scopeMetrics:[{scope:{name:V7},metrics:$}]},errors:[]})}}var U7=(J,Q)=>{if(Q===void 0||Object.keys(Q).length===0)return J;let Z=Object.entries(Q).sort(($,q)=>$[0].localeCompare(q[0]));return`${J}:${JSON.stringify(Z)}`},b0=()=>{let J=Date.now();return[Math.floor(J/1000),J%1000*1e6]},$J=(J,Q)=>{let Z=Q.unit??Q.time_unit??"1";return{name:J.id,description:J.description??"",unit:Z,type:B7(J),valueType:j7(J),advice:{}}},B7=(J)=>{switch(J.type){case"Histogram":return P.HISTOGRAM;case"Gauge":return P.OBSERVABLE_GAUGE;case"Frequency":return P.COUNTER;case"Counter":return J.state.incremental?P.COUNTER:P.UP_DOWN_COUNTER;case"Summary":return P.COUNTER}},j7=(J)=>{if(J.type==="Counter")return typeof J.state.count==="bigint"?l.ValueType.INT:l.ValueType.DOUBLE;else if(J.type==="Gauge")return typeof J.state.value==="bigint"?l.ValueType.INT:l.ValueType.DOUBLE;return l.ValueType.DOUBLE};var F7=(J)=>g(function*(){let Q=yield*ZJ,Z=yield*S0();return new zQ(Q,Z,J)}),h7=(J,Q,Z)=>JJ(u(()=>{let $=Q(),q=Array.isArray($)?$:[$];return q.forEach((W)=>W.setMetricProducer(J)),q}),($)=>r(()=>Promise.all($.map((q)=>q.shutdown()))).pipe(t,QJ,e(Z?.shutdownTimeout??3000))),v0=(J,Q)=>d0(y0(F7(Q?.temporality),(Z)=>h7(Z,J,Q)));var D7=(J,Q)=>PJ(s0,g(function*(){let Z=yield*ZJ;return yield*JJ(u(()=>{return new a0.NodeTracerProvider({...Q??void 0,resource:Z,spanProcessors:Array.isArray(J)?J:[J]})}),($)=>r(()=>$.forceFlush().then(()=>$.shutdown())).pipe(t,QJ,e(Q?.shutdownTimeout??3000)))})),a9=(J)=>l0(g(function*(){let Q=yield*c0(J)?J:u(J),Z=n0(Q.resource&&p0(Q.resource)),$=MJ(Q.spanProcessor)?XQ(o0,D7(Q.spanProcessor,{...Q.tracerConfig,shutdownTimeout:Q.shutdownTimeout})):NJ,q=MJ(Q.metricReader)?v0(g0(Q.metricReader),{shutdownTimeout:Q.shutdownTimeout,temporality:Q.metricTemporality}):NJ,W=MJ(Q.logRecordProcessor)?XQ(f0({mergeWithExisting:Q.loggerMergeWithExisting}),T0(Q.logRecordProcessor,{...Q.loggerProviderConfig,shutdownTimeout:Q.shutdownTimeout})):NJ;return m0($,q,W).pipe(u0(Z))})),r9=i0;export{D7 as layerTracerProvider,r9 as layerEmpty,a9 as layer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{dg as a,eg as b,fg as c,gg as d,hg as e}from"./chunk-bqqxvagz.js";import"./chunk-1dnvdeat.js";import"./chunk-zj5snrsa.js";import"./chunk-3tf7xfw5.js";import"./chunk-egcvm4x2.js";import"./chunk-nfg7nt13.js";import"./chunk-r4qpsa4e.js";import"./chunk-seda5sfd.js";import"./chunk-88hmeyf5.js";import"./chunk-aykvrqrp.js";import"./chunk-2h8b0csf.js";import"./chunk-4q14whpc.js";import"./chunk-s81ck6bw.js";import"./chunk-jt7g0r2j.js";import"./chunk-84qx54nf.js";import"./chunk-ep92grvg.js";import"./chunk-xf1y0sc6.js";import"./chunk-n24yx79r.js";import"./chunk-5qydhr42.js";import"./chunk-v30ezr68.js";import"./chunk-ex47pb9n.js";import"./chunk-jh2za7y4.js";import"./chunk-s3zmxfz2.js";import"./chunk-krk24aqm.js";import"./chunk-j7d3v0x2.js";import"./chunk-3hawwbw6.js";import"./chunk-4c6d1wy1.js";import"./chunk-vyf77kq1.js";import"./chunk-bxc3z38f.js";import"./chunk-7wshaze9.js";import"./chunk-vbcekkw2.js";import"./chunk-4ngvj758.js";import"./chunk-cqtkxwd8.js";import"./chunk-wpkr3vzf.js";import"./chunk-49we3vy1.js";import"./chunk-y7cqyeve.js";import"./chunk-92xxg12q.js";import"./chunk-h8yf5e2e.js";import"./chunk-yvtbt12y.js";import"./chunk-g83d3a0t.js";import"./chunk-1p39y33b.js";import"./chunk-yg0rs4g1.js";import"./chunk-vhh80d5j.js";import"./chunk-wp0xd7at.js";import"./chunk-dzw0j790.js";import"./chunk-rvev3cy6.js";import"./chunk-c53ev0da.js";import"./chunk-78yvbv9b.js";import"./chunk-c5n49vrd.js";import"./chunk-bwzbcwff.js";import"./chunk-r6055kk0.js";import"./chunk-datctfgt.js";import"./chunk-x28chfpz.js";import"./chunk-mnxcykeq.js";import"./chunk-0bn86djg.js";import"./chunk-xphzr4wg.js";import"./chunk-hav9pgf3.js";import"./chunk-cshsqavb.js";import"./chunk-tz60e15h.js";import"./chunk-0tya4pqb.js";import"./chunk-63t0rhc9.js";import"./chunk-9svh74gt.js";export{c as url,b as openapi,d as listen,e as Server,a as Default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
For more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);let N=c.originalExpiration??c.expiration;return{...c,...N?{originalExpiration:N}:{},expiration:T}};var k=(c,I={})=>{let x=I?.logger||console,T;return async()=>{let N;try{if(N=await c(),N.expiration&&N.expiration.getTime()<Date.now())N=L(N,x)}catch(O){if(T)x.warn("Credential renew failed: ",O),N=L(T,x);else throw O}return T=N,N}};var p="/latest/meta-data/iam/security-credentials/",Ic="/latest/api/token",B="AWS_EC2_METADATA_V1_DISABLED",R="ec2_metadata_v1_disabled",M="x-aws-ec2-metadata-token",pc=(c={})=>k(Tc(c),{logger:c.logger}),Tc=(c={})=>{let I=!1,{logger:x,profile:T}=c,{timeout:N,maxRetries:O}=Z(c),$=async(y,j)=>{if(I||j.headers?.[M]==null){let w=!1,h=!1,n=await G.loadConfig({environmentVariableSelector:(Y)=>{let u=Y[B];if(h=!!u&&u!=="false",u===void 0)throw new G.CredentialsProviderError(`${B} not set in env, checking config file next.`,{logger:c.logger});return h},configFileSelector:(Y)=>{let u=Y[R];return w=!!u&&u!=="false",w},default:!1},{profile:T})();if(c.ec2MetadataV1Disabled||n){let Y=[];if(c.ec2MetadataV1Disabled)Y.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(w)Y.push(`config file profile (${R})`);if(h)Y.push(`process environment variable (${B})`);throw new D(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${Y.join(", ")}].`)}}let C=(await m(async()=>{let w;try{w=await xc(j)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)).trim();return m(async()=>{let w;try{w=await Oc(C,j,c)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)};return async()=>{let y=await H();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),$(O,{...y,timeout:N});else{let j;try{j=(await Nc({...y,timeout:N})).toString()}catch(E){if(E?.statusCode===400)throw Object.assign(E,{message:"EC2 Metadata token request returned error"});else if(E.message==="TimeoutError"||[403,404,405].includes(E.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),$(O,{...y,timeout:N})}return $(O,{...y,headers:{[M]:j},timeout:N})}}},Nc=async(c)=>S({...c,path:Ic,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),xc=async(c)=>(await S({...c,path:p})).toString(),Oc=async(c,I,x)=>{let T=JSON.parse((await S({...I,path:p+c})).toString());if(!Q(T))throw new G.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:x.logger});return X(T)};export{wc as
|
|
2
|
+
import{Qe as e}from"./chunk-gfer8ch3.js";import{Ef as K}from"./chunk-wqkvsj5y.js";import{QQ as A}from"./chunk-9svh74gt.js";var J=A(K(),1);var Q=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",X=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var wc=1000,hc=0,Z=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var _=A(K(),1);import q from"http";function S(c){return new Promise((I,x)=>{let T=q.request({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});T.on("error",(N)=>{x(Object.assign(new _.ProviderError("Unable to connect to instance metadata service"),N)),T.destroy()}),T.on("timeout",()=>{x(new _.ProviderError("TimeoutError from instance metadata service")),T.destroy()}),T.on("response",(N)=>{let{statusCode:O=400}=N;if(O<200||300<=O)x(Object.assign(new _.ProviderError("Error response received from instance metadata service"),{statusCode:O})),T.destroy();let $=[];N.on("data",(y)=>{$.push(y)}),N.on("end",()=>{I(Buffer.concat($)),T.destroy()})}),T.end()})}var m=(c,I)=>{let x=c();for(let T=0;T<I;T++)x=x.catch(c);return x};var v="AWS_CONTAINER_CREDENTIALS_FULL_URI",W="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",t="AWS_CONTAINER_AUTHORIZATION_TOKEN",Kc=(c={})=>{let{timeout:I,maxRetries:x}=Z(c);return()=>m(async()=>{let T=await l({logger:c.logger}),N=JSON.parse(await a(I,T));if(!Q(N))throw new J.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:c.logger});return X(N)},x)},a=async(c,I)=>{if(process.env[t])I.headers={...I.headers,Authorization:process.env[t]};return(await S({...I,timeout:c})).toString()},o="169.254.170.2",s=new Set(["localhost","127.0.0.1"]),g=new Set(["http:","https:"]),l=async({logger:c})=>{if(process.env[W])return{hostname:o,path:process.env[W]};if(process.env[v]){let I;try{I=new URL(process.env[v])}catch{throw new J.CredentialsProviderError(`${process.env[v]} is not a valid container metadata service URL`,{tryNextLink:!1,logger:c})}if(!I.hostname||!s.has(I.hostname))throw new J.CredentialsProviderError(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!g.has(I.protocol))throw new J.CredentialsProviderError(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{protocol:I.protocol,hostname:I.hostname,path:I.pathname+I.search,port:I.port?parseInt(I.port,10):void 0}}throw new J.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${W} or ${v} environment variable is set`,{tryNextLink:!1,logger:c})};var G=A(K(),1);var U=A(K(),1);class D extends U.CredentialsProviderError{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(c,I=!0){super(c,I);this.tryNextLink=I,Object.setPrototypeOf(this,D.prototype)}}var b=A(K(),1),V=A(e(),1);var z;(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(z||(z={}));var F={environmentVariableSelector:(c)=>c.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(c)=>c.ec2_metadata_service_endpoint,default:void 0};var f;(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(f||(f={}));var r="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",d="ec2_metadata_service_endpoint_mode",P={environmentVariableSelector:(c)=>c[r],configFileSelector:(c)=>c[d],default:f.IPv4};var H=async()=>V.parseUrl(await i()||await cc()),i=async()=>b.loadConfig(F)(),cc=async()=>{let c=await b.loadConfig(P)();switch(c){case f.IPv4:return z.IPv4;case f.IPv6:return z.IPv6;default:throw Error(`Unsupported endpoint mode: ${c}. Select from ${Object.values(f)}`)}};var L=(c,I)=>{let x=300+Math.floor(Math.random()*300),T=new Date(Date.now()+x*1000);I.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(T)}.
|
|
3
|
+
For more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);let N=c.originalExpiration??c.expiration;return{...c,...N?{originalExpiration:N}:{},expiration:T}};var k=(c,I={})=>{let x=I?.logger||console,T;return async()=>{let N;try{if(N=await c(),N.expiration&&N.expiration.getTime()<Date.now())N=L(N,x)}catch(O){if(T)x.warn("Credential renew failed: ",O),N=L(T,x);else throw O}return T=N,N}};var p="/latest/meta-data/iam/security-credentials/",Ic="/latest/api/token",B="AWS_EC2_METADATA_V1_DISABLED",R="ec2_metadata_v1_disabled",M="x-aws-ec2-metadata-token",pc=(c={})=>k(Tc(c),{logger:c.logger}),Tc=(c={})=>{let I=!1,{logger:x,profile:T}=c,{timeout:N,maxRetries:O}=Z(c),$=async(y,j)=>{if(I||j.headers?.[M]==null){let w=!1,h=!1,n=await G.loadConfig({environmentVariableSelector:(Y)=>{let u=Y[B];if(h=!!u&&u!=="false",u===void 0)throw new G.CredentialsProviderError(`${B} not set in env, checking config file next.`,{logger:c.logger});return h},configFileSelector:(Y)=>{let u=Y[R];return w=!!u&&u!=="false",w},default:!1},{profile:T})();if(c.ec2MetadataV1Disabled||n){let Y=[];if(c.ec2MetadataV1Disabled)Y.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(w)Y.push(`config file profile (${R})`);if(h)Y.push(`process environment variable (${B})`);throw new D(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${Y.join(", ")}].`)}}let C=(await m(async()=>{let w;try{w=await xc(j)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)).trim();return m(async()=>{let w;try{w=await Oc(C,j,c)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)};return async()=>{let y=await H();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),$(O,{...y,timeout:N});else{let j;try{j=(await Nc({...y,timeout:N})).toString()}catch(E){if(E?.statusCode===400)throw Object.assign(E,{message:"EC2 Metadata token request returned error"});else if(E.message==="TimeoutError"||[403,404,405].includes(E.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),$(O,{...y,timeout:N})}return $(O,{...y,headers:{[M]:j},timeout:N})}}},Nc=async(c)=>S({...c,path:Ic,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),xc=async(c)=>(await S({...c,path:p})).toString(),Oc=async(c,I,x)=>{let T=JSON.parse((await S({...I,path:p+c})).toString());if(!Q(T))throw new G.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:x.logger});return X(T)};export{wc as oe,hc as pe,Z as qe,S as re,v as se,W as te,t as ue,Kc as ve,z as we,H as xe,pc as ye};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{dlopen as H,ptr as V}from"bun:ffi";var W=-10,M=1,g=()=>H("kernel32.dll",{GetStdHandle:{args:["i32"],returns:"ptr"},GetConsoleMode:{args:["ptr","ptr"],returns:"i32"},SetConsoleMode:{args:["ptr","u32"],returns:"i32"},FlushConsoleInputBuffer:{args:["ptr"],returns:"i32"}}),j;function X(){if(process.platform!=="win32")return!1;try{return j??=g(),!0}catch{return!1}}function B(){if(process.platform!=="win32")return;if(!process.stdin.isTTY)return;if(!X())return;let q=j.symbols.GetStdHandle(W),z=new Uint32Array(1);if(j.symbols.GetConsoleMode(q,V(z))===0)return;let x=z[0];if((x&M)===0)return;j.symbols.SetConsoleMode(q,x&~M)}function C(){if(process.platform!=="win32")return;if(!process.stdin.isTTY)return;if(!X())return;let q=j.symbols.GetStdHandle(W);j.symbols.FlushConsoleInputBuffer(q)}var F;function O(){if(process.platform!=="win32")return;if(!process.stdin.isTTY)return;if(!X())return;if(F)return F;let q=process.stdin,z=q.setRawMode,x=j.symbols.GetStdHandle(W),G=new Uint32Array(1);if(j.symbols.GetConsoleMode(x,V(G))===0)return;let y=G[0],Q=()=>{if(j.symbols.GetConsoleMode(x,V(G))===0)return;let K=G[0];if((K&M)===0)return;j.symbols.SetConsoleMode(x,K&~M)},Y=()=>{Q(),setImmediate(Q)},J;if(typeof z==="function")J=(K)=>{let v=z.call(q,K);return Y(),v},q.setRawMode=J;Y();let Z=setInterval(Q,100);Z.unref();let $=!1;return F=()=>{if($)return;if($=!0,clearInterval(Z),J&&q.setRawMode===J)q.setRawMode=z;j.symbols.SetConsoleMode(x,y),F=void 0},F}
|
|
3
|
-
export{B as
|
|
3
|
+
export{B as D,C as E,O as F};
|