@qitqode/qitqode-android-arm64 0.1.30 → 0.1.32
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-37n34pzd.js → chunk-01my2y0c.js} +1 -1
- package/bundle/{chunk-ejjea8hh.js → chunk-02jtpxe0.js} +1 -1
- package/bundle/{chunk-6qy1ghrx.js → chunk-05mce0j3.js} +1 -1
- package/bundle/chunk-096pd6c4.js +2 -0
- package/bundle/{chunk-g1dwbvkg.js → chunk-0bbs01f0.js} +1 -1
- package/bundle/chunk-0c2p3a6v.js +2 -0
- package/bundle/chunk-0c5rxty9.js +2 -0
- package/bundle/{chunk-j6emx6jn.js → chunk-0dt0bxz6.js} +2 -2
- package/bundle/chunk-0e86gt9r.js +2 -0
- package/bundle/{chunk-mskwkcgj.js → chunk-0mx2psfc.js} +1 -1
- package/bundle/chunk-0p27fvfr.js +2 -0
- package/bundle/chunk-0qs1vx97.js +2 -0
- package/bundle/{chunk-f45tp3e3.js → chunk-0v0vqbn5.js} +1 -1
- package/bundle/{chunk-be216spx.js → chunk-10bjs581.js} +2 -2
- package/bundle/{chunk-bss414qz.js → chunk-12vef2pr.js} +1 -1
- package/bundle/{chunk-jm1ptn8n.js → chunk-15hw2z9t.js} +1 -1
- package/bundle/chunk-15j5cn4t.js +2 -0
- package/bundle/{chunk-srh4xvsj.js → chunk-1gx18dm5.js} +1 -1
- package/bundle/chunk-1r95p0tp.js +2 -0
- package/bundle/chunk-1rhhhm88.js +2 -0
- package/bundle/{chunk-b0syck9r.js → chunk-1sgahe1s.js} +1 -1
- package/bundle/{chunk-26nfphsg.js → chunk-1vb79bw1.js} +1 -1
- package/bundle/chunk-1wbjh23g.js +2 -0
- package/bundle/chunk-20702epe.js +2 -0
- package/bundle/{chunk-371r2111.js → chunk-24jg9d61.js} +1 -1
- package/bundle/chunk-257me4z3.js +800 -0
- package/bundle/{chunk-1sgby720.js → chunk-2hc5z7b5.js} +1 -1
- package/bundle/{chunk-yq3m8190.js → chunk-2maqde7w.js} +2 -2
- package/bundle/{chunk-mrw279k3.js → chunk-2phz0bn9.js} +1 -1
- package/bundle/{chunk-b8tw709r.js → chunk-2vn41ecx.js} +1 -1
- package/bundle/chunk-2wajs9xv.js +2 -0
- package/bundle/{chunk-w87a3mzm.js → chunk-2zq4k837.js} +1 -1
- package/bundle/{chunk-1bhvt33f.js → chunk-31qrzrwy.js} +1 -1
- package/bundle/{chunk-d5bxan80.js → chunk-326p5b10.js} +2 -2
- package/bundle/{chunk-0df4kede.js → chunk-33e9y2aw.js} +1 -1
- package/bundle/{chunk-zcm2jdr5.js → chunk-35xk4g91.js} +1 -1
- package/bundle/{chunk-5fz8tph5.js → chunk-3632wgg1.js} +1 -1
- package/bundle/{chunk-1ngtxja9.js → chunk-3bxg5bta.js} +1 -1
- package/bundle/{chunk-mgk9sh16.js → chunk-3c6p8tm3.js} +1 -1
- package/bundle/{chunk-fqw4y7x0.js → chunk-3nx7112w.js} +2 -2
- package/bundle/{chunk-n26yf3he.js → chunk-3wetyrjs.js} +1 -1
- package/bundle/{chunk-2jmxt3fb.js → chunk-40efytmk.js} +1 -1
- package/bundle/chunk-42p59wm4.js +2 -0
- package/bundle/chunk-4512pvca.js +2 -0
- package/bundle/chunk-456bmaww.js +2 -0
- package/bundle/{chunk-c5e6sk9c.js → chunk-48ge2ryx.js} +1 -1
- package/bundle/chunk-48pajrnt.js +2 -0
- package/bundle/{chunk-12bssxd4.js → chunk-4cnwn1rh.js} +2 -2
- package/bundle/chunk-4fy9c54h.js +2 -0
- package/bundle/{chunk-4tbwha3m.js → chunk-4jtxtkj7.js} +2 -2
- package/bundle/chunk-4sc82a27.js +2 -0
- package/bundle/chunk-52bam8g7.js +2 -0
- package/bundle/{chunk-6fp8a9ek.js → chunk-53bqcctj.js} +1 -1
- package/bundle/{chunk-hwbyqezq.js → chunk-56z7x7h4.js} +2 -2
- package/bundle/chunk-59y8q9m5.js +2 -0
- package/bundle/chunk-59yqvk48.js +3 -0
- package/bundle/{chunk-a1pw9r6f.js → chunk-5hw6xa49.js} +2 -2
- package/bundle/{chunk-8qkhddq3.js → chunk-5jx0yadh.js} +2 -2
- package/bundle/chunk-5pb551dx.js +2 -0
- package/bundle/{chunk-qrey2gwb.js → chunk-5q4harvc.js} +2 -2
- package/bundle/chunk-5tray1fw.js +3 -0
- package/bundle/{chunk-my6sz5d6.js → chunk-60v5jvgt.js} +1 -1
- package/bundle/chunk-634pnryq.js +2 -0
- package/bundle/chunk-64ezpbwt.js +2 -0
- package/bundle/{chunk-5fgx6fa4.js → chunk-69nzndk7.js} +1 -1
- package/bundle/{chunk-k8ss3135.js → chunk-6aqyhfag.js} +218 -218
- package/bundle/{chunk-chmrvbbj.js → chunk-6d5rrre9.js} +1 -1
- package/bundle/{chunk-g3dhsmbt.js → chunk-6hpgb8h4.js} +3 -3
- package/bundle/{chunk-drs1gv2b.js → chunk-6kp07m7p.js} +1 -1
- package/bundle/{chunk-wy46mbwt.js → chunk-6phh70sp.js} +1 -1
- package/bundle/{chunk-v2zp22r3.js → chunk-70ck4v3t.js} +1 -1
- package/bundle/{chunk-2tnarng3.js → chunk-71sjjjr8.js} +1 -1
- package/bundle/{chunk-ds69qc8b.js → chunk-71xz70r9.js} +1 -1
- package/bundle/{chunk-2dzk5txw.js → chunk-73e409hd.js} +1 -1
- package/bundle/chunk-764fksh3.js +2 -0
- package/bundle/{chunk-g7rjtehn.js → chunk-78ymd20x.js} +1 -1
- package/bundle/{chunk-szr0f7k2.js → chunk-7avcnwv8.js} +1 -1
- package/bundle/{chunk-z8v2tsz2.js → chunk-7hm0c2yg.js} +1 -1
- package/bundle/chunk-7mke41x0.js +2 -0
- package/bundle/chunk-7ry9cvby.js +2 -0
- package/bundle/chunk-7tr9ejyk.js +7 -0
- package/bundle/chunk-7wczs9mx.js +2 -0
- package/bundle/{chunk-aztre27e.js → chunk-7xm75w1e.js} +1 -1
- package/bundle/{chunk-s3yna2wm.js → chunk-7z5jh4ra.js} +1 -1
- package/bundle/chunk-7z777y9k.js +2 -0
- package/bundle/{chunk-vj62pc0h.js → chunk-81qwdg5s.js} +1 -1
- package/bundle/chunk-85wcc1tp.js +3 -0
- package/bundle/chunk-89w3yhf8.js +2 -0
- package/bundle/chunk-8dwq41q1.js +28 -0
- package/bundle/{chunk-6hv59ere.js → chunk-8hytwgwf.js} +1 -1
- package/bundle/{chunk-wz0zcddf.js → chunk-8n20thvd.js} +2 -2
- package/bundle/{chunk-s07j8hfy.js → chunk-8qswepp2.js} +1 -1
- package/bundle/{chunk-bpbptx89.js → chunk-8r6ht39z.js} +1 -1
- package/bundle/chunk-8v96pmqn.js +2 -0
- package/bundle/chunk-8y2scz6z.js +2 -0
- package/bundle/chunk-8zx7vnx6.js +2 -0
- package/bundle/{chunk-qhc90p4a.js → chunk-93p131d5.js} +1 -1
- package/bundle/chunk-94a76f8w.js +2 -0
- package/bundle/{chunk-ppfjf7qx.js → chunk-9emq67vc.js} +1 -1
- package/bundle/{chunk-bvkq0a5q.js → chunk-9f1z9xce.js} +1 -1
- package/bundle/{chunk-dcvatax2.js → chunk-9gazyynx.js} +2 -2
- package/bundle/chunk-9ng7jjp7.js +2 -0
- package/bundle/chunk-9tpgnjy8.js +2 -0
- package/bundle/{chunk-mk6cddvd.js → chunk-a1wdeapb.js} +1 -1
- package/bundle/{chunk-qjn86fc0.js → chunk-a7amey9s.js} +1 -1
- package/bundle/chunk-a7ym9f0v.js +2 -0
- package/bundle/chunk-a8f2xvy3.js +2 -0
- package/bundle/chunk-a99cvwta.js +2 -0
- package/bundle/{chunk-42f7p0hq.js → chunk-ad72gb5f.js} +2 -2
- package/bundle/{chunk-89v6dgpp.js → chunk-ag8kz1e7.js} +2 -2
- package/bundle/{chunk-zv6pjtz1.js → chunk-avf8v3hb.js} +1 -1
- package/bundle/chunk-avys5mnz.js +2 -0
- package/bundle/chunk-axvjd10y.js +2 -0
- package/bundle/{chunk-m612agnk.js → chunk-ay8emwym.js} +1 -1
- package/bundle/chunk-b4pphqab.js +2 -0
- package/bundle/chunk-b6087ak4.js +2 -0
- package/bundle/{chunk-msegx0t7.js → chunk-b8gjz6bk.js} +1 -1
- package/bundle/{chunk-gf0pdgjs.js → chunk-bh53dz71.js} +1 -1
- package/bundle/chunk-bn0h9dny.js +10 -0
- package/bundle/chunk-brkqxbjy.js +2 -0
- package/bundle/{chunk-09kba1hg.js → chunk-c11d28qn.js} +2 -2
- package/bundle/chunk-c26qxt5g.js +2 -0
- package/bundle/chunk-c6zscb38.js +2 -0
- package/bundle/{chunk-ddnpx1yx.js → chunk-caj1b9y7.js} +5 -5
- package/bundle/{chunk-pekm54ce.js → chunk-cfgvm15x.js} +1 -1
- package/bundle/{chunk-v4xcysh0.js → chunk-chpr8ekb.js} +1 -1
- package/bundle/chunk-cjww2jmv.js +3 -0
- package/bundle/{chunk-m67tcnk4.js → chunk-ck2gfaba.js} +1 -1
- package/bundle/{chunk-9j1qqdr2.js → chunk-cphrgyp6.js} +1 -1
- package/bundle/{chunk-eb9mytjq.js → chunk-ctaze2hn.js} +1 -1
- package/bundle/{chunk-5qam3c8r.js → chunk-cxnfy6qk.js} +1 -1
- package/bundle/{chunk-cafzcmrg.js → chunk-d07p6fpk.js} +2 -2
- package/bundle/chunk-d0damw6y.js +2 -0
- package/bundle/{chunk-b8bytvka.js → chunk-d3ermm6d.js} +2 -2
- package/bundle/{chunk-4qqkqrn9.js → chunk-d6ry9418.js} +2 -2
- package/bundle/{chunk-sn4nez18.js → chunk-d9hbhkbq.js} +2 -2
- package/bundle/{chunk-ztc3gm8y.js → chunk-dactgryw.js} +1 -1
- package/bundle/chunk-dafmkrhn.js +2 -0
- package/bundle/{chunk-dfnv7vkn.js → chunk-db405hjg.js} +1 -1
- package/bundle/chunk-dgprdym0.js +2 -0
- package/bundle/{chunk-7yrhe3xq.js → chunk-dnwefyhv.js} +1 -1
- package/bundle/chunk-dryzt12j.js +2 -0
- package/bundle/chunk-dsamees2.js +2 -0
- package/bundle/{chunk-xpc2zgj7.js → chunk-dxpj0cxh.js} +2 -2
- package/bundle/{chunk-yjtdgcq5.js → chunk-dynv30gm.js} +1 -1
- package/bundle/chunk-dyqpxx3b.js +2 -0
- package/bundle/{chunk-2rs39vj2.js → chunk-e01wnqvc.js} +1 -1
- package/bundle/{chunk-2vepzgek.js → chunk-e10py6yr.js} +1 -1
- package/bundle/chunk-e5mv5wnt.js +2 -0
- package/bundle/{chunk-qv2s39dv.js → chunk-e7ny0b3x.js} +1 -1
- package/bundle/{chunk-n8h6x2en.js → chunk-ejrhvy38.js} +1 -1
- package/bundle/{chunk-dq9kpj4a.js → chunk-enpzvmtc.js} +1 -1
- package/bundle/chunk-ew9pdrp9.js +3 -0
- package/bundle/{chunk-gj3hzx3d.js → chunk-ezfy0b6q.js} +2 -2
- package/bundle/{chunk-2km50rd3.js → chunk-fgg9txzb.js} +1 -1
- package/bundle/{chunk-b9za12y1.js → chunk-fn9h4ync.js} +1 -1
- package/bundle/{chunk-ngchsw2g.js → chunk-fvzwbjh8.js} +1 -1
- package/bundle/{chunk-nzehfpxp.js → chunk-g10d6x57.js} +1 -1
- package/bundle/{chunk-zyhdxggp.js → chunk-g5rabwre.js} +2 -2
- package/bundle/{chunk-kfsb2stm.js → chunk-g7ccdh7r.js} +1 -1
- package/bundle/{chunk-phxrg7aw.js → chunk-gagtmjmp.js} +2 -2
- package/bundle/{chunk-yp0a8q29.js → chunk-gb00fh4z.js} +3 -3
- package/bundle/{chunk-hw1dmx28.js → chunk-gbpvs0fx.js} +1 -1
- package/bundle/{chunk-j8efst22.js → chunk-gj0wt0cy.js} +1 -1
- package/bundle/{chunk-2q96x1t5.js → chunk-gsar6xda.js} +1 -1
- package/bundle/{chunk-xs3xtz6x.js → chunk-gt31468k.js} +1 -1
- package/bundle/{chunk-ecn8gbtz.js → chunk-gwp17r03.js} +1 -1
- package/bundle/chunk-gwzw92jt.js +2 -0
- package/bundle/chunk-gz8sz7z1.js +9 -0
- package/bundle/{chunk-2bn4b42t.js → chunk-h2afsbm1.js} +1 -1
- package/bundle/{chunk-tj78jsp9.js → chunk-h4j5xzc8.js} +1 -1
- package/bundle/chunk-h6f3kbz2.js +2 -0
- package/bundle/{chunk-b3dqcbsc.js → chunk-hbbsbyyq.js} +1 -1
- package/bundle/{chunk-2gerf08b.js → chunk-hnvn2c25.js} +2 -2
- package/bundle/{chunk-vn7nkrqb.js → chunk-hnzegjgv.js} +1 -1
- package/bundle/chunk-hp7tssgv.js +2 -0
- package/bundle/chunk-ht0hbdmx.js +2 -0
- package/bundle/{chunk-j9pcnkkq.js → chunk-ht5w06x7.js} +2 -2
- package/bundle/{chunk-a1p2f16h.js → chunk-htz93dsd.js} +2 -2
- package/bundle/{chunk-q6ztpfcs.js → chunk-jbx3s7nw.js} +2 -2
- package/bundle/{chunk-hxz2rdjq.js → chunk-jdynx7m6.js} +1 -1
- package/bundle/{chunk-h9pvnp5c.js → chunk-jef04wyf.js} +1 -1
- package/bundle/{chunk-ct48575c.js → chunk-jh0bw59r.js} +1 -1
- package/bundle/{chunk-knpt9n8f.js → chunk-jrqb0jwy.js} +1 -1
- package/bundle/{chunk-1dwcga8g.js → chunk-js1n8tgv.js} +1 -1
- package/bundle/chunk-k1txw65h.js +2 -0
- package/bundle/chunk-k5atbdbm.js +2 -0
- package/bundle/chunk-k75jqg60.js +3 -0
- package/bundle/{chunk-yn6sbycg.js → chunk-k7aenxan.js} +2 -2
- package/bundle/{chunk-1rp1cvmc.js → chunk-kf167jw7.js} +1 -1
- package/bundle/{chunk-wsy0m70r.js → chunk-kfxv5rfg.js} +1 -1
- package/bundle/{chunk-btz9jvec.js → chunk-kj20f048.js} +1 -1
- package/bundle/{chunk-j5kb0y1m.js → chunk-kq6b222y.js} +1 -1
- package/bundle/{chunk-1t9jne14.js → chunk-ktzq4ha1.js} +1 -1
- package/bundle/{chunk-5v4py9p2.js → chunk-m2q317gh.js} +1 -1
- package/bundle/chunk-mahgmbt9.js +2 -0
- package/bundle/{chunk-1qshjfzm.js → chunk-mk1bfzg5.js} +1 -1
- package/bundle/{chunk-2y90ad1v.js → chunk-mqd1jsg2.js} +1 -1
- package/bundle/{chunk-t12xrrfr.js → chunk-mzs2pjyc.js} +2 -2
- package/bundle/{chunk-m02zt1a3.js → chunk-n9xns8by.js} +2 -2
- package/bundle/chunk-ngm6pqyt.js +2 -0
- package/bundle/chunk-ngtavamt.js +2 -0
- package/bundle/chunk-nkhc32s3.js +2 -0
- package/bundle/{chunk-wpajh5s5.js → chunk-nkkch4h7.js} +1 -1
- package/bundle/chunk-npse2xrd.js +2 -0
- package/bundle/{chunk-k7gq9bra.js → chunk-nv3eyyaj.js} +1 -1
- package/bundle/{chunk-ab6cabxh.js → chunk-p18axz0m.js} +1 -1
- package/bundle/{chunk-jje0srjq.js → chunk-p62gb4wj.js} +1 -1
- package/bundle/chunk-p6e4vqy7.js +2 -0
- package/bundle/{chunk-m1h5a4vg.js → chunk-p9qfbr02.js} +1 -1
- package/bundle/{chunk-ggqst87g.js → chunk-pe29yy6s.js} +1 -1
- package/bundle/{chunk-yy526n9c.js → chunk-pje60pj2.js} +1 -1
- package/bundle/{chunk-3n1324bt.js → chunk-pp2eqkse.js} +1 -1
- package/bundle/{chunk-x067eetw.js → chunk-pp6vhqrr.js} +1 -1
- package/bundle/chunk-pqkjhn8h.js +2 -0
- package/bundle/{chunk-ezja6njs.js → chunk-pv67gwce.js} +1 -1
- package/bundle/{chunk-b3rpzkcb.js → chunk-q7vasbxn.js} +1 -1
- package/bundle/chunk-qadw6j20.js +2 -0
- package/bundle/{chunk-89q1y7tc.js → chunk-qc8rsn4v.js} +1 -1
- package/bundle/chunk-qd8w2gkd.js +2 -0
- package/bundle/chunk-qggcszs2.js +2 -0
- package/bundle/{chunk-q1v2pytx.js → chunk-qrsveve6.js} +1 -1
- package/bundle/chunk-r7sqdfad.js +2 -0
- package/bundle/chunk-r8m7rtfc.js +2 -0
- package/bundle/{chunk-7ppd2phw.js → chunk-rbk8seme.js} +1 -1
- package/bundle/chunk-rf12t4n5.js +2 -0
- package/bundle/{chunk-04tw0r4s.js → chunk-rg0mrprz.js} +1 -1
- package/bundle/{chunk-cdhmc0t0.js → chunk-rjd8gbs5.js} +1 -1
- package/bundle/chunk-rkyf0cp8.js +2 -0
- package/bundle/chunk-rpgne7xh.js +2 -0
- package/bundle/chunk-rvgj1vky.js +2 -0
- package/bundle/{chunk-c01z3cvg.js → chunk-rvkrgkeq.js} +1 -1
- package/bundle/chunk-rza530gm.js +5 -0
- package/bundle/{chunk-2ahqhh4z.js → chunk-rzhdkkpz.js} +1 -1
- package/bundle/chunk-s3mnrhbx.js +5 -0
- package/bundle/chunk-s6ktx2sx.js +2 -0
- package/bundle/{chunk-kqn9h2gk.js → chunk-skqbaadf.js} +1 -1
- package/bundle/chunk-ss2jvqrg.js +2 -0
- package/bundle/{chunk-ydp0q1hk.js → chunk-ss2ms1r3.js} +1 -1
- package/bundle/{chunk-1fbeendk.js → chunk-t56r99hp.js} +1 -1
- package/bundle/{chunk-xc5044tm.js → chunk-t8m74g39.js} +1 -1
- package/bundle/{chunk-s6bar2f9.js → chunk-t9mz17gb.js} +2 -2
- package/bundle/{chunk-cvdxgsq1.js → chunk-tq0239xp.js} +1 -1
- package/bundle/{chunk-whxjkz9a.js → chunk-tqj69nh6.js} +2 -2
- package/bundle/{chunk-hj5y7fvk.js → chunk-tt30dybd.js} +1 -1
- package/bundle/{chunk-5a5t01ka.js → chunk-tvdmnee6.js} +1 -1
- package/bundle/chunk-tvwwq4b3.js +2 -0
- package/bundle/{chunk-dhjp0zx2.js → chunk-v1xjc3s8.js} +1 -1
- package/bundle/chunk-v2n26eg4.js +2 -0
- package/bundle/chunk-vcw00k0n.js +3 -0
- package/bundle/{chunk-7jbz3dgt.js → chunk-vhe0tth1.js} +1 -1
- package/bundle/{chunk-yfkvjphe.js → chunk-vvxmwyrw.js} +1 -1
- package/bundle/{chunk-p68rwmhc.js → chunk-vxyy2dp3.js} +2 -2
- package/bundle/{chunk-y2v09y71.js → chunk-vywnd5sf.js} +1 -1
- package/bundle/{chunk-0jgsp4c2.js → chunk-w18xs2h5.js} +1 -1
- package/bundle/{chunk-fjgyrsbw.js → chunk-w7vh8cxt.js} +1 -1
- package/bundle/chunk-w8saweey.js +2 -0
- package/bundle/chunk-we9cv8we.js +8 -0
- package/bundle/chunk-wezarrvy.js +2 -0
- package/bundle/{chunk-d6r4xwtg.js → chunk-wfb608qf.js} +3 -3
- package/bundle/{chunk-3g1yz39h.js → chunk-whe7h2mj.js} +1 -1
- package/bundle/chunk-wmqsdt2c.js +3 -0
- package/bundle/chunk-wqj0xasg.js +2 -0
- package/bundle/chunk-wr42tphe.js +2 -0
- package/bundle/chunk-x24y7qyd.js +2 -0
- package/bundle/{chunk-07g7cybt.js → chunk-x25zkrz7.js} +1 -1
- package/bundle/{chunk-tr8sf0dk.js → chunk-x3y2xzhn.js} +1 -1
- package/bundle/{chunk-27yxgy03.js → chunk-x4sp99g6.js} +1 -1
- package/bundle/{chunk-3nwve06r.js → chunk-x562b0xk.js} +1 -1
- package/bundle/{chunk-61c62e5s.js → chunk-x7k5yeey.js} +1 -1
- package/bundle/{chunk-fkgv2hqd.js → chunk-x9rbv6p6.js} +1 -1
- package/bundle/{chunk-wnqwb6fd.js → chunk-xcmgkc57.js} +1 -1
- package/bundle/chunk-xj765svc.js +3 -0
- package/bundle/{chunk-gm85xefs.js → chunk-xm7wascx.js} +1 -1
- package/bundle/{chunk-whcg14sc.js → chunk-xrs18kzn.js} +1 -1
- package/bundle/{chunk-6nbzdb0r.js → chunk-xthkjax9.js} +1 -1
- package/bundle/{chunk-scnz207s.js → chunk-xvwvd4kq.js} +2 -2
- package/bundle/{chunk-zb0me4kk.js → chunk-xzrb857v.js} +1 -1
- package/bundle/chunk-y2d0w09y.js +2 -0
- package/bundle/{chunk-3nyqh1d6.js → chunk-y3b4k38p.js} +1 -1
- package/bundle/{chunk-svvgv1s0.js → chunk-y6123zvq.js} +1 -1
- package/bundle/chunk-y7sy3w6z.js +2 -0
- package/bundle/{chunk-vg2fmyje.js → chunk-y9q0hb7b.js} +2 -2
- package/bundle/chunk-yb79f79m.js +2 -0
- package/bundle/{chunk-fnbpap62.js → chunk-yek0sk2q.js} +1 -1
- package/bundle/{chunk-wfs4pcwa.js → chunk-ygs5pzk7.js} +4 -4
- package/bundle/{chunk-3bmzjznz.js → chunk-yhbcbjfk.js} +1 -1
- package/bundle/{chunk-sermjas1.js → chunk-yjf3kyej.js} +1 -1
- package/bundle/chunk-yjnyzpmt.js +2 -0
- package/bundle/{chunk-0a0vat1h.js → chunk-yp5bypsp.js} +2 -2
- package/bundle/{chunk-h0rpmne5.js → chunk-yp8wyzzm.js} +1 -1
- package/bundle/chunk-yqbcnsa1.js +2 -0
- package/bundle/{chunk-4xh1qm90.js → chunk-yv0xrnn9.js} +1 -1
- package/bundle/chunk-z3mra3nm.js +2 -0
- package/bundle/chunk-za7mwbye.js +2 -0
- package/bundle/chunk-zaks8cae.js +11 -0
- package/bundle/{chunk-0fmbz83g.js → chunk-zcsgqk9f.js} +1 -1
- package/bundle/chunk-zqqx96jx.js +3 -0
- package/bundle/{chunk-snm5q21k.js → chunk-zs8kqdsf.js} +2 -2
- package/bundle/{chunk-y062spw2.js → chunk-zscer8rc.js} +1 -1
- package/bundle/{chunk-qjjch1zt.js → chunk-zw815d68.js} +2 -2
- package/bundle/chunk-zy9w1vkc.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-07ws99b1.js +0 -2
- package/bundle/chunk-09c4ngag.js +0 -2
- package/bundle/chunk-0ch32p4c.js +0 -3
- package/bundle/chunk-0jgst767.js +0 -2
- package/bundle/chunk-0psrr9vp.js +0 -2
- package/bundle/chunk-1j73cnvz.js +0 -2
- package/bundle/chunk-1yddn03z.js +0 -2
- package/bundle/chunk-27dgtm8r.js +0 -2
- package/bundle/chunk-2ec6ps8r.js +0 -5
- package/bundle/chunk-38g8yzw0.js +0 -2
- package/bundle/chunk-3bkd0ar3.js +0 -2
- package/bundle/chunk-3f4zht9e.js +0 -2
- package/bundle/chunk-3pxnp6jb.js +0 -2
- package/bundle/chunk-3szwfy7w.js +0 -3
- package/bundle/chunk-426dt7be.js +0 -2
- package/bundle/chunk-4amgp4yd.js +0 -3
- package/bundle/chunk-4p5e5tsz.js +0 -28
- package/bundle/chunk-4pjm21a5.js +0 -2
- package/bundle/chunk-4sz3jbc5.js +0 -2
- package/bundle/chunk-58x5seqn.js +0 -2
- package/bundle/chunk-5xe6x2rt.js +0 -2
- package/bundle/chunk-618tmyx9.js +0 -2
- package/bundle/chunk-6d9wsjxm.js +0 -2
- package/bundle/chunk-730a2d1k.js +0 -2
- package/bundle/chunk-76wrw0cs.js +0 -2
- package/bundle/chunk-7bd0x9vf.js +0 -2
- package/bundle/chunk-7czkntef.js +0 -2
- package/bundle/chunk-7ex57nyh.js +0 -2
- package/bundle/chunk-7gpczxbh.js +0 -2
- package/bundle/chunk-7j0bgeh2.js +0 -2
- package/bundle/chunk-7py443fe.js +0 -2
- package/bundle/chunk-90q5sae0.js +0 -2
- package/bundle/chunk-9amwe0ed.js +0 -2
- package/bundle/chunk-9grvepmd.js +0 -2
- package/bundle/chunk-9hrh15p2.js +0 -2
- package/bundle/chunk-a0v55ywn.js +0 -8
- package/bundle/chunk-a2qz9m10.js +0 -2
- package/bundle/chunk-av6ezvxm.js +0 -2
- package/bundle/chunk-beksar7w.js +0 -2
- package/bundle/chunk-bg66rqrx.js +0 -2
- package/bundle/chunk-bn15mzd7.js +0 -2
- package/bundle/chunk-bt6yw07v.js +0 -2
- package/bundle/chunk-cy9s1ma5.js +0 -2
- package/bundle/chunk-d0nkvp57.js +0 -2
- package/bundle/chunk-dvk2wwjj.js +0 -2
- package/bundle/chunk-dxe29jj6.js +0 -2
- package/bundle/chunk-e0jy9qxd.js +0 -2
- package/bundle/chunk-eercqt72.js +0 -2
- package/bundle/chunk-efxd6b2k.js +0 -2
- package/bundle/chunk-eneawsj8.js +0 -2
- package/bundle/chunk-f72pppr7.js +0 -2
- package/bundle/chunk-feyphhxd.js +0 -2
- package/bundle/chunk-fnnch1e9.js +0 -2
- package/bundle/chunk-ft93f33g.js +0 -3
- package/bundle/chunk-gk34kh8p.js +0 -2
- package/bundle/chunk-gn50xqbd.js +0 -2
- package/bundle/chunk-h6rv626m.js +0 -2
- package/bundle/chunk-h7s2w1e2.js +0 -2
- package/bundle/chunk-hmv2cdnz.js +0 -2
- package/bundle/chunk-ht81ensf.js +0 -2
- package/bundle/chunk-hxpgs78j.js +0 -5
- package/bundle/chunk-j59ktwny.js +0 -2
- package/bundle/chunk-jmz2mq3t.js +0 -2
- package/bundle/chunk-jvqbvgjy.js +0 -11
- package/bundle/chunk-k309zez0.js +0 -3
- package/bundle/chunk-k3fn3yed.js +0 -2
- package/bundle/chunk-kpw6nghv.js +0 -2
- package/bundle/chunk-m5ghbt5y.js +0 -2
- package/bundle/chunk-mj4bepvj.js +0 -2
- package/bundle/chunk-mn41f9qv.js +0 -2
- package/bundle/chunk-mqjf9sbm.js +0 -2
- package/bundle/chunk-n5gwrrbb.js +0 -2
- package/bundle/chunk-nfjhem1c.js +0 -2
- package/bundle/chunk-ngytjdg2.js +0 -3
- package/bundle/chunk-nj4d554m.js +0 -11
- package/bundle/chunk-nrc3bj9p.js +0 -2
- package/bundle/chunk-nt4e3em9.js +0 -3
- package/bundle/chunk-nxyyn2ra.js +0 -2
- package/bundle/chunk-p5tceb4k.js +0 -2
- package/bundle/chunk-pvpy9kq1.js +0 -800
- package/bundle/chunk-qjgm3e2p.js +0 -2
- package/bundle/chunk-qt80mhdn.js +0 -2
- package/bundle/chunk-qtw5nrr4.js +0 -2
- package/bundle/chunk-rc9ex3vt.js +0 -2
- package/bundle/chunk-s9672vvv.js +0 -2
- package/bundle/chunk-sbyey0qb.js +0 -2
- package/bundle/chunk-shpq6es1.js +0 -3
- package/bundle/chunk-sj5v361q.js +0 -2
- package/bundle/chunk-ta3k9syc.js +0 -2
- package/bundle/chunk-tk5afan4.js +0 -2
- package/bundle/chunk-tpndnprb.js +0 -2
- package/bundle/chunk-v965rsr8.js +0 -3
- package/bundle/chunk-vcmrrt8b.js +0 -3
- package/bundle/chunk-vcrn3v70.js +0 -2
- package/bundle/chunk-vwxfgea7.js +0 -2
- package/bundle/chunk-w0kgcz1t.js +0 -2
- package/bundle/chunk-wgpsmxqx.js +0 -7
- package/bundle/chunk-wksczmes.js +0 -2
- package/bundle/chunk-wsxta33r.js +0 -2
- package/bundle/chunk-xck0sq3k.js +0 -2
- package/bundle/chunk-xjyhtm8r.js +0 -2
- package/bundle/chunk-xm08fc2q.js +0 -3
- package/bundle/chunk-ygc5qegv.js +0 -2
- package/bundle/chunk-yjqmzm51.js +0 -2
- package/bundle/chunk-yzc53n88.js +0 -2
- package/bundle/chunk-yzjc15vp.js +0 -9
- package/bundle/chunk-z7y9pdj7.js +0 -2
- package/bundle/chunk-z8g819cz.js +0 -2
- package/bundle/chunk-z8r65yw3.js +0 -2
- package/bundle/chunk-zt1nbwmm.js +0 -2
- package/bundle/chunk-zz36xg2n.js +0 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var J=Symbol.for("drizzle:entityKind");function D(X,Y){if(!X||typeof X!=="object")return!1;if(X instanceof Y)return!0;if(!Object.prototype.hasOwnProperty.call(Y,J))throw Error(`Class "${Y.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let Z=Object.getPrototypeOf(X)?.constructor;if(Z)while(Z){if(J in Z&&Z[J]===Y[J])return!0;Z=Object.getPrototypeOf(Z)}return!1}var T1=Symbol.for("drizzle:OriginalColumn");var N=class{static[J]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;length;isLengthExact;isAlias;config;table;onInit(){}constructor(X,Y){this.config=Y,this.onInit(),this.table=X,this.name=Y.name,this.isAlias=!1,this.keyAsName=Y.keyAsName,this.notNull=Y.notNull,this.default=Y.default,this.defaultFn=Y.defaultFn,this.onUpdateFn=Y.onUpdateFn,this.hasDefault=Y.hasDefault,this.primary=Y.primaryKey,this.isUnique=Y.isUnique,this.uniqueName=Y.uniqueName,this.uniqueType=Y.uniqueType,this.dataType=Y.dataType,this.columnType=Y.columnType,this.generated=Y.generated,this.generatedIdentity=Y.generatedIdentity,this.length=Y.length,this.isLengthExact=Y.isLengthExact}mapFromDriverValue(X){return X}mapToDriverValue(X){return X}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}[T1](){return this}};var r=Symbol.for("drizzle:Name");var G1=Symbol.for("drizzle:Schema"),n=Symbol.for("drizzle:Columns"),GY=Symbol.for("drizzle:ExtraConfigColumns"),U1=Symbol.for("drizzle:OriginalName"),QX=Symbol.for("drizzle:BaseName"),_1=Symbol.for("drizzle:IsAlias"),WY=Symbol.for("drizzle:ExtraConfigBuilder"),X0=Symbol.for("drizzle:IsDrizzleTable"),A=class{static[J]="Table";static Symbol={Name:r,Schema:G1,OriginalName:U1,Columns:n,ExtraConfigColumns:GY,BaseName:QX,IsAlias:_1,ExtraConfigBuilder:WY};[r];[U1];[G1];[n];[GY];[QX];[_1]=!1;[X0]=!0;[WY]=void 0;constructor(X,Y,Z){this[r]=this[U1]=X,this[G1]=Y,this[QX]=Z}};function z1(X){return X[r]}function A1(X){return`${X[G1]??"public"}.${X[r]}`}var T=class{static[J]="Subquery";constructor(X,Y,Z,$=!1,G=[]){this._={brand:"Subquery",sql:X,selectedFields:Y,alias:Z,isWith:$,usedTables:G}}},WX=class extends T{static[J]="WithSubquery"};function JY(X,...Y){return X(...Y)}var HY={startActiveSpan(X,Y){return Y()}};var Q=Symbol.for("drizzle:ViewBaseConfig");var Y0=class{static[J]="FakePrimitiveParam"};function E1(X){return X!==null&&X!==void 0&&typeof X.getSQL==="function"}function Z0(X){let Y={sql:"",params:[]};for(let Z of X)if(Y.sql+=Z.sql,Y.params.push(...Z.params),Z.typings?.length){if(!Y.typings)Y.typings=[];Y.typings.push(...Z.typings)}return Y}var h=class{static[J]="StringChunk";value;constructor(X){this.value=Array.isArray(X)?X:[X]}getSQL(){return new x([this])}},x=class X{static[J]="SQL";decoder=C1;shouldInlineParams=!1;usedTables=[];constructor(Y){this.queryChunks=Y;for(let Z of Y)if(D(Z,A)){let $=Z[A.Symbol.Schema];this.usedTables.push($===void 0?Z[A.Symbol.Name]:$+"."+Z[A.Symbol.Name])}}append(Y){return this.queryChunks.push(...Y.queryChunks),this}toQuery(Y){return HY.startActiveSpan("drizzle.buildSQL",(Z)=>{let $=this.buildQueryFromSourceParams(this.queryChunks,Y);return Z?.setAttributes({"drizzle.query.text":$.sql,"drizzle.query.params":JSON.stringify($.params)}),$})}buildQueryFromSourceParams(Y,Z){let $=Object.assign({},Z,{inlineParams:Z.inlineParams||this.shouldInlineParams,paramStartIndex:Z.paramStartIndex||{value:0}}),{casing:G,escapeName:H,escapeParam:_,prepareTyping:z,inlineParams:O,paramStartIndex:E,invokeSource:U}=$;return Z0(Y.map((F)=>{if(D(F,h))return{sql:F.value.join(""),params:[]};if(D(F,S1))return{sql:H(F.value),params:[]};if(F===void 0)return{sql:"",params:[]};if(Array.isArray(F)){let M=[new h("(")];for(let[I,L]of F.entries())if(M.push(L),I<F.length-1)M.push(new h(", "));return M.push(new h(")")),this.buildQueryFromSourceParams(M,$)}if(D(F,X))return this.buildQueryFromSourceParams(F.queryChunks,{...$,inlineParams:O||F.shouldInlineParams});if(D(F,A)){let M=F[A.Symbol.Schema],I=F[A.Symbol.Name];if(U==="mssql-view-with-schemabinding")return{sql:(M===void 0?H("dbo"):H(M))+"."+H(I),params:[]};return{sql:M===void 0||F[_1]?H(I):H(M)+"."+H(I),params:[]}}if(D(F,N)){let M=G.getColumnCasing(F);if(Z.invokeSource==="indexes")return{sql:H(M),params:[]};let I=U==="mssql-check"?void 0:F.table[A.Symbol.Schema];return{sql:F.isAlias?H(F.name):F.table[_1]||I===void 0?H(F.table[A.Symbol.Name])+"."+H(M):H(I)+"."+H(F.table[A.Symbol.Name])+"."+H(M),params:[]}}if(D(F,y)){let M=F[Q].schema,I=F[Q].name;return{sql:M===void 0||F[Q].isAlias?H(I):H(M)+"."+H(I),params:[]}}if(D(F,g)){if(D(F.value,l))return{sql:_(E.value++,F),params:[F],typings:["none"]};let M=F.value===null?null:F.encoder.mapToDriverValue(F.value);if(D(M,X))return this.buildQueryFromSourceParams([M],$);if(O)return{sql:this.mapInlineParam(M,$),params:[]};let I=["none"];if(z)I=[z(F.encoder)];return{sql:_(E.value++,M),params:[M],typings:I}}if(D(F,l))return{sql:_(E.value++,F),params:[F],typings:["none"]};if(D(F,X.Aliased)&&F.fieldAlias!==void 0)return{sql:(F.origin!==void 0?H(F.origin)+".":"")+H(F.fieldAlias),params:[]};if(D(F,T)){if(F._.isWith)return{sql:H(F._.alias),params:[]};return this.buildQueryFromSourceParams([new h("("),F._.sql,new h(") "),new S1(F._.alias)],$)}if(typeof F==="function"&&"enumName"in F){if("schema"in F&&F.schema)return{sql:H(F.schema)+"."+H(F.enumName),params:[]};return{sql:H(F.enumName),params:[]}}if(E1(F)){if(F.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([F.getSQL()],$);return this.buildQueryFromSourceParams([new h("("),F.getSQL(),new h(")")],$)}if(O)return{sql:this.mapInlineParam(F,$),params:[]};return{sql:_(E.value++,F),params:[F],typings:["none"]}}))}mapInlineParam(Y,{escapeString:Z}){if(Y===null)return"null";if(typeof Y==="number"||typeof Y==="boolean"||typeof Y==="bigint")return Y.toString();if(typeof Y==="string")return Z(Y);if(typeof Y==="object"){let $=Y.toString();if($==="[object Object]")return Z(JSON.stringify(Y));return Z($)}throw Error("Unexpected param value: "+Y)}getSQL(){return this}as(Y){if(Y===void 0)return this;return new X.Aliased(this,Y)}mapWith(Y){return this.decoder=typeof Y==="function"?{mapFromDriverValue:Y}:Y,this}inlineParams(){return this.shouldInlineParams=!0,this}if(Y){return Y?this:void 0}},S1=class{static[J]="Name";brand;constructor(X){this.value=X}getSQL(){return new x([this])}};function $0(X){return new S1(X)}function PX(X){return typeof X==="object"&&X!==null&&"mapToDriverValue"in X&&typeof X.mapToDriverValue==="function"}var C1={mapFromDriverValue:(X)=>X},LX={mapToDriverValue:(X)=>X},G0={...C1,...LX},g=class{static[J]="Param";brand;constructor(X,Y=LX){this.value=X,this.encoder=Y}getSQL(){return new x([this])}};function W0(X,Y){return new g(X,Y)}function W(X,...Y){let Z=[];if(Y.length>0||X.length>0&&X[0]!=="")Z.push(new h(X[0]));for(let[$,G]of Y.entries())Z.push(G,new h(X[$+1]));return new x(Z)}(function(X){function Y(){return new x([])}X.empty=Y;function Z(O){return new x(O)}X.fromList=Z;function $(O){return new x([new h(O)])}X.raw=$;function G(O,E){let U=[];for(let[F,M]of O.entries()){if(F>0&&E!==void 0)U.push(E);U.push(M)}return new x(U)}X.join=G;function H(O){return new S1(O)}X.identifier=H;function _(O){return new l(O)}X.placeholder=_;function z(O,E){return new g(O,E)}X.param=z})(W||(W={}));(function(X){class Y{static[J]="SQL.Aliased";isSelectionField=!1;origin;constructor(Z,$){this.sql=Z,this.fieldAlias=$}getSQL(){return this.sql}clone(){return new Y(this.sql,this.fieldAlias)}}X.Aliased=Y})(x||(x={}));var l=class{static[J]="Placeholder";constructor(X){this.name=X}getSQL(){return new x([this])}};function J0(X){return new l(X)}function D1(X,Y){return X.map((Z)=>{if(D(Z,l)){if(!(Z.name in Y))throw Error(`No value for placeholder "${Z.name}" was provided`);return Y[Z.name]}if(D(Z,g)&&D(Z.value,l)){if(!(Z.value.name in Y))throw Error(`No value for placeholder "${Z.value.name}" was provided`);return Z.encoder.mapToDriverValue(Y[Z.value.name])}return Z})}var _Y=Symbol.for("drizzle:IsDrizzleView"),y=class{static[J]="View";[Q];[_Y]=!0;get[r](){return this[Q].name}get[G1](){return this[Q].schema}get[_1](){return this[Q].isAlias}get[U1](){return this[Q].originalName}get[n](){return this[Q].selectedFields}constructor({name:X,schema:Y,selectedFields:Z,query:$}){this[Q]={name:X,originalName:X,schema:Y,selectedFields:Z,query:$,isExisting:!$,isAlias:!1}}};function H0(X){return typeof X==="object"&&X!==null&&_Y in X}function _0(X){return X[Q].name}N.prototype.getSQL=function(){return new x([this])};T.prototype.getSQL=function(){return new x([this])};function BX(X,Y,Z){let $={},G=X.reduce((H,{path:_,field:z},O)=>{let E;if(D(z,N))E=z;else if(D(z,x))E=z.decoder;else if(D(z,T))E=z._.sql.decoder;else E=z.sql.decoder;let U=H;for(let[F,M]of _.entries())if(F<_.length-1){if(!(M in U))U[M]={};U=U[M]}else{let I=Y[O],L=U[M]=I===null?null:E.mapFromDriverValue(I);if(Z&&D(z,N)&&_.length===2){let P=_[0];if(!(P in $))$[P]=L===null?z1(z.table):!1;else if(typeof $[P]==="string"&&$[P]!==z1(z.table))$[P]=!1}}return H},{});if(Z&&Object.keys($).length>0){for(let[H,_]of Object.entries($))if(typeof _==="string"&&!Z[_])G[H]=null}return G}function i(X,Y){return Object.entries(X).reduce((Z,[$,G])=>{if(typeof $!=="string")return Z;let H=Y?[...Y,$]:[$];if(D(G,N)||D(G,x)||D(G,x.Aliased)||D(G,T))Z.push({path:H,field:G});else if(D(G,A))Z.push(...i(G[A.Symbol.Columns],H));else Z.push(...i(G,H));return Z},[])}function q1(X,Y){let Z=Object.keys(X),$=Object.keys(Y);if(Z.length!==$.length)return!1;for(let[G,H]of Z.entries())if(H!==$[G])return!1;return!0}function JX(X,Y){let Z=Object.entries(Y).filter(([,$])=>$!==void 0).map(([$,G])=>{if(D(G,x)||D(G,N))return[$,G];else return[$,new g(G,X[A.Symbol.Columns][$])]});if(Z.length===0)throw Error("No values to set");return Object.fromEntries(Z)}function zY(X,Y){for(let Z of Y)for(let $ of Object.getOwnPropertyNames(Z.prototype)){if($==="constructor")continue;Object.defineProperty(X.prototype,$,Object.getOwnPropertyDescriptor(Z.prototype,$)||Object.create(null))}}function EY(X){return X[A.Symbol.Columns]}function v1(X){return D(X,T)?X._.alias:D(X,y)?X[Q].name:D(X,x)?void 0:X[A.Symbol.IsAlias]?X[A.Symbol.Name]:X[A.Symbol.BaseName]}function k(X,Y){return{name:typeof X==="string"&&X.length>0?X:"",config:typeof X==="object"?X:Y}}var jX=typeof TextDecoder>"u"?null:new TextDecoder;var D3={INT8_MIN:-128,INT8_MAX:127,INT8_UNSIGNED_MAX:255,INT16_MIN:-32768,INT16_MAX:32767,INT16_UNSIGNED_MAX:65535,INT24_MIN:-8388608,INT24_MAX:8388607,INT24_UNSIGNED_MAX:16777215,INT32_MIN:-2147483648,INT32_MAX:2147483647,INT32_UNSIGNED_MAX:4294967295,INT48_MIN:-140737488355328,INT48_MAX:140737488355327,INT48_UNSIGNED_MAX:281474976710655,INT64_MIN:-9223372036854775808n,INT64_MAX:9223372036854775807n,INT64_UNSIGNED_MAX:18446744073709551615n};var z0=class{static[J]="ConsoleLogWriter";write(X){console.log(X)}},DY=class{static[J]="DefaultLogger";writer;constructor(X){this.writer=X?.writer??new z0}logQuery(X,Y){let Z=Y.map((G)=>{try{return JSON.stringify(G)}catch{return String(G)}}),$=Z.length?` -- params: [${Z.join(", ")}]`:"";this.writer.write(`Query: ${X}${$}`)}},OY=class{static[J]="NoopLogger";logQuery(){}};var FY=class{static[J]="ColumnBuilder";config;constructor(X,Y,Z){this.config={name:X,keyAsName:X==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:Y,columnType:Z,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(X){return this.config.default=X,this.config.hasDefault=!0,this}$defaultFn(X){return this.config.defaultFn=X,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(X){return this.config.onUpdateFn=X,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(X){if(this.config.name!=="")return;this.config.name=X}};var HX=class{static[J]="SQLiteForeignKeyBuilder";reference;_onUpdate;_onDelete;constructor(X,Y){if(this.reference=()=>{let{name:Z,columns:$,foreignColumns:G}=X();return{name:Z,columns:$,foreignTable:G[0].table,foreignColumns:G}},Y)this._onUpdate=Y.onUpdate,this._onDelete=Y.onDelete}onUpdate(X){return this._onUpdate=X,this}onDelete(X){return this._onDelete=X,this}build(X){return new UY(X,this)}},UY=class{static[J]="SQLiteForeignKey";reference;onUpdate;onDelete;constructor(X,Y){this.table=X,this.reference=Y.reference,this.onUpdate=Y._onUpdate,this.onDelete=Y._onDelete}getName(){let{name:X,columns:Y,foreignColumns:Z}=this.reference(),$=Y.map((_)=>_.name),G=Z.map((_)=>_.name),H=[this.table[r],...$,Z[0].table[r],...G];return X??`${H.join("_")}_fk`}isNameExplicit(){return!!this.reference().name}};function E0(X){function Y(){if(typeof X==="function"){let{name:Z,columns:$,foreignColumns:G}=X();return{name:Z,columns:$,foreignColumns:G}}return X}return new HX(Y)}var f=class extends FY{static[J]="SQLiteColumnBuilder";foreignKeyConfigs=[];references(X,Y={}){return this.foreignKeyConfigs.push({ref:X,actions:Y}),this}unique(X){return this.config.isUnique=!0,this.config.uniqueName=X,this}generatedAlwaysAs(X,Y){return this.config.generated={as:X,type:"always",mode:Y?.mode??"virtual"},this}buildForeignKeys(X,Y){return this.foreignKeyConfigs.map(({ref:Z,actions:$})=>{return((G,H)=>{let _=new HX(()=>{let z=G();return{columns:[X],foreignColumns:[z]}});if(H.onUpdate)_.onUpdate(H.onUpdate);if(H.onDelete)_.onDelete(H.onDelete);return _.build(Y)})(Z,$)})}},S=class extends N{static[J]="SQLiteColumn";table;constructor(X,Y){super(X,Y);this.table=X}};var _X=class extends f{static[J]="SQLiteBaseIntegerBuilder";constructor(X,Y,Z){super(X,Y,Z);this.config.autoIncrement=!1}primaryKey(X){if(X?.autoIncrement)this.config.autoIncrement=!0;return this.config.hasDefault=!0,super.primaryKey()}},zX=class extends S{static[J]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return"integer"}},AY=class extends _X{static[J]="SQLiteIntegerBuilder";constructor(X){super(X,"number int53","SQLiteInteger")}build(X){return new VY(X,this.config)}},VY=class extends zX{static[J]="SQLiteInteger"},IY=class extends _X{static[J]="SQLiteTimestampBuilder";constructor(X,Y){super(X,"object date","SQLiteTimestamp");this.config.mode=Y}defaultNow(){return this.default(W`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build(X){return new MY(X,this.config)}},MY=class extends zX{static[J]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue(X){if(typeof X==="string")return new Date(X.replaceAll('"',""));if(this.config.mode==="timestamp")return new Date(X*1000);return new Date(X)}mapToDriverValue(X){if(typeof X==="number")return X;let Y=X.getTime();if(this.config.mode==="timestamp")return Math.floor(Y/1000);return Y}},xY=class extends _X{static[J]="SQLiteBooleanBuilder";constructor(X,Y){super(X,"boolean","SQLiteBoolean");this.config.mode=Y}build(X){return new KY(X,this.config)}},KY=class extends zX{static[J]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue(X){return Number(X)===1}mapToDriverValue(X){return X?1:0}};function TX(X,Y){let{name:Z,config:$}=k(X,Y);if($?.mode==="timestamp"||$?.mode==="timestamp_ms")return new IY(Z,$.mode);if($?.mode==="boolean")return new xY(Z,$.mode);return new AY(Z)}var kY=class extends f{static[J]="SQLiteTextBuilder";constructor(X,Y){super(X,Y.enum?.length?"string enum":"string","SQLiteText");this.config.enumValues=Y.enum,this.config.length=Y.length}build(X){return new NY(X,this.config)}},NY=class extends S{static[J]="SQLiteText";enumValues=this.config.enumValues;constructor(X,Y){super(X,Y)}getSQLType(){return`text${this.config.length?`(${this.config.length})`:""}`}},RY=class extends f{static[J]="SQLiteTextJsonBuilder";constructor(X){super(X,"object json","SQLiteTextJson")}build(X){return new wY(X,this.config)}},wY=class extends S{static[J]="SQLiteTextJson";getSQLType(){return"text"}mapFromDriverValue(X){return JSON.parse(X)}mapToDriverValue(X){return JSON.stringify(X)}};function SX(X,Y={}){let{name:Z,config:$}=k(X,Y);if($.mode==="json")return new RY(Z);return new kY(Z,$)}var QY=class{static[J]="SQLiteIndexBuilderOn";constructor(X,Y){this.name=X,this.unique=Y}on(...X){return new PY(this.name,X,this.unique)}},PY=class{static[J]="SQLiteIndexBuilder";config;constructor(X,Y,Z){this.config={name:X,columns:Y,unique:Z,where:void 0}}where(X){return this.config.where=X,this}build(X){return new LY(this.config,X)}},LY=class{static[J]="SQLiteIndex";config;isNameExplicit;constructor(X,Y){this.config={...X,table:Y},this.isNameExplicit=!!X.name}};function D0(X){return new QY(X,!1)}function BY(X){let Y="";for(let Z=0;Z<X.length;Z+=2){let $=X.slice(Z,Z+2),G=Number.parseInt($,16);Y+=String.fromCodePoint(G)}return Y}var O0=class extends f{static[J]="SQLiteBigIntBuilder";constructor(X){super(X,"bigint int64","SQLiteBigInt")}build(X){return new F0(X,this.config)}},F0=class extends S{static[J]="SQLiteBigInt";getSQLType(){return"blob"}mapFromDriverValue(X){if(typeof X==="string")return BigInt(BY(X));if(typeof Buffer<"u"&&Buffer.from){let Y=Buffer.isBuffer(X)?X:X instanceof ArrayBuffer?Buffer.from(X):X.buffer?Buffer.from(X.buffer,X.byteOffset,X.byteLength):Buffer.from(X);return BigInt(Y.toString("utf8"))}return BigInt(jX.decode(X))}mapToDriverValue(X){return Buffer.from(X.toString())}},U0=class extends f{static[J]="SQLiteBlobJsonBuilder";constructor(X){super(X,"object json","SQLiteBlobJson")}build(X){return new A0(X,this.config)}},A0=class extends S{static[J]="SQLiteBlobJson";getSQLType(){return"blob"}mapFromDriverValue(X){if(typeof X==="string")return JSON.parse(BY(X));if(typeof Buffer<"u"&&Buffer.from){let Y=Buffer.isBuffer(X)?X:X instanceof ArrayBuffer?Buffer.from(X):X.buffer?Buffer.from(X.buffer,X.byteOffset,X.byteLength):Buffer.from(X);return JSON.parse(Y.toString("utf8"))}return JSON.parse(jX.decode(X))}mapToDriverValue(X){return Buffer.from(JSON.stringify(X))}},V0=class extends f{static[J]="SQLiteBlobBufferBuilder";constructor(X){super(X,"object buffer","SQLiteBlobBuffer")}build(X){return new I0(X,this.config)}},I0=class extends S{static[J]="SQLiteBlobBuffer";mapFromDriverValue(X){if(Buffer.isBuffer(X))return X;if(typeof X==="string")return Buffer.from(X,"hex");return Buffer.from(X)}getSQLType(){return"blob"}};function jY(X,Y){let{name:Z,config:$}=k(X,Y);if($?.mode==="json")return new U0(Z);if($?.mode==="bigint")return new O0(Z);return new V0(Z)}var M0=class extends f{static[J]="SQLiteCustomColumnBuilder";constructor(X,Y,Z){super(X,"custom","SQLiteCustomColumn");this.config.fieldConfig=Y,this.config.customTypeParams=Z}build(X){return new x0(X,this.config)}},x0=class extends S{static[J]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;mapJson;forJsonSelect;constructor(X,Y){super(X,Y);this.sqlName=Y.customTypeParams.dataType(Y.fieldConfig),this.mapTo=Y.customTypeParams.toDriver,this.mapFrom=Y.customTypeParams.fromDriver,this.mapJson=Y.customTypeParams.fromJson,this.forJsonSelect=Y.customTypeParams.forJsonSelect}getSQLType(){return this.sqlName}mapFromDriverValue(X){return typeof this.mapFrom==="function"?this.mapFrom(X):X}mapFromJsonValue(X){return typeof this.mapJson==="function"?this.mapJson(X):this.mapFromDriverValue(X)}jsonSelectIdentifier(X,Y){if(typeof this.forJsonSelect==="function")return this.forJsonSelect(X,Y);let Z=this.getSQLType().toLowerCase(),$=Z.indexOf("(");switch($+1?Z.slice(0,$):Z){case"numeric":case"decimal":case"bigint":return Y`cast(${X} as text)`;case"blob":return Y`hex(${X})`;default:return X}}mapToDriverValue(X){return typeof this.mapTo==="function"?this.mapTo(X):X}};function TY(X){return(Y,Z)=>{let{name:$,config:G}=k(Y,Z);return new M0($,G,X)}}var K0=class extends f{static[J]="SQLiteNumericBuilder";constructor(X){super(X,"string numeric","SQLiteNumeric")}build(X){return new k0(X,this.config)}},k0=class extends S{static[J]="SQLiteNumeric";mapFromDriverValue(X){if(typeof X==="string")return X;return String(X)}getSQLType(){return"numeric"}},N0=class extends f{static[J]="SQLiteNumericNumberBuilder";constructor(X){super(X,"number","SQLiteNumericNumber")}build(X){return new R0(X,this.config)}},R0=class extends S{static[J]="SQLiteNumericNumber";mapFromDriverValue(X){if(typeof X==="number")return X;return Number(X)}mapToDriverValue=String;getSQLType(){return"numeric"}},w0=class extends f{static[J]="SQLiteNumericBigIntBuilder";constructor(X){super(X,"bigint int64","SQLiteNumericBigInt")}build(X){return new Q0(X,this.config)}},Q0=class extends S{static[J]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return"numeric"}};function SY(X,Y){let{name:Z,config:$}=k(X,Y),G=$?.mode;return G==="number"?new N0(Z):G==="bigint"?new w0(Z):new K0(Z)}var P0=class extends f{static[J]="SQLiteRealBuilder";constructor(X){super(X,"number double","SQLiteReal")}build(X){return new L0(X,this.config)}},L0=class extends S{static[J]="SQLiteReal";getSQLType(){return"real"}};function CY(X){return new P0(X??"")}function qY(){return{blob:jY,customType:TY,integer:TX,numeric:SY,real:CY,text:SX}}var EX=Symbol.for("drizzle:SQLiteInlineForeignKeys"),v=class extends A{static[J]="SQLiteTable";static Symbol=Object.assign({},A.Symbol,{InlineForeignKeys:EX});[A.Symbol.Columns];[EX]=[];[A.Symbol.ExtraConfigBuilder]=void 0};function B0(X,Y,Z,$,G=X){let H=new v(X,$,G),_=typeof Y==="function"?Y(qY()):Y,z=Object.fromEntries(Object.entries(_).map(([E,U])=>{let F=U;F.setName(E);let M=F.build(H);return H[EX].push(...F.buildForeignKeys(M,H)),[E,M]})),O=Object.assign(H,z);if(O[A.Symbol.Columns]=z,O[A.Symbol.ExtraConfigColumns]=z,Z)O[v.Symbol.ExtraConfigBuilder]=Z;return O}var j0=(X,Y,Z)=>{return B0(X,Y,Z)};function T0(...X){if(X[0].columns)return new CX(X[0].columns,X[0].name);return new CX(X)}var CX=class{static[J]="SQLitePrimaryKeyBuilder";columns;name;constructor(X,Y){this.columns=X,this.name=Y}build(X){return new vY(X,this.columns,this.name)}},vY=class{static[J]="SQLitePrimaryKey";columns;name;isNameExplicit;constructor(X,Y,Z){this.table=X,this.columns=Y,this.name=Z,this.isNameExplicit=!!Z}getName(){return this.name??`${this.table[v.Symbol.Name]}_${this.columns.map((X)=>X.name).join("_")}_pk`}};function q(X,Y){if(PX(Y)&&!E1(X)&&!D(X,g)&&!D(X,l)&&!D(X,N)&&!D(X,A)&&!D(X,y))return new g(X,Y);return X}var a=(X,Y)=>{return W`${X} = ${q(Y,X)}`},h1=(X,Y)=>{return W`${X} <> ${q(Y,X)}`};function m(...X){let Y=X.filter((Z)=>Z!==void 0);if(Y.length===0)return;if(Y.length===1)return new x(Y);return new x([new h("("),W.join(Y,new h(" and ")),new h(")")])}function V1(...X){let Y=X.filter((Z)=>Z!==void 0);if(Y.length===0)return;if(Y.length===1)return new x(Y);return new x([new h("("),W.join(Y,new h(" or ")),new h(")")])}function I1(X){return W`not ${X}`}var p1=(X,Y)=>{return W`${X} > ${q(Y,X)}`},y1=(X,Y)=>{return W`${X} >= ${q(Y,X)}`},f1=(X,Y)=>{return W`${X} < ${q(Y,X)}`},b1=(X,Y)=>{return W`${X} <= ${q(Y,X)}`};function d1(X,Y){if(Array.isArray(Y)){if(Y.length===0)return W`false`;return W`${X} in ${Y.map((Z)=>q(Z,X))}`}return W`${X} in ${q(Y,X)}`}function g1(X,Y){if(Array.isArray(Y)){if(Y.length===0)return W`true`;return W`${X} not in ${Y.map((Z)=>q(Z,X))}`}return W`${X} not in ${q(Y,X)}`}function m1(X){return W`(${X} is null)`}function c1(X){return W`(${X} is not null)`}function k1(X){return W`exists ${X}`}function N1(X){return W`not exists ${X}`}function u1(X,Y,Z){return W`${X} between ${q(Y,X)} and ${q(Z,X)}`}function r1(X,Y,Z){return W`${X} not between ${q(Y,X)} and ${q(Z,X)}`}function o1(X,Y){return W`${X} like ${Y}`}function s1(X,Y){return W`${X} not like ${Y}`}function t1(X,Y){return W`${X} ilike ${Y}`}function n1(X,Y){return W`${X} not ilike ${Y}`}function qX(X,Y){if(Array.isArray(Y)){if(Y.length===0)throw Error("arrayContains requires at least one value");let Z=q(Y,X);return W`${X} @> ${W`${Array.isArray(Z)?new g(Z):Z}`}`}return W`${X} @> ${q(Y,X)}`}function vX(X,Y){if(Array.isArray(Y)){if(Y.length===0)throw Error("arrayContained requires at least one value");let Z=q(Y,X);return W`${X} <@ ${W`${Array.isArray(Z)?new g(Z):Z}`}`}return W`${X} <@ ${q(Y,X)}`}function hX(X,Y){if(Array.isArray(Y)){if(Y.length===0)throw Error("arrayOverlaps requires at least one value");let Z=q(Y,X);return W`${X} && ${W`${Array.isArray(Z)?new g(Z):Z}`}`}return W`${X} && ${q(Y,X)}`}function M1(X){return W`${X} asc`}function i1(X){return W`${X} desc`}function hY(X,Y,Z){for(let $=Y;$<X.length;$++){let G=X[$];if(G==="\\"){$++;continue}if(G==='"')return[X.slice(Y,$).replace(/\\/g,""),$+1];if(Z)continue;if(G===","||G==="}")return[X.slice(Y,$).replace(/\\/g,""),$]}return[X.slice(Y).replace(/\\/g,""),X.length]}function pY(X,Y=0){let Z=[],$=Y,G=!1;while($<X.length){let H=X[$];if(H===","){if(G||$===Y)Z.push("");G=!0,$++;continue}if(G=!1,H==="\\"){$+=2;continue}if(H==='"'){let[O,E]=hY(X,$+1,!0);Z.push(O),$=E;continue}if(H==="}")return[Z,$+1];if(H==="{"){let[O,E]=pY(X,$+1);Z.push(O),$=E;continue}let[_,z]=hY(X,$,!1);Z.push(_),$=z}return[Z,$]}function DX(X){let[Y]=pY(X,1);return Y}function pX(X){return`{${X.map((Y)=>{if(Array.isArray(Y))return pX(Y);if(typeof Y==="string")return`"${Y.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;return`${Y}`}).join(",")}}`}var yY=class{static[J]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(X,Y){if(this.reference=()=>{let{name:Z,columns:$,foreignColumns:G}=X();return{name:Z,columns:$,foreignTable:G[0].table,foreignColumns:G}},Y)this._onUpdate=Y.onUpdate,this._onDelete=Y.onDelete}onUpdate(X){return this._onUpdate=X===void 0?"no action":X,this}onDelete(X){return this._onDelete=X===void 0?"no action":X,this}build(X){return new S0(X,this)}},S0=class{static[J]="PgForeignKey";reference;onUpdate;onDelete;name;constructor(X,Y){this.table=X,this.reference=Y.reference,this.onUpdate=Y._onUpdate,this.onDelete=Y._onDelete}getName(){let{name:X,columns:Y,foreignColumns:Z}=this.reference(),$=Y.map((_)=>_.name),G=Z.map((_)=>_.name),H=[this.table[r],...$,Z[0].table[r],...G];return X??`${H.join("_")}_fk`}isNameExplicit(){return!!this.reference().name}};var K=class{static[J]="PgColumnBuilder";foreignKeyConfigs=[];config;constructor(X,Y,Z){this.config={name:X,keyAsName:X==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:Y,columnType:Z,generated:void 0,defaultFn:void 0,onUpdateFn:void 0,generatedIdentity:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(X){return this.config.default=X,this.config.hasDefault=!0,this}$defaultFn(X){return this.config.defaultFn=X,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(X){return this.config.onUpdateFn=X,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(X){if(this.config.name!=="")return;this.config.name=X}array(X){let Y=X??"[]";return this.config.dimensions=Y.length/2,this}references(X,Y={}){return this.foreignKeyConfigs.push({ref:X,config:Y}),this}unique(X,Y){return this.config.isUnique=!0,this.config.uniqueName=X,this.config.uniqueType=Y?.nulls,this}generatedAlwaysAs(X){return this.config.generated={as:X,type:"always",mode:"stored"},this}buildForeignKeys(X,Y){return this.foreignKeyConfigs.map(({ref:Z,config:$})=>{return JY((G,H)=>{let _=new yY(()=>{let z=G();return{name:H.name,columns:[X],foreignColumns:[z]}});if(H.onUpdate)_.onUpdate(H.onUpdate);if(H.onDelete)_.onDelete(H.onDelete);return _.build(Y)},Z,$)})}buildExtraConfigColumn(X){return new C0(X,{...this.config,dimensions:this.config.dimensions??0})}},V=class extends N{static[J]="PgColumn";table;dimensions;constructor(X,Y){super(X,Y);if(this.table=X,this.dimensions=Y.dimensions??0,this.dimensions){let Z=this.mapFromDriverValue.bind(this),$=this.mapToDriverValue.bind(this);this.mapFromDriverValue=(G)=>{if(G===null)return G;let H=typeof G==="string"?DX(G):G;return this.mapArrayElements(H,Z,this.dimensions)},this.mapToDriverValue=(G)=>{if(G===null)return G;return pX(this.mapArrayElements(G,$,this.dimensions))}}}mapArrayElements(X,Y,Z){if(Z>0&&Array.isArray(X))return X.map(($)=>$===null?null:this.mapArrayElements($,Y,Z-1));return Y(X)}},C0=class extends V{static[J]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(X){return this.indexConfig.opClass=X,this}};var O1=class extends K{static[J]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(X){if(X){let{name:Y,...Z}=X;this.config.generatedIdentity={type:"always",sequenceName:Y,sequenceOptions:Z}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(X){if(X){let{name:Y,...Z}=X;this.config.generatedIdentity={type:"byDefault",sequenceName:Y,sequenceOptions:Z}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}};var q0=class extends O1{static[J]="PgBigInt53Builder";constructor(X){super(X,"number int53","PgBigInt53")}build(X){return new v0(X,this.config)}},v0=class extends V{static[J]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(X){if(typeof X==="number")return X;return Number(X)}},h0=class extends O1{static[J]="PgBigInt64Builder";constructor(X){super(X,"bigint int64","PgBigInt64")}build(X){return new p0(X,this.config)}},p0=class extends V{static[J]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(X){return BigInt(X)}},y0=class extends O1{static[J]="PgBigIntStringBuilder";constructor(X){super(X,"string int64","PgBigIntString")}build(X){return new f0(X,this.config)}},f0=class extends V{static[J]="PgBigIntString";getSQLType(){return"bigint"}mapFromDriverValue(X){if(typeof X==="string")return X;return String(X)}};function fY(X,Y){let{name:Z,config:$}=k(X,Y);if($.mode==="number")return new q0(Z);if($.mode==="string")return new y0(Z);return new h0(Z)}var b0=class extends K{static[J]="PgBigSerial53Builder";constructor(X){super(X,"number int53","PgBigSerial53");this.config.hasDefault=!0,this.config.notNull=!0}build(X){return new d0(X,this.config)}},d0=class extends V{static[J]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(X){if(typeof X==="number")return X;return Number(X)}},g0=class extends K{static[J]="PgBigSerial64Builder";constructor(X){super(X,"bigint int64","PgBigSerial64");this.config.hasDefault=!0,this.config.notNull=!0}build(X){return new m0(X,this.config)}},m0=class extends V{static[J]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(X){return BigInt(X)}};function bY(X,Y){let{name:Z,config:$}=k(X,Y);if($.mode==="number")return new b0(Z);return new g0(Z)}var c0=class extends K{static[J]="PgBooleanBuilder";constructor(X){super(X,"boolean","PgBoolean")}build(X){return new u0(X,this.config)}},u0=class extends V{static[J]="PgBoolean";getSQLType(){return"boolean"}};function dY(X){return new c0(X??"")}var r0=class extends K{static[J]="PgCharBuilder";constructor(X,Y){super(X,Y.enum?.length?"string enum":"string","PgChar");this.config.length=Y.length??1,this.config.setLength=Y.length!==void 0,this.config.enumValues=Y.enum}build(X){return new o0(X,this.config)}},o0=class extends V{static[J]="PgChar";enumValues;setLength;constructor(X,Y){super(X,Y);this.enumValues=Y.enumValues,this.setLength=Y.setLength}getSQLType(){return this.setLength?`char(${this.length})`:"char"}};function gY(X,Y={}){let{name:Z,config:$}=k(X,Y);return new r0(Z,$)}var s0=class extends K{static[J]="PgCidrBuilder";constructor(X){super(X,"string cidr","PgCidr")}build(X){return new t0(X,this.config)}},t0=class extends V{static[J]="PgCidr";getSQLType(){return"cidr"}};function mY(X){return new s0(X??"")}var n0=class extends K{static[J]="PgCustomColumnBuilder";constructor(X,Y,Z){super(X,"custom","PgCustomColumn");this.config.fieldConfig=Y,this.config.customTypeParams=Z}build(X){return new i0(X,this.config)}},i0=class extends V{static[J]="PgCustomColumn";sqlName;mapTo;mapFrom;mapJson;forJsonSelect;constructor(X,Y){super(X,Y);if(this.sqlName=Y.customTypeParams.dataType(Y.fieldConfig),this.mapTo=Y.customTypeParams.toDriver,this.mapFrom=Y.customTypeParams.fromDriver,this.mapJson=Y.customTypeParams.fromJson,this.forJsonSelect=Y.customTypeParams.forJsonSelect,this.dimensions){let Z=($)=>{if(typeof this.mapJson==="function")return this.mapJson($);if(typeof this.mapFrom==="function")return this.mapFrom($);return $};this.mapFromJsonValue=($)=>{if($===null)return $;let G=typeof $==="string"?DX($):$;return this.mapJsonArrayElements(G,Z,this.dimensions)}}}mapJsonArrayElements(X,Y,Z){if(Z>0&&Array.isArray(X))return X.map(($)=>$===null?null:this.mapJsonArrayElements($,Y,Z-1));return Y(X)}getSQLType(){return this.sqlName}mapFromDriverValue(X){return typeof this.mapFrom==="function"?this.mapFrom(X):X}mapFromJsonValue(X){return typeof this.mapJson==="function"?this.mapJson(X):this.mapFromDriverValue(X)}jsonSelectIdentifier(X,Y,Z){if(typeof this.forJsonSelect==="function")return this.forJsonSelect(X,Y,Z);let $=this.getSQLType().toLowerCase(),G=$.indexOf("(");switch(G+1?$.slice(0,G):$){case"bytea":case"geometry":case"timestamp":case"numeric":case"bigint":{let H="[]".repeat(Z??0);return Y`${X}::text${Y.raw(H).if(Z)}`}default:return X}}mapToDriverValue(X){return typeof this.mapTo==="function"?this.mapTo(X):X}};function cY(X){return(Y,Z)=>{let{name:$,config:G}=k(Y,Z);return new n0($,G,X)}}var F1=class extends K{static[J]="PgDateColumnBaseBuilder";defaultNow(){return this.default(W`now()`)}};var l0=class extends F1{static[J]="PgDateBuilder";constructor(X){super(X,"object date","PgDate")}build(X){return new a0(X,this.config)}},a0=class extends V{static[J]="PgDate";getSQLType(){return"date"}mapFromDriverValue(X){if(typeof X==="string")return new Date(X);return X}mapToDriverValue(X){if(typeof X==="string")return X;return X.toISOString()}},e0=class extends F1{static[J]="PgDateStringBuilder";constructor(X){super(X,"string date","PgDateString")}build(X){return new X8(X,this.config)}},X8=class extends V{static[J]="PgDateString";getSQLType(){return"date"}mapFromDriverValue(X){if(typeof X==="string")return X;return X.toISOString().slice(0,-14)}mapToDriverValue(X){if(typeof X==="string")return X;return X.toISOString()}};function uY(X,Y){let{name:Z,config:$}=k(X,Y);if($?.mode==="date")return new l0(Z);return new e0(Z)}var Y8=class extends K{static[J]="PgDoublePrecisionBuilder";constructor(X){super(X,"number double","PgDoublePrecision")}build(X){return new Z8(X,this.config)}},Z8=class extends V{static[J]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(X){if(typeof X==="string")return Number.parseFloat(X);return X}};function rY(X){return new Y8(X??"")}var $8=class extends K{static[J]="PgInetBuilder";constructor(X){super(X,"string inet","PgInet")}build(X){return new G8(X,this.config)}},G8=class extends V{static[J]="PgInet";getSQLType(){return"inet"}};function oY(X){return new $8(X??"")}var W8=class extends O1{static[J]="PgIntegerBuilder";constructor(X){super(X,"number int32","PgInteger")}build(X){return new J8(X,this.config)}},J8=class extends V{static[J]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(X){if(typeof X==="string")return Number.parseInt(X);return X}};function sY(X){return new W8(X??"")}var H8=class extends K{static[J]="PgIntervalBuilder";constructor(X,Y){super(X,"string interval","PgInterval");this.config.intervalConfig=Y}build(X){return new _8(X,this.config)}},_8=class extends V{static[J]="PgInterval";fields;precision;constructor(X,Y){super(X,Y);this.fields=Y.intervalConfig.fields,this.precision=Y.intervalConfig.precision}getSQLType(){return`interval${this.fields?` ${this.fields}`:""}${this.precision?`(${this.precision})`:""}`}};function tY(X,Y={}){let{name:Z,config:$}=k(X,Y);return new H8(Z,$)}var z8=class extends K{static[J]="PgJsonBuilder";constructor(X){super(X,"object json","PgJson")}build(X){return new E8(X,this.config)}},E8=class extends V{static[J]="PgJson";constructor(X,Y){super(X,Y)}getSQLType(){return"json"}mapToDriverValue(X){return JSON.stringify(X)}mapFromDriverValue(X){if(typeof X==="string")try{return JSON.parse(X)}catch{return X}return X}};function nY(X){return new z8(X??"")}var D8=class extends K{static[J]="PgJsonbBuilder";constructor(X){super(X,"object json","PgJsonb")}build(X){return new O8(X,this.config)}},O8=class extends V{static[J]="PgJsonb";constructor(X,Y){super(X,Y)}getSQLType(){return"jsonb"}mapToDriverValue(X){return JSON.stringify(X)}mapFromDriverValue(X){if(typeof X==="string")try{return JSON.parse(X)}catch{return X}return X}};function iY(X){return new D8(X??"")}var F8=class extends K{static[J]="PgLineBuilder";constructor(X){super(X,"array line","PgLine")}build(X){return new U8(X,this.config)}},U8=class extends V{static[J]="PgLine";mode="tuple";getSQLType(){return"line"}mapFromDriverValue(X){let[Y,Z,$]=X.slice(1,-1).split(",");return[Number.parseFloat(Y),Number.parseFloat(Z),Number.parseFloat($)]}mapToDriverValue(X){return`{${X[0]},${X[1]},${X[2]}}`}},A8=class extends K{static[J]="PgLineABCBuilder";constructor(X){super(X,"object line","PgLineABC")}build(X){return new V8(X,this.config)}},V8=class extends V{static[J]="PgLineABC";mode="abc";getSQLType(){return"line"}mapFromDriverValue(X){let[Y,Z,$]=X.slice(1,-1).split(",");return{a:Number.parseFloat(Y),b:Number.parseFloat(Z),c:Number.parseFloat($)}}mapToDriverValue(X){return`{${X.a},${X.b},${X.c}}`}};function lY(X,Y){let{name:Z,config:$}=k(X,Y);if(!$?.mode||$.mode==="tuple")return new F8(Z);return new A8(Z)}var I8=class extends K{static[J]="PgMacaddrBuilder";constructor(X){super(X,"string macaddr","PgMacaddr")}build(X){return new M8(X,this.config)}},M8=class extends V{static[J]="PgMacaddr";getSQLType(){return"macaddr"}};function aY(X){return new I8(X??"")}var x8=class extends K{static[J]="PgMacaddr8Builder";constructor(X){super(X,"string macaddr8","PgMacaddr8")}build(X){return new K8(X,this.config)}},K8=class extends V{static[J]="PgMacaddr8";getSQLType(){return"macaddr8"}};function eY(X){return new x8(X??"")}var k8=class extends K{static[J]="PgNumericBuilder";constructor(X,Y,Z){super(X,"string numeric","PgNumeric");this.config.precision=Y,this.config.scale=Z}build(X){return new N8(X,this.config)}},N8=class extends V{static[J]="PgNumeric";precision;scale;constructor(X,Y){super(X,Y);this.precision=Y.precision,this.scale=Y.scale}mapFromDriverValue(X){if(typeof X==="string")return X;return String(X)}getSQLType(){if(this.precision!==void 0&&this.scale!==void 0)return`numeric(${this.precision}, ${this.scale})`;else if(this.precision===void 0)return"numeric";else return`numeric(${this.precision})`}},R8=class extends K{static[J]="PgNumericNumberBuilder";constructor(X,Y,Z){super(X,"number","PgNumericNumber");this.config.precision=Y,this.config.scale=Z}build(X){return new w8(X,this.config)}},w8=class extends V{static[J]="PgNumericNumber";precision;scale;constructor(X,Y){super(X,Y);this.precision=Y.precision,this.scale=Y.scale}mapFromDriverValue(X){if(typeof X==="number")return X;return Number(X)}mapToDriverValue(X){return String(X)}getSQLType(){if(this.precision!==void 0&&this.scale!==void 0)return`numeric(${this.precision}, ${this.scale})`;else if(this.precision===void 0)return"numeric";else return`numeric(${this.precision})`}},Q8=class extends K{static[J]="PgNumericBigIntBuilder";constructor(X,Y,Z){super(X,"bigint int64","PgNumericBigInt");this.config.precision=Y,this.config.scale=Z}build(X){return new P8(X,this.config)}},P8=class extends V{static[J]="PgNumericBigInt";precision;scale;constructor(X,Y){super(X,Y);this.precision=Y.precision,this.scale=Y.scale}mapFromDriverValue(X){return BigInt(X)}mapToDriverValue(X){return String(X)}getSQLType(){if(this.precision!==void 0&&this.scale!==void 0)return`numeric(${this.precision}, ${this.scale})`;else if(this.precision===void 0)return"numeric";else return`numeric(${this.precision})`}};function XZ(X,Y){let{name:Z,config:$}=k(X,Y),G=$?.mode;return G==="number"?new R8(Z,$?.precision,$?.scale):G==="bigint"?new Q8(Z,$?.precision,$?.scale):new k8(Z,$?.precision,$?.scale)}var L8=class extends K{static[J]="PgPointTupleBuilder";constructor(X){super(X,"array point","PgPointTuple")}build(X){return new B8(X,this.config)}},B8=class extends V{static[J]="PgPointTuple";mode="tuple";getSQLType(){return"point"}mapFromDriverValue(X){if(typeof X==="string"){let[Y,Z]=X.slice(1,-1).split(",");return[Number.parseFloat(Y),Number.parseFloat(Z)]}return[X.x,X.y]}mapToDriverValue(X){return`(${X[0]},${X[1]})`}},j8=class extends K{static[J]="PgPointObjectBuilder";constructor(X){super(X,"object point","PgPointObject")}build(X){return new T8(X,this.config)}},T8=class extends V{static[J]="PgPointObject";mode="xy";getSQLType(){return"point"}mapFromDriverValue(X){if(typeof X==="string"){let[Y,Z]=X.slice(1,-1).split(",");return{x:Number.parseFloat(Y),y:Number.parseFloat(Z)}}return X}mapToDriverValue(X){return`(${X.x},${X.y})`}};function YZ(X,Y){let{name:Z,config:$}=k(X,Y);if(!$?.mode||$.mode==="tuple")return new L8(Z);return new j8(Z)}function S8(X){let Y=[];for(let Z=0;Z<X.length;Z+=2)Y.push(Number.parseInt(X.slice(Z,Z+2),16));return new Uint8Array(Y)}function ZZ(X,Y){let $=new DataView(new ArrayBuffer(8));for(let G=0;G<8;G++)$.setUint8(G,X[Y+G]);return $.getFloat64(0,!0)}function yX(X){let Y=S8(X),Z=0,$=Y[Z];Z+=1;let G=new DataView(Y.buffer),H=G.getUint32(Z,$===1);Z+=4;let _;if(H&536870912)_=G.getUint32(Z,$===1),Z+=4;if((H&65535)===1){let z=ZZ(Y,Z);Z+=8;let O=ZZ(Y,Z);return Z+=8,{srid:_,point:[z,O]}}throw Error("Unsupported geometry type")}var C8=class extends K{static[J]="PgGeometryBuilder";constructor(X,Y){super(X,"array geometry","PgGeometry");this.config.srid=Y}build(X){return new q8(X,this.config)}},q8=class extends V{static[J]="PgGeometry";srid=this.config.srid;mode="tuple";getSQLType(){return`geometry(point${this.srid===void 0?"":`,${this.srid}`})`}mapFromDriverValue(X){if(typeof X!=="string")return X;return yX(X).point}mapToDriverValue(X){return`point(${X[0]} ${X[1]})`}},v8=class extends K{static[J]="PgGeometryObjectBuilder";constructor(X,Y){super(X,"object geometry","PgGeometryObject");this.config.srid=Y}build(X){return new h8(X,this.config)}},h8=class extends V{static[J]="PgGeometryObject";srid=this.config.srid;mode="object";getSQLType(){return`geometry(point${this.srid===void 0?"":`,${this.srid}`})`}mapFromDriverValue(X){let Y=yX(X);return{x:Y.point[0],y:Y.point[1]}}mapToDriverValue(X){return`point(${X.x} ${X.y})`}};function $Z(X,Y){let{name:Z,config:$}=k(X,Y);if(!$?.mode||$.mode==="tuple")return new C8(Z,$?.srid);return new v8(Z,$?.srid)}var p8=class extends K{static[J]="PgRealBuilder";constructor(X,Y){super(X,"number float","PgReal");this.config.length=Y}build(X){return new y8(X,this.config)}},y8=class extends V{static[J]="PgReal";constructor(X,Y){super(X,Y)}getSQLType(){return"real"}mapFromDriverValue(X){if(typeof X==="string")return Number.parseFloat(X);return X}};function GZ(X){return new p8(X??"")}var f8=class extends K{static[J]="PgSerialBuilder";constructor(X){super(X,"number int32","PgSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(X){return new b8(X,this.config)}},b8=class extends V{static[J]="PgSerial";getSQLType(){return"serial"}};function WZ(X){return new f8(X??"")}var d8=class extends O1{static[J]="PgSmallIntBuilder";constructor(X){super(X,"number int16","PgSmallInt")}build(X){return new g8(X,this.config)}},g8=class extends V{static[J]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue(X){if(typeof X==="string")return Number(X);return X}};function JZ(X){return new d8(X??"")}var m8=class extends K{static[J]="PgSmallSerialBuilder";constructor(X){super(X,"number int16","PgSmallSerial");this.config.hasDefault=!0,this.config.notNull=!0}build(X){return new c8(X,this.config)}},c8=class extends V{static[J]="PgSmallSerial";getSQLType(){return"smallserial"}};function HZ(X){return new m8(X??"")}var u8=class extends K{static[J]="PgTextBuilder";constructor(X,Y){super(X,Y.enum?.length?"string enum":"string","PgText");this.config.enumValues=Y.enum}build(X){return new r8(X,this.config,this.config.enumValues)}},r8=class extends V{static[J]="PgText";enumValues;constructor(X,Y,Z){super(X,Y);this.enumValues=Z}getSQLType(){return"text"}};function _Z(X,Y={}){let{name:Z,config:$}=k(X,Y);return new u8(Z,$)}var o8=class extends F1{static[J]="PgTimeBuilder";constructor(X,Y,Z){super(X,"string time","PgTime");this.withTimezone=Y,this.precision=Z,this.config.withTimezone=Y,this.config.precision=Z}build(X){return new s8(X,this.config)}},s8=class extends V{static[J]="PgTime";withTimezone;precision;constructor(X,Y){super(X,Y);this.withTimezone=Y.withTimezone,this.precision=Y.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}};function zZ(X,Y={}){let{name:Z,config:$}=k(X,Y);return new o8(Z,$.withTimezone??!1,$.precision)}var t8=class extends F1{static[J]="PgTimestampBuilder";constructor(X,Y,Z){super(X,"object date","PgTimestamp");this.config.withTimezone=Y,this.config.precision=Z}build(X){return new n8(X,this.config)}},n8=class extends V{static[J]="PgTimestamp";withTimezone;precision;constructor(X,Y){super(X,Y);this.withTimezone=Y.withTimezone,this.precision=Y.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(X){if(typeof X==="string")return new Date(this.withTimezone?X:X+"+0000");return X}mapToDriverValue(X){if(typeof X==="string")return X;return X.toISOString()}},i8=class extends F1{static[J]="PgTimestampStringBuilder";constructor(X,Y,Z){super(X,"string timestamp","PgTimestampString");this.config.withTimezone=Y,this.config.precision=Z}build(X){return new l8(X,this.config)}},l8=class extends V{static[J]="PgTimestampString";withTimezone;precision;constructor(X,Y){super(X,Y);this.withTimezone=Y.withTimezone,this.precision=Y.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(X){if(typeof X==="string")return X;let Y=X.toISOString().slice(0,-1).replace("T"," ");if(this.withTimezone)return`${Y}+00`;return Y}mapToDriverValue(X){if(typeof X==="string")return X;return X.toISOString()}};function EZ(X,Y={}){let{name:Z,config:$}=k(X,Y);if($?.mode==="string")return new i8(Z,$.withTimezone??!1,$.precision);return new t8(Z,$?.withTimezone??!1,$?.precision)}var a8=class extends K{static[J]="PgUUIDBuilder";constructor(X){super(X,"string uuid","PgUUID")}defaultRandom(){return this.default(W`gen_random_uuid()`)}build(X){return new e8(X,this.config)}},e8=class extends V{static[J]="PgUUID";getSQLType(){return"uuid"}};function DZ(X){return new a8(X??"")}var X2=class extends K{static[J]="PgVarcharBuilder";constructor(X,Y){super(X,Y.enum?.length?"string enum":"string","PgVarchar");this.config.length=Y.length,this.config.enumValues=Y.enum}build(X){return new Y2(X,this.config)}},Y2=class extends V{static[J]="PgVarchar";enumValues;constructor(X,Y){super(X,Y);this.enumValues=Y.enumValues}getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}};function OZ(X,Y={}){let{name:Z,config:$}=k(X,Y);return new X2(Z,$)}var Z2=class extends K{static[J]="PgBinaryVectorBuilder";constructor(X,Y){super(X,"string binary","PgBinaryVector");this.config.length=Y.dimensions,this.config.isLengthExact=!0}build(X){return new $2(X,this.config)}},$2=class extends V{static[J]="PgBinaryVector";getSQLType(){return`bit(${this.length})`}};function FZ(X,Y){let{name:Z,config:$}=k(X,Y);return new Z2(Z,$)}var G2=class extends K{static[J]="PgHalfVectorBuilder";constructor(X,Y){super(X,"array halfvector","PgHalfVector");this.config.length=Y.dimensions,this.config.isLengthExact=!0}build(X){return new W2(X,this.config)}},W2=class extends V{static[J]="PgHalfVector";getSQLType(){return`halfvec(${this.length})`}mapToDriverValue(X){return JSON.stringify(X)}mapFromDriverValue(X){return X.slice(1,-1).split(",").map((Y)=>Number.parseFloat(Y))}};function UZ(X,Y){let{name:Z,config:$}=k(X,Y);return new G2(Z,$)}var J2=class extends K{static[J]="PgSparseVectorBuilder";constructor(X,Y){super(X,"string sparsevec","PgSparseVector");this.config.vectorDimensions=Y.dimensions}build(X){return new H2(X,this.config)}},H2=class extends V{static[J]="PgSparseVector";vectorDimensions=this.config.vectorDimensions;getSQLType(){return`sparsevec(${this.vectorDimensions})`}};function AZ(X,Y){let{name:Z,config:$}=k(X,Y);return new J2(Z,$)}var _2=class extends K{static[J]="PgVectorBuilder";constructor(X,Y){super(X,"array vector","PgVector");this.config.length=Y.dimensions,this.config.isLengthExact=!0}build(X){return new z2(X,this.config)}},z2=class extends V{static[J]="PgVector";getSQLType(){return`vector(${this.length})`}mapToDriverValue(X){return JSON.stringify(X)}mapFromDriverValue(X){return X.slice(1,-1).split(",").map((Y)=>Number.parseFloat(Y))}};function VZ(X,Y){let{name:Z,config:$}=k(X,Y);return new _2(Z,$)}function IZ(){return{bigint:fY,bigserial:bY,boolean:dY,char:gY,cidr:mY,customType:cY,date:uY,doublePrecision:rY,inet:oY,integer:sY,interval:tY,json:nY,jsonb:iY,line:lY,macaddr:aY,macaddr8:eY,numeric:XZ,point:YZ,geometry:$Z,real:GZ,serial:WZ,smallint:JZ,smallserial:HZ,text:_Z,time:zZ,timestamp:EZ,uuid:DZ,varchar:OZ,bit:FZ,halfvec:UZ,sparsevec:AZ,vector:VZ}}var fX=Symbol.for("drizzle:PgInlineForeignKeys"),bX=Symbol.for("drizzle:EnableRLS"),l1=class extends A{static[J]="PgTable";static Symbol=Object.assign({},A.Symbol,{InlineForeignKeys:fX,EnableRLS:bX});[fX]=[];[bX]=!1;[A.Symbol.ExtraConfigBuilder]=void 0;[A.Symbol.ExtraConfigColumns]={}};function MZ(X,Y,Z,$,G=X){let H=new l1(X,$,G),_=typeof Y==="function"?Y(IZ()):Y,z=Object.fromEntries(Object.entries(_).map(([U,F])=>{let M=F;M.setName(U);let I=M.build(H);return H[fX].push(...M.buildForeignKeys(I,H)),[U,I]})),O=Object.fromEntries(Object.entries(_).map(([U,F])=>{let M=F;return M.setName(U),[U,M.buildExtraConfigColumn(H)]})),E=Object.assign(H,z);if(E[A.Symbol.Columns]=z,E[A.Symbol.ExtraConfigColumns]=O,Z)E[l1.Symbol.ExtraConfigBuilder]=Z;return Object.assign(E,{enableRLS:()=>{return E[l1.Symbol.EnableRLS]=!0,E}})}var E2=(X,Y,Z)=>{return MZ(X,Y,Z,void 0)},D2=(X,Y,Z)=>{let $=MZ(X,Y,Z,void 0);return $[bX]=!0,$},GG=Object.assign(E2,{withRLS:D2});var xZ=class{static[J]="PgPrimaryKeyBuilder";columns;name;constructor(X,Y){this.columns=X,this.name=Y}build(X){return new O2(X,this.columns,this.name)}},O2=class{static[J]="PgPrimaryKey";columns;name;isNameExplicit;constructor(X,Y,Z){this.table=X,this.columns=Y,this.name=Z,this.isNameExplicit=!!Z}getName(){return this.name??`${this.table[l1.Symbol.Name]}_${this.columns.map((X)=>X.name).join("_")}_pk`}};var KZ=class{static[J]="Relation";referencedTableName;fieldName;constructor(X,Y,Z){this.sourceTable=X,this.referencedTable=Y,this.relationName=Z,this.referencedTableName=Y[A.Symbol.Name]}},F2=class{static[J]="Relations";constructor(X,Y){this.table=X,this.config=Y}},R1=class X extends KZ{static[J]="One";constructor(Y,Z,$,G){super(Y,Z,$?.relationName);this.config=$,this.isNullable=G}withFieldName(Y){let Z=new X(this.sourceTable,this.referencedTable,this.config,this.isNullable);return Z.fieldName=Y,Z}},dX=class X extends KZ{static[J]="Many";constructor(Y,Z,$){super(Y,Z,$?.relationName);this.config=$}withFieldName(Y){let Z=new X(this.sourceTable,this.referencedTable,this.config);return Z.fieldName=Y,Z}};function kZ(){return{and:m,between:u1,eq:a,exists:k1,gt:p1,gte:y1,ilike:t1,inArray:d1,isNull:m1,isNotNull:c1,like:o1,lt:f1,lte:b1,ne:h1,not:I1,notBetween:r1,notExists:N1,notLike:s1,notIlike:n1,notInArray:g1,or:V1,sql:W}}function NZ(){return{sql:W,asc:M1,desc:i1}}function RZ(X,Y){if(Object.keys(X).length===1&&"default"in X&&!D(X.default,A))X=X.default;let Z={},$={},G={};for(let[H,_]of Object.entries(X))if(D(_,A)){let z=A1(_),O=$[z];Z[z]=H,G[H]={tsName:H,dbName:_[A.Symbol.Name],schema:_[A.Symbol.Schema],columns:_[A.Symbol.Columns],relations:O?.relations??{},primaryKey:O?.primaryKey??[]};for(let U of Object.values(_[A.Symbol.Columns]))if(U.primary)G[H].primaryKey.push(U);let E=_[A.Symbol.ExtraConfigBuilder]?.(_[A.Symbol.ExtraConfigColumns]);if(E){for(let U of Object.values(E))if(D(U,xZ))G[H].primaryKey.push(...U.columns)}}else if(D(_,F2)){let z=A1(_.table),O=Z[z],E=_.config(Y(_.table));for(let[U,F]of Object.entries(E))if(O){let M=G[O];M.relations[U]=F}else{if(!(z in $))$[z]={relations:{}};$[z].relations[U]=F}}return{tables:G,tableNamesMap:Z}}function U2(X){return function(Z,$){return new R1(X,Z,$,$?.fields.reduce((G,H)=>G&&H.notNull,!0)??!1)}}function A2(X){return function(Z,$){return new dX(X,Z,$)}}function wZ(X,Y,Z){if(D(Z,R1)&&Z.config)return{fields:Z.config.fields,references:Z.config.references};let $=Y[A1(Z.referencedTable)];if(!$)throw Error(`Table "${Z.referencedTable[A.Symbol.Name]}" not found in schema`);let G=X[$];if(!G)throw Error(`Table "${$}" not found in schema`);let H=Z.sourceTable,_=Y[A1(H)];if(!_)throw Error(`Table "${H[A.Symbol.Name]}" not found in schema`);let z=[];for(let O of Object.values(G.relations))if(Z.relationName&&Z!==O&&O.relationName===Z.relationName||!Z.relationName&&O.referencedTable===Z.sourceTable)z.push(O);if(z.length>1)throw Z.relationName?Error(`There are multiple relations with name "${Z.relationName}" in table "${$}"`):Error(`There are multiple relations between "${$}" and "${Z.sourceTable[A.Symbol.Name]}". Please specify relation name`);if(z[0]&&D(z[0],R1)&&z[0].config)return{fields:z[0].config.references,references:z[0].config.fields};throw Error(`There is not enough information to infer relation "${_}.${Z.fieldName}"`)}function QZ(X){return{one:U2(X),many:A2(X)}}function OX(X,Y,Z,$,G=(H)=>H){let H={};for(let[_,z]of $.entries())if(z.isJson){let O=Y.relations[z.tsKey],E=Z[_],U=typeof E==="string"?JSON.parse(E):E;H[z.tsKey]=D(O,R1)?U&&OX(X,X[z.relationTableTsKey],U,z.selection,G):U.map((F)=>OX(X,X[z.relationTableTsKey],F,z.selection,G))}else{let O=G(Z[_]),E=z.field,U;if(D(E,N))U=E;else if(D(E,x))U=E.decoder;else U=E.sql.decoder;H[z.tsKey]=O===null?null:U.mapFromDriverValue(O)}return H}var c=class{static[J]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(X){return this.then(void 0,X)}finally(X){return this.then((Y)=>{return X?.(),Y},(Y)=>{throw X?.(),Y})}then(X,Y){return this.execute().then(X,Y)}};var LZ=class{static[J]="SQLiteAsyncRelationalQueryBuilder";constructor(X,Y,Z,$,G,H,_,z){this.mode=X,this.fullSchema=Y,this.schema=Z,this.tableNamesMap=$,this.table=G,this.tableConfig=H,this.dialect=_,this.session=z}findMany(X){return this.mode==="sync"?new PZ(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,X?X:{},"many"):new mX(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,X?X:{},"many")}findFirst(X){return this.mode==="sync"?new PZ(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,X?{...X,limit:1}:{limit:1},"first"):new mX(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,X?{...X,limit:1}:{limit:1},"first")}},mX=class extends c{static[J]="SQLiteAsyncRelationalQuery";mode;constructor(X,Y,Z,$,G,H,_,z,O){super();this.fullSchema=X,this.schema=Y,this.tableNamesMap=Z,this.table=$,this.tableConfig=G,this.dialect=H,this.session=_,this.config=z,this.mode=O}getSQL(){return this.dialect._buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName}).sql}_prepare(X=!1){let{query:Y,builtQuery:Z}=this._toSQL();return this.session[X?"prepareOneTimeQuery":"prepareQuery"](Z,void 0,this.mode==="first"?"get":"all",!0,($,G)=>{let H=$.map((_)=>OX(this.schema,this.tableConfig,_,Y.selection,G));if(this.mode==="first")return H[0];return H})}prepare(){return this._prepare(!1)}_toSQL(){let X=this.dialect._buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName});return{query:X,builtQuery:this.dialect.sqlToQuery(X.sql)}}toSQL(){return this._toSQL().builtQuery}executeRaw(){if(this.mode==="first")return this._prepare(!1).get();return this._prepare(!1).all()}async execute(){return this.executeRaw()}},PZ=class extends mX{static[J]="SQLiteSyncRelationalQuery";sync(){return this.executeRaw()}};var BZ=class X extends x{sql;static[J]="SQLiteCountBuilderAsync";[Symbol.toStringTag]="SQLiteCountBuilderAsync";session;static buildEmbeddedCount(Y,Z){return W`(select count(*) from ${Y}${W.raw(" where ").if(Z)}${Z})`}static buildCount(Y,Z){return W`select count(*) from ${Y}${W.raw(" where ").if(Z)}${Z}`}constructor(Y){super(X.buildEmbeddedCount(Y.source,Y.filters).queryChunks);this.params=Y,this.session=Y.session,this.sql=X.buildCount(Y.source,Y.filters)}then(Y,Z){return Promise.resolve(this.session.count(this.sql)).then(Y,Z)}catch(Y){return this.then(void 0,Y)}finally(Y){return this.then((Z)=>{return Y?.(),Z},(Z)=>{throw Y?.(),Z})}};var w1=class{static[J]="ColumnTableAliasProxyHandler";constructor(X,Y){this.table=X,this.ignoreColumnAlias=Y}get(X,Y){if(Y==="table")return this.table;if(Y==="isAlias"&&this.ignoreColumnAlias)return!1;return X[Y]}},jZ=class{static[J]="ViewSelectionAliasProxyHandler";constructor(X,Y,Z){this.view=X,this.selection=Y,this.ignoreColumnAlias=Z}get(X,Y){let Z=X[Y];if(D(Z,N))return new Proxy(Z,new w1(this.view,this.ignoreColumnAlias));if(D(Z,T)||D(Z,x)||D(Z,x.Aliased)||E1(Z)||typeof Z!=="object"||Z===null)return Z;return new Proxy(Z,this)}},FX=class{static[J]="TableAliasProxyHandler";constructor(X,Y,Z){this.alias=X,this.replaceOriginalName=Y,this.ignoreColumnAlias=Z}get(X,Y){if(Y===A.Symbol.IsAlias)return!0;if(Y===A.Symbol.Name)return this.alias;if(this.replaceOriginalName&&Y===A.Symbol.OriginalName)return this.alias;if(Y===Q)return{...X[Q],name:this.alias,isAlias:!0,selectedFields:new Proxy(X[Q].selectedFields,new jZ(new Proxy(X,this),X[Q].selectedFields,this.ignoreColumnAlias))};if(Y===A.Symbol.Columns){let $=X[A.Symbol.Columns];if(!$)return $;if(D(X,y))return new Proxy(X[A.Symbol.Columns],new jZ(new Proxy(X,this),X[A.Symbol.Columns],this.ignoreColumnAlias));let G={};return Object.keys($).map((H)=>{G[H]=new Proxy($[H],new w1(new Proxy(X,this),this.ignoreColumnAlias))}),G}let Z=X[Y];if(D(Z,N))return new Proxy(Z,new w1(new Proxy(X,this),this.ignoreColumnAlias));return Z}},V2=class{static[J]="ColumnAliasProxyHandler";constructor(X){this.alias=X}get(X,Y){if(Y==="isAlias")return!0;if(Y==="name")return this.alias;if(Y==="keyAsName")return!1;if(Y===T1)return()=>X;return X[Y]}};function Y1(X,Y){return new Proxy(X,new FX(Y,!1,!1))}function I2(X,Y){return new Proxy(X,new V2(Y))}function Z1(X,Y){return new Proxy(X,new w1(new Proxy(X.table,new FX(Y,!1,!1)),!1))}function cX(X,Y){return new x.Aliased(a1(X.sql,Y),X.fieldAlias)}function a1(X,Y){return W.join(X.queryChunks.map((Z)=>{if(D(Z,N))return Z1(Z,Y);if(D(Z,x))return a1(Z,Y);if(D(Z,x.Aliased))return cX(Z,Y);return Z}))}N.prototype.as=function(X){return I2(this,X)};function e1(X){return X[T1]()}var W1=class extends Error{static[J]="DrizzleError";constructor({message:X,cause:Y}){super(X);this.name="DrizzleError",this.cause=Y}},x1=class X extends Error{static[J]="DrizzleQueryError";constructor(Y,Z,$){super(`Failed query: ${Y}
|
|
3
|
+
params: ${Z}`);if(this.query=Y,this.params=Z,this.cause=$,Error.captureStackTrace(this,X),$)this.cause=$}},TZ=class extends W1{static[J]="TransactionRollbackError";constructor(){super({message:"Rollback"})}};var M2=class{static[J]="RelationV2";fieldName;sourceColumns;targetColumns;alias;where;sourceTable;targetTable;through;throughTable;isReversed;sourceColumnTableNames=[];targetColumnTableNames=[];constructor(X,Y){this.targetTableName=Y,this.targetTable=X}},SZ=class extends M2{static[J]="OneV2";relationType="one";optional;constructor(X,Y,Z,$){super(Y,Z);if(this.alias=$?.alias,this.where=$?.where,$?.from)this.sourceColumns=(Array.isArray($.from)?$.from:[$.from]).map((G)=>{return this.throughTable??=G._.through?X[G._.through._.tableName]:void 0,this.sourceColumnTableNames.push(G._.tableName),G._.column});if($?.to)this.targetColumns=(Array.isArray($.to)?$.to:[$.to]).map((G)=>{return this.throughTable??=G._.through?X[G._.through._.tableName]:void 0,this.targetColumnTableNames.push(G._.tableName),G._.column});if(this.throughTable)this.through={source:(Array.isArray($?.from)?$.from:($?.from)?[$.from]:[]).map((G)=>G._.through),target:(Array.isArray($?.to)?$.to:($?.to)?[$.to]:[]).map((G)=>G._.through)};this.optional=$?.optional??!0}};var Q1={and:m,between:u1,eq:a,exists:k1,gt:p1,gte:y1,ilike:t1,inArray:d1,arrayContains:qX,arrayContained:vX,arrayOverlaps:hX,isNull:m1,isNotNull:c1,like:o1,lt:f1,lte:b1,ne:h1,not:I1,notBetween:r1,notExists:N1,notLike:s1,notIlike:n1,notInArray:g1,or:V1,sql:W},x2={sql:W,asc:M1,desc:i1};function AX(X,Y,Z=(_)=>_,$=!1,G=!1,H){for(let _ of Y){if(_.selection){let U=`${H?`${H}.`:""}${_.key}`;if(X[_.key]===null)continue;if($){if(X[_.key]=JSON.parse(X[_.key]),X[_.key]===null)continue}if(G&&typeof X[_.key]==="string")X[_.key]=JSON.parse(X[_.key]);if(_.isArray){for(let F of X[_.key])AX(F,_.selection,Z,!1,G,U);continue}AX(X[_.key],_.selection,Z,!1,G,U);continue}let z=_.field,O=Z(X[_.key]);if(O===null)continue;let E;if(D(z,N))E=z;else if(D(z,x))E=z.decoder;else if(D(z,x.Aliased))E=z.sql.decoder;else if(D(z,A)||D(z,y))E=C1;else E=z.getSQL().decoder;X[_.key]="mapFromJsonValue"in E?E.mapFromJsonValue(O):E.mapFromDriverValue(O)}return X}function CZ(X,Y){let Z=X[n][Y];return Z?D(Z,N)?Z:D(Z,x.Aliased)?W`${X}.${W.identifier(Z.fieldAlias)}`:W`${X}.${W.identifier(Y)}`:W`${X}.${W.identifier(Y)}`}function UX(X,Y){if(typeof Y!=="object"||D(Y,l))return a(X,Y);let Z=Object.entries(Y);if(!Z.length)return;let $=[];for(let[G,H]of Z){if(H===void 0)continue;switch(G){case"NOT":{let _=UX(X,H);if(!_)continue;$.push(I1(_));continue}case"OR":if(!H.length)continue;$.push(V1(...H.map((_)=>UX(X,_))));continue;case"AND":if(!H.length)continue;$.push(m(...H.map((_)=>UX(X,_))));continue;case"isNotNull":case"isNull":if(!H)continue;$.push(Q1[G](X));continue;case"in":$.push(Q1.inArray(X,H));continue;case"notIn":$.push(Q1.notInArray(X,H));continue;default:$.push(Q1[G](X,H));continue}}if(!$.length)return;return m(...$)}function J1(X,Y,Z={},$={},G,H=0){let _=Object.entries(Y);if(!_.length)return;let z=[];for(let[O,E]of _){if(E===void 0)continue;switch(O){case"RAW":{let U=typeof E==="function"?E(X,Q1):E.getSQL();z.push(U);continue}case"OR":if(!E?.length)continue;z.push(V1(...E.map((U)=>J1(X,U,Z,$,G,H))));continue;case"AND":if(!E?.length)continue;z.push(m(...E.map((U)=>J1(X,U,Z,$,G,H))));continue;case"NOT":{if(E===void 0)continue;let U=J1(X,E,Z,$,G,H);if(!U)continue;z.push(I1(U));continue}default:{if(X[n][O]){let R=UX(CZ(X,O),E);if(R)z.push(R);continue}let U=Z[O];if(!U)throw new W1({message:`Unknown relational filter field: "${O}"`});let F=Y1(U.targetTable,`f${H}`),M=U.throughTable?Y1(U.throughTable,`ft${H}`):void 0,I=$[U.targetTableName],{filter:L,joinCondition:P}=uX(G,U,X,F,M),B=m(L,typeof E==="boolean"?void 0:J1(F,E,I.relations,$,G,H+1)),d=M?W`(select * from ${P1(F)} inner join ${P1(M)} on ${P}${W` where ${B}`.if(B)} limit 1)`:W`(select * from ${P1(F)}${W` where ${B}`.if(B)} limit 1)`;if(B)z.push((E?k1:N1)(d))}}}return m(...z)}function qZ(X,Y){if(typeof Y==="function"){let $=Y(X,x2);return D($,x)?$:Array.isArray($)?$.length?W.join($.map((G)=>D(G,x)?G:M1(G)),W`, `):void 0:D($,N)?M1($):void 0}let Z=Object.entries(Y).filter(([$,G])=>G);if(!Z.length)return;return W.join(Z.map(([$,G])=>(G==="asc"?M1:i1)(CZ(X,$))),W`, `)}function vZ(X,Y){let Z=[],$=[];for(let[G,H]of Object.entries(Y)){if(!H)continue;let _=typeof H==="function"?H(X,{sql:Q1.sql}):H,z=W`(${_.getSQL()}) as ${W.identifier(G)}`;z.decoder=_.getSQL().decoder,Z.push(z),$.push({key:G,field:z})}return{sql:Z.length?W.join(Z,W`, `):void 0,selection:$}}function uX(X,Y,Z,$,G){if(Y.through){let H=Y.sourceColumns.map((z,O)=>{let E=Y.through.source[O];return a(W`${Z}.${W.identifier(X.getColumnCasing(z))}`,W`${G}.${W.identifier(D(E._.column,N)?X.getColumnCasing(E._.column):E._.key)}`)}),_=Y.targetColumns.map((z,O)=>{let E=Y.through.target[O];return a(W`${G}.${W.identifier(D(E._.column,N)?X.getColumnCasing(E._.column):E._.key)}`,W`${$}.${W.identifier(X.getColumnCasing(z))}`)});return{filter:m(Y.where?J1(Y.isReversed?Z:$,Y.where):void 0,...H),joinCondition:m(..._)}}return{filter:m(...Y.sourceColumns.map((H,_)=>{let z=Y.targetColumns[_];return a(W`${Z}.${W.identifier(X.getColumnCasing(H))}`,W`${$}.${W.identifier(X.getColumnCasing(z))}`)}),Y.where?J1(Y.isReversed?Z:$,Y.where):void 0)}}function P1(X){return W`${X[_1]?W`${W`${W.identifier(X[G1]??"")}.`.if(X[G1])}${W.identifier(X[U1])} as ${X}`:X}`}var pZ=class{static[J]="SQLiteAsyncRelationalQueryBuilderV2";constructor(X,Y,Z,$,G,H,_,z){this.mode=X,this.schema=Y,this.table=Z,this.tableConfig=$,this.dialect=G,this.session=H,this.rowMode=_,this.forbidJsonb=z}findMany(X){return this.mode==="sync"?new hZ(this.schema,this.table,this.tableConfig,this.dialect,this.session,X??!0,"many",this.rowMode,this.forbidJsonb):new rX(this.schema,this.table,this.tableConfig,this.dialect,this.session,X??!0,"many",this.rowMode,this.forbidJsonb)}findFirst(X){return this.mode==="sync"?new hZ(this.schema,this.table,this.tableConfig,this.dialect,this.session,X??!0,"first",this.rowMode,this.forbidJsonb):new rX(this.schema,this.table,this.tableConfig,this.dialect,this.session,X??!0,"first",this.rowMode,this.forbidJsonb)}},rX=class extends c{static[J]="SQLiteAsyncRelationalQueryV2";mode;table;constructor(X,Y,Z,$,G,H,_,z,O){super();this.schema=X,this.tableConfig=Z,this.dialect=$,this.session=G,this.config=H,this.rowMode=z,this.forbidJsonb=O,this.mode=_,this.table=Y}getSQL(){return this.dialect.buildRelationalQuery({schema:this.schema,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,mode:this.mode,jsonb:this.forbidJsonb?W`json`:W`jsonb`}).sql}_prepare(X=!0){let{query:Y,builtQuery:Z}=this._toSQL();return this.session[X?"prepareOneTimeRelationalQuery":"prepareRelationalQuery"](Z,void 0,this.mode==="first"?"get":"all",($,G)=>{let H=$.map((_)=>AX(_,Y.selection,G,!this.rowMode));if(this.mode==="first")return H[0];return H})}prepare(){return this._prepare(!1)}_getQuery(){let X=this.forbidJsonb?W`json`:W`jsonb`,Y=this.dialect.buildRelationalQuery({schema:this.schema,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,mode:this.mode,isNested:this.rowMode,jsonb:X});if(this.rowMode)Y.sql=W`select json_object(${W.join(Y.selection.map((Z)=>{return W`${W.raw(this.dialect.escapeString(Z.key))}, ${Z.selection?W`${X}(${W.identifier(Z.key)})`:W.identifier(Z.key)}`}),W`, `)}) as ${W.identifier("r")} from (${Y.sql}) as ${W.identifier("t")}`;return Y}_toSQL(){let X=this._getQuery();return{query:X,builtQuery:this.dialect.sqlToQuery(X.sql)}}toSQL(){return this._toSQL().builtQuery}executeRaw(){if(this.mode==="first")return this._prepare().get();return this._prepare().all()}async execute(){return this.executeRaw()}},hZ=class extends rX{static[J]="SQLiteSyncRelationalQueryV2";sync(){return this.executeRaw()}};var XX=class extends c{static[J]="SQLiteRaw";config;constructor(X,Y,Z,$,G){super();this.execute=X,this.getSQL=Y,this.dialect=$,this.mapBatchResult=G,this.config={action:Z}}getQuery(){return{...this.dialect.sqlToQuery(this.getSQL()),method:this.config.action}}mapResult(X,Y){return Y?this.mapBatchResult(X):X}_prepare(){return this}isResponseInArrayMode(){return!1}};var b=class X{static[J]="SelectionProxyHandler";config;constructor(Y){this.config={...Y}}get(Y,Z){if(Z==="_")return{...Y._,selectedFields:new Proxy(Y._.selectedFields,this)};if(Z===Q)return{...Y[Q],selectedFields:new Proxy(Y[Q].selectedFields,this)};if(typeof Z==="symbol")return Y[Z];let $=(D(Y,T)?Y._.selectedFields:D(Y,y)?Y[Q].selectedFields:Y)[Z];if(D($,x.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!$.isSelectionField)return $.sql;let G=$.clone();return G.isSelectionField=!0,G.origin=this.config.alias,G}if(D($,x)){if(this.config.sqlBehavior==="sql")return $;throw Error(`You tried to reference "${Z}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}if(D($,N)){if(this.config.alias)return new Proxy($,new w1(new Proxy($.table,new FX(this.config.alias,this.config.replaceOriginalName??!1,!0)),!0));return $}if(typeof $!=="object"||$===null)return $;return new Proxy($,new X(this.config))}};function e(X){if(D(X,v))return[`${X[A.Symbol.BaseName]}`];if(D(X,T))return X._.usedTables??[];if(D(X,x))return X.usedTables??[];return[]}var VX=class extends c{static[J]="SQLiteDelete";config;constructor(X,Y,Z,$){super();this.table=X,this.session=Y,this.dialect=Z,this.config={table:X,withList:$}}where(X){return this.config.where=X,this}orderBy(...X){if(typeof X[0]==="function"){let Y=X[0](new Proxy(this.config.table[A.Symbol.Columns],new b({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),Z=Array.isArray(Y)?Y:[Y];this.config.orderBy=Z}else{let Y=X;this.config.orderBy=Y}return this}limit(X){return this.config.limit=X,this}returning(X=this.table[v.Symbol.Columns]){return this.config.returning=i(X),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:X,...Y}=this.dialect.sqlToQuery(this.getSQL());return Y}_prepare(X=!0){return this.session[X?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"delete",tables:e(this.config.table)})}prepare(){return this._prepare(!1)}run=(X)=>{return this._prepare().run(X)};all=(X)=>{return this._prepare().all(X)};get=(X)=>{return this._prepare().get(X)};values=(X)=>{return this._prepare().values(X)};async execute(X){return this._prepare().execute(X)}$dynamic(){return this}};var L1=class extends y{static[J]="SQLiteViewBase"};var yZ=class{static[J]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}};var X1=class{static[J]="SQLiteSelectBuilder";fields;session;dialect;withList;distinct;constructor(X){this.fields=X.fields,this.session=X.session,this.dialect=X.dialect,this.withList=X.withList,this.distinct=X.distinct}from(X){let Y=!!this.fields,Z;if(this.fields)Z=this.fields;else if(D(X,T))Z=Object.fromEntries(Object.keys(X._.selectedFields).map(($)=>[$,X[$]]));else if(D(X,L1))Z=X[Q].selectedFields;else if(D(X,x))Z={};else Z=EY(X);return new oX({table:X,fields:Z,isPartialSelect:Y,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct})}},fZ=class extends yZ{static[J]="SQLiteSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;cacheConfig=void 0;usedTables=new Set;constructor({table:X,fields:Y,isPartialSelect:Z,session:$,dialect:G,withList:H,distinct:_}){super();this.config={withList:H,table:X,fields:{...Y},distinct:_,setOperators:[]},this.isPartialSelect=Z,this.session=$,this.dialect=G,this._={selectedFields:Y,config:this.config},this.tableName=v1(X),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{};for(let z of e(X))this.usedTables.add(z)}getUsedTables(){return[...this.usedTables]}createJoin(X){return(Y,Z)=>{let $=this.tableName,G=v1(Y);for(let H of e(Y))this.usedTables.add(H);if(typeof G==="string"&&this.config.joins?.some((H)=>H.alias===G))throw Error(`Alias "${G}" is already used in this query`);if(!this.isPartialSelect){if(Object.keys(this.joinsNotNullableMap).length===1&&typeof $==="string")this.config.fields={[$]:this.config.fields};if(typeof G==="string"&&!D(Y,x)){let H=D(Y,T)?Y._.selectedFields:D(Y,y)?Y[Q].selectedFields:Y[A.Symbol.Columns];this.config.fields[G]=H}}if(typeof Z==="function")Z=Z(new Proxy(this.config.fields,new b({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));if(!this.config.joins)this.config.joins=[];if(this.config.joins.push({on:Z,table:Y,joinType:X,alias:G}),typeof G==="string")switch(X){case"left":this.joinsNotNullableMap[G]=!1;break;case"right":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([H])=>[H,!1])),this.joinsNotNullableMap[G]=!0;break;case"cross":case"inner":this.joinsNotNullableMap[G]=!0;break;case"full":this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([H])=>[H,!1])),this.joinsNotNullableMap[G]=!1;break}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");crossJoin=this.createJoin("cross");createSetOperator(X,Y){return(Z)=>{let $=typeof Z==="function"?Z(K2()):Z;if(!q1(this.getSelectedFields(),$.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:X,isAll:Y,rightSelect:$}),this}}union=this.createSetOperator("union",!1);unionAll=this.createSetOperator("union",!0);intersect=this.createSetOperator("intersect",!1);except=this.createSetOperator("except",!1);addSetOperators(X){return this.config.setOperators.push(...X),this}where(X){if(typeof X==="function")X=X(new Proxy(this.config.fields,new b({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.where=X,this}having(X){if(typeof X==="function")X=X(new Proxy(this.config.fields,new b({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.having=X,this}groupBy(...X){if(typeof X[0]==="function"){let Y=X[0](new Proxy(this.config.fields,new b({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(Y)?Y:[Y]}else this.config.groupBy=X;return this}orderBy(...X){if(typeof X[0]==="function"){let Y=X[0](new Proxy(this.config.fields,new b({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),Z=Array.isArray(Y)?Y:[Y];if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=Z;else this.config.orderBy=Z}else{let Y=X;if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=Y;else this.config.orderBy=Y}return this}limit(X){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).limit=X;else this.config.limit=X;return this}offset(X){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).offset=X;else this.config.offset=X;return this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:X,...Y}=this.dialect.sqlToQuery(this.getSQL());return Y}as(X){let Y=[];if(Y.push(...e(this.config.table)),this.config.joins)for(let Z of this.config.joins)Y.push(...e(Z.table));return new Proxy(new T(this.getSQL(),this.config.fields,X,!1,[...new Set(Y)]),new b({alias:X,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new b({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}},oX=class extends fZ{static[J]="SQLiteSelect";_prepare(X=!0){if(!this.session)throw Error("Cannot execute a query on a query builder. Please use a database instance instead.");let Y=i(this.config.fields),Z=this.session[X?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),Y,"all",!0,void 0,{type:"select",tables:[...this.usedTables]},this.cacheConfig);return Z.joinsNotNullableMap=this.joinsNotNullableMap,Z}$withCache(X){return this.cacheConfig=X===void 0?{config:{},enabled:!0,autoInvalidate:!0}:X===!1?{enabled:!1}:{enabled:!0,autoInvalidate:!0,...X},this}prepare(){return this._prepare(!1)}run=(X)=>{return this._prepare().run(X)};all=(X)=>{return this._prepare().all(X)};get=(X)=>{return this._prepare().get(X)};values=(X)=>{return this._prepare().values(X)};async execute(){return this.all()}};zY(oX,[c]);function IX(X,Y){return(Z,$,...G)=>{let H=[$,...G].map((_)=>({type:X,isAll:Y,rightSelect:_}));for(let _ of H)if(!q1(Z.getSelectedFields(),_.rightSelect.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return Z.addSetOperators(H)}}var K2=()=>({union:bZ,unionAll:dZ,intersect:gZ,except:mZ}),bZ=IX("union",!1),dZ=IX("union",!0),gZ=IX("intersect",!1),mZ=IX("except",!1);function _J(X){let Y=parseInt(X.slice(0,4),10),Z=parseInt(X.slice(4,6),10)-1,$=parseInt(X.slice(6,8),10),G=parseInt(X.slice(8,10),10),H=parseInt(X.slice(10,12),10),_=parseInt(X.slice(12,14),10);return Date.UTC(Y,Z,$,G,H,_)}function cZ(X){let{localMigrations:Y,dbMigrations:Z}=X,$=new Set(Z.map((G)=>G.name).filter((G)=>G!==null));return Y.filter((G)=>!G.name||!$.has(G.name))}var uZ=1;function k2(X){if(X.includes("name"))return 1;return 0}function sX(X,Y,Z=()=>[]){let $=X.all(Y);if($.length===0)return[];if(Array.isArray($[0]))return $.map((G)=>Z(G));return $}function rZ(X,Y,Z){if(sX(Y,W`SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ${X}`,(G)=>({"1":G[0]})).length===0)return{newDb:!0};let $=k2(sX(Y,W`SELECT name as column_name FROM pragma_table_info(${X})`,(G)=>({column_name:G[0]})).map((G)=>G.column_name));for(let G=$;G<uZ;G++){let H=N2[G];if(!H)throw Error(`No upgrade path from migration table version ${G} to ${G+1}`);H(X,Y,Z)}return{prevVersion:$,currentVersion:uZ}}var N2={0:(X,Y,Z)=>{let $=W`${W.identifier(X)}`,G=sX(Y,W`SELECT id, hash, created_at FROM ${$} ORDER BY id ASC`,(E)=>({id:E[0],hash:E[1],created_at:E[2]}));Z.sort((E,U)=>E.folderMillis!==U.folderMillis?E.folderMillis-U.folderMillis:(E.name??"").localeCompare(U.name??""));let H=new Map,_=new Map;for(let E of Z){if(!H.has(E.folderMillis))H.set(E.folderMillis,[]);H.get(E.folderMillis).push(E),_.set(E.hash,E)}let z=[],O=[];for(let E of G){let U=String(E.created_at),F=Number(U.substring(0,U.length-3)+"000"),M=H.get(F),I,L=null;if(M&&M.length===1)I=M[0],L="millis";else if(M&&M.length>1){if(I=M.find((P)=>P.hash&&E.hash&&P.hash===E.hash),I)L="hash"}else if(I=_.get(E.hash),I)L="hash";if(I)z.push({id:E.id,name:I.name,hash:E.hash,created_at:U,matchedBy:E.id?"id":L});else O.push(E)}if(O.length>0)throw Error(`While upgrading your database migrations table we found ${O.length} (${O.map((E)=>`[id: ${E.id}, created_at: ${E.created_at}]`).join(", ")}) migrations in the database that do not match any local migration. This means that some migrations were applied to the database but are missing from the local environment`);Y.transaction((E)=>{E.run(W`ALTER TABLE ${$} ADD COLUMN ${W.identifier("name")} text`),E.run(W`ALTER TABLE ${$} ADD COLUMN ${W.identifier("applied_at")} TEXT`);for(let U of z){let F=W`UPDATE ${$} SET ${W.identifier("name")} = ${U.name}, ${W.identifier("applied_at")} = NULL WHERE`;if(U.id)F.append(W` ${W.identifier("id")} = ${U.id}`);else if(U.matchedBy==="millis")F.append(W` ${W.identifier("created_at")} = ${U.created_at}`);else F.append(W` ${W.identifier("hash")} = ${U.hash}`);E.run(F)}})}};function R2(X){return(X.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map((Y)=>Y.toLowerCase()).join("_")}function w2(X){return(X.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((Y,Z,$)=>{return Y+($===0?Z.toLowerCase():`${Z[0].toUpperCase()}${Z.slice(1)}`)},"")}function Q2(X){return X}var oZ=class{static[J]="CasingCache";cache={};cachedTables={};convert;constructor(X){this.convert=X==="snake_case"?R2:X==="camelCase"?w2:Q2}getColumnCasing(X){if(!X.keyAsName)return X.name;let Y=`${X.table[A.Symbol.Schema]??"public"}.${X.table[A.Symbol.OriginalName]}.${X.name}`;if(!this.cache[Y])this.cacheTable(X.table);return this.cache[Y]}cacheTable(X){let Y=`${X[A.Symbol.Schema]??"public"}.${X[A.Symbol.OriginalName]}`;if(!this.cachedTables[Y]){for(let Z of Object.values(X[A.Symbol.Columns])){if(!D(Z,N))continue;let $=`${Y}.${Z.name}`;this.cache[$]=this.convert(Z.name)}this.cachedTables[Y]=!0}}clearCache(){this.cache={},this.cachedTables={}}};var MX=class{static[J]="SQLiteDialect";casing;constructor(X){this.casing=new oZ(X?.casing)}escapeName(X){return`"${X}"`}escapeParam(X){return"?"}escapeString(X){return`'${X.replace(/'/g,"''")}'`}buildWithCTE(X){if(!X?.length)return;let Y=[W`with `];for(let[Z,$]of X.entries())if(Y.push(W`${W.identifier($._.alias)} as (${$._.sql})`),Z<X.length-1)Y.push(W`, `);return Y.push(W` `),W.join(Y)}buildDeleteQuery({table:X,where:Y,returning:Z,withList:$,limit:G,orderBy:H}){let _=this.buildWithCTE($),z=Z?W` returning ${this.buildSelection(Z,{isSingleTable:!0})}`:void 0;return W`${_}delete from ${X}${Y?W` where ${Y}`:void 0}${z}${this.buildOrderBy(H)}${this.buildLimit(G)}`}buildUpdateSet(X,Y){let Z=X[A.Symbol.Columns],$=Object.keys(Z).filter((H)=>Y[H]!==void 0||Z[H]?.onUpdateFn!==void 0),G=$.length;return W.join($.flatMap((H,_)=>{let z=Z[H],O=z.onUpdateFn?.(),E=Y[H]??(D(O,x)?O:W.param(O,z)),U=W`${W.identifier(this.casing.getColumnCasing(z))} = ${E}`;if(_<G-1)return[U,W.raw(", ")];return[U]}))}buildUpdateQuery({table:X,set:Y,where:Z,returning:$,withList:G,joins:H,from:_,limit:z,orderBy:O}){let E=this.buildWithCTE(G),U=this.buildUpdateSet(X,Y),F=_&&W.join([W.raw(" from "),this.buildFromTable(_)]),M=this.buildJoins(H),I=$?W` returning ${this.buildSelection($,{isSingleTable:!0})}`:void 0;return W`${E}update ${X} set ${U}${F}${M}${Z?W` where ${Z}`:void 0}${I}${this.buildOrderBy(O)}${this.buildLimit(z)}`}buildSelection(X,{isSingleTable:Y=!1}={}){let Z=X.length,$=X.flatMap(({field:G},H)=>{let _=[];if(D(G,x.Aliased)&&G.isSelectionField){if(!Y&&G.origin!==void 0)_.push(W.identifier(G.origin),W.raw("."));_.push(W.identifier(G.fieldAlias))}else if(D(G,x.Aliased)||D(G,x)){let z=D(G,x.Aliased)?G.sql:G;if(Y){let O=new x(z.queryChunks.map((E)=>{if(D(E,N))return W.identifier(this.casing.getColumnCasing(E));return E}));_.push(z.shouldInlineParams?O.inlineParams():O)}else _.push(z);if(D(G,x.Aliased))_.push(W` as ${W.identifier(G.fieldAlias)}`)}else if(D(G,N))if(G.columnType==="SQLiteNumericBigInt")if(Y)_.push(G.isAlias?W`cast(${W.identifier(this.casing.getColumnCasing(e1(G)))} as text) as ${G}`:W`cast(${W.identifier(this.casing.getColumnCasing(G))} as text)`);else _.push(G.isAlias?W`cast(${e1(G)} as text) as ${G}`:W`cast(${G} as text)`);else if(Y)_.push(G.isAlias?W`${W.identifier(this.casing.getColumnCasing(e1(G)))} as ${G}`:W.identifier(this.casing.getColumnCasing(G)));else _.push(G.isAlias?W`${e1(G)} as ${G}`:G);else if(D(G,T)){let z=Object.entries(G._.selectedFields);if(z.length===1){let O=z[0][1],E=D(O,x)?O.decoder:D(O,N)?{mapFromDriverValue:(U)=>O.mapFromDriverValue(U)}:O.sql.decoder;if(E)G._.sql.decoder=E}_.push(G)}if(H<Z-1)_.push(W`, `);return _});return W.join($)}buildJoins(X){if(!X||X.length===0)return;let Y=[];if(X)for(let[Z,$]of X.entries()){if(Z===0)Y.push(W` `);let G=$.table,H=$.on?W` on ${$.on}`:void 0;if(D(G,v)){let _=G[v.Symbol.Name],z=G[v.Symbol.Schema],O=G[v.Symbol.OriginalName],E=_===O?void 0:$.alias;Y.push(W`${W.raw($.joinType)} join ${z?W`${W.identifier(z)}.`:void 0}${W.identifier(O)}${E&&W` ${W.identifier(E)}`}${H}`)}else Y.push(W`${W.raw($.joinType)} join ${G}${H}`);if(Z<X.length-1)Y.push(W` `)}return W.join(Y)}buildLimit(X){return typeof X==="object"||typeof X==="number"&&X>=0?W` limit ${X}`:void 0}buildOrderBy(X){let Y=[];if(X){for(let[Z,$]of X.entries())if(Y.push($),Z<X.length-1)Y.push(W`, `)}return Y.length>0?W` order by ${W.join(Y)}`:void 0}buildFromTable(X){if(D(X,A)&&X[A.Symbol.IsAlias])return W`${W`${W.identifier(X[A.Symbol.Schema]??"")}.`.if(X[A.Symbol.Schema])}${W.identifier(X[A.Symbol.OriginalName])} ${W.identifier(X[A.Symbol.Name])}`;if(D(X,y)&&X[Q].isAlias){let Y=W`${W.identifier(X[Q].originalName)}`;if(X[Q].schema)Y=W`${W.identifier(X[Q].schema)}.${Y}`;return W`${Y} ${W.identifier(X[Q].name)}`}return X}buildSelectQuery({withList:X,fields:Y,fieldsFlat:Z,where:$,having:G,table:H,joins:_,orderBy:z,groupBy:O,limit:E,offset:U,distinct:F,setOperators:M}){let I=Z??i(Y);for(let C of I)if(D(C.field,N)&&z1(C.field.table)!==(D(H,T)?H._.alias:D(H,L1)?H[Q].name:D(H,x)?void 0:z1(H))&&!((u)=>_?.some(({alias:t})=>t===(u[A.Symbol.IsAlias]?z1(u):u[A.Symbol.BaseName])))(C.field.table)){let u=z1(C.field.table);throw Error(`Your "${C.path.join("->")}" field references a column "${u}"."${C.field.name}", but the table "${u}" is not part of the query! Did you forget to join it?`)}let L=!_||_.length===0,P=this.buildWithCTE(X),B=F?W` distinct`:void 0,d=this.buildSelection(I,{isSingleTable:L}),R=this.buildFromTable(H),s=this.buildJoins(_),o=$?W` where ${$}`:void 0,p=G?W` having ${G}`:void 0,w=[];if(O){for(let[C,u]of O.entries())if(w.push(u),C<O.length-1)w.push(W`, `)}let j=W`${P}select${B} ${d} from ${R}${s}${o}${w.length>0?W` group by ${W.join(w)}`:void 0}${p}${this.buildOrderBy(z)}${this.buildLimit(E)}${U?W` offset ${U}`:void 0}`;if(M.length>0)return this.buildSetOperations(j,M);return j}buildSetOperations(X,Y){let[Z,...$]=Y;if(!Z)throw Error("Cannot pass undefined values to any set operator");if($.length===0)return this.buildSetOperationQuery({leftSelect:X,setOperator:Z});return this.buildSetOperations(this.buildSetOperationQuery({leftSelect:X,setOperator:Z}),$)}buildSetOperationQuery({leftSelect:X,setOperator:{type:Y,isAll:Z,rightSelect:$,limit:G,orderBy:H,offset:_}}){let z=W`${X.getSQL()} `,O=W`${$.getSQL()}`,E;if(H&&H.length>0){let I=[];for(let L of H)if(D(L,S))I.push(W.identifier(L.name));else if(D(L,x)){for(let P=0;P<L.queryChunks.length;P++){let B=L.queryChunks[P];if(D(B,S))L.queryChunks[P]=W.identifier(this.casing.getColumnCasing(B))}I.push(W`${L}`)}else I.push(W`${L}`);E=W` order by ${W.join(I,W`, `)}`}let U=typeof G==="object"||typeof G==="number"&&G>=0?W` limit ${G}`:void 0,F=W.raw(`${Y} ${Z?"all ":""}`),M=_?W` offset ${_}`:void 0;return W`${z}${F}${O}${E}${U}${M}`}buildInsertQuery({table:X,values:Y,onConflict:Z,returning:$,withList:G,select:H}){let _=[],z=X[A.Symbol.Columns],O=Object.entries(z).filter(([I,L])=>!L.shouldDisableInsert()),E=O.map(([,I])=>W.identifier(this.casing.getColumnCasing(I)));if(H){let I=Y;if(D(I,x))_.push(I);else _.push(I.getSQL())}else{let I=Y;_.push(W.raw("values "));for(let[L,P]of I.entries()){let B=[];for(let[d,R]of O){let s=P[d];if(s===void 0||D(s,g)&&s.value===void 0){let o;if(R.default!==null&&R.default!==void 0)o=D(R.default,x)?R.default:W.param(R.default,R);else if(R.defaultFn!==void 0){let p=R.defaultFn();o=D(p,x)?p:W.param(p,R)}else if(!R.default&&R.onUpdateFn!==void 0){let p=R.onUpdateFn();o=D(p,x)?p:W.param(p,R)}else o=W`null`;B.push(o)}else B.push(s)}if(_.push(B),L<I.length-1)_.push(W`, `)}}let U=this.buildWithCTE(G),F=W.join(_),M=$?W` returning ${this.buildSelection($,{isSingleTable:!0})}`:void 0;return W`${U}insert into ${X} ${E} ${F}${Z?.length?W.join(Z):void 0}${M}`}sqlToQuery(X,Y){return X.toQuery({casing:this.casing,escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,invokeSource:Y})}_buildRelationalQuery({fullSchema:X,schema:Y,tableNamesMap:Z,table:$,tableConfig:G,queryConfig:H,tableAlias:_,nestedQueryRelation:z,joinOn:O}){let E=[],U,F,M=[],I,L=[];if(H===!0)E=Object.entries(G.columns).map(([B,d])=>({dbKey:d.name,tsKey:B,field:Z1(d,_),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let B=Object.fromEntries(Object.entries(G.columns).map(([w,j])=>[w,Z1(j,_)]));if(H.where){let w=typeof H.where==="function"?H.where(B,kZ()):H.where;I=w&&a1(w,_)}let d=[],R=[];if(H.columns){let w=!1;for(let[j,C]of Object.entries(H.columns)){if(C===void 0)continue;if(j in G.columns){if(!w&&C===!0)w=!0;R.push(j)}}if(R.length>0)R=w?R.filter((j)=>H.columns?.[j]===!0):Object.keys(G.columns).filter((j)=>!R.includes(j))}else R=Object.keys(G.columns);for(let w of R){let j=G.columns[w];d.push({tsKey:w,value:j})}let s=[];if(H.with)s=Object.entries(H.with).filter((w)=>!!w[1]).map(([w,j])=>({tsKey:w,queryConfig:j,relation:G.relations[w]}));let o;if(H.extras){o=typeof H.extras==="function"?H.extras(B,{sql:W}):H.extras;for(let[w,j]of Object.entries(o))d.push({tsKey:w,value:cX(j,_)})}for(let{tsKey:w,value:j}of d)E.push({dbKey:D(j,x.Aliased)?j.fieldAlias:G.columns[w].name,tsKey:w,field:D(j,N)?Z1(j,_):j,relationTableTsKey:void 0,isJson:!1,selection:[]});let p=typeof H.orderBy==="function"?H.orderBy(B,NZ()):H.orderBy??[];if(!Array.isArray(p))p=[p];M=p.map((w)=>{if(D(w,N))return Z1(w,_);return a1(w,_)}),U=H.limit,F=H.offset;for(let{tsKey:w,queryConfig:j,relation:C}of s){let u=wZ(Y,Z,C),t=Z[A1(C.referencedTable)],H1=`${_}_${w}`,$1=m(...u.fields.map((j1,wX)=>a(Z1(u.references[wX],H1),Z1(j1,_)))),K1=this._buildRelationalQuery({fullSchema:X,schema:Y,tableNamesMap:Z,table:X[t],tableConfig:Y[t],queryConfig:D(C,R1)?j===!0?{limit:1}:{...j,limit:1}:j,tableAlias:H1,joinOn:$1,nestedQueryRelation:C}),B1=W`(${K1.sql})`.as(w);E.push({dbKey:w,tsKey:w,field:B1,relationTableTsKey:t,isJson:!0,selection:K1.selection})}}if(E.length===0)throw new W1({message:`No fields selected for table "${G.tsName}" ("${_}"). You need to have at least one item in "columns", "with" or "extras". If you need to select all columns, omit the "columns" key or set it to undefined.`});let P;if(I=m(O,I),z){let B=W`json_array(${W.join(E.map(({field:R})=>D(R,S)?W.identifier(this.casing.getColumnCasing(R)):D(R,x.Aliased)?R.sql:R),W`, `)})`;if(D(z,dX))B=W`coalesce(json_group_array(${B}), json_array())`;let d=[{dbKey:"data",tsKey:"data",field:B.as("data"),isJson:!0,relationTableTsKey:G.tsName,selection:E}];if(U!==void 0||F!==void 0||M.length>0)P=this.buildSelectQuery({table:Y1($,_),fields:{},fieldsFlat:[{path:[],field:W.raw("*")}],where:I,limit:U,offset:F,orderBy:M,setOperators:[]}),I=void 0,U=void 0,F=void 0,M=void 0;else P=Y1($,_);P=this.buildSelectQuery({table:D(P,v)?P:new T(P,{},_),fields:{},fieldsFlat:d.map(({field:R})=>({path:[],field:D(R,N)?Z1(R,_):R})),joins:L,where:I,limit:U,offset:F,orderBy:M,setOperators:[]})}else P=this.buildSelectQuery({table:Y1($,_),fields:{},fieldsFlat:E.map(({field:B})=>({path:[],field:D(B,N)?Z1(B,_):B})),joins:L,where:I,limit:U,offset:F,orderBy:M,setOperators:[]});return{tableTsKey:G.tsName,sql:P,selection:E}}nestedSelectionerror(){throw new W1({message:"Views with nested selections are not supported by the relational query builder"})}buildRqbColumn(X,Y,Z){if(D(Y,N)){let $=W`${X}.${W.identifier(this.casing.getColumnCasing(Y))}`;switch(Y.columnType){case"SQLiteBigInt":case"SQLiteBlobJson":case"SQLiteBlobBuffer":return W`hex(${$}) as ${W.identifier(Z)}`;case"SQLiteNumeric":case"SQLiteNumericNumber":case"SQLiteNumericBigInt":return W`cast(${$} as text) as ${W.identifier(Z)}`;case"SQLiteCustomColumn":return W`${Y.jsonSelectIdentifier($,W)} as ${W.identifier(Z)}`;default:return W`${$} as ${W.identifier(Z)}`}}return W`${X}.${D(Y,x.Aliased)?W.identifier(Y.fieldAlias):E1(Y)?W.identifier(Z):this.nestedSelectionerror()} as ${W.identifier(Z)}`}unwrapAllColumns=(X,Y)=>{return W.join(Object.entries(X[n]).map(([Z,$])=>{return Y.push({key:Z,field:$}),this.buildRqbColumn(X,$,Z)}),W`, `)};getSelectedTableColumns=(X,Y)=>{let Z=[],$=X[n],G=Object.entries(Y),H;for(let[_,z]of G){if(z===void 0)continue;if(H=H||z,z){let O=$[_];Z.push({column:O,tsName:_})}}if(H===!1)for(let[_,z]of Object.entries($)){if(Y[_]===!1)continue;Z.push({column:z,tsName:_})}return Z};buildColumns=(X,Y,Z)=>Z?.columns?(()=>{let $=[],G=this.getSelectedTableColumns(X,Z?.columns);for(let{column:H,tsName:_}of G)$.push(this.buildRqbColumn(X,H,_)),Y.push({key:_,field:H});return $.length?W.join($,W`, `):void 0})():this.unwrapAllColumns(X,Y);buildRelationalQuery({schema:X,table:Y,tableConfig:Z,queryConfig:$,relationWhere:G,mode:H,isNested:_,errorPath:z,depth:O,throughJoin:E,jsonb:U}){let F=[],M=H==="first",I=$===!0?void 0:$,L=z??"",P=O??0;if(!P)Y=Y1(Y,`d${P}`);let B=M?1:I?.limit,d=I?.offset,R=this.buildColumns(Y,F,I),s=I?.where&&G?m(J1(Y,I.where,Z.relations,X,this.casing),G):I?.where?J1(Y,I.where,Z.relations,X,this.casing):G,o=I?.orderBy?qZ(Y,I.orderBy):void 0,p=I?.extras?vZ(Y,I.extras):void 0;if(p)F.push(...p.selection);let w=I?(()=>{let{with:C}=I;if(!C)return;let u=Object.entries(C).filter(([t,H1])=>H1);if(!u.length)return;return W.join(u.map(([t,H1])=>{let $1=Z.relations[t],K1=D($1,SZ),B1=Y1($1.targetTable,`d${P+1}`),j1=$1.throughTable?Y1($1.throughTable,`tr${P}`):void 0,{filter:wX,joinCondition:aZ}=uX(this.casing,$1,Y,B1,j1),eZ=j1?W` inner join ${P1(j1)} on ${aZ}`:void 0,$X=this.buildRelationalQuery({table:B1,mode:K1?"first":"many",schema:X,queryConfig:H1,tableConfig:X[$1.targetTableName],relationWhere:wX,isNested:!0,errorPath:`${L.length?`${L}.`:""}${t}`,depth:P+1,throughJoin:eZ,jsonb:U});F.push({field:B1,key:t,selection:$X.selection,isArray:!K1,isOptional:($1.optional??!1)||H1!==!0&&!!H1.where});let ZY=W.join($X.selection.map((GX)=>{return W`${W.raw(this.escapeString(GX.key))}, ${GX.selection?W`${U}(${W.identifier(GX.key)})`:W.identifier(GX.key)}`}),W`, `),$Y=_?U:W`json`;return K1?W`(select ${$Y}_object(${ZY}) as ${W.identifier("r")} from (${$X.sql}) as ${W.identifier("t")}) as ${W.identifier(t)}`:W`coalesce((select ${$Y}_group_array(json_object(${ZY})) as ${W.identifier("r")} from (${$X.sql}) as ${W.identifier("t")}), ${U}_array()) as ${W.identifier(t)}`}),W`, `)})():void 0,j=[R,p?.sql,w].filter((C)=>C!==void 0);if(!j.length)throw new W1({message:`No fields selected for table "${Z.name}"${L?` ("${L}")`:""}`});return{sql:W`select ${W.join(j,W`, `)} from ${P1(Y)}${E}${W` where ${s}`.if(s)}${W` order by ${o}`.if(o)}${W` limit ${B}`.if(B!==void 0)}${W` offset ${d}`.if(d!==void 0)}`,selection:F}}},xX=class extends MX{static[J]="SQLiteSyncDialect";migrate(X,Y,Z){let $=Z===void 0?"__drizzle_migrations":typeof Z==="string"?"__drizzle_migrations":Z.migrationsTable??"__drizzle_migrations",{newDb:G}=rZ($,Y,X);if(G){let z=W`
|
|
4
|
+
CREATE TABLE IF NOT EXISTS ${W.identifier($)} (
|
|
5
|
+
id INTEGER PRIMARY KEY,
|
|
6
|
+
hash text NOT NULL,
|
|
7
|
+
created_at numeric,
|
|
8
|
+
name text,
|
|
9
|
+
applied_at TEXT
|
|
10
|
+
)`;Y.run(z)}let H=Y.all(W`SELECT id, hash, created_at, name FROM ${W.identifier($)}`);if(typeof Z==="object"&&Z.init){if(H.length)return{exitCode:"databaseMigrations"};if(X.length>1)return{exitCode:"localMigrations"};let[z]=X;if(!z)return;Y.run(W`insert into ${W.identifier($)} ("hash", "created_at", "name", "applied_at") values(${z.hash}, ${z.folderMillis}, ${z.name}, ${new Date().toISOString()})`);return}let _=cZ({localMigrations:X,dbMigrations:H});Y.run(W`BEGIN`);try{for(let z of _){for(let O of z.sql)Y.run(W.raw(O));Y.run(W`INSERT INTO ${W.identifier($)} ("hash", "created_at", "name", "applied_at") values(${z.hash}, ${z.folderMillis}, ${z.name}, ${new Date().toISOString()})`)}Y.run(W`COMMIT`)}catch(z){throw Y.run(W`ROLLBACK`),z}}};var YX=class{static[J]="SQLiteQueryBuilder";dialect;dialectConfig;constructor(X){this.dialect=D(X,MX)?X:void 0,this.dialectConfig=D(X,MX)?void 0:X}$with=(X,Y)=>{let Z=this;return{as:(G)=>{if(typeof G==="function")G=G(Z);return new Proxy(new WX(G.getSQL(),Y??("getSelectedFields"in G?G.getSelectedFields()??{}:{}),X,!0),new b({alias:X,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}};with(...X){let Y=this;function Z(G){return new X1({fields:G??void 0,session:void 0,dialect:Y.getDialect(),withList:X})}function $(G){return new X1({fields:G??void 0,session:void 0,dialect:Y.getDialect(),withList:X,distinct:!0})}return{select:Z,selectDistinct:$}}select(X){return new X1({fields:X??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(X){return new X1({fields:X??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}getDialect(){if(!this.dialect)this.dialect=new xX(this.dialectConfig);return this.dialect}};var KX=class{static[J]="SQLiteInsertBuilder";constructor(X,Y,Z,$){this.table=X,this.session=Y,this.dialect=Z,this.withList=$}values(X){if(X=Array.isArray(X)?X:[X],X.length===0)throw Error("values() must be called with at least one value");let Y=X.map((Z)=>{let $={},G=this.table[A.Symbol.Columns];for(let H of Object.keys(Z)){let _=Z[H];$[H]=D(_,x)?_:new g(_,G[H])}return $});return new tX(this.table,Y,this.session,this.dialect,this.withList)}select(X){let Y=typeof X==="function"?X(new YX):X;if(!D(Y,x)&&!q1(this.table[n],Y._.selectedFields))throw Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new tX(this.table,Y,this.session,this.dialect,this.withList,!0)}},tX=class extends c{static[J]="SQLiteInsert";config;constructor(X,Y,Z,$,G,H){super();this.session=Z,this.dialect=$,this.config={table:X,values:Y,withList:G,select:H}}returning(X=this.config.table[v.Symbol.Columns]){return this.config.returning=i(X),this}onConflictDoNothing(X={}){if(!this.config.onConflict)this.config.onConflict=[];if(X.target===void 0)this.config.onConflict.push(W` on conflict do nothing`);else{let Y=Array.isArray(X.target)?W`${X.target}`:W`${[X.target]}`,Z=X.where?W` where ${X.where}`:W``;this.config.onConflict.push(W` on conflict ${Y} do nothing${Z}`)}return this}onConflictDoUpdate(X){if(X.where&&(X.targetWhere||X.setWhere))throw Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');if(!this.config.onConflict)this.config.onConflict=[];let Y=X.where?W` where ${X.where}`:void 0,Z=X.targetWhere?W` where ${X.targetWhere}`:void 0,$=X.setWhere?W` where ${X.setWhere}`:void 0,G=Array.isArray(X.target)?W`${X.target}`:W`${[X.target]}`,H=this.dialect.buildUpdateSet(this.config.table,JX(this.config.table,X.set));return this.config.onConflict.push(W` on conflict ${G}${Z} do update set ${H}${Y}${$}`),this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:X,...Y}=this.dialect.sqlToQuery(this.getSQL());return Y}_prepare(X=!0){return this.session[X?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"insert",tables:e(this.config.table)})}prepare(){return this._prepare(!1)}run=(X)=>{return this._prepare().run(X)};all=(X)=>{return this._prepare().all(X)};get=(X)=>{return this._prepare().get(X)};values=(X)=>{return this._prepare().values(X)};async execute(){return this.config.returning?this.all():this.run()}$dynamic(){return this}};var kX=class{static[J]="SQLiteUpdateBuilder";constructor(X,Y,Z,$){this.table=X,this.session=Y,this.dialect=Z,this.withList=$}set(X){return new sZ(this.table,JX(this.table,X),this.session,this.dialect,this.withList)}},sZ=class extends c{static[J]="SQLiteUpdate";config;constructor(X,Y,Z,$,G){super();this.session=Z,this.dialect=$,this.config={set:Y,table:X,withList:G,joins:[]}}from(X){return this.config.from=X,this}createJoin(X){return(Y,Z)=>{let $=v1(Y);if(typeof $==="string"&&this.config.joins.some((G)=>G.alias===$))throw Error(`Alias "${$}" is already used in this query`);if(typeof Z==="function"){let G=this.config.from?D(Y,v)?Y[A.Symbol.Columns]:D(Y,T)?Y._.selectedFields:D(Y,L1)?Y[Q].selectedFields:void 0:void 0;Z=Z(new Proxy(this.config.table[A.Symbol.Columns],new b({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),G&&new Proxy(G,new b({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}return this.config.joins.push({on:Z,table:Y,joinType:X,alias:$}),this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");where(X){return this.config.where=X,this}orderBy(...X){if(typeof X[0]==="function"){let Y=X[0](new Proxy(this.config.table[A.Symbol.Columns],new b({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),Z=Array.isArray(Y)?Y:[Y];this.config.orderBy=Z}else{let Y=X;this.config.orderBy=Y}return this}limit(X){return this.config.limit=X,this}returning(X=this.config.table[v.Symbol.Columns]){return this.config.returning=i(X),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:X,...Y}=this.dialect.sqlToQuery(this.getSQL());return Y}_prepare(X=!0){return this.session[X?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"insert",tables:e(this.config.table)})}prepare(){return this._prepare(!1)}run=(X)=>{return this._prepare().run(X)};all=(X)=>{return this._prepare().all(X)};get=(X)=>{return this._prepare().get(X)};values=(X)=>{return this._prepare().values(X)};async execute(){return this.config.returning?this.all():this.run()}$dynamic(){return this}};var NX=class{static[J]="BaseSQLiteDatabase";_query;query;constructor(X,Y,Z,$,G,H,_){this.resultKind=X,this.dialect=Y,this.session=Z,this.rowModeRQB=H,this.forbidJsonb=_,this._=G?{schema:G.schema,fullSchema:G.fullSchema,tableNamesMap:G.tableNamesMap,relations:$}:{schema:void 0,fullSchema:{},tableNamesMap:{},relations:$},this._query={};let z=this._query;if(this._.schema)for(let[O,E]of Object.entries(this._.schema))z[O]=new LZ(X,G.fullSchema,this._.schema,this._.tableNamesMap,G.fullSchema[O],E,Y,Z);this.query={};for(let[O,E]of Object.entries($))this.query[O]=new pZ(X,$,$[E.name].table,E,Y,Z,H,_);this.$cache={invalidate:async(O)=>{}}}$with=(X,Y)=>{let Z=this;return{as:(G)=>{if(typeof G==="function")G=G(new YX(Z.dialect));return new Proxy(new WX(G.getSQL(),Y??("getSelectedFields"in G?G.getSelectedFields()??{}:{}),X,!0),new b({alias:X,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}};$count(X,Y){return new BZ({source:X,filters:Y,session:this.session})}with(...X){let Y=this;function Z(z){return new X1({fields:z??void 0,session:Y.session,dialect:Y.dialect,withList:X})}function $(z){return new X1({fields:z??void 0,session:Y.session,dialect:Y.dialect,withList:X,distinct:!0})}function G(z){return new kX(z,Y.session,Y.dialect,X)}function H(z){return new KX(z,Y.session,Y.dialect,X)}function _(z){return new VX(z,Y.session,Y.dialect,X)}return{select:Z,selectDistinct:$,update:G,insert:H,delete:_}}select(X){return new X1({fields:X??void 0,session:this.session,dialect:this.dialect})}selectDistinct(X){return new X1({fields:X??void 0,session:this.session,dialect:this.dialect,distinct:!0})}update(X){return new kX(X,this.session,this.dialect)}$cache;insert(X){return new KX(X,this.session,this.dialect)}delete(X){return new VX(X,this.session,this.dialect)}run(X){let Y=typeof X==="string"?W.raw(X):X.getSQL();if(this.resultKind==="async")return new XX(async()=>this.session.run(Y),()=>Y,"run",this.dialect,this.session.extractRawRunValueFromBatchResult.bind(this.session));return this.session.run(Y)}all(X){let Y=typeof X==="string"?W.raw(X):X.getSQL();if(this.resultKind==="async")return new XX(async()=>this.session.all(Y),()=>Y,"all",this.dialect,this.session.extractRawAllValueFromBatchResult.bind(this.session));return this.session.all(Y)}get(X){let Y=typeof X==="string"?W.raw(X):X.getSQL();if(this.resultKind==="async")return new XX(async()=>this.session.get(Y),()=>Y,"get",this.dialect,this.session.extractRawGetValueFromBatchResult.bind(this.session));return this.session.get(Y)}values(X){let Y=typeof X==="string"?W.raw(X):X.getSQL();if(this.resultKind==="async")return new XX(async()=>this.session.values(Y),()=>Y,"values",this.dialect,this.session.extractRawValuesValueFromBatchResult.bind(this.session));return this.session.values(Y)}transaction(X,Y){return this.session.transaction(X,Y)}};var P2=class{static[J]="Cache"},tZ=class extends P2{static[J]="NoopCache";strategy(){return"all"}async get(X){}async put(X,Y,Z,$){}async onMutate(X){}};async function nX(X,Y){let Z=`${X}-${JSON.stringify(Y,(H,_)=>typeof _==="bigint"?`${_}n`:_)}`,$=new TextEncoder().encode(Z),G=await crypto.subtle.digest("SHA-256",$);return[...new Uint8Array(G)].map((H)=>H.toString(16).padStart(2,"0")).join("")}var nZ=class extends c{static[J]="ExecuteResultSync";constructor(X){super();this.resultCb=X}async execute(){return this.resultCb()}sync(){return this.resultCb()}},iX=class{static[J]="PreparedQuery";joinsNotNullableMap;constructor(X,Y,Z,$,G,H){if(this.mode=X,this.executeMethod=Y,this.query=Z,this.cache=$,this.queryMetadata=G,this.cacheConfig=H,$&&$.strategy()==="all"&&H===void 0)this.cacheConfig={enabled:!0,autoInvalidate:!0};if(!this.cacheConfig?.enabled)this.cacheConfig=void 0}async queryWithCache(X,Y,Z){if(this.cache===void 0||D(this.cache,tZ)||this.queryMetadata===void 0)try{return await Z()}catch($){throw new x1(X,Y,$)}if(this.cacheConfig&&!this.cacheConfig.enabled)try{return await Z()}catch($){throw new x1(X,Y,$)}if((this.queryMetadata.type==="insert"||this.queryMetadata.type==="update"||this.queryMetadata.type==="delete")&&this.queryMetadata.tables.length>0)try{let[$]=await Promise.all([Z(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return $}catch($){throw new x1(X,Y,$)}if(!this.cacheConfig)try{return await Z()}catch($){throw new x1(X,Y,$)}if(this.queryMetadata.type==="select"){let $=await this.cache.get(this.cacheConfig.tag??await nX(X,Y),this.queryMetadata.tables,this.cacheConfig.tag!==void 0,this.cacheConfig.autoInvalidate);if($===void 0){let G;try{G=await Z()}catch(H){throw new x1(X,Y,H)}return await this.cache.put(this.cacheConfig.tag??await nX(X,Y),G,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],this.cacheConfig.tag!==void 0,this.cacheConfig.config),G}return $}try{return await Z()}catch($){throw new x1(X,Y,$)}}getQuery(){return this.query}mapRunResult(X,Y){return X}mapAllResult(X,Y){throw Error("Not implemented")}mapGetResult(X,Y){throw Error("Not implemented")}execute(X){if(this.mode==="async")return this[this.executeMethod](X);return new nZ(()=>this[this.executeMethod](X))}mapResult(X,Y){switch(this.executeMethod){case"run":return this.mapRunResult(X,Y);case"all":return this.mapAllResult(X,Y);case"get":return this.mapGetResult(X,Y)}}},lX=class{static[J]="SQLiteSession";constructor(X){this.dialect=X}prepareOneTimeQuery(X,Y,Z,$,G,H,_){return this.prepareQuery(X,Y,Z,$,G,H,_)}prepareOneTimeRelationalQuery(X,Y,Z,$){return this.prepareRelationalQuery(X,Y,Z,$)}run(X){let Y=this.dialect.sqlToQuery(X);try{return this.prepareOneTimeQuery(Y,void 0,"run",!1).run()}catch(Z){throw new W1({cause:Z,message:`Failed to run the query '${Y.sql}'`})}}extractRawRunValueFromBatchResult(X){return X}all(X){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(X),void 0,"run",!1).all()}extractRawAllValueFromBatchResult(X){throw Error("Not implemented")}get(X){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(X),void 0,"run",!1).get()}extractRawGetValueFromBatchResult(X){throw Error("Not implemented")}values(X){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(X),void 0,"run",!1).values()}async count(X){return(await this.values(X))[0][0]}extractRawValuesValueFromBatchResult(X){throw Error("Not implemented")}},aX=class extends NX{static[J]="SQLiteTransaction";constructor(X,Y,Z,$,G,H=0,_,z){super(X,Y,Z,$,G,_,z);this.relations=$,this.schema=G,this.nestedIndex=H}rollback(){throw new TZ}};var XY=class extends lX{static[J]="SQLiteBunSession";logger;constructor(X,Y,Z,$,G={}){super(Y);this.client=X,this.relations=Z,this.schema=$,this.logger=G.logger??new OY}exec(X){this.client.exec(X)}prepareQuery(X,Y,Z,$,G){return new eX(this.client.prepare(X.sql),X,this.logger,Y,Z,$,G)}prepareRelationalQuery(X,Y,Z,$){return new eX(this.client.prepare(X.sql),X,this.logger,Y,Z,!1,$,!0)}transaction(X,Y={}){let Z=new iZ("sync",this.dialect,this,this.relations,this.schema),$;return this.client.transaction(()=>{$=X(Z)})[Y.behavior??"deferred"](),$}},iZ=class X extends aX{static[J]="SQLiteBunTransaction";transaction(Y){let Z=`sp${this.nestedIndex}`,$=new X("sync",this.dialect,this.session,this.relations,this.schema,this.nestedIndex+1);this.session.run(W.raw(`savepoint ${Z}`));try{let G=Y($);return this.session.run(W.raw(`release savepoint ${Z}`)),G}catch(G){throw this.session.run(W.raw(`rollback to savepoint ${Z}`)),G}}},eX=class extends iX{static[J]="SQLiteBunPreparedQuery";constructor(X,Y,Z,$,G,H,_,z){super("sync",G,Y);this.stmt=X,this.logger=Z,this.fields=$,this._isResponseInArrayMode=H,this.customResultMapper=_,this.isRqbV2Query=z}run(X){let Y=D1(this.query.params,X??{});return this.logger.logQuery(this.query.sql,Y),this.stmt.run(...Y)}all(X){if(this.isRqbV2Query)return this.allRqbV2(X);let{fields:Y,query:Z,logger:$,joinsNotNullableMap:G,stmt:H,customResultMapper:_}=this;if(!Y&&!_){let O=D1(Z.params,X??{});return $.logQuery(Z.sql,O),H.all(...O)}let z=this.values(X);if(_)return _(z);return z.map((O)=>BX(Y,O,G))}get(X){if(this.isRqbV2Query)return this.getRqbV2(X);let Y=D1(this.query.params,X??{});this.logger.logQuery(this.query.sql,Y);let{fields:Z,joinsNotNullableMap:$,customResultMapper:G}=this;if(!Z&&!G){let _=this.stmt.get(...Y);if(!_)return;return _}let H=this.stmt.values(...Y)[0];if(!H)return;if(G)return G([H]);return BX(Z,H,$)}allRqbV2(X){let{query:Y,logger:Z,stmt:$,customResultMapper:G}=this,H=D1(Y.params,X??{});return Z.logQuery(Y.sql,H),G($.all(...H))}getRqbV2(X){let Y=D1(this.query.params,X??{});this.logger.logQuery(this.query.sql,Y);let{stmt:Z,customResultMapper:$}=this,G=Z.get(...Y);if(!G)return;return $([G])}values(X){let Y=D1(this.query.params,X??{});return this.logger.logQuery(this.query.sql,Y),this.stmt.values(...Y)}isResponseInArrayMode(){return this._isResponseInArrayMode}};import{Database as RX}from"bun:sqlite";var lZ=class extends NX{static[J]="SQLiteBunDatabase"};function ZX(X,Y={}){let Z=new xX({casing:Y.casing}),$;if(Y.logger===!0)$=new DY;else if(Y.logger!==!1)$=Y.logger;let G;if(Y.schema){let z=RZ(Y.schema,QZ);G={fullSchema:Y.schema,schema:z.tables,tableNamesMap:z.tableNamesMap}}let H=Y.relations??{},_=new lZ("sync",Z,new XY(X,Z,H,G,{logger:$}),H,G);return _.$client=X,_}function YY(...X){if(X[0]===void 0||typeof X[0]==="string")return ZX(X[0]===void 0?new RX:new RX(X[0]),X[1]);let{connection:Y,client:Z,...$}=X[0];if(Z)return ZX(Z,$);if(typeof Y==="object"){let{source:G,...H}=Y;return ZX(new RX(G,Object.values(H).filter((_)=>_!==void 0).length?H:void 0),$)}return ZX(new RX(Y),$)}(function(X){function Y(Z){return ZX({},Z)}X.mock=Y})(YY||(YY={}));export{D as ym,N as zm,E0 as Am,Y0 as Bm,E1 as Cm,h as Dm,x as Em,S1 as Fm,$0 as Gm,PX as Hm,C1 as Im,LX as Jm,G0 as Km,g as Lm,W0 as Mm,W as Nm,l as Om,J0 as Pm,D1 as Qm,y as Rm,H0 as Sm,_0 as Tm,TX as Um,SX as Vm,D0 as Wm,j0 as Xm,T0 as Ym,q as Zm,a as _m,h1 as $m,m as an,V1 as bn,I1 as cn,p1 as dn,y1 as en,f1 as fn,b1 as gn,d1 as hn,g1 as in,m1 as jn,c1 as kn,k1 as ln,N1 as mn,u1 as nn,r1 as on,o1 as pn,s1 as qn,t1 as rn,n1 as sn,qX as tn,vX as un,hX as vn,M1 as wn,i1 as xn,_J as yn,XY as zn,iZ as An,eX as Bn,lZ as Cn,YY as Dn};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$x as fW,$y as z,$z as uc,Av as q,Ax as a$,Ay as x$,Az as i,Bv as jx,Bx as n$,By as $$,Bz as gc,Cx as i$,Cy as c$,Dv as g,Dw as UA,Dx as t$,Dy as W$,Ev as y,Ew as TA,Ex as s$,Ey as Bc,Fv as gW,Fw as Q$,Fx as Ac,Fy as FW,Gw as Y$,Gx as xc,Gy as Pc,Hv as yW,Hw as O$,Hx as $c,Hy as Lc,Iv as Ux,Iw as J$,Ix as cc,Iy as Ec,Jw as X$,Jx as Wc,Jy as Dc,Kv as Tx,Kw as G$,Kx as _c,Ky as Nc,Lw as M$,Lx as qc,Ly as Sc,Mv as vx,Mw as w$,Mx as Hc,My as jW,Mz as yc,Nw as z$,Nx as Qc,Ny as Cc,Ov as gx,Ow as K$,Ox as Yc,Oy as hW,Pw as B$,Px as Oc,Py as Vc,Qv as yx,Qw as P$,Qx as Jc,Qy as Rc,Rw as ix,Rx as Xc,Ry as Ic,Sv as Zx,Sw as tx,Sx as Gc,Sy as kc,Tw as sx,Tx as Mc,Ty as bc,Uv as ox,Uw as A$,Ux as wc,Uy as Fc,Vw as L$,Vx as zc,Vy as jc,Wv as ux,Ww as E$,Wx as ZW,Wy as hc,Xw as D$,Xx as oW,Xy as Uc,Yv as lx,Yw as N$,Yx as uW,Yy as Tc,Zx as lW,Zy as UW,Zz as Zc,_v as fx,_w as S$,_y as vc,_z as oc,aw as mx,ax as C$,ay as P,az as G,bA as lc,bx as V$,by as Kc,bz as K,cA as F,cw as rx,cy as bW,cz as X,dx as R$,dy as vA,dz as px,eA as rW,ew as L,ex as I$,ey as cA,ez as ex,fw as H$,fx as k$,fy as gA,fz as dx,gA as w,gx as b$,gy as yA,gz as ax,hx as F$,hy as ZA,hz as D,ix as j$,iy as oA,iz as V,jx as h$,jy as QA,jz as N,kx as U$,ky as uA,kz as Z,lx as T$,ly as lA,lz as R,mx as v$,my as fA,mz as B,nx as g$,ny as mA,nz as I,ox as y$,oy as rA,oz as o,px as Z$,py as pA,pz as u,qx as o$,qy as eA,qz as l,rv as TW,rx as u$,ry as dA,rz as f,sv as W,sx as l$,sy as aA,sz as m,tv as vW,ty as nA,tz as r,ux as f$,uy as iA,uz as nx,vv as q$,vx as m$,vy as tA,vz as p,wx as r$,wy as sA,wz as e,xv as E,xx as p$,xy as Ax,xz as d,yv as MA,yx as e$,yy as xx,yz as a,zv as b,zx as d$,zy as mW,zz as n}from"./chunk-t12xrrfr.js";import{bQ as RA}from"./chunk-aztre27e.js";var hx=(A,x)=>{jx.init(A,x),A.name="ZodError",Object.defineProperties(A,{format:{value:($)=>y(A,$)},flatten:{value:($)=>g(A,$)},addIssue:{value:($)=>{A.issues.push($),A.message=JSON.stringify(A.issues,MA,2)}},addIssues:{value:($)=>{A.issues.push(...$),A.message=JSON.stringify(A.issues,MA,2)}},isEmpty:{get(){return A.issues.length===0}}})},pW=W("ZodError",hx),O=W("ZodError",hx,{Parent:Error});var wA=Ux(O),zA=Tx(O),KA=vx(O),BA=gx(O),PA=yx(O),LA=Zx(O),EA=ox(O),DA=ux(O),NA=lx(O),SA=fx(O),CA=mx(O),VA=rx(O);var Xq={};RA(Xq,{xid:()=>Q_,void:()=>j_,uuidv7:()=>A_,uuidv6:()=>sW,uuidv4:()=>tW,uuid:()=>iW,util:()=>q,url:()=>x_,uppercase:()=>l,unknown:()=>S,union:()=>Dx,undefined:()=>b_,ulid:()=>H_,uint64:()=>I_,uint32:()=>C_,tuple:()=>WW,trim:()=>a,treeifyError:()=>gW,transform:()=>Cx,toUpperCase:()=>i,toLowerCase:()=>n,toJSONSchema:()=>rW,templateLiteral:()=>a_,symbol:()=>k_,superRefine:()=>kW,success:()=>p_,stringbool:()=>xq,stringFormat:()=>B_,string:()=>jA,strictObject:()=>v_,startsWith:()=>m,size:()=>Z,setErrorMap:()=>_q,set:()=>u_,safeParseAsync:()=>BA,safeParse:()=>KA,safeEncodeAsync:()=>CA,safeEncode:()=>NA,safeDecodeAsync:()=>VA,safeDecode:()=>SA,registry:()=>fW,regexes:()=>L,regex:()=>o,refine:()=>IW,record:()=>_W,readonly:()=>DW,property:()=>nx,promise:()=>n_,prettifyError:()=>yW,preprocess:()=>cq,prefault:()=>wW,positive:()=>px,pipe:()=>HA,partialRecord:()=>Z_,parseAsync:()=>zA,parse:()=>wA,overwrite:()=>e,optional:()=>_A,object:()=>T_,number:()=>fc,nullish:()=>r_,nullable:()=>qA,null:()=>dc,normalize:()=>d,nonpositive:()=>dx,nonoptional:()=>zW,nonnegative:()=>ax,never:()=>Lx,negative:()=>ex,nativeEnum:()=>l_,nanoid:()=>W_,nan:()=>e_,multipleOf:()=>D,minSize:()=>N,minLength:()=>B,mime:()=>p,maxSize:()=>V,maxLength:()=>R,map:()=>o_,lte:()=>G,lt:()=>z,lowercase:()=>u,looseObject:()=>g_,locales:()=>oW,literal:()=>f_,length:()=>I,lazy:()=>CW,ksuid:()=>Y_,keyof:()=>U_,jwt:()=>K_,json:()=>$q,iso:()=>$A,ipv6:()=>J_,ipv4:()=>O_,intersection:()=>$W,int64:()=>R_,int32:()=>S_,int:()=>hA,instanceof:()=>Aq,includes:()=>f,httpUrl:()=>$_,hostname:()=>P_,hex:()=>L_,hash:()=>E_,guid:()=>nW,gte:()=>X,gt:()=>K,globalRegistry:()=>P,getErrorMap:()=>qq,function:()=>i_,formatError:()=>y,float64:()=>N_,float32:()=>D_,flattenError:()=>g,file:()=>m_,enum:()=>Sx,endsWith:()=>r,encodeAsync:()=>EA,encode:()=>PA,emoji:()=>c_,email:()=>aW,e164:()=>z_,discriminatedUnion:()=>y_,decodeAsync:()=>DA,decode:()=>LA,date:()=>h_,custom:()=>s_,cuid2:()=>q_,cuid:()=>__,core:()=>w,config:()=>E,coerce:()=>Fx,codec:()=>d_,clone:()=>b,cidrv6:()=>G_,cidrv4:()=>X_,check:()=>t_,catch:()=>PW,boolean:()=>mc,bigint:()=>V_,base64url:()=>w_,base64:()=>M_,array:()=>JA,any:()=>F_,_function:()=>i_,_default:()=>GW,_ZodString:()=>$x,ZodXID:()=>Yx,ZodVoid:()=>tc,ZodUnknown:()=>nc,ZodUnion:()=>Ex,ZodUndefined:()=>pc,ZodUUID:()=>M,ZodURL:()=>YA,ZodULID:()=>Qx,ZodType:()=>H,ZodTuple:()=>cW,ZodTransform:()=>OW,ZodTemplateLiteral:()=>NW,ZodSymbol:()=>rc,ZodSuccess:()=>KW,ZodStringFormat:()=>Q,ZodString:()=>j,ZodSet:()=>HW,ZodRecord:()=>Nx,ZodRealError:()=>O,ZodReadonly:()=>EW,ZodPromise:()=>VW,ZodPrefault:()=>MW,ZodPipe:()=>Ix,ZodOptional:()=>Vx,ZodObject:()=>XA,ZodNumberFormat:()=>C,ZodNumber:()=>U,ZodNullable:()=>JW,ZodNull:()=>ec,ZodNonOptional:()=>Rx,ZodNever:()=>ic,ZodNanoID:()=>_x,ZodNaN:()=>LW,ZodMap:()=>qW,ZodLiteral:()=>QW,ZodLazy:()=>SW,ZodKSUID:()=>Ox,ZodJWT:()=>Bx,ZodIssueCode:()=>Wq,ZodIntersection:()=>xW,ZodISOTime:()=>AA,ZodISODuration:()=>xA,ZodISODateTime:()=>t,ZodISODate:()=>s,ZodIPv6:()=>Xx,ZodIPv4:()=>Jx,ZodGUID:()=>WA,ZodFunction:()=>RW,ZodFirstPartyTypeKind:()=>bx,ZodFile:()=>YW,ZodError:()=>pW,ZodEnum:()=>k,ZodEmoji:()=>Wx,ZodEmail:()=>cx,ZodE164:()=>Kx,ZodDiscriminatedUnion:()=>AW,ZodDefault:()=>XW,ZodDate:()=>OA,ZodCustomStringFormat:()=>h,ZodCustom:()=>GA,ZodCodec:()=>kx,ZodCatch:()=>BW,ZodCUID2:()=>Hx,ZodCUID:()=>qx,ZodCIDRv6:()=>Mx,ZodCIDRv4:()=>Gx,ZodBoolean:()=>T,ZodBigIntFormat:()=>Px,ZodBigInt:()=>v,ZodBase64URL:()=>zx,ZodBase64:()=>wx,ZodArray:()=>sc,ZodAny:()=>ac,TimePrecision:()=>mW,NEVER:()=>TW,$output:()=>uW,$input:()=>lW,$brand:()=>vW});var $A={};RA($A,{time:()=>bA,duration:()=>FA,datetime:()=>IA,date:()=>kA,ZodISOTime:()=>AA,ZodISODuration:()=>xA,ZodISODateTime:()=>t,ZodISODate:()=>s});var t=W("ZodISODateTime",(A,x)=>{ix.init(A,x),Q.init(A,x)});function IA(A){return x$(t,A)}var s=W("ZodISODate",(A,x)=>{tx.init(A,x),Q.init(A,x)});function kA(A){return $$(s,A)}var AA=W("ZodISOTime",(A,x)=>{sx.init(A,x),Q.init(A,x)});function bA(A){return c$(AA,A)}var xA=W("ZodISODuration",(A,x)=>{A$.init(A,x),Q.init(A,x)});function FA(A){return W$(xA,A)}var H=W("ZodType",(A,x)=>{return UA.init(A,x),A.def=x,A.type=x.type,Object.defineProperty(A,"_def",{value:x}),A.check=(...$)=>{return A.clone({...x,checks:[...x.checks??[],...$.map((c)=>typeof c==="function"?{_zod:{check:c,def:{check:"custom"},onattach:[]}}:c)]})},A.clone=($,c)=>b(A,$,c),A.brand=()=>A,A.register=($,c)=>{return $.add(A,c),A},A.parse=($,c)=>wA(A,$,c,{callee:A.parse}),A.safeParse=($,c)=>KA(A,$,c),A.parseAsync=async($,c)=>zA(A,$,c,{callee:A.parseAsync}),A.safeParseAsync=async($,c)=>BA(A,$,c),A.spa=A.safeParseAsync,A.encode=($,c)=>PA(A,$,c),A.decode=($,c)=>LA(A,$,c),A.encodeAsync=async($,c)=>EA(A,$,c),A.decodeAsync=async($,c)=>DA(A,$,c),A.safeEncode=($,c)=>NA(A,$,c),A.safeDecode=($,c)=>SA(A,$,c),A.safeEncodeAsync=async($,c)=>CA(A,$,c),A.safeDecodeAsync=async($,c)=>VA(A,$,c),A.refine=($,c)=>A.check(IW($,c)),A.superRefine=($)=>A.check(kW($)),A.overwrite=($)=>A.check(e($)),A.optional=()=>_A(A),A.nullable=()=>qA(A),A.nullish=()=>_A(qA(A)),A.nonoptional=($)=>zW(A,$),A.array=()=>JA(A),A.or=($)=>Dx([A,$]),A.and=($)=>$W(A,$),A.transform=($)=>HA(A,Cx($)),A.default=($)=>GW(A,$),A.prefault=($)=>wW(A,$),A.catch=($)=>PW(A,$),A.pipe=($)=>HA(A,$),A.readonly=()=>DW(A),A.describe=($)=>{let c=A.clone();return P.add(c,{description:$}),c},Object.defineProperty(A,"description",{get(){return P.get(A)?.description},configurable:!0}),A.meta=(...$)=>{if($.length===0)return P.get(A);let c=A.clone();return P.add(c,$[0]),c},A.isOptional=()=>A.safeParse(void 0).success,A.isNullable=()=>A.safeParse(null).success,A}),$x=W("_ZodString",(A,x)=>{TA.init(A,x),H.init(A,x);let $=A._zod.bag;A.format=$.format??null,A.minLength=$.minimum??null,A.maxLength=$.maximum??null,A.regex=(...c)=>A.check(o(...c)),A.includes=(...c)=>A.check(f(...c)),A.startsWith=(...c)=>A.check(m(...c)),A.endsWith=(...c)=>A.check(r(...c)),A.min=(...c)=>A.check(B(...c)),A.max=(...c)=>A.check(R(...c)),A.length=(...c)=>A.check(I(...c)),A.nonempty=(...c)=>A.check(B(1,...c)),A.lowercase=(c)=>A.check(u(c)),A.uppercase=(c)=>A.check(l(c)),A.trim=()=>A.check(a()),A.normalize=(...c)=>A.check(d(...c)),A.toLowerCase=()=>A.check(n()),A.toUpperCase=()=>A.check(i())}),j=W("ZodString",(A,x)=>{TA.init(A,x),$x.init(A,x),A.email=($)=>A.check(vA(cx,$)),A.url=($)=>A.check(QA(YA,$)),A.jwt=($)=>A.check(xx(Bx,$)),A.emoji=($)=>A.check(uA(Wx,$)),A.guid=($)=>A.check(cA(WA,$)),A.uuid=($)=>A.check(gA(M,$)),A.uuidv4=($)=>A.check(yA(M,$)),A.uuidv6=($)=>A.check(ZA(M,$)),A.uuidv7=($)=>A.check(oA(M,$)),A.nanoid=($)=>A.check(lA(_x,$)),A.guid=($)=>A.check(cA(WA,$)),A.cuid=($)=>A.check(fA(qx,$)),A.cuid2=($)=>A.check(mA(Hx,$)),A.ulid=($)=>A.check(rA(Qx,$)),A.base64=($)=>A.check(tA(wx,$)),A.base64url=($)=>A.check(sA(zx,$)),A.xid=($)=>A.check(pA(Yx,$)),A.ksuid=($)=>A.check(eA(Ox,$)),A.ipv4=($)=>A.check(dA(Jx,$)),A.ipv6=($)=>A.check(aA(Xx,$)),A.cidrv4=($)=>A.check(nA(Gx,$)),A.cidrv6=($)=>A.check(iA(Mx,$)),A.e164=($)=>A.check(Ax(Kx,$)),A.datetime=($)=>A.check(IA($)),A.date=($)=>A.check(kA($)),A.time=($)=>A.check(bA($)),A.duration=($)=>A.check(FA($))});function jA(A){return Kc(j,A)}var Q=W("ZodStringFormat",(A,x)=>{Q$.init(A,x),$x.init(A,x)}),cx=W("ZodEmail",(A,x)=>{J$.init(A,x),Q.init(A,x)});function aW(A){return vA(cx,A)}var WA=W("ZodGUID",(A,x)=>{Y$.init(A,x),Q.init(A,x)});function nW(A){return cA(WA,A)}var M=W("ZodUUID",(A,x)=>{O$.init(A,x),Q.init(A,x)});function iW(A){return gA(M,A)}function tW(A){return yA(M,A)}function sW(A){return ZA(M,A)}function A_(A){return oA(M,A)}var YA=W("ZodURL",(A,x)=>{X$.init(A,x),Q.init(A,x)});function x_(A){return QA(YA,A)}function $_(A){return QA(YA,{protocol:/^https?$/,hostname:L.domain,...q.normalizeParams(A)})}var Wx=W("ZodEmoji",(A,x)=>{G$.init(A,x),Q.init(A,x)});function c_(A){return uA(Wx,A)}var _x=W("ZodNanoID",(A,x)=>{M$.init(A,x),Q.init(A,x)});function W_(A){return lA(_x,A)}var qx=W("ZodCUID",(A,x)=>{w$.init(A,x),Q.init(A,x)});function __(A){return fA(qx,A)}var Hx=W("ZodCUID2",(A,x)=>{z$.init(A,x),Q.init(A,x)});function q_(A){return mA(Hx,A)}var Qx=W("ZodULID",(A,x)=>{K$.init(A,x),Q.init(A,x)});function H_(A){return rA(Qx,A)}var Yx=W("ZodXID",(A,x)=>{B$.init(A,x),Q.init(A,x)});function Q_(A){return pA(Yx,A)}var Ox=W("ZodKSUID",(A,x)=>{P$.init(A,x),Q.init(A,x)});function Y_(A){return eA(Ox,A)}var Jx=W("ZodIPv4",(A,x)=>{L$.init(A,x),Q.init(A,x)});function O_(A){return dA(Jx,A)}var Xx=W("ZodIPv6",(A,x)=>{E$.init(A,x),Q.init(A,x)});function J_(A){return aA(Xx,A)}var Gx=W("ZodCIDRv4",(A,x)=>{D$.init(A,x),Q.init(A,x)});function X_(A){return nA(Gx,A)}var Mx=W("ZodCIDRv6",(A,x)=>{N$.init(A,x),Q.init(A,x)});function G_(A){return iA(Mx,A)}var wx=W("ZodBase64",(A,x)=>{S$.init(A,x),Q.init(A,x)});function M_(A){return tA(wx,A)}var zx=W("ZodBase64URL",(A,x)=>{C$.init(A,x),Q.init(A,x)});function w_(A){return sA(zx,A)}var Kx=W("ZodE164",(A,x)=>{V$.init(A,x),Q.init(A,x)});function z_(A){return Ax(Kx,A)}var Bx=W("ZodJWT",(A,x)=>{R$.init(A,x),Q.init(A,x)});function K_(A){return xx(Bx,A)}var h=W("ZodCustomStringFormat",(A,x)=>{I$.init(A,x),Q.init(A,x)});function B_(A,x,$={}){return F(h,A,x,$)}function P_(A){return F(h,"hostname",L.hostname,A)}function L_(A){return F(h,"hex",L.hex,A)}function E_(A,x){let $=x?.enc??"hex",c=`${A}_${$}`,_=L[c];if(!_)throw Error(`Unrecognized hash format: ${c}`);return F(h,c,_,x)}var U=W("ZodNumber",(A,x)=>{k$.init(A,x),H.init(A,x),A.gt=(c,_)=>A.check(K(c,_)),A.gte=(c,_)=>A.check(X(c,_)),A.min=(c,_)=>A.check(X(c,_)),A.lt=(c,_)=>A.check(z(c,_)),A.lte=(c,_)=>A.check(G(c,_)),A.max=(c,_)=>A.check(G(c,_)),A.int=(c)=>A.check(hA(c)),A.safe=(c)=>A.check(hA(c)),A.positive=(c)=>A.check(K(0,c)),A.nonnegative=(c)=>A.check(X(0,c)),A.negative=(c)=>A.check(z(0,c)),A.nonpositive=(c)=>A.check(G(0,c)),A.multipleOf=(c,_)=>A.check(D(c,_)),A.step=(c,_)=>A.check(D(c,_)),A.finite=()=>A;let $=A._zod.bag;A.minValue=Math.max($.minimum??Number.NEGATIVE_INFINITY,$.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,A.maxValue=Math.min($.maximum??Number.POSITIVE_INFINITY,$.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,A.isInt=($.format??"").includes("int")||Number.isSafeInteger($.multipleOf??0.5),A.isFinite=!0,A.format=$.format??null});function fc(A){return Bc(U,A)}var C=W("ZodNumberFormat",(A,x)=>{b$.init(A,x),U.init(A,x)});function hA(A){return Pc(C,A)}function D_(A){return Lc(C,A)}function N_(A){return Ec(C,A)}function S_(A){return Dc(C,A)}function C_(A){return Nc(C,A)}var T=W("ZodBoolean",(A,x)=>{F$.init(A,x),H.init(A,x)});function mc(A){return Sc(T,A)}var v=W("ZodBigInt",(A,x)=>{j$.init(A,x),H.init(A,x),A.gte=(c,_)=>A.check(X(c,_)),A.min=(c,_)=>A.check(X(c,_)),A.gt=(c,_)=>A.check(K(c,_)),A.gte=(c,_)=>A.check(X(c,_)),A.min=(c,_)=>A.check(X(c,_)),A.lt=(c,_)=>A.check(z(c,_)),A.lte=(c,_)=>A.check(G(c,_)),A.max=(c,_)=>A.check(G(c,_)),A.positive=(c)=>A.check(K(BigInt(0),c)),A.negative=(c)=>A.check(z(BigInt(0),c)),A.nonpositive=(c)=>A.check(G(BigInt(0),c)),A.nonnegative=(c)=>A.check(X(BigInt(0),c)),A.multipleOf=(c,_)=>A.check(D(c,_));let $=A._zod.bag;A.minValue=$.minimum??null,A.maxValue=$.maximum??null,A.format=$.format??null});function V_(A){return Cc(v,A)}var Px=W("ZodBigIntFormat",(A,x)=>{h$.init(A,x),v.init(A,x)});function R_(A){return Vc(Px,A)}function I_(A){return Rc(Px,A)}var rc=W("ZodSymbol",(A,x)=>{U$.init(A,x),H.init(A,x)});function k_(A){return Ic(rc,A)}var pc=W("ZodUndefined",(A,x)=>{T$.init(A,x),H.init(A,x)});function b_(A){return kc(pc,A)}var ec=W("ZodNull",(A,x)=>{v$.init(A,x),H.init(A,x)});function dc(A){return bc(ec,A)}var ac=W("ZodAny",(A,x)=>{g$.init(A,x),H.init(A,x)});function F_(){return Fc(ac)}var nc=W("ZodUnknown",(A,x)=>{y$.init(A,x),H.init(A,x)});function S(){return jc(nc)}var ic=W("ZodNever",(A,x)=>{Z$.init(A,x),H.init(A,x)});function Lx(A){return hc(ic,A)}var tc=W("ZodVoid",(A,x)=>{o$.init(A,x),H.init(A,x)});function j_(A){return Uc(tc,A)}var OA=W("ZodDate",(A,x)=>{u$.init(A,x),H.init(A,x),A.min=(c,_)=>A.check(X(c,_)),A.max=(c,_)=>A.check(G(c,_));let $=A._zod.bag;A.minDate=$.minimum?new Date($.minimum):null,A.maxDate=$.maximum?new Date($.maximum):null});function h_(A){return Tc(OA,A)}var sc=W("ZodArray",(A,x)=>{l$.init(A,x),H.init(A,x),A.element=x.element,A.min=($,c)=>A.check(B($,c)),A.nonempty=($)=>A.check(B(1,$)),A.max=($,c)=>A.check(R($,c)),A.length=($,c)=>A.check(I($,c)),A.unwrap=()=>A.element});function JA(A,x){return gc(sc,A,x)}function U_(A){let x=A._zod.def.shape;return Sx(Object.keys(x))}var XA=W("ZodObject",(A,x)=>{f$.init(A,x),H.init(A,x),q.defineLazy(A,"shape",()=>x.shape),A.keyof=()=>Sx(Object.keys(A._zod.def.shape)),A.catchall=($)=>A.clone({...A._zod.def,catchall:$}),A.passthrough=()=>A.clone({...A._zod.def,catchall:S()}),A.loose=()=>A.clone({...A._zod.def,catchall:S()}),A.strict=()=>A.clone({...A._zod.def,catchall:Lx()}),A.strip=()=>A.clone({...A._zod.def,catchall:void 0}),A.extend=($)=>{return q.extend(A,$)},A.safeExtend=($)=>{return q.safeExtend(A,$)},A.merge=($)=>q.merge(A,$),A.pick=($)=>q.pick(A,$),A.omit=($)=>q.omit(A,$),A.partial=(...$)=>q.partial(Vx,A,$[0]),A.required=(...$)=>q.required(Rx,A,$[0])});function T_(A,x){let $={type:"object",get shape(){return q.assignProp(this,"shape",A?q.objectClone(A):{}),this.shape},...q.normalizeParams(x)};return new XA($)}function v_(A,x){return new XA({type:"object",get shape(){return q.assignProp(this,"shape",q.objectClone(A)),this.shape},catchall:Lx(),...q.normalizeParams(x)})}function g_(A,x){return new XA({type:"object",get shape(){return q.assignProp(this,"shape",q.objectClone(A)),this.shape},catchall:S(),...q.normalizeParams(x)})}var Ex=W("ZodUnion",(A,x)=>{m$.init(A,x),H.init(A,x),A.options=x.options});function Dx(A,x){return new Ex({type:"union",options:A,...q.normalizeParams(x)})}var AW=W("ZodDiscriminatedUnion",(A,x)=>{Ex.init(A,x),r$.init(A,x)});function y_(A,x,$){return new AW({type:"union",options:x,discriminator:A,...q.normalizeParams($)})}var xW=W("ZodIntersection",(A,x)=>{p$.init(A,x),H.init(A,x)});function $W(A,x){return new xW({type:"intersection",left:A,right:x})}var cW=W("ZodTuple",(A,x)=>{e$.init(A,x),H.init(A,x),A.rest=($)=>A.clone({...A._zod.def,rest:$})});function WW(A,x,$){let c=x instanceof UA,_=c?$:x;return new cW({type:"tuple",items:A,rest:c?x:null,...q.normalizeParams(_)})}var Nx=W("ZodRecord",(A,x)=>{d$.init(A,x),H.init(A,x),A.keyType=x.keyType,A.valueType=x.valueType});function _W(A,x,$){return new Nx({type:"record",keyType:A,valueType:x,...q.normalizeParams($)})}function Z_(A,x,$){let c=b(A);return c._zod.values=void 0,new Nx({type:"record",keyType:c,valueType:x,...q.normalizeParams($)})}var qW=W("ZodMap",(A,x)=>{a$.init(A,x),H.init(A,x),A.keyType=x.keyType,A.valueType=x.valueType});function o_(A,x,$){return new qW({type:"map",keyType:A,valueType:x,...q.normalizeParams($)})}var HW=W("ZodSet",(A,x)=>{n$.init(A,x),H.init(A,x),A.min=(...$)=>A.check(N(...$)),A.nonempty=($)=>A.check(N(1,$)),A.max=(...$)=>A.check(V(...$)),A.size=(...$)=>A.check(Z(...$))});function u_(A,x){return new HW({type:"set",valueType:A,...q.normalizeParams(x)})}var k=W("ZodEnum",(A,x)=>{i$.init(A,x),H.init(A,x),A.enum=x.entries,A.options=Object.values(x.entries);let $=new Set(Object.keys(x.entries));A.extract=(c,_)=>{let J={};for(let Y of c)if($.has(Y))J[Y]=x.entries[Y];else throw Error(`Key ${Y} not found in enum`);return new k({...x,checks:[],...q.normalizeParams(_),entries:J})},A.exclude=(c,_)=>{let J={...x.entries};for(let Y of c)if($.has(Y))delete J[Y];else throw Error(`Key ${Y} not found in enum`);return new k({...x,checks:[],...q.normalizeParams(_),entries:J})}});function Sx(A,x){let $=Array.isArray(A)?Object.fromEntries(A.map((c)=>[c,c])):A;return new k({type:"enum",entries:$,...q.normalizeParams(x)})}function l_(A,x){return new k({type:"enum",entries:A,...q.normalizeParams(x)})}var QW=W("ZodLiteral",(A,x)=>{t$.init(A,x),H.init(A,x),A.values=new Set(x.values),Object.defineProperty(A,"value",{get(){if(x.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return x.values[0]}})});function f_(A,x){return new QW({type:"literal",values:Array.isArray(A)?A:[A],...q.normalizeParams(x)})}var YW=W("ZodFile",(A,x)=>{s$.init(A,x),H.init(A,x),A.min=($,c)=>A.check(N($,c)),A.max=($,c)=>A.check(V($,c)),A.mime=($,c)=>A.check(p(Array.isArray($)?$:[$],c))});function m_(A){return yc(YW,A)}var OW=W("ZodTransform",(A,x)=>{Ac.init(A,x),H.init(A,x),A._zod.parse=($,c)=>{if(c.direction==="backward")throw new q$(A.constructor.name);$.addIssue=(J)=>{if(typeof J==="string")$.issues.push(q.issue(J,$.value,x));else{let Y=J;if(Y.fatal)Y.continue=!1;Y.code??(Y.code="custom"),Y.input??(Y.input=$.value),Y.inst??(Y.inst=A),$.issues.push(q.issue(Y))}};let _=x.transform($.value,$);if(_ instanceof Promise)return _.then((J)=>{return $.value=J,$});return $.value=_,$}});function Cx(A){return new OW({type:"transform",transform:A})}var Vx=W("ZodOptional",(A,x)=>{xc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function _A(A){return new Vx({type:"optional",innerType:A})}var JW=W("ZodNullable",(A,x)=>{$c.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function qA(A){return new JW({type:"nullable",innerType:A})}function r_(A){return _A(qA(A))}var XW=W("ZodDefault",(A,x)=>{cc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType,A.removeDefault=A.unwrap});function GW(A,x){return new XW({type:"default",innerType:A,get defaultValue(){return typeof x==="function"?x():q.shallowClone(x)}})}var MW=W("ZodPrefault",(A,x)=>{Wc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function wW(A,x){return new MW({type:"prefault",innerType:A,get defaultValue(){return typeof x==="function"?x():q.shallowClone(x)}})}var Rx=W("ZodNonOptional",(A,x)=>{_c.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function zW(A,x){return new Rx({type:"nonoptional",innerType:A,...q.normalizeParams(x)})}var KW=W("ZodSuccess",(A,x)=>{qc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function p_(A){return new KW({type:"success",innerType:A})}var BW=W("ZodCatch",(A,x)=>{Hc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType,A.removeCatch=A.unwrap});function PW(A,x){return new BW({type:"catch",innerType:A,catchValue:typeof x==="function"?x:()=>x})}var LW=W("ZodNaN",(A,x)=>{Qc.init(A,x),H.init(A,x)});function e_(A){return vc(LW,A)}var Ix=W("ZodPipe",(A,x)=>{Yc.init(A,x),H.init(A,x),A.in=x.in,A.out=x.out});function HA(A,x){return new Ix({type:"pipe",in:A,out:x})}var kx=W("ZodCodec",(A,x)=>{Ix.init(A,x),Oc.init(A,x)});function d_(A,x,$){return new kx({type:"pipe",in:A,out:x,transform:$.decode,reverseTransform:$.encode})}var EW=W("ZodReadonly",(A,x)=>{Jc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function DW(A){return new EW({type:"readonly",innerType:A})}var NW=W("ZodTemplateLiteral",(A,x)=>{Xc.init(A,x),H.init(A,x)});function a_(A,x){return new NW({type:"template_literal",parts:A,...q.normalizeParams(x)})}var SW=W("ZodLazy",(A,x)=>{wc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.getter()});function CW(A){return new SW({type:"lazy",getter:A})}var VW=W("ZodPromise",(A,x)=>{Mc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function n_(A){return new VW({type:"promise",innerType:A})}var RW=W("ZodFunction",(A,x)=>{Gc.init(A,x),H.init(A,x)});function i_(A){return new RW({type:"function",input:Array.isArray(A?.input)?WW(A?.input):A?.input??JA(S()),output:A?.output??S()})}var GA=W("ZodCustom",(A,x)=>{zc.init(A,x),H.init(A,x)});function t_(A){let x=new H$({check:"custom"});return x._zod.check=A,x}function s_(A,x){return Zc(GA,A??(()=>!0),x)}function IW(A,x={}){return oc(GA,A,x)}function kW(A){return uc(A)}function Aq(A,x={error:`Input not instance of ${A.name}`}){let $=new GA({type:"custom",check:"custom",fn:(c)=>c instanceof A,abort:!0,...q.normalizeParams(x)});return $._zod.bag.Class=A,$}var xq=(...A)=>lc({Codec:kx,Boolean:T,String:j},...A);function $q(A){let x=CW(()=>{return Dx([jA(A),fc(),mc(),dc(),JA(x),_W(jA(),x)])});return x}function cq(A,x){return HA(Cx(A),x)}var Wq={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function _q(A){E({customError:A})}function qq(){return E().customError}var bx;(function(A){})(bx||(bx={}));var Fx={};RA(Fx,{string:()=>Hq,number:()=>Qq,date:()=>Jq,boolean:()=>Yq,bigint:()=>Oq});function Hq(A){return bW(j,A)}function Qq(A){return FW(U,A)}function Yq(A){return jW(T,A)}function Oq(A){return hW(v,A)}function Jq(A){return UW(OA,A)}E(ZW());
|
|
3
|
-
export{$A as
|
|
2
|
+
import{$t as b,$v as d$,$w as mW,$x as n,Au as fx,Av as S$,Ax as vc,Ay as oc,Bw as fW,Bx as z,By as uc,Cu as mx,Cv as C$,Cw as P,Cx as G,Dv as V$,Dw as Kc,Dx as K,Dy as lc,Eu as rx,Ew as bW,Ex as X,Ey as F,Fv as R$,Fw as vA,Fx as px,Gu as L,Gv as I$,Gw as cA,Gx as ex,Gy as rW,Hu as H$,Hv as k$,Hw as gA,Hx as dx,Iv as b$,Iw as yA,Ix as ax,Iy as w,Jv as F$,Jw as ZA,Jx as D,Kv as j$,Kw as oA,Kx as V,Lv as h$,Lw as QA,Lx as N,Mv as U$,Mw as uA,Mx as Z,Nv as T$,Nw as lA,Nx as R,Ov as v$,Ow as fA,Ox as B,Pv as g$,Pw as mA,Px as I,Qv as y$,Qw as rA,Qx as o,Rv as Z$,Rw as pA,Rx as u,Sv as o$,Sw as eA,Sx as l,Tt as TW,Tv as u$,Tw as dA,Tx as f,Ut as W,Uv as l$,Uw as aA,Ux as m,Vt as vW,Vw as nA,Vx as r,Wv as f$,Ww as iA,Wx as nx,Xt as q$,Xv as m$,Xw as tA,Xx as p,Yv as r$,Yw as sA,Yx as e,Zt as E,Zv as p$,Zw as Ax,Zx as d,_t as MA,_v as e$,_w as xx,_x as a,au as q,aw as a$,ax as x$,ay as i,bu as jx,bw as n$,bx as $$,by as gc,cw as i$,cx as c$,du as g,dv as UA,dw as t$,dx as W$,eu as y,ev as TA,ew as s$,ex as Bc,fu as gW,fv as Q$,fw as Ac,fx as FW,gv as Y$,gw as xc,gx as Pc,hu as yW,hv as O$,hw as $c,hx as Lc,iu as Ux,iv as J$,iw as cc,ix as Ec,jv as X$,jw as Wc,jx as Dc,ku as Tx,kv as G$,kw as _c,kx as Nc,lv as M$,lw as qc,lx as Sc,mu as vx,mv as w$,mw as Hc,mx as jW,my as yc,nv as z$,nw as Qc,nx as Cc,ou as gx,ov as K$,ow as Yc,ox as hW,pv as B$,pw as Oc,px as Vc,qu as yx,qv as P$,qw as Jc,qx as Rc,rv as ix,rw as Xc,rx as Ic,su as Zx,sv as tx,sw as Gc,sx as kc,tv as sx,tw as Mc,tx as bc,uu as ox,uv as A$,uw as wc,ux as Fc,vv as L$,vw as zc,vx as jc,wu as ux,wv as E$,ww as ZW,wx as hc,xv as D$,xw as oW,xx as Uc,yu as lx,yv as N$,yw as uW,yx as Tc,zw as lW,zx as UW,zy as Zc}from"./chunk-mzs2pjyc.js";import{DO as RA}from"./chunk-7xm75w1e.js";var hx=(A,x)=>{jx.init(A,x),A.name="ZodError",Object.defineProperties(A,{format:{value:($)=>y(A,$)},flatten:{value:($)=>g(A,$)},addIssue:{value:($)=>{A.issues.push($),A.message=JSON.stringify(A.issues,MA,2)}},addIssues:{value:($)=>{A.issues.push(...$),A.message=JSON.stringify(A.issues,MA,2)}},isEmpty:{get(){return A.issues.length===0}}})},pW=W("ZodError",hx),O=W("ZodError",hx,{Parent:Error});var wA=Ux(O),zA=Tx(O),KA=vx(O),BA=gx(O),PA=yx(O),LA=Zx(O),EA=ox(O),DA=ux(O),NA=lx(O),SA=fx(O),CA=mx(O),VA=rx(O);var Xq={};RA(Xq,{xid:()=>Q_,void:()=>j_,uuidv7:()=>A_,uuidv6:()=>sW,uuidv4:()=>tW,uuid:()=>iW,util:()=>q,url:()=>x_,uppercase:()=>l,unknown:()=>S,union:()=>Dx,undefined:()=>b_,ulid:()=>H_,uint64:()=>I_,uint32:()=>C_,tuple:()=>WW,trim:()=>a,treeifyError:()=>gW,transform:()=>Cx,toUpperCase:()=>i,toLowerCase:()=>n,toJSONSchema:()=>rW,templateLiteral:()=>a_,symbol:()=>k_,superRefine:()=>kW,success:()=>p_,stringbool:()=>xq,stringFormat:()=>B_,string:()=>jA,strictObject:()=>v_,startsWith:()=>m,size:()=>Z,setErrorMap:()=>_q,set:()=>u_,safeParseAsync:()=>BA,safeParse:()=>KA,safeEncodeAsync:()=>CA,safeEncode:()=>NA,safeDecodeAsync:()=>VA,safeDecode:()=>SA,registry:()=>fW,regexes:()=>L,regex:()=>o,refine:()=>IW,record:()=>_W,readonly:()=>DW,property:()=>nx,promise:()=>n_,prettifyError:()=>yW,preprocess:()=>cq,prefault:()=>wW,positive:()=>px,pipe:()=>HA,partialRecord:()=>Z_,parseAsync:()=>zA,parse:()=>wA,overwrite:()=>e,optional:()=>_A,object:()=>T_,number:()=>fc,nullish:()=>r_,nullable:()=>qA,null:()=>dc,normalize:()=>d,nonpositive:()=>dx,nonoptional:()=>zW,nonnegative:()=>ax,never:()=>Lx,negative:()=>ex,nativeEnum:()=>l_,nanoid:()=>W_,nan:()=>e_,multipleOf:()=>D,minSize:()=>N,minLength:()=>B,mime:()=>p,maxSize:()=>V,maxLength:()=>R,map:()=>o_,lte:()=>G,lt:()=>z,lowercase:()=>u,looseObject:()=>g_,locales:()=>oW,literal:()=>f_,length:()=>I,lazy:()=>CW,ksuid:()=>Y_,keyof:()=>U_,jwt:()=>K_,json:()=>$q,iso:()=>$A,ipv6:()=>J_,ipv4:()=>O_,intersection:()=>$W,int64:()=>R_,int32:()=>S_,int:()=>hA,instanceof:()=>Aq,includes:()=>f,httpUrl:()=>$_,hostname:()=>P_,hex:()=>L_,hash:()=>E_,guid:()=>nW,gte:()=>X,gt:()=>K,globalRegistry:()=>P,getErrorMap:()=>qq,function:()=>i_,formatError:()=>y,float64:()=>N_,float32:()=>D_,flattenError:()=>g,file:()=>m_,enum:()=>Sx,endsWith:()=>r,encodeAsync:()=>EA,encode:()=>PA,emoji:()=>c_,email:()=>aW,e164:()=>z_,discriminatedUnion:()=>y_,decodeAsync:()=>DA,decode:()=>LA,date:()=>h_,custom:()=>s_,cuid2:()=>q_,cuid:()=>__,core:()=>w,config:()=>E,coerce:()=>Fx,codec:()=>d_,clone:()=>b,cidrv6:()=>G_,cidrv4:()=>X_,check:()=>t_,catch:()=>PW,boolean:()=>mc,bigint:()=>V_,base64url:()=>w_,base64:()=>M_,array:()=>JA,any:()=>F_,_function:()=>i_,_default:()=>GW,_ZodString:()=>$x,ZodXID:()=>Yx,ZodVoid:()=>tc,ZodUnknown:()=>nc,ZodUnion:()=>Ex,ZodUndefined:()=>pc,ZodUUID:()=>M,ZodURL:()=>YA,ZodULID:()=>Qx,ZodType:()=>H,ZodTuple:()=>cW,ZodTransform:()=>OW,ZodTemplateLiteral:()=>NW,ZodSymbol:()=>rc,ZodSuccess:()=>KW,ZodStringFormat:()=>Q,ZodString:()=>j,ZodSet:()=>HW,ZodRecord:()=>Nx,ZodRealError:()=>O,ZodReadonly:()=>EW,ZodPromise:()=>VW,ZodPrefault:()=>MW,ZodPipe:()=>Ix,ZodOptional:()=>Vx,ZodObject:()=>XA,ZodNumberFormat:()=>C,ZodNumber:()=>U,ZodNullable:()=>JW,ZodNull:()=>ec,ZodNonOptional:()=>Rx,ZodNever:()=>ic,ZodNanoID:()=>_x,ZodNaN:()=>LW,ZodMap:()=>qW,ZodLiteral:()=>QW,ZodLazy:()=>SW,ZodKSUID:()=>Ox,ZodJWT:()=>Bx,ZodIssueCode:()=>Wq,ZodIntersection:()=>xW,ZodISOTime:()=>AA,ZodISODuration:()=>xA,ZodISODateTime:()=>t,ZodISODate:()=>s,ZodIPv6:()=>Xx,ZodIPv4:()=>Jx,ZodGUID:()=>WA,ZodFunction:()=>RW,ZodFirstPartyTypeKind:()=>bx,ZodFile:()=>YW,ZodError:()=>pW,ZodEnum:()=>k,ZodEmoji:()=>Wx,ZodEmail:()=>cx,ZodE164:()=>Kx,ZodDiscriminatedUnion:()=>AW,ZodDefault:()=>XW,ZodDate:()=>OA,ZodCustomStringFormat:()=>h,ZodCustom:()=>GA,ZodCodec:()=>kx,ZodCatch:()=>BW,ZodCUID2:()=>Hx,ZodCUID:()=>qx,ZodCIDRv6:()=>Mx,ZodCIDRv4:()=>Gx,ZodBoolean:()=>T,ZodBigIntFormat:()=>Px,ZodBigInt:()=>v,ZodBase64URL:()=>zx,ZodBase64:()=>wx,ZodArray:()=>sc,ZodAny:()=>ac,TimePrecision:()=>mW,NEVER:()=>TW,$output:()=>uW,$input:()=>lW,$brand:()=>vW});var $A={};RA($A,{time:()=>bA,duration:()=>FA,datetime:()=>IA,date:()=>kA,ZodISOTime:()=>AA,ZodISODuration:()=>xA,ZodISODateTime:()=>t,ZodISODate:()=>s});var t=W("ZodISODateTime",(A,x)=>{ix.init(A,x),Q.init(A,x)});function IA(A){return x$(t,A)}var s=W("ZodISODate",(A,x)=>{tx.init(A,x),Q.init(A,x)});function kA(A){return $$(s,A)}var AA=W("ZodISOTime",(A,x)=>{sx.init(A,x),Q.init(A,x)});function bA(A){return c$(AA,A)}var xA=W("ZodISODuration",(A,x)=>{A$.init(A,x),Q.init(A,x)});function FA(A){return W$(xA,A)}var H=W("ZodType",(A,x)=>{return UA.init(A,x),A.def=x,A.type=x.type,Object.defineProperty(A,"_def",{value:x}),A.check=(...$)=>{return A.clone({...x,checks:[...x.checks??[],...$.map((c)=>typeof c==="function"?{_zod:{check:c,def:{check:"custom"},onattach:[]}}:c)]})},A.clone=($,c)=>b(A,$,c),A.brand=()=>A,A.register=($,c)=>{return $.add(A,c),A},A.parse=($,c)=>wA(A,$,c,{callee:A.parse}),A.safeParse=($,c)=>KA(A,$,c),A.parseAsync=async($,c)=>zA(A,$,c,{callee:A.parseAsync}),A.safeParseAsync=async($,c)=>BA(A,$,c),A.spa=A.safeParseAsync,A.encode=($,c)=>PA(A,$,c),A.decode=($,c)=>LA(A,$,c),A.encodeAsync=async($,c)=>EA(A,$,c),A.decodeAsync=async($,c)=>DA(A,$,c),A.safeEncode=($,c)=>NA(A,$,c),A.safeDecode=($,c)=>SA(A,$,c),A.safeEncodeAsync=async($,c)=>CA(A,$,c),A.safeDecodeAsync=async($,c)=>VA(A,$,c),A.refine=($,c)=>A.check(IW($,c)),A.superRefine=($)=>A.check(kW($)),A.overwrite=($)=>A.check(e($)),A.optional=()=>_A(A),A.nullable=()=>qA(A),A.nullish=()=>_A(qA(A)),A.nonoptional=($)=>zW(A,$),A.array=()=>JA(A),A.or=($)=>Dx([A,$]),A.and=($)=>$W(A,$),A.transform=($)=>HA(A,Cx($)),A.default=($)=>GW(A,$),A.prefault=($)=>wW(A,$),A.catch=($)=>PW(A,$),A.pipe=($)=>HA(A,$),A.readonly=()=>DW(A),A.describe=($)=>{let c=A.clone();return P.add(c,{description:$}),c},Object.defineProperty(A,"description",{get(){return P.get(A)?.description},configurable:!0}),A.meta=(...$)=>{if($.length===0)return P.get(A);let c=A.clone();return P.add(c,$[0]),c},A.isOptional=()=>A.safeParse(void 0).success,A.isNullable=()=>A.safeParse(null).success,A}),$x=W("_ZodString",(A,x)=>{TA.init(A,x),H.init(A,x);let $=A._zod.bag;A.format=$.format??null,A.minLength=$.minimum??null,A.maxLength=$.maximum??null,A.regex=(...c)=>A.check(o(...c)),A.includes=(...c)=>A.check(f(...c)),A.startsWith=(...c)=>A.check(m(...c)),A.endsWith=(...c)=>A.check(r(...c)),A.min=(...c)=>A.check(B(...c)),A.max=(...c)=>A.check(R(...c)),A.length=(...c)=>A.check(I(...c)),A.nonempty=(...c)=>A.check(B(1,...c)),A.lowercase=(c)=>A.check(u(c)),A.uppercase=(c)=>A.check(l(c)),A.trim=()=>A.check(a()),A.normalize=(...c)=>A.check(d(...c)),A.toLowerCase=()=>A.check(n()),A.toUpperCase=()=>A.check(i())}),j=W("ZodString",(A,x)=>{TA.init(A,x),$x.init(A,x),A.email=($)=>A.check(vA(cx,$)),A.url=($)=>A.check(QA(YA,$)),A.jwt=($)=>A.check(xx(Bx,$)),A.emoji=($)=>A.check(uA(Wx,$)),A.guid=($)=>A.check(cA(WA,$)),A.uuid=($)=>A.check(gA(M,$)),A.uuidv4=($)=>A.check(yA(M,$)),A.uuidv6=($)=>A.check(ZA(M,$)),A.uuidv7=($)=>A.check(oA(M,$)),A.nanoid=($)=>A.check(lA(_x,$)),A.guid=($)=>A.check(cA(WA,$)),A.cuid=($)=>A.check(fA(qx,$)),A.cuid2=($)=>A.check(mA(Hx,$)),A.ulid=($)=>A.check(rA(Qx,$)),A.base64=($)=>A.check(tA(wx,$)),A.base64url=($)=>A.check(sA(zx,$)),A.xid=($)=>A.check(pA(Yx,$)),A.ksuid=($)=>A.check(eA(Ox,$)),A.ipv4=($)=>A.check(dA(Jx,$)),A.ipv6=($)=>A.check(aA(Xx,$)),A.cidrv4=($)=>A.check(nA(Gx,$)),A.cidrv6=($)=>A.check(iA(Mx,$)),A.e164=($)=>A.check(Ax(Kx,$)),A.datetime=($)=>A.check(IA($)),A.date=($)=>A.check(kA($)),A.time=($)=>A.check(bA($)),A.duration=($)=>A.check(FA($))});function jA(A){return Kc(j,A)}var Q=W("ZodStringFormat",(A,x)=>{Q$.init(A,x),$x.init(A,x)}),cx=W("ZodEmail",(A,x)=>{J$.init(A,x),Q.init(A,x)});function aW(A){return vA(cx,A)}var WA=W("ZodGUID",(A,x)=>{Y$.init(A,x),Q.init(A,x)});function nW(A){return cA(WA,A)}var M=W("ZodUUID",(A,x)=>{O$.init(A,x),Q.init(A,x)});function iW(A){return gA(M,A)}function tW(A){return yA(M,A)}function sW(A){return ZA(M,A)}function A_(A){return oA(M,A)}var YA=W("ZodURL",(A,x)=>{X$.init(A,x),Q.init(A,x)});function x_(A){return QA(YA,A)}function $_(A){return QA(YA,{protocol:/^https?$/,hostname:L.domain,...q.normalizeParams(A)})}var Wx=W("ZodEmoji",(A,x)=>{G$.init(A,x),Q.init(A,x)});function c_(A){return uA(Wx,A)}var _x=W("ZodNanoID",(A,x)=>{M$.init(A,x),Q.init(A,x)});function W_(A){return lA(_x,A)}var qx=W("ZodCUID",(A,x)=>{w$.init(A,x),Q.init(A,x)});function __(A){return fA(qx,A)}var Hx=W("ZodCUID2",(A,x)=>{z$.init(A,x),Q.init(A,x)});function q_(A){return mA(Hx,A)}var Qx=W("ZodULID",(A,x)=>{K$.init(A,x),Q.init(A,x)});function H_(A){return rA(Qx,A)}var Yx=W("ZodXID",(A,x)=>{B$.init(A,x),Q.init(A,x)});function Q_(A){return pA(Yx,A)}var Ox=W("ZodKSUID",(A,x)=>{P$.init(A,x),Q.init(A,x)});function Y_(A){return eA(Ox,A)}var Jx=W("ZodIPv4",(A,x)=>{L$.init(A,x),Q.init(A,x)});function O_(A){return dA(Jx,A)}var Xx=W("ZodIPv6",(A,x)=>{E$.init(A,x),Q.init(A,x)});function J_(A){return aA(Xx,A)}var Gx=W("ZodCIDRv4",(A,x)=>{D$.init(A,x),Q.init(A,x)});function X_(A){return nA(Gx,A)}var Mx=W("ZodCIDRv6",(A,x)=>{N$.init(A,x),Q.init(A,x)});function G_(A){return iA(Mx,A)}var wx=W("ZodBase64",(A,x)=>{S$.init(A,x),Q.init(A,x)});function M_(A){return tA(wx,A)}var zx=W("ZodBase64URL",(A,x)=>{C$.init(A,x),Q.init(A,x)});function w_(A){return sA(zx,A)}var Kx=W("ZodE164",(A,x)=>{V$.init(A,x),Q.init(A,x)});function z_(A){return Ax(Kx,A)}var Bx=W("ZodJWT",(A,x)=>{R$.init(A,x),Q.init(A,x)});function K_(A){return xx(Bx,A)}var h=W("ZodCustomStringFormat",(A,x)=>{I$.init(A,x),Q.init(A,x)});function B_(A,x,$={}){return F(h,A,x,$)}function P_(A){return F(h,"hostname",L.hostname,A)}function L_(A){return F(h,"hex",L.hex,A)}function E_(A,x){let $=x?.enc??"hex",c=`${A}_${$}`,_=L[c];if(!_)throw Error(`Unrecognized hash format: ${c}`);return F(h,c,_,x)}var U=W("ZodNumber",(A,x)=>{k$.init(A,x),H.init(A,x),A.gt=(c,_)=>A.check(K(c,_)),A.gte=(c,_)=>A.check(X(c,_)),A.min=(c,_)=>A.check(X(c,_)),A.lt=(c,_)=>A.check(z(c,_)),A.lte=(c,_)=>A.check(G(c,_)),A.max=(c,_)=>A.check(G(c,_)),A.int=(c)=>A.check(hA(c)),A.safe=(c)=>A.check(hA(c)),A.positive=(c)=>A.check(K(0,c)),A.nonnegative=(c)=>A.check(X(0,c)),A.negative=(c)=>A.check(z(0,c)),A.nonpositive=(c)=>A.check(G(0,c)),A.multipleOf=(c,_)=>A.check(D(c,_)),A.step=(c,_)=>A.check(D(c,_)),A.finite=()=>A;let $=A._zod.bag;A.minValue=Math.max($.minimum??Number.NEGATIVE_INFINITY,$.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,A.maxValue=Math.min($.maximum??Number.POSITIVE_INFINITY,$.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,A.isInt=($.format??"").includes("int")||Number.isSafeInteger($.multipleOf??0.5),A.isFinite=!0,A.format=$.format??null});function fc(A){return Bc(U,A)}var C=W("ZodNumberFormat",(A,x)=>{b$.init(A,x),U.init(A,x)});function hA(A){return Pc(C,A)}function D_(A){return Lc(C,A)}function N_(A){return Ec(C,A)}function S_(A){return Dc(C,A)}function C_(A){return Nc(C,A)}var T=W("ZodBoolean",(A,x)=>{F$.init(A,x),H.init(A,x)});function mc(A){return Sc(T,A)}var v=W("ZodBigInt",(A,x)=>{j$.init(A,x),H.init(A,x),A.gte=(c,_)=>A.check(X(c,_)),A.min=(c,_)=>A.check(X(c,_)),A.gt=(c,_)=>A.check(K(c,_)),A.gte=(c,_)=>A.check(X(c,_)),A.min=(c,_)=>A.check(X(c,_)),A.lt=(c,_)=>A.check(z(c,_)),A.lte=(c,_)=>A.check(G(c,_)),A.max=(c,_)=>A.check(G(c,_)),A.positive=(c)=>A.check(K(BigInt(0),c)),A.negative=(c)=>A.check(z(BigInt(0),c)),A.nonpositive=(c)=>A.check(G(BigInt(0),c)),A.nonnegative=(c)=>A.check(X(BigInt(0),c)),A.multipleOf=(c,_)=>A.check(D(c,_));let $=A._zod.bag;A.minValue=$.minimum??null,A.maxValue=$.maximum??null,A.format=$.format??null});function V_(A){return Cc(v,A)}var Px=W("ZodBigIntFormat",(A,x)=>{h$.init(A,x),v.init(A,x)});function R_(A){return Vc(Px,A)}function I_(A){return Rc(Px,A)}var rc=W("ZodSymbol",(A,x)=>{U$.init(A,x),H.init(A,x)});function k_(A){return Ic(rc,A)}var pc=W("ZodUndefined",(A,x)=>{T$.init(A,x),H.init(A,x)});function b_(A){return kc(pc,A)}var ec=W("ZodNull",(A,x)=>{v$.init(A,x),H.init(A,x)});function dc(A){return bc(ec,A)}var ac=W("ZodAny",(A,x)=>{g$.init(A,x),H.init(A,x)});function F_(){return Fc(ac)}var nc=W("ZodUnknown",(A,x)=>{y$.init(A,x),H.init(A,x)});function S(){return jc(nc)}var ic=W("ZodNever",(A,x)=>{Z$.init(A,x),H.init(A,x)});function Lx(A){return hc(ic,A)}var tc=W("ZodVoid",(A,x)=>{o$.init(A,x),H.init(A,x)});function j_(A){return Uc(tc,A)}var OA=W("ZodDate",(A,x)=>{u$.init(A,x),H.init(A,x),A.min=(c,_)=>A.check(X(c,_)),A.max=(c,_)=>A.check(G(c,_));let $=A._zod.bag;A.minDate=$.minimum?new Date($.minimum):null,A.maxDate=$.maximum?new Date($.maximum):null});function h_(A){return Tc(OA,A)}var sc=W("ZodArray",(A,x)=>{l$.init(A,x),H.init(A,x),A.element=x.element,A.min=($,c)=>A.check(B($,c)),A.nonempty=($)=>A.check(B(1,$)),A.max=($,c)=>A.check(R($,c)),A.length=($,c)=>A.check(I($,c)),A.unwrap=()=>A.element});function JA(A,x){return gc(sc,A,x)}function U_(A){let x=A._zod.def.shape;return Sx(Object.keys(x))}var XA=W("ZodObject",(A,x)=>{f$.init(A,x),H.init(A,x),q.defineLazy(A,"shape",()=>x.shape),A.keyof=()=>Sx(Object.keys(A._zod.def.shape)),A.catchall=($)=>A.clone({...A._zod.def,catchall:$}),A.passthrough=()=>A.clone({...A._zod.def,catchall:S()}),A.loose=()=>A.clone({...A._zod.def,catchall:S()}),A.strict=()=>A.clone({...A._zod.def,catchall:Lx()}),A.strip=()=>A.clone({...A._zod.def,catchall:void 0}),A.extend=($)=>{return q.extend(A,$)},A.safeExtend=($)=>{return q.safeExtend(A,$)},A.merge=($)=>q.merge(A,$),A.pick=($)=>q.pick(A,$),A.omit=($)=>q.omit(A,$),A.partial=(...$)=>q.partial(Vx,A,$[0]),A.required=(...$)=>q.required(Rx,A,$[0])});function T_(A,x){let $={type:"object",get shape(){return q.assignProp(this,"shape",A?q.objectClone(A):{}),this.shape},...q.normalizeParams(x)};return new XA($)}function v_(A,x){return new XA({type:"object",get shape(){return q.assignProp(this,"shape",q.objectClone(A)),this.shape},catchall:Lx(),...q.normalizeParams(x)})}function g_(A,x){return new XA({type:"object",get shape(){return q.assignProp(this,"shape",q.objectClone(A)),this.shape},catchall:S(),...q.normalizeParams(x)})}var Ex=W("ZodUnion",(A,x)=>{m$.init(A,x),H.init(A,x),A.options=x.options});function Dx(A,x){return new Ex({type:"union",options:A,...q.normalizeParams(x)})}var AW=W("ZodDiscriminatedUnion",(A,x)=>{Ex.init(A,x),r$.init(A,x)});function y_(A,x,$){return new AW({type:"union",options:x,discriminator:A,...q.normalizeParams($)})}var xW=W("ZodIntersection",(A,x)=>{p$.init(A,x),H.init(A,x)});function $W(A,x){return new xW({type:"intersection",left:A,right:x})}var cW=W("ZodTuple",(A,x)=>{e$.init(A,x),H.init(A,x),A.rest=($)=>A.clone({...A._zod.def,rest:$})});function WW(A,x,$){let c=x instanceof UA,_=c?$:x;return new cW({type:"tuple",items:A,rest:c?x:null,...q.normalizeParams(_)})}var Nx=W("ZodRecord",(A,x)=>{d$.init(A,x),H.init(A,x),A.keyType=x.keyType,A.valueType=x.valueType});function _W(A,x,$){return new Nx({type:"record",keyType:A,valueType:x,...q.normalizeParams($)})}function Z_(A,x,$){let c=b(A);return c._zod.values=void 0,new Nx({type:"record",keyType:c,valueType:x,...q.normalizeParams($)})}var qW=W("ZodMap",(A,x)=>{a$.init(A,x),H.init(A,x),A.keyType=x.keyType,A.valueType=x.valueType});function o_(A,x,$){return new qW({type:"map",keyType:A,valueType:x,...q.normalizeParams($)})}var HW=W("ZodSet",(A,x)=>{n$.init(A,x),H.init(A,x),A.min=(...$)=>A.check(N(...$)),A.nonempty=($)=>A.check(N(1,$)),A.max=(...$)=>A.check(V(...$)),A.size=(...$)=>A.check(Z(...$))});function u_(A,x){return new HW({type:"set",valueType:A,...q.normalizeParams(x)})}var k=W("ZodEnum",(A,x)=>{i$.init(A,x),H.init(A,x),A.enum=x.entries,A.options=Object.values(x.entries);let $=new Set(Object.keys(x.entries));A.extract=(c,_)=>{let J={};for(let Y of c)if($.has(Y))J[Y]=x.entries[Y];else throw Error(`Key ${Y} not found in enum`);return new k({...x,checks:[],...q.normalizeParams(_),entries:J})},A.exclude=(c,_)=>{let J={...x.entries};for(let Y of c)if($.has(Y))delete J[Y];else throw Error(`Key ${Y} not found in enum`);return new k({...x,checks:[],...q.normalizeParams(_),entries:J})}});function Sx(A,x){let $=Array.isArray(A)?Object.fromEntries(A.map((c)=>[c,c])):A;return new k({type:"enum",entries:$,...q.normalizeParams(x)})}function l_(A,x){return new k({type:"enum",entries:A,...q.normalizeParams(x)})}var QW=W("ZodLiteral",(A,x)=>{t$.init(A,x),H.init(A,x),A.values=new Set(x.values),Object.defineProperty(A,"value",{get(){if(x.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return x.values[0]}})});function f_(A,x){return new QW({type:"literal",values:Array.isArray(A)?A:[A],...q.normalizeParams(x)})}var YW=W("ZodFile",(A,x)=>{s$.init(A,x),H.init(A,x),A.min=($,c)=>A.check(N($,c)),A.max=($,c)=>A.check(V($,c)),A.mime=($,c)=>A.check(p(Array.isArray($)?$:[$],c))});function m_(A){return yc(YW,A)}var OW=W("ZodTransform",(A,x)=>{Ac.init(A,x),H.init(A,x),A._zod.parse=($,c)=>{if(c.direction==="backward")throw new q$(A.constructor.name);$.addIssue=(J)=>{if(typeof J==="string")$.issues.push(q.issue(J,$.value,x));else{let Y=J;if(Y.fatal)Y.continue=!1;Y.code??(Y.code="custom"),Y.input??(Y.input=$.value),Y.inst??(Y.inst=A),$.issues.push(q.issue(Y))}};let _=x.transform($.value,$);if(_ instanceof Promise)return _.then((J)=>{return $.value=J,$});return $.value=_,$}});function Cx(A){return new OW({type:"transform",transform:A})}var Vx=W("ZodOptional",(A,x)=>{xc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function _A(A){return new Vx({type:"optional",innerType:A})}var JW=W("ZodNullable",(A,x)=>{$c.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function qA(A){return new JW({type:"nullable",innerType:A})}function r_(A){return _A(qA(A))}var XW=W("ZodDefault",(A,x)=>{cc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType,A.removeDefault=A.unwrap});function GW(A,x){return new XW({type:"default",innerType:A,get defaultValue(){return typeof x==="function"?x():q.shallowClone(x)}})}var MW=W("ZodPrefault",(A,x)=>{Wc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function wW(A,x){return new MW({type:"prefault",innerType:A,get defaultValue(){return typeof x==="function"?x():q.shallowClone(x)}})}var Rx=W("ZodNonOptional",(A,x)=>{_c.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function zW(A,x){return new Rx({type:"nonoptional",innerType:A,...q.normalizeParams(x)})}var KW=W("ZodSuccess",(A,x)=>{qc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function p_(A){return new KW({type:"success",innerType:A})}var BW=W("ZodCatch",(A,x)=>{Hc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType,A.removeCatch=A.unwrap});function PW(A,x){return new BW({type:"catch",innerType:A,catchValue:typeof x==="function"?x:()=>x})}var LW=W("ZodNaN",(A,x)=>{Qc.init(A,x),H.init(A,x)});function e_(A){return vc(LW,A)}var Ix=W("ZodPipe",(A,x)=>{Yc.init(A,x),H.init(A,x),A.in=x.in,A.out=x.out});function HA(A,x){return new Ix({type:"pipe",in:A,out:x})}var kx=W("ZodCodec",(A,x)=>{Ix.init(A,x),Oc.init(A,x)});function d_(A,x,$){return new kx({type:"pipe",in:A,out:x,transform:$.decode,reverseTransform:$.encode})}var EW=W("ZodReadonly",(A,x)=>{Jc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function DW(A){return new EW({type:"readonly",innerType:A})}var NW=W("ZodTemplateLiteral",(A,x)=>{Xc.init(A,x),H.init(A,x)});function a_(A,x){return new NW({type:"template_literal",parts:A,...q.normalizeParams(x)})}var SW=W("ZodLazy",(A,x)=>{wc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.getter()});function CW(A){return new SW({type:"lazy",getter:A})}var VW=W("ZodPromise",(A,x)=>{Mc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function n_(A){return new VW({type:"promise",innerType:A})}var RW=W("ZodFunction",(A,x)=>{Gc.init(A,x),H.init(A,x)});function i_(A){return new RW({type:"function",input:Array.isArray(A?.input)?WW(A?.input):A?.input??JA(S()),output:A?.output??S()})}var GA=W("ZodCustom",(A,x)=>{zc.init(A,x),H.init(A,x)});function t_(A){let x=new H$({check:"custom"});return x._zod.check=A,x}function s_(A,x){return Zc(GA,A??(()=>!0),x)}function IW(A,x={}){return oc(GA,A,x)}function kW(A){return uc(A)}function Aq(A,x={error:`Input not instance of ${A.name}`}){let $=new GA({type:"custom",check:"custom",fn:(c)=>c instanceof A,abort:!0,...q.normalizeParams(x)});return $._zod.bag.Class=A,$}var xq=(...A)=>lc({Codec:kx,Boolean:T,String:j},...A);function $q(A){let x=CW(()=>{return Dx([jA(A),fc(),mc(),dc(),JA(x),_W(jA(),x)])});return x}function cq(A,x){return HA(Cx(A),x)}var Wq={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function _q(A){E({customError:A})}function qq(){return E().customError}var bx;(function(A){})(bx||(bx={}));var Fx={};RA(Fx,{string:()=>Hq,number:()=>Qq,date:()=>Jq,boolean:()=>Yq,bigint:()=>Oq});function Hq(A){return bW(j,A)}function Qq(A){return FW(U,A)}function Yq(A){return jW(T,A)}function Oq(A){return hW(v,A)}function Jq(A){return UW(OA,A)}E(ZW());
|
|
3
|
+
export{$A as vt,BA as wt,jA as xt,x_ as yt,fc as zt,mc as At,dc as Bt,F_ as Ct,S as Dt,JA as Et,T_ as Ft,g_ as Gt,Dx as Ht,y_ as It,$W as Jt,_W as Kt,Sx as Lt,f_ as Mt,_A as Nt,s_ as Ot,cq as Pt,Wq as Qt,Fx as Rt,Xq as St};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{jf as a,kf as b,lf as c,mf as d,nf as e,of as f}from"./chunk-hnzegjgv.js";import"./chunk-2maqde7w.js";import"./chunk-kj20f048.js";import"./chunk-cqtkxwd8.js";import"./chunk-x9rbv6p6.js";import"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-7xm75w1e.js";export{f as createOpenAICompatible,e as VERSION,d as OpenAICompatibleImageModel,c as OpenAICompatibleEmbeddingModel,b as OpenAICompatibleCompletionLanguageModel,a as OpenAICompatibleChatLanguageModel};
|