omegga 1.5.2 → 1.6.0

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +19 -2
  2. package/bin/omegga +1 -1
  3. package/dist/cli/terminal.js +46 -0
  4. package/dist/cli/terminal.js.map +1 -1
  5. package/dist/omegga/commandInjector.js +13 -6
  6. package/dist/omegga/commandInjector.js.map +1 -1
  7. package/dist/omegga/player.js +2 -2
  8. package/dist/omegga/player.js.map +1 -1
  9. package/dist/plugin.js.map +1 -1
  10. package/dist/webserver/backend/database.js +219 -7
  11. package/dist/webserver/backend/database.js.map +1 -1
  12. package/dist/webserver/backend/events.js +1 -1
  13. package/dist/webserver/backend/events.js.map +1 -1
  14. package/dist/webserver/backend/index.js +120 -2
  15. package/dist/webserver/backend/index.js.map +1 -1
  16. package/dist/webserver/backend/permissions.js +74 -0
  17. package/dist/webserver/backend/permissions.js.map +1 -0
  18. package/dist/webserver/backend/router/chat.js +9 -7
  19. package/dist/webserver/backend/router/chat.js.map +1 -1
  20. package/dist/webserver/backend/router/index.js +3 -1
  21. package/dist/webserver/backend/router/index.js.map +1 -1
  22. package/dist/webserver/backend/router/mfa.js +162 -0
  23. package/dist/webserver/backend/router/mfa.js.map +1 -0
  24. package/dist/webserver/backend/router/player.js +7 -6
  25. package/dist/webserver/backend/router/player.js.map +1 -1
  26. package/dist/webserver/backend/router/plugin.js +14 -10
  27. package/dist/webserver/backend/router/plugin.js.map +1 -1
  28. package/dist/webserver/backend/router/role.js +2 -1
  29. package/dist/webserver/backend/router/role.js.map +1 -1
  30. package/dist/webserver/backend/router/server.js +85 -71
  31. package/dist/webserver/backend/router/server.js.map +1 -1
  32. package/dist/webserver/backend/router/session.js +11 -2
  33. package/dist/webserver/backend/router/session.js.map +1 -1
  34. package/dist/webserver/backend/router/user.js +175 -13
  35. package/dist/webserver/backend/router/user.js.map +1 -1
  36. package/dist/webserver/backend/router/world.js +10 -9
  37. package/dist/webserver/backend/router/world.js.map +1 -1
  38. package/dist/webserver/backend/scopes.js +303 -0
  39. package/dist/webserver/backend/scopes.js.map +1 -0
  40. package/dist/webserver/backend/totp.js +32 -0
  41. package/dist/webserver/backend/totp.js.map +1 -0
  42. package/dist/webserver/backend/trpc.js +47 -4
  43. package/dist/webserver/backend/trpc.js.map +1 -1
  44. package/doc/permissions.md +193 -0
  45. package/package.json +7 -2
  46. package/public/app.html +932 -526
  47. package/public/assets/IconShieldCheck-Bjlm8mX2.js +2 -0
  48. package/public/assets/IconShieldCheck-Bjlm8mX2.js.map +1 -0
  49. package/public/assets/IconWorld-XmQNg6JI.js +2 -0
  50. package/public/assets/IconWorld-XmQNg6JI.js.map +1 -0
  51. package/public/assets/IconWorldPlus-CxGGv2eD.js +2 -0
  52. package/public/assets/IconWorldPlus-CxGGv2eD.js.map +1 -0
  53. package/public/assets/app-DMr_-wik.js +7 -0
  54. package/public/assets/app-DMr_-wik.js.map +1 -0
  55. package/public/assets/auth-CEYiizOt.js +2 -0
  56. package/public/assets/auth-CEYiizOt.js.map +1 -0
  57. package/public/assets/index-BDkarAkX.js +3 -0
  58. package/public/assets/index-BDkarAkX.js.map +1 -0
  59. package/public/assets/{index-2cgXLhrt.js → index-DEL-PD_8.js} +2 -2
  60. package/public/assets/{index-2cgXLhrt.js.map → index-DEL-PD_8.js.map} +1 -1
  61. package/public/assets/index-D_STNela.js +2 -0
  62. package/public/assets/index-D_STNela.js.map +1 -0
  63. package/public/assets/index-Dkh3HiBz.js +4 -0
  64. package/public/assets/index-Dkh3HiBz.js.map +1 -0
  65. package/public/assets/shared/@components-CgsSYMe6.js +2 -0
  66. package/public/assets/shared/@components-CgsSYMe6.js.map +1 -0
  67. package/public/assets/shared/@hooks-DT93N7wd.js +2 -0
  68. package/public/assets/shared/{@hooks-Ch_hJYh0.js.map → @hooks-DT93N7wd.js.map} +1 -1
  69. package/public/assets/shared/@tabler_icons-react-DrVFX3uL.js +3 -0
  70. package/public/assets/shared/{@tabler_icons-react-iQk11eD_.js.map → @tabler_icons-react-DrVFX3uL.js.map} +1 -1
  71. package/public/assets/shared/{wouter-CUC1caxu.js → wouter-CNISJ5i6.js} +2 -2
  72. package/public/assets/shared/wouter-CNISJ5i6.js.map +1 -0
  73. package/public/assets/useHasScope-BOdFktko.js +2 -0
  74. package/public/assets/useHasScope-BOdFktko.js.map +1 -0
  75. package/public/auth.html +97 -33
  76. package/templates/safe-ts/omegga.d.ts +1 -1
  77. package/public/assets/IconArrowRight-BuVxhqKX.js +0 -2
  78. package/public/assets/IconArrowRight-BuVxhqKX.js.map +0 -1
  79. package/public/assets/IconWorld-B6GK5qpx.js +0 -2
  80. package/public/assets/IconWorld-B6GK5qpx.js.map +0 -1
  81. package/public/assets/IconWorldPlus-Dkos72Ws.js +0 -2
  82. package/public/assets/IconWorldPlus-Dkos72Ws.js.map +0 -1
  83. package/public/assets/app-CLZ-5FIi.js +0 -6
  84. package/public/assets/app-CLZ-5FIi.js.map +0 -1
  85. package/public/assets/auth-6N37o421.js +0 -2
  86. package/public/assets/auth-6N37o421.js.map +0 -1
  87. package/public/assets/index-DLZ8-XzO.js +0 -4
  88. package/public/assets/index-DLZ8-XzO.js.map +0 -1
  89. package/public/assets/index-DY750sgZ.js +0 -2
  90. package/public/assets/index-DY750sgZ.js.map +0 -1
  91. package/public/assets/shared/@components-DPHARroA.js +0 -2
  92. package/public/assets/shared/@components-DPHARroA.js.map +0 -1
  93. package/public/assets/shared/@hooks-Ch_hJYh0.js +0 -2
  94. package/public/assets/shared/@tabler_icons-react-iQk11eD_.js +0 -3
  95. package/public/assets/shared/wouter-CUC1caxu.js.map +0 -1
@@ -0,0 +1,4 @@
1
+ import{L as _n,I as Tn,a as Ve,B as Ms}from"./index-D_STNela.js";import{j as y}from"./jsx-runtime-BX5r4UiA.js";import{r as g,R as Ns}from"./index-CrN8I5Az.js";import{a as Us,L as tt}from"./index-DEL-PD_8.js";import{h as Qs,a as Ir,d as In,I as qs,n as An,b as Fs,o as kn,i as Hs,g as $s,f as Ws,j as Ks,e as Bs,c as Gs,k as zs,l as Vs,m as Ys}from"./IconWorld-XmQNg6JI.js";import{useStore as Jr}from"./shared/@nanostores_react-DJPF1Eqx.js";import{l as Js,b as Zs}from"./utils-Ds3ldd-U.js";import{a as Xs,d as ei,u as ti}from"./useHasScope-BOdFktko.js";const ri="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",ni="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",fr="numeric",hr="ascii",pr="alpha",He="asciinumeric",Fe="alphanumeric",yr="domain",Ln="emoji",si="scheme",ii="slashscheme",tr="whitespace";function oi(e,t){return e in t||(t[e]=[]),t[e]}function Re(e,t,r){t[fr]&&(t[He]=!0,t[Fe]=!0),t[hr]&&(t[He]=!0,t[pr]=!0),t[He]&&(t[Fe]=!0),t[pr]&&(t[Fe]=!0),t[Fe]&&(t[yr]=!0),t[Ln]&&(t[yr]=!0);for(const s in t){const n=oi(s,r);n.indexOf(e)<0&&n.push(e)}}function ai(e,t){const r={};for(const s in t)t[s].indexOf(e)>=0&&(r[s]=!0);return r}function te(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}te.groups={};te.prototype={accepts(){return!!this.t},go(e){const t=this,r=t.j[e];if(r)return r;for(let s=0;s<t.jr.length;s++){const n=t.jr[s][0],i=t.jr[s][1];if(i&&n.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,r,s){for(let n=0;n<e.length;n++)this.tt(e[n],t,r,s)},tr(e,t,r,s){s=s||te.groups;let n;return t&&t.j?n=t:(n=new te(t),r&&s&&Re(t,r,s)),this.jr.push([e,n]),n},ts(e,t,r,s){let n=this;const i=e.length;if(!i)return n;for(let o=0;o<i-1;o++)n=n.tt(e[o]);return n.tt(e[i-1],t,r,s)},tt(e,t,r,s){s=s||te.groups;const n=this;if(t&&t.j)return n.j[e]=t,t;const i=t;let o,a=n.go(e);if(a?(o=new te,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new te,i){if(s)if(o.t&&typeof o.t=="string"){const u=Object.assign(ai(o.t,s),r);Re(i,u,s)}else r&&Re(i,r,s);o.t=i}return n.j[e]=o,o}};const L=(e,t,r,s,n)=>e.ta(t,r,s,n),B=(e,t,r,s,n)=>e.tr(t,r,s,n),Zr=(e,t,r,s,n)=>e.ts(t,r,s,n),v=(e,t,r,s,n)=>e.tt(t,r,s,n),ve="WORD",mr="UWORD",Dn="ASCIINUMERICAL",Mn="ALPHANUMERICAL",Ye="LOCALHOST",vr="TLD",br="UTLD",bt="SCHEME",Me="SLASH_SCHEME",Ar="NUM",gr="WS",kr="NL",$e="OPENBRACE",We="CLOSEBRACE",St="OPENBRACKET",xt="CLOSEBRACKET",wt="OPENPAREN",Pt="CLOSEPAREN",Et="OPENANGLEBRACKET",jt="CLOSEANGLEBRACKET",Ct="FULLWIDTHLEFTPAREN",Rt="FULLWIDTHRIGHTPAREN",_t="LEFTCORNERBRACKET",Tt="RIGHTCORNERBRACKET",It="LEFTWHITECORNERBRACKET",At="RIGHTWHITECORNERBRACKET",kt="FULLWIDTHLESSTHAN",Lt="FULLWIDTHGREATERTHAN",Dt="AMPERSAND",Mt="APOSTROPHE",Nt="ASTERISK",Se="AT",Ut="BACKSLASH",Qt="BACKTICK",qt="CARET",xe="COLON",Lr="COMMA",Ft="DOLLAR",ce="DOT",Ht="EQUALS",Dr="EXCLAMATION",ie="HYPHEN",Ke="PERCENT",$t="PIPE",Wt="PLUS",Kt="POUND",Be="QUERY",Mr="QUOTE",Nn="FULLWIDTHMIDDLEDOT",Nr="SEMI",le="SLASH",Ge="TILDE",Bt="UNDERSCORE",Un="EMOJI",Gt="SYM";var Qn=Object.freeze({__proto__:null,ALPHANUMERICAL:Mn,AMPERSAND:Dt,APOSTROPHE:Mt,ASCIINUMERICAL:Dn,ASTERISK:Nt,AT:Se,BACKSLASH:Ut,BACKTICK:Qt,CARET:qt,CLOSEANGLEBRACKET:jt,CLOSEBRACE:We,CLOSEBRACKET:xt,CLOSEPAREN:Pt,COLON:xe,COMMA:Lr,DOLLAR:Ft,DOT:ce,EMOJI:Un,EQUALS:Ht,EXCLAMATION:Dr,FULLWIDTHGREATERTHAN:Lt,FULLWIDTHLEFTPAREN:Ct,FULLWIDTHLESSTHAN:kt,FULLWIDTHMIDDLEDOT:Nn,FULLWIDTHRIGHTPAREN:Rt,HYPHEN:ie,LEFTCORNERBRACKET:_t,LEFTWHITECORNERBRACKET:It,LOCALHOST:Ye,NL:kr,NUM:Ar,OPENANGLEBRACKET:Et,OPENBRACE:$e,OPENBRACKET:St,OPENPAREN:wt,PERCENT:Ke,PIPE:$t,PLUS:Wt,POUND:Kt,QUERY:Be,QUOTE:Mr,RIGHTCORNERBRACKET:Tt,RIGHTWHITECORNERBRACKET:At,SCHEME:bt,SEMI:Nr,SLASH:le,SLASH_SCHEME:Me,SYM:Gt,TILDE:Ge,TLD:vr,UNDERSCORE:Bt,UTLD:br,UWORD:mr,WORD:ve,WS:gr});const ye=/[a-z]/,Qe=new RegExp("\\p{L}","u"),rr=new RegExp("\\p{Emoji}","u"),me=/\d/,nr=/\s/,Xr="\r",sr=`
2
+ `,ui="️",ci="‍",ir="";let ut=null,ct=null;function li(e=[]){const t={};te.groups=t;const r=new te;ut==null&&(ut=en(ri)),ct==null&&(ct=en(ni)),v(r,"'",Mt),v(r,"{",$e),v(r,"}",We),v(r,"[",St),v(r,"]",xt),v(r,"(",wt),v(r,")",Pt),v(r,"<",Et),v(r,">",jt),v(r,"(",Ct),v(r,")",Rt),v(r,"「",_t),v(r,"」",Tt),v(r,"『",It),v(r,"』",At),v(r,"<",kt),v(r,">",Lt),v(r,"&",Dt),v(r,"*",Nt),v(r,"@",Se),v(r,"`",Qt),v(r,"^",qt),v(r,":",xe),v(r,",",Lr),v(r,"$",Ft),v(r,".",ce),v(r,"=",Ht),v(r,"!",Dr),v(r,"-",ie),v(r,"%",Ke),v(r,"|",$t),v(r,"+",Wt),v(r,"#",Kt),v(r,"?",Be),v(r,'"',Mr),v(r,"/",le),v(r,";",Nr),v(r,"~",Ge),v(r,"_",Bt),v(r,"\\",Ut),v(r,"・",Nn);const s=B(r,me,Ar,{[fr]:!0});B(s,me,s);const n=B(s,ye,Dn,{[He]:!0}),i=B(s,Qe,Mn,{[Fe]:!0}),o=B(r,ye,ve,{[hr]:!0});B(o,me,n),B(o,ye,o),B(n,me,n),B(n,ye,n);const a=B(r,Qe,mr,{[pr]:!0});B(a,ye),B(a,me,i),B(a,Qe,a),B(i,me,i),B(i,ye),B(i,Qe,i);const u=v(r,sr,kr,{[tr]:!0}),c=v(r,Xr,gr,{[tr]:!0}),l=B(r,nr,gr,{[tr]:!0});v(r,ir,l),v(c,sr,u),v(c,ir,l),B(c,nr,l),v(l,Xr),v(l,sr),B(l,nr,l),v(l,ir,l);const d=B(r,rr,Un,{[Ln]:!0});v(d,"#"),B(d,rr,d),v(d,ui,d);const f=v(d,ci);v(f,"#"),B(f,rr,d);const p=[[ye,o],[me,n]],b=[[ye,null],[Qe,a],[me,i]];for(let h=0;h<ut.length;h++)be(r,ut[h],vr,ve,p);for(let h=0;h<ct.length;h++)be(r,ct[h],br,mr,b);Re(vr,{tld:!0,ascii:!0},t),Re(br,{utld:!0,alpha:!0},t),be(r,"file",bt,ve,p),be(r,"mailto",bt,ve,p),be(r,"http",Me,ve,p),be(r,"https",Me,ve,p),be(r,"ftp",Me,ve,p),be(r,"ftps",Me,ve,p),Re(bt,{scheme:!0,ascii:!0},t),Re(Me,{slashscheme:!0,ascii:!0},t),e=e.sort((h,S)=>h[0]>S[0]?1:-1);for(let h=0;h<e.length;h++){const S=e[h][0],j=e[h][1]?{[si]:!0}:{[ii]:!0};S.indexOf("-")>=0?j[yr]=!0:ye.test(S)?me.test(S)?j[He]=!0:j[hr]=!0:j[fr]=!0,Zr(r,S,S,j)}return Zr(r,"localhost",Ye,{ascii:!0}),r.jd=new te(Gt),{start:r,tokens:Object.assign({groups:t},Qn)}}function qn(e,t){const r=di(t.replace(/[A-Z]/g,a=>a.toLowerCase())),s=r.length,n=[];let i=0,o=0;for(;o<s;){let a=e,u=null,c=0,l=null,d=-1,f=-1;for(;o<s&&(u=a.go(r[o]));)a=u,a.accepts()?(d=0,f=0,l=a):d>=0&&(d+=r[o].length,f++),c+=r[o].length,i+=r[o].length,o++;i-=d,o-=f,c-=d,n.push({t:l.t,v:t.slice(i-c,i),s:i-c,e:i})}return n}function di(e){const t=[],r=e.length;let s=0;for(;s<r;){let n=e.charCodeAt(s),i,o=n<55296||n>56319||s+1===r||(i=e.charCodeAt(s+1))<56320||i>57343?e[s]:e.slice(s,s+2);t.push(o),s+=o.length}return t}function be(e,t,r,s,n){let i;const o=t.length;for(let a=0;a<o-1;a++){const u=t[a];e.j[u]?i=e.j[u]:(i=new te(s),i.jr=n.slice(),e.j[u]=i),e=i}return i=new te(r),i.jr=n.slice(),e.j[t[o-1]]=i,i}function en(e){const t=[],r=[];let s=0,n="0123456789";for(;s<e.length;){let i=0;for(;n.indexOf(e[s+i])>=0;)i++;if(i>0){t.push(r.join(""));for(let o=parseInt(e.substring(s,s+i),10);o>0;o--)r.pop();s+=i}else r.push(e[s]),s++}return t}const Je={defaultProtocol:"http",events:null,format:tn,formatHref:tn,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ur(e,t=null){let r=Object.assign({},Je);e&&(r=Object.assign(r,e instanceof Ur?e.o:e));const s=r.ignoreTags,n=[];for(let i=0;i<s.length;i++)n.push(s[i].toUpperCase());this.o=r,t&&(this.defaultRender=t),this.ignoreTags=n}Ur.prototype={o:Je,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,r){const s=t!=null;let n=this.o[e];return n&&(typeof n=="object"?(n=r.t in n?n[r.t]:Je[e],typeof n=="function"&&s&&(n=n(t,r))):typeof n=="function"&&s&&(n=n(t,r.t,r)),n)},getObj(e,t,r){let s=this.o[e];return typeof s=="function"&&t!=null&&(s=s(t,r.t,r)),s},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function tn(e){return e}function Fn(e,t){this.t="token",this.v=e,this.tk=t}Fn.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),r=e.get("truncate",t,this),s=e.get("format",t,this);return r&&s.length>r?s.substring(0,r)+"…":s},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Je.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,r=this.toHref(e.get("defaultProtocol")),s=e.get("formatHref",r,this),n=e.get("tagName",r,t),i=this.toFormattedString(e),o={},a=e.get("className",r,t),u=e.get("target",r,t),c=e.get("rel",r,t),l=e.getObj("attributes",r,t),d=e.getObj("events",r,t);return o.href=s,a&&(o.class=a),u&&(o.target=u),c&&(o.rel=c),l&&Object.assign(o,l),{tagName:n,attributes:o,content:i,eventListeners:d}}};function Yt(e,t){class r extends Fn{constructor(n,i){super(n,i),this.t=e}}for(const s in t)r.prototype[s]=t[s];return r.t=e,r}const rn=Yt("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),nn=Yt("text"),fi=Yt("nl"),lt=Yt("url",{isLink:!0,toHref(e=Je.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Ye&&e[1].t===xe}}),se=e=>new te(e);function hi({groups:e}){const t=e.domain.concat([Dt,Nt,Se,Ut,Qt,qt,Ft,Ht,ie,Ar,Ke,$t,Wt,Kt,le,Gt,Ge,Bt]),r=[Mt,xe,Lr,ce,Dr,Ke,Be,Mr,Nr,Et,jt,$e,We,xt,St,wt,Pt,Ct,Rt,_t,Tt,It,At,kt,Lt],s=[Dt,Mt,Nt,Ut,Qt,qt,Ft,Ht,ie,$e,We,Ke,$t,Wt,Kt,Be,le,Gt,Ge,Bt],n=se(),i=v(n,Ge);L(i,s,i),L(i,e.domain,i);const o=se(),a=se(),u=se();L(n,e.domain,o),L(n,e.scheme,a),L(n,e.slashscheme,u),L(o,s,i),L(o,e.domain,o);const c=v(o,Se);v(i,Se,c),v(a,Se,c),v(u,Se,c);const l=v(i,ce);L(l,s,i),L(l,e.domain,i);const d=se();L(c,e.domain,d),L(d,e.domain,d);const f=v(d,ce);L(f,e.domain,d);const p=se(rn);L(f,e.tld,p),L(f,e.utld,p),v(c,Ye,p);const b=v(d,ie);v(b,ie,b),L(b,e.domain,d),L(p,e.domain,d),v(p,ce,f),v(p,ie,b);const h=v(p,xe);L(h,e.numeric,rn);const S=v(o,ie),P=v(o,ce);v(S,ie,S),L(S,e.domain,o),L(P,s,i),L(P,e.domain,o);const j=se(lt);L(P,e.tld,j),L(P,e.utld,j),L(j,e.domain,o),L(j,s,i),v(j,ce,P),v(j,ie,S),v(j,Se,c);const k=v(j,xe),F=se(lt);L(k,e.numeric,F);const x=se(lt),w=se();L(x,t,x),L(x,r,w),L(w,t,x),L(w,r,w),v(j,le,x),v(F,le,x);const m=v(a,xe),E=v(u,xe),R=v(E,le),_=v(R,le);L(a,e.domain,o),v(a,ce,P),v(a,ie,S),L(u,e.domain,o),v(u,ce,P),v(u,ie,S),L(m,e.domain,x),v(m,le,x),v(m,Be,x),L(_,e.domain,x),L(_,t,x),v(_,le,x);const A=[[$e,We],[St,xt],[wt,Pt],[Et,jt],[Ct,Rt],[_t,Tt],[It,At],[kt,Lt]];for(let C=0;C<A.length;C++){const[D,M]=A[C],Q=v(x,D);v(w,D,Q),v(Q,M,x);const N=se(lt);L(Q,t,N);const q=se();L(Q,r),L(N,t,N),L(N,r,q),L(q,t,N),L(q,r,q),v(N,M,x),v(q,M,x)}return v(n,Ye,j),v(n,kr,fi),{start:n,tokens:Qn}}function pi(e,t,r){let s=r.length,n=0,i=[],o=[];for(;n<s;){let a=e,u=null,c=null,l=0,d=null,f=-1;for(;n<s&&!(u=a.go(r[n].t));)o.push(r[n++]);for(;n<s&&(c=u||a.go(r[n].t));)u=null,a=c,a.accepts()?(f=0,d=a):f>=0&&f++,n++,l++;if(f<0)n-=l,n<s&&(o.push(r[n]),n++);else{o.length>0&&(i.push(or(nn,t,o)),o=[]),n-=f,l-=f;const p=d.t,b=r.slice(n-l,n);i.push(or(p,t,b))}}return o.length>0&&i.push(or(nn,t,o)),i}function or(e,t,r){const s=r[0].s,n=r[r.length-1].e,i=t.slice(s,n);return new e(i,r)}const Z={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function yi(){Z.scanner=li(Z.customSchemes);for(let e=0;e<Z.tokenQueue.length;e++)Z.tokenQueue[e][1]({scanner:Z.scanner});Z.parser=hi(Z.scanner.tokens);for(let e=0;e<Z.pluginQueue.length;e++)Z.pluginQueue[e][1]({scanner:Z.scanner,parser:Z.parser});return Z.initialized=!0,Z}function Hn(e){return Z.initialized||yi(),pi(Z.parser.start,e,qn(Z.scanner.start,e))}Hn.scan=qn;function mi(e,t,r){const s=Hn(e),n=[];for(let i=0;i<s.length;i++){const o=s[i];if(o.t==="nl"&&t.get("nl2br")){const a=`__linkify-el-${r.elementId++}`;n.push(g.createElement("br",{key:a}))}else if(!o.isLink||!t.check(o))n.push(o.toString());else{let a=t.render(o);if(!("key"in a.props)){const u=`__linkify-el-${r.elementId++}`,c=Object.assign({key:u},a.props);a=g.cloneElement(a,c)}n.push(a)}}return n}function $n(e,t,r){if(g.Children.count(e.props.children)===0)return e;const s=[];g.Children.forEach(e.props.children,o=>{typeof o=="string"?s.push.apply(s,mi(o,t,r)):g.isValidElement(o)?typeof o.type=="string"&&t.ignoreTags.indexOf(o.type.toUpperCase())>=0?s.push(o):s.push($n(o,t,r)):s.push(o)});const n=`__linkify-el-${r.elementId++}`,i=Object.assign({key:n},e.props);return g.cloneElement(e,i,s)}const vi=e=>{let t=0;const r=({tagName:u,attributes:c,content:l})=>(c.key=`__linkify-lnk-${t++}`,c.class&&(c.className=c.class,delete c.class),g.createElement(u,c,l)),s={key:"__linkify-wrapper"};for(const u in e)u!=="options"&&u!=="as"&&u!=="tagName"&&u!=="children"&&(s[u]=e[u]);const n=new Ur(e.options,r),i=e.as||e.tagName||g.Fragment||"span",o=e.children,a=g.createElement(i,s,o);return $n(a,n,{elementId:0})},bi=({time:e})=>{const t=new Date(e);let r=t.getHours();const s=r>=12?"PM":"AM";r>12?r-=12:r===0&&(r=12);const n=String(t.getMinutes()).padStart(2,"0");return y.jsxs("div",{className:"chat-timestamp",children:[r,":",n," ",s]})},dt=({color:e,user:t,link:r,className:s})=>{const n={className:s,style:e?{color:`#${t?.color}`}:void 0,"data-tooltip":[t?.name&&`Username: ${t?.name}`,t?.displayName&&`Display Name: ${t?.displayName}`].filter(Boolean).join(`
3
+ `)};return r&&t?.id?y.jsx(tt,{href:`/players/${t.id}`,...n,children:t?.displayName??t?.name}):y.jsx("span",{...n,children:t?.displayName??t?.name})},ou=({log:e})=>{const[t,r]=Us("/history/:time?"),s=r?.time===e.created+"";return y.jsx("div",{className:`log-entry ${s?"focused":""}`,children:y.jsxs("div",{className:"log-row",children:[y.jsxs(tt,{href:`/history/${s?"":e.created}`,className:"time-link",children:[y.jsx(Qs,{}),y.jsx(bi,{time:e.created})]}),e.action==="msg"&&y.jsxs("div",{className:"chat-message message",children:[e.user.web?"[":"",e.user.web?y.jsx(dt,{color:!0,user:e.user}):y.jsx(dt,{link:!0,color:!0,className:"user",user:e.user}),e.user.web?"]":"",":"," ",y.jsx(vi,{as:"span",children:e.message})]}),e.action==="leave"&&y.jsxs("div",{className:"message join-message",children:[y.jsx(dt,{link:!0,className:"user",user:e.user})," left the game."]}),e.action==="join"&&y.jsxs("div",{className:"message join-message",children:[y.jsx(dt,{link:!0,className:"user",user:e.user})," joined the game",e.user.isFirst?" for the first time":"","."]}),e.action==="server"&&y.jsx("div",{className:"message server-message",children:e.message})]})})},gi=({disabled:e=!1,options:t=[],value:r,onChange:s,icons:n})=>{const[i,o]=g.useState(!1),a=g.useRef(null);return g.useEffect(()=>{if(!i)return;function u(c){c.target&&!a.current?.contains(c.target)&&(console.log("[debug] close"),o(!1))}return document.addEventListener("click",u),()=>document.removeEventListener("click",u)},[i]),y.jsxs("div",{className:`dropdown ${e?"disabled":""}`,ref:a,children:[i&&y.jsx("div",{className:"options",children:t.map(u=>y.jsxs("div",{className:`option ${r===u?"green":""}`,onClick:()=>{o(!1),s(u)},children:[n?.[u],u]},u))}),y.jsxs("div",{className:"selected",onClick:()=>{!e&&o(u=>!u)},children:[y.jsx("div",{className:"value",children:r}),y.jsx(Ir,{})]})]})},au=({loading:e,offset:t=0,onTopScrollsToBottom:r=!0,onBottom:s,onTop:n,children:i,className:o,...a})=>{const u=g.useRef(null),c=g.useRef(0),l=g.useRef(""),d=g.useRef(e),f=g.useRef(0),p=g.useRef(!1);e&&!d.current&&u.current&&(f.current=u.current.scrollHeight,c.current=u.current.scrollTop),d.current=e,g.useLayoutEffect(()=>{if(e||!u.current)return;const h=u.current,S=l.current;if(l.current="",S==="top"){if(r)h.scrollTop=h.scrollHeight-h.offsetHeight-t-2;else{const P=h.scrollHeight-f.current;P>0&&(h.scrollTop+=P)}c.current=h.scrollTop,p.current=!0}},[e,r,t]);const b=g.useCallback(h=>{if(p.current){p.current=!1;return}if(d.current)return;const S=h.currentTarget,P=S.scrollTop,j=c.current;if(P>j&&P+S.offsetHeight>=S.scrollHeight-t){l.current="bottom",c.current=P,s();return}if(P<=t&&P<=j){l.current="top",c.current=P,n();return}c.current=P},[t,s,n]);return y.jsx("div",{ref:u,onScroll:b,className:o,style:{overflowAnchor:"none"},...a,children:i})};var Ae=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Oi={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Si=class{#t=Oi;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},_e=new Si;function xi(e){setTimeout(e,0)}var Te=typeof window>"u"||"Deno"in globalThis;function X(){}function wi(e,t){return typeof e=="function"?e(t):e}function Or(e){return typeof e=="number"&&e>=0&&e!==1/0}function Wn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function we(e,t){return typeof e=="function"?e(t):e}function oe(e,t){return typeof e=="function"?e(t):e}function sn(e,t){const{type:r="all",exact:s,fetchStatus:n,predicate:i,queryKey:o,stale:a}=e;if(o){if(s){if(t.queryHash!==Qr(o,t.options))return!1}else if(!Ze(t.queryKey,o))return!1}if(r!=="all"){const u=t.isActive();if(r==="active"&&!u||r==="inactive"&&u)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||n&&n!==t.state.fetchStatus||i&&!i(t))}function on(e,t){const{exact:r,status:s,predicate:n,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Pe(t.options.mutationKey)!==Pe(i))return!1}else if(!Ze(t.options.mutationKey,i))return!1}return!(s&&t.state.status!==s||n&&!n(t))}function Qr(e,t){return(t?.queryKeyHashFn||Pe)(e)}function Pe(e){return JSON.stringify(e,(t,r)=>Sr(r)?Object.keys(r).sort().reduce((s,n)=>(s[n]=r[n],s),{}):r)}function Ze(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Ze(e[r],t[r])):!1}var Pi=Object.prototype.hasOwnProperty;function qr(e,t,r=0){if(e===t)return e;if(r>500)return t;const s=an(e)&&an(t);if(!s&&!(Sr(e)&&Sr(t)))return t;const i=(s?e:Object.keys(e)).length,o=s?t:Object.keys(t),a=o.length,u=s?new Array(a):{};let c=0;for(let l=0;l<a;l++){const d=s?l:o[l],f=e[d],p=t[d];if(f===p){u[d]=f,(s?l<i:Pi.call(e,d))&&c++;continue}if(f===null||p===null||typeof f!="object"||typeof p!="object"){u[d]=p;continue}const b=qr(f,p,r+1);u[d]=b,b===f&&c++}return i===a&&c===i?e:u}function Xe(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function an(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sr(e){if(!un(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!un(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function un(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ei(e){return new Promise(t=>{_e.setTimeout(t,e)})}function xr(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?qr(e,t):t}function ji(e,t,r=0){const s=[...e,t];return r&&s.length>r?s.slice(1):s}function Ci(e,t,r=0){const s=[t,...e];return r&&s.length>r?s.slice(0,-1):s}var re=Symbol();function Kn(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===re?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Fr(e,t){return typeof e=="function"?e(...t):!!e}function Ri(e,t,r){let s=!1,n;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??=t(),s||(s=!0,n.aborted?r():n.addEventListener("abort",r,{once:!0})),n)}),e}var _i=class extends Ae{#t;#e;#r;constructor(){super(),this.#r=e=>{if(!Te&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#r=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Hr=new _i;function wr(){let e,t;const r=new Promise((n,i)=>{e=n,t=i});r.status="pending",r.catch(()=>{});function s(n){Object.assign(r,n),delete r.resolve,delete r.reject}return r.resolve=n=>{s({status:"fulfilled",value:n}),e(n)},r.reject=n=>{s({status:"rejected",reason:n}),t(n)},r}var Ti=xi;function Ii(){let e=[],t=0,r=a=>{a()},s=a=>{a()},n=Ti;const i=a=>{t?e.push(a):n(()=>{r(a)})},o=()=>{const a=e;e=[],a.length&&n(()=>{s(()=>{a.forEach(u=>{r(u)})})})};return{batch:a=>{let u;t++;try{u=a()}finally{t--,t||o()}return u},batchCalls:a=>(...u)=>{i(()=>{a(...u)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{s=a},setScheduler:a=>{n=a}}}var G=Ii(),Ai=class extends Ae{#t=!0;#e;#r;constructor(){super(),this.#r=e=>{if(!Te&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#r=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#t}},zt=new Ai;function ki(e){return Math.min(1e3*2**e,3e4)}function Bn(e){return(e??"online")==="online"?zt.isOnline():!0}var Pr=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Gn(e){let t=!1,r=0,s;const n=wr(),i=()=>n.status!=="pending",o=h=>{if(!i()){const S=new Pr(h);f(S),e.onCancel?.(S)}},a=()=>{t=!0},u=()=>{t=!1},c=()=>Hr.isFocused()&&(e.networkMode==="always"||zt.isOnline())&&e.canRun(),l=()=>Bn(e.networkMode)&&e.canRun(),d=h=>{i()||(s?.(),n.resolve(h))},f=h=>{i()||(s?.(),n.reject(h))},p=()=>new Promise(h=>{s=S=>{(i()||c())&&h(S)},e.onPause?.()}).then(()=>{s=void 0,i()||e.onContinue?.()}),b=()=>{if(i())return;let h;const S=r===0?e.initialPromise:void 0;try{h=S??e.fn()}catch(P){h=Promise.reject(P)}Promise.resolve(h).then(d).catch(P=>{if(i())return;const j=e.retry??(Te?0:3),k=e.retryDelay??ki,F=typeof k=="function"?k(r,P):k,x=j===!0||typeof j=="number"&&r<j||typeof j=="function"&&j(r,P);if(t||!x){f(P);return}r++,e.onFail?.(r,P),Ei(F).then(()=>c()?void 0:p()).then(()=>{t?f(P):b()})})};return{promise:n,status:()=>n.status,cancel:o,continue:()=>(s?.(),n),cancelRetry:a,continueRetry:u,canStart:l,start:()=>(l()?b():p().then(b),n)}}var zn=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Or(this.gcTime)&&(this.#t=_e.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Te?1/0:300*1e3))}clearGcTimeout(){this.#t&&(_e.clearTimeout(this.#t),this.#t=void 0)}},Li=class extends zn{#t;#e;#r;#s;#n;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#r=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ln(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=ln(this.options);t.data!==void 0&&(this.setState(cn(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=xr(this.state.data,e,this.options);return this.#o({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(X).catch(X):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>oe(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===re||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>we(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Wn(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#a?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(u=>u.options.queryFn);a&&this.setOptions(a.options)}const r=new AbortController,s=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#a=!0,r.signal)})},n=()=>{const a=Kn(this.options,t),c=(()=>{const l={client:this.#s,queryKey:this.queryKey,meta:this.meta};return s(l),l})();return this.#a=!1,this.options.persister?this.options.persister(a,c,this):a(c)},o=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:n};return s(a),a})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#o({type:"fetch",meta:o.fetchOptions?.meta}),this.#n=Gn({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:a=>{a instanceof Pr&&a.revert&&this.setState({...this.#e,fetchStatus:"idle"}),r.abort()},onFail:(a,u)=>{this.#o({type:"failed",failureCount:a,error:u})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const a=await this.#n.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#r.config.onSuccess?.(a,this),this.#r.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Pr){if(a.silent)return this.#n.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#o({type:"error",error:a}),this.#r.config.onError?.(a,this),this.#r.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#o(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Vn(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...cn(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?s:void 0,s;case"error":const n=e.error;return{...r,error:n,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),G.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Vn(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Bn(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function cn(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ln(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,s=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var rt=class extends Ae{constructor(e,t){super(),this.options=t,this.#t=e,this.#o=null,this.#a=wr(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#r=void 0;#s=void 0;#n;#i;#a;#o;#p;#d;#f;#c;#l;#u;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),dn(this.#e,this.options)?this.#y():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Er(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Er(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#O(),this.#S(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,r=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof oe(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#e.setOptions(this.options),t._defaulted&&!Xe(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const s=this.hasListeners();s&&fn(this.#e,r,this.options,t)&&this.#y(),this.updateResult(),s&&(this.#e!==r||oe(this.options.enabled,this.#e)!==oe(t.enabled,this.#e)||we(this.options.staleTime,this.#e)!==we(t.staleTime,this.#e))&&this.#m();const n=this.#v();s&&(this.#e!==r||oe(this.options.enabled,this.#e)!==oe(t.enabled,this.#e)||n!==this.#u)&&this.#b(n)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),r=this.createResult(t,e);return Mi(this,r)&&(this.#s=r,this.#i=this.options,this.#n=this.#e.state),r}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),r=this.#t.getQueryCache().build(this.#t,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#y({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#y(e){this.#x();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(X)),t}#m(){this.#O();const e=we(this.options.staleTime,this.#e);if(Te||this.#s.isStale||!Or(e))return;const r=Wn(this.#s.dataUpdatedAt,e)+1;this.#c=_e.setTimeout(()=>{this.#s.isStale||this.updateResult()},r)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#b(e){this.#S(),this.#u=e,!(Te||oe(this.options.enabled,this.#e)===!1||!Or(this.#u)||this.#u===0)&&(this.#l=_e.setInterval(()=>{(this.options.refetchIntervalInBackground||Hr.isFocused())&&this.#y()},this.#u))}#g(){this.#m(),this.#b(this.#v())}#O(){this.#c&&(_e.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#l&&(_e.clearInterval(this.#l),this.#l=void 0)}createResult(e,t){const r=this.#e,s=this.options,n=this.#s,i=this.#n,o=this.#i,u=e!==r?e.state:this.#r,{state:c}=e;let l={...c},d=!1,f;if(t._optimisticResults){const E=this.hasListeners(),R=!E&&dn(e,t),_=E&&fn(e,r,t,s);(R||_)&&(l={...l,...Vn(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:p,errorUpdatedAt:b,status:h}=l;f=l.data;let S=!1;if(t.placeholderData!==void 0&&f===void 0&&h==="pending"){let E;n?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(E=n.data,S=!0):E=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,E!==void 0&&(h="success",f=xr(n?.data,E,t),d=!0)}if(t.select&&f!==void 0&&!S)if(n&&f===i?.data&&t.select===this.#p)f=this.#d;else try{this.#p=t.select,f=t.select(f),f=xr(n?.data,f,t),this.#d=f,this.#o=null}catch(E){this.#o=E}this.#o&&(p=this.#o,f=this.#d,b=Date.now(),h="error");const P=l.fetchStatus==="fetching",j=h==="pending",k=h==="error",F=j&&P,x=f!==void 0,m={status:h,fetchStatus:l.fetchStatus,isPending:j,isSuccess:h==="success",isError:k,isInitialLoading:F,isLoading:F,data:f,dataUpdatedAt:l.dataUpdatedAt,error:p,errorUpdatedAt:b,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>u.dataUpdateCount||l.errorUpdateCount>u.errorUpdateCount,isFetching:P,isRefetching:P&&!j,isLoadingError:k&&!x,isPaused:l.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:k&&x,isStale:$r(e,t),refetch:this.refetch,promise:this.#a,isEnabled:oe(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const E=m.data!==void 0,R=m.status==="error"&&!E,_=D=>{R?D.reject(m.error):E&&D.resolve(m.data)},A=()=>{const D=this.#a=m.promise=wr();_(D)},C=this.#a;switch(C.status){case"pending":e.queryHash===r.queryHash&&_(C);break;case"fulfilled":(R||m.data!==C.value)&&A();break;case"rejected":(!R||m.error!==C.reason)&&A();break}}return m}updateResult(){const e=this.#s,t=this.createResult(this.#e,this.options);if(this.#n=this.#e.state,this.#i=this.options,this.#n.data!==void 0&&(this.#f=this.#e),Xe(t,e))return;this.#s=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,n=typeof s=="function"?s():s;if(n==="all"||!n&&!this.#h.size)return!0;const i=new Set(n??this.#h);return this.options.throwOnError&&i.add("error"),Object.keys(this.#s).some(o=>{const a=o;return this.#s[a]!==e[a]&&i.has(a)})};this.#w({listeners:r()})}#x(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#w(e){G.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Di(e,t){return oe(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function dn(e,t){return Di(e,t)||e.state.data!==void 0&&Er(e,t,t.refetchOnMount)}function Er(e,t,r){if(oe(t.enabled,e)!==!1&&we(t.staleTime,e)!=="static"){const s=typeof r=="function"?r(e):r;return s==="always"||s!==!1&&$r(e,t)}return!1}function fn(e,t,r,s){return(e!==t||oe(s.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&$r(e,r)}function $r(e,t){return oe(t.enabled,e)!==!1&&e.isStaleByTime(we(t.staleTime,e))}function Mi(e,t){return!Xe(e.getCurrentResult(),t)}function Vt(e){return{onFetch:(t,r)=>{const s=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},u=0;const c=async()=>{let l=!1;const d=b=>{Ri(b,()=>t.signal,()=>l=!0)},f=Kn(t.options,t.fetchOptions),p=async(b,h,S)=>{if(l)return Promise.reject();if(h==null&&b.pages.length)return Promise.resolve(b);const j=(()=>{const w={client:t.client,queryKey:t.queryKey,pageParam:h,direction:S?"backward":"forward",meta:t.options.meta};return d(w),w})(),k=await f(j),{maxPages:F}=t.options,x=S?Ci:ji;return{pages:x(b.pages,k,F),pageParams:x(b.pageParams,h,F)}};if(n&&i.length){const b=n==="backward",h=b?Yn:jr,S={pages:i,pageParams:o},P=h(s,S);a=await p(S,P,b)}else{const b=e??i.length;do{const h=u===0?o[0]??s.initialPageParam:jr(s,a);if(u>0&&h==null)break;a=await p(a,h),u++}while(u<b)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=c}}}function jr(e,{pages:t,pageParams:r}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,r[s],r):void 0}function Yn(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function Ni(e,t){return t?jr(e,t)!=null:!1}function Ui(e,t){return!t||!e.getPreviousPageParam?!1:Yn(e,t)!=null}var Jn=class extends rt{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:Vt()})}getOptimisticResult(e){return e.behavior=Vt(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:r}=e,s=super.createResult(e,t),{isFetching:n,isRefetching:i,isError:o,isRefetchError:a}=s,u=r.fetchMeta?.fetchMore?.direction,c=o&&u==="forward",l=n&&u==="forward",d=o&&u==="backward",f=n&&u==="backward";return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Ni(t,r.data),hasPreviousPage:Ui(t,r.data),isFetchNextPageError:c,isFetchingNextPage:l,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:a&&!c&&!d,isRefetching:i&&!l&&!f}}},Qi=class extends zn{#t;#e;#r;#s;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#e=[],this.state=e.state||Zn(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#n({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Gn({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(i,o)=>{this.#n({type:"failed",failureCount:i,error:o})},onPause:()=>{this.#n({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const s=this.state.status==="pending",n=!this.#s.canStart();try{if(s)t();else{this.#n({type:"pending",variables:e,isPaused:n}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);const o=await this.options.onMutate?.(e,r);o!==this.state.context&&this.#n({type:"pending",context:o,variables:e,isPaused:n})}const i=await this.#s.start();return await this.#r.config.onSuccess?.(i,e,this.state.context,this,r),await this.options.onSuccess?.(i,e,this.state.context,r),await this.#r.config.onSettled?.(i,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(i,null,e,this.state.context,r),this.#n({type:"success",data:i}),i}catch(i){try{await this.#r.config.onError?.(i,e,this.state.context,this,r)}catch(o){Promise.reject(o)}try{await this.options.onError?.(i,e,this.state.context,r)}catch(o){Promise.reject(o)}try{await this.#r.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,r)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,r)}catch(o){Promise.reject(o)}throw this.#n({type:"error",error:i}),i}finally{this.#r.runNext(this)}}#n(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),G.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function Zn(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var qi=class extends Ae{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#r=0}#t;#e;#r;build(e,t,r){const s=new Qi({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(s),s}add(e){this.#t.add(e);const t=ft(e);if(typeof t=="string"){const r=this.#e.get(t);r?r.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=ft(e);if(typeof t=="string"){const r=this.#e.get(t);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=ft(e);if(typeof t=="string"){const s=this.#e.get(t)?.find(n=>n.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=ft(e);return typeof t=="string"?this.#e.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){G.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>on(t,r))}findAll(e={}){return this.getAll().filter(t=>on(e,t))}notify(e){G.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return G.batch(()=>Promise.all(e.map(t=>t.continue().catch(X))))}};function ft(e){return e.options.scope?.id}var Fi=class extends Ae{#t;#e=void 0;#r;#s;constructor(e,t){super(),this.#t=e,this.setOptions(t),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#t.defaultMutationOptions(e),Xe(this.options,t)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&Pe(t.mutationKey)!==Pe(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#n(),this.#i(e)}getCurrentResult(){return this.#e}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#n(),this.#i()}mutate(e,t){return this.#s=t,this.#r?.removeObserver(this),this.#r=this.#t.getMutationCache().build(this.#t,this.options),this.#r.addObserver(this),this.#r.execute(e)}#n(){const e=this.#r?.state??Zn();this.#e={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#i(e){G.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#e.variables,r=this.#e.context,s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#s.onSuccess?.(e.data,t,r,s)}catch(n){Promise.reject(n)}try{this.#s.onSettled?.(e.data,null,t,r,s)}catch(n){Promise.reject(n)}}else if(e?.type==="error"){try{this.#s.onError?.(e.error,t,r,s)}catch(n){Promise.reject(n)}try{this.#s.onSettled?.(void 0,e.error,t,r,s)}catch(n){Promise.reject(n)}}}this.listeners.forEach(t=>{t(this.#e)})})}};function hn(e,t){const r=new Set(t);return e.filter(s=>!r.has(s))}function Hi(e,t,r){const s=e.slice(0);return s[t]=r,s}var $i=class extends Ae{#t;#e;#r;#s;#n;#i;#a;#o;#p;#d=[];constructor(e,t,r){super(),this.#t=e,this.#s=r,this.#r=[],this.#n=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#n.forEach(e=>{e.subscribe(t=>{this.#u(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#n.forEach(e=>{e.destroy()})}setQueries(e,t){this.#r=e,this.#s=t,G.batch(()=>{const r=this.#n,s=this.#l(this.#r);s.forEach(l=>l.observer.setOptions(l.defaultedQueryOptions));const n=s.map(l=>l.observer),i=n.map(l=>l.getCurrentResult()),o=r.length!==n.length,a=n.some((l,d)=>l!==r[d]),u=o||a,c=u?!0:i.some((l,d)=>{const f=this.#e[d];return!f||!Xe(l,f)});!u&&!c||(u&&(this.#d=s,this.#n=n),this.#e=i,this.hasListeners()&&(u&&(hn(r,n).forEach(l=>{l.destroy()}),hn(n,r).forEach(l=>{l.subscribe(d=>{this.#u(l,d)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#n.map(e=>e.getCurrentQuery())}getObservers(){return this.#n}getOptimisticResult(e,t){const r=this.#l(e),s=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions)),n=r.map(i=>i.defaultedQueryOptions.queryHash);return[s,i=>this.#c(i??s,t,n),()=>this.#f(s,r)]}#f(e,t){return t.map((r,s)=>{const n=e[s];return r.defaultedQueryOptions.notifyOnChangeProps?n:r.observer.trackResult(n,i=>{t.forEach(o=>{o.observer.trackProp(i)})})})}#c(e,t,r){if(t){const s=this.#p,n=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((i,o)=>i!==s[o]));return(!this.#i||this.#e!==this.#o||n||t!==this.#a)&&(this.#a=t,this.#o=this.#e,r!==void 0&&(this.#p=r),this.#i=qr(this.#i,t(e))),this.#i}return e}#l(e){const t=new Map;this.#n.forEach(s=>{const n=s.options.queryHash;if(!n)return;const i=t.get(n);i?i.push(s):t.set(n,[s])});const r=[];return e.forEach(s=>{const n=this.#t.defaultQueryOptions(s),o=t.get(n.queryHash)?.shift()??new rt(this.#t,n);r.push({defaultedQueryOptions:n,observer:o})}),r}#u(e,t){const r=this.#n.indexOf(e);r!==-1&&(this.#e=Hi(this.#e,r,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#i,t=this.#f(this.#e,this.#d),r=this.#c(t,this.#s?.combine);e!==r&&G.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}},Wi=class extends Ae{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,r){const s=t.queryKey,n=t.queryHash??Qr(s,t);let i=this.get(n);return i||(i=new Li({client:e,queryKey:s,queryHash:n,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(i)),i}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){G.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>sn(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>sn(e,r)):t}notify(e){G.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){G.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){G.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ki=class{#t;#e;#r;#s;#n;#i;#a;#o;constructor(e={}){this.#t=e.queryCache||new Wi,this.#e=e.mutationCache||new qi,this.#r=e.defaultOptions||{},this.#s=new Map,this.#n=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Hr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#o=zt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#t.build(this,t),s=r.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(we(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:r})=>{const s=r.data;return[t,s]})}setQueryData(e,t,r){const s=this.defaultQueryOptions({queryKey:e}),i=this.#t.get(s.queryHash)?.state.data,o=wi(t,i);if(o!==void 0)return this.#t.build(this,s).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return G.batch(()=>this.#t.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;G.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#t;return G.batch(()=>(r.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},s=G.batch(()=>this.#t.findAll(e).map(n=>n.cancel(r)));return Promise.all(s).then(X).catch(X)}invalidateQueries(e,t={}){return G.batch(()=>(this.#t.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},s=G.batch(()=>this.#t.findAll(e).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let i=n.fetch(void 0,r);return r.throwOnError||(i=i.catch(X)),n.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(s).then(X)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#t.build(this,t);return r.isStaleByTime(we(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(X).catch(X)}fetchInfiniteQuery(e){return e.behavior=Vt(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(X).catch(X)}ensureInfiniteQueryData(e){return e.behavior=Vt(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return zt.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#s.set(Pe(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],r={};return t.forEach(s=>{Ze(e,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(e,t){this.#n.set(Pe(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(s=>{Ze(e,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Qr(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===re&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},Xn=g.createContext(void 0),nt=e=>{const t=g.useContext(Xn);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},uu=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(Xn.Provider,{value:e,children:t})),es=g.createContext(!1),ts=()=>g.useContext(es);es.Provider;function Bi(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Gi=g.createContext(Bi()),rs=()=>g.useContext(Gi),ns=(e,t,r)=>{const s=r?.state.error&&typeof e.throwOnError=="function"?Fr(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},ss=e=>{g.useEffect(()=>{e.clearReset()},[e])},is=({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(n&&e.data===void 0||Fr(r,[e.error,s])),Wr=(e,t)=>t.state.data===void 0,os=e=>{if(e.suspense){const r=n=>n==="static"?n:Math.max(n??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...n)=>r(s(...n)):r(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},zi=(e,t)=>e.isLoading&&e.isFetching&&!t,Cr=(e,t)=>e?.suspense&&t.isPending,Rr=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function as({queries:e,...t},r){const s=nt(r),n=ts(),i=rs(),o=g.useMemo(()=>e.map(h=>{const S=s.defaultQueryOptions(h);return S._optimisticResults=n?"isRestoring":"optimistic",S}),[e,s,n]);o.forEach(h=>{os(h);const S=s.getQueryCache().get(h.queryHash);ns(h,i,S)}),ss(i);const[a]=g.useState(()=>new $i(s,o,t)),[u,c,l]=a.getOptimisticResult(o,t.combine),d=!n&&t.subscribed!==!1;g.useSyncExternalStore(g.useCallback(h=>d?a.subscribe(G.batchCalls(h)):X,[a,d]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),g.useEffect(()=>{a.setQueries(o,t)},[o,t,a]);const p=u.some((h,S)=>Cr(o[S],h))?u.flatMap((h,S)=>{const P=o[S];if(P&&Cr(P,h)){const j=new rt(s,P);return Rr(P,j,i)}return[]}):[];if(p.length>0)throw Promise.all(p);const b=u.find((h,S)=>{const P=o[S];return P&&is({result:h,errorResetBoundary:i,throwOnError:P.throwOnError,query:s.getQueryCache().get(P.queryHash),suspense:P.suspense})});if(b?.error)throw b.error;return c(l())}function Jt(e,t,r){const s=ts(),n=rs(),i=nt(r),o=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const a=i.getQueryCache().get(o.queryHash);o._optimisticResults=s?"isRestoring":"optimistic",os(o),ns(o,n,a),ss(n);const u=!i.getQueryCache().get(o.queryHash),[c]=g.useState(()=>new t(i,o)),l=c.getOptimisticResult(o),d=!s&&e.subscribed!==!1;if(g.useSyncExternalStore(g.useCallback(f=>{const p=d?c.subscribe(G.batchCalls(f)):X;return c.updateResult(),p},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),g.useEffect(()=>{c.setOptions(o)},[o,c]),Cr(o,l))throw Rr(o,c,n);if(is({result:l,errorResetBoundary:n,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw l.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(o,l),o.experimental_prefetchInRender&&!Te&&zi(l,s)&&(u?Rr(o,c,n):a?.promise)?.catch(X).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?l:c.trackResult(l)}function Vi(e,t){return Jt(e,rt,t)}function Yi(e,t){return Jt({...e,enabled:!0,suspense:!0,throwOnError:Wr,placeholderData:void 0},rt,t)}function Ji(e,t){return Jt({...e,enabled:!0,suspense:!0,throwOnError:Wr},Jn,t)}function Zi(e,t){return as({...e,queries:e.queries.map(r=>({...r,suspense:!0,throwOnError:Wr,enabled:!0,placeholderData:void 0}))},t)}function Xi(e,t){const r=nt(t);r.getQueryState(e.queryKey)||r.prefetchQuery(e)}function eo(e,t){const r=nt(t);r.getQueryState(e.queryKey)||r.prefetchInfiniteQuery(e)}function to(e,t){const r=nt(t),[s]=g.useState(()=>new Fi(r,e));g.useEffect(()=>{s.setOptions(e)},[s,e]);const n=g.useSyncExternalStore(g.useCallback(o=>s.subscribe(G.batchCalls(o)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),i=g.useCallback((o,a)=>{s.mutate(o,a).catch(X)},[s]);if(n.error&&Fr(s.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:i,mutateAsync:n.mutate}}function ro(e,t){return Jt(e,Jn,t)}var no=Object.create,us=Object.defineProperty,so=Object.getOwnPropertyDescriptor,cs=Object.getOwnPropertyNames,io=Object.getPrototypeOf,oo=Object.prototype.hasOwnProperty,he=(e,t)=>function(){return t||(0,e[cs(e)[0]])((t={exports:{}}).exports,t),t.exports},ao=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=cs(t),i=0,o=n.length,a;i<o;i++)a=n[i],!oo.call(e,a)&&a!==r&&us(e,a,{get:(u=>t[u]).bind(null,a),enumerable:!(s=so(t,a))||s.enumerable});return e},z=(e,t,r)=>(r=e!=null?no(io(e)):{},ao(us(r,"default",{value:e,enumerable:!0}),e)),ls=he({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function r(s){"@babel/helpers - typeof";return t.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t.exports.__esModule=!0,t.exports.default=t.exports,r(s)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),uo=he({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var r=ls().default;function s(n,i){if(r(n)!="object"||!n)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var a=o.call(n,i||"default");if(r(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),co=he({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var r=ls().default,s=uo();function n(i){var o=s(i,"string");return r(o)=="symbol"?o:o+""}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),ke=he({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var r=co();function s(n,i,o){return(i=r(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o,n}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),ae=he({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var r=ke();function s(i,o){var a=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable})),a.push.apply(a,u)}return a}function n(i){for(var o=1;o<arguments.length;o++){var a=arguments[o]!=null?arguments[o]:{};o%2?s(Object(a),!0).forEach(function(u){r(i,u,a[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach(function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(a,u))})}return i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}});function Ne(e){const t={subscribe(r){let s=null,n=!1,i=!1,o=!1;function a(){if(s===null){o=!0;return}i||(i=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=e({next(u){var c;n||(c=r.next)===null||c===void 0||c.call(r,u)},error(u){var c;n||(n=!0,(c=r.error)===null||c===void 0||c.call(r,u),a())},complete(){var u;n||(n=!0,(u=r.complete)===null||u===void 0||u.call(r),a())}}),o&&a(),{unsubscribe:a}},pipe(...r){return r.reduce(lo,t)}};return t}function lo(e,t){return t(e)}function fo(e){const t=new AbortController;return new Promise((s,n)=>{let i=!1;function o(){i||(i=!0,a.unsubscribe())}t.signal.addEventListener("abort",()=>{n(t.signal.reason)});const a=e.subscribe({next(u){i=!0,s(u),o()},error(u){n(u)},complete(){t.abort(),o()}})})}function ho(e){return t=>{let r=0,s=null;const n=[];function i(){s||(s=t.subscribe({next(a){for(const c of n){var u;(u=c.next)===null||u===void 0||u.call(c,a)}},error(a){for(const c of n){var u;(u=c.error)===null||u===void 0||u.call(c,a)}},complete(){for(const u of n){var a;(a=u.complete)===null||a===void 0||a.call(u)}}}))}function o(){if(r===0&&s){const a=s;s=null,a.unsubscribe()}}return Ne(a=>(r++,n.push(a),i(),{unsubscribe(){r--,o();const u=n.findIndex(c=>c===a);u>-1&&n.splice(u,1)}}))}}function ds(e){let t=e;const r=[],s=o=>{t!==void 0&&o.next(t),r.push(o)},n=o=>{r.splice(r.indexOf(o),1)},i=Ne(o=>(s(o),()=>{n(o)}));return i.next=o=>{if(t!==o){t=o;for(const a of r)a.next(o)}},i.get=()=>t,i}function fs(e){return Ne(t=>{function r(n=0,i=e.op){const o=e.links[n];if(!o)throw new Error("No more links to execute - did you forget to add an ending link?");return o({op:i,next(u){return r(n+1,u)}})}return r().subscribe(t)})}function pn(e){return Array.isArray(e)?e:[e]}function po(e){return t=>{const r=pn(e.true).map(n=>n(t)),s=pn(e.false).map(n=>n(t));return n=>Ne(i=>{const o=e.condition(n.op)?r:s;return fs({op:n.op,links:o}).subscribe(i)})}}function Ie(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function hs(){return Object.create(null)}const yo=typeof Symbol=="function"&&!!Symbol.asyncIterator;function ps(e){return yo&&Ie(e)&&Symbol.asyncIterator in e}const ys=e=>e(),ht={INTERNAL_SERVER_ERROR:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603},mo=[ht.BAD_GATEWAY,ht.SERVICE_UNAVAILABLE,ht.GATEWAY_TIMEOUT,ht.INTERNAL_SERVER_ERROR];var vo=Object.create,ms=Object.defineProperty,bo=Object.getOwnPropertyDescriptor,vs=Object.getOwnPropertyNames,go=Object.getPrototypeOf,Oo=Object.prototype.hasOwnProperty,ue=(e,t)=>function(){return t||(0,e[vs(e)[0]])((t={exports:{}}).exports,t),t.exports},So=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=vs(t),i=0,o=n.length,a;i<o;i++)a=n[i],!Oo.call(e,a)&&a!==r&&ms(e,a,{get:(u=>t[u]).bind(null,a),enumerable:!(s=bo(t,a))||s.enumerable});return e},W=(e,t,r)=>(r=e!=null?vo(go(e)):{},So(ms(r,"default",{value:e,enumerable:!0}),e));const bs=()=>{},yn=e=>{Object.freeze&&Object.freeze(e)};function gs(e,t,r){var s;const n=t.join(".");return(s=r[n])!==null&&s!==void 0||(r[n]=new Proxy(bs,{get(i,o){if(!(typeof o!="string"||o==="then"))return gs(e,[...t,o],r)},apply(i,o,a){const u=t[t.length-1];let c={args:a,path:t};return u==="call"?c={args:a.length>=2?[a[1]]:[],path:t.slice(0,-1)}:u==="apply"&&(c={args:a.length>=2?a[1]:[],path:t.slice(0,-1)}),yn(c.args),yn(c.path),e(c)}})),r[n]}const Zt=e=>gs(e,[],hs()),Kr=e=>new Proxy(bs,{get(t,r){if(r!=="then")return e(r)}});var Os=ue({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function r(s){"@babel/helpers - typeof";return t.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t.exports.__esModule=!0,t.exports.default=t.exports,r(s)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),xo=ue({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var r=Os().default;function s(n,i){if(r(n)!="object"||!n)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var a=o.call(n,i||"default");if(r(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),wo=ue({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var r=Os().default,s=xo();function n(i){var o=s(i,"string");return r(o)=="symbol"?o:o+""}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Br=ue({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var r=wo();function s(n,i,o){return(i=r(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o,n}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),st=ue({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var r=Br();function s(i,o){var a=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable})),a.push.apply(a,u)}return a}function n(i){for(var o=1;o<arguments.length;o++){var a=arguments[o]!=null?arguments[o]:{};o%2?s(Object(a),!0).forEach(function(u){r(i,u,a[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach(function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(a,u))})}return i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}});W(st());W(Br());var pt=W(st());function Po(e,t){if("error"in e){const s=t.deserialize(e.error);return{ok:!1,error:(0,pt.default)((0,pt.default)({},e),{},{error:s})}}return{ok:!0,result:(0,pt.default)((0,pt.default)({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var ar=class extends Error{constructor(){super("Unable to transform response from server")}};function Eo(e,t){let r;try{r=Po(e,t)}catch{throw new ar}if(!r.ok&&(!Ie(r.error.error)||typeof r.error.error.code!="number"))throw new ar;if(r.ok&&!Ie(r.result))throw new ar;return r}W(st());W(st());var yt=W(Br());let Ss;const ur=new WeakMap,jo=()=>{};Ss=Symbol.toStringTag;var xs=class Ce{constructor(t){(0,yt.default)(this,"promise",void 0),(0,yt.default)(this,"subscribers",[]),(0,yt.default)(this,"settlement",null),(0,yt.default)(this,Ss,"Unpromise"),typeof t=="function"?this.promise=new Promise(t):this.promise=t;const r=this.promise.then(s=>{const{subscribers:n}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:s},n?.forEach(({resolve:i})=>{i(s)})});"catch"in r&&r.catch(s=>{const{subscribers:n}=this;this.subscribers=null,this.settlement={status:"rejected",reason:s},n?.forEach(({reject:i})=>{i(s)})})}subscribe(){let t,r;const{settlement:s}=this;if(s===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");const n=Ro();this.subscribers=_o(this.subscribers,n),t=n.promise,r=()=>{this.subscribers!==null&&(this.subscribers=Io(this.subscribers,n))}}else{const{status:n}=s;n==="fulfilled"?t=Promise.resolve(s.value):t=Promise.reject(s.reason),r=jo}return Object.assign(t,{unsubscribe:r})}then(t,r){const s=this.subscribe(),{unsubscribe:n}=s;return Object.assign(s.then(t,r),{unsubscribe:n})}catch(t){const r=this.subscribe(),{unsubscribe:s}=r;return Object.assign(r.catch(t),{unsubscribe:s})}finally(t){const r=this.subscribe(),{unsubscribe:s}=r;return Object.assign(r.finally(t),{unsubscribe:s})}static proxy(t){const r=Ce.getSubscribablePromise(t);return typeof r<"u"?r:Ce.createSubscribablePromise(t)}static createSubscribablePromise(t){const r=new Ce(t);return ur.set(t,r),ur.set(r,r),r}static getSubscribablePromise(t){return ur.get(t)}static resolve(t){const r=typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"?t:Promise.resolve(t);return Ce.proxy(r).subscribe()}static async any(t){const s=(Array.isArray(t)?t:[...t]).map(Ce.resolve);try{return await Promise.any(s)}finally{s.forEach(({unsubscribe:n})=>{n()})}}static async race(t){const s=(Array.isArray(t)?t:[...t]).map(Ce.resolve);try{return await Promise.race(s)}finally{s.forEach(({unsubscribe:n})=>{n()})}}static async raceReferences(t){const r=t.map(Co);try{return await Promise.race(r)}finally{for(const s of r)s.unsubscribe()}}};function Co(e){return xs.proxy(e).then(()=>[e])}function Ro(){let e,t;return{promise:new Promise((s,n)=>{e=s,t=n}),resolve:e,reject:t}}function _o(e,t){return[...e,t]}function To(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function Io(e,t){const r=e.indexOf(t);return r!==-1?To(e,r):e}var mn,vn,bn,gn;(vn=(mn=Symbol).dispose)!==null&&vn!==void 0||(mn.dispose=Symbol());(gn=(bn=Symbol).asyncDispose)!==null&&gn!==void 0||(bn.asyncDispose=Symbol());function Ao(e,t){const r=e,s=r[Symbol.dispose];return r[Symbol.dispose]=()=>{t(),s?.()},r}function ko(e,t){const r=e,s=r[Symbol.asyncDispose];return r[Symbol.asyncDispose]=async()=>{await t(),await s?.()},r}const ws=Symbol();function Lo(e){let t=null;return Ao({start(){if(t)throw new Error("Timer already started");return new Promise(s=>{t=setTimeout(()=>s(ws),e)})}},()=>{t&&clearTimeout(t)})}var it=ue({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function r(){var s=typeof SuppressedError=="function"?SuppressedError:function(a,u){var c=Error();return c.name="SuppressedError",c.error=a,c.suppressed=u,c},n={},i=[];function o(a,u){if(u!=null){if(Object(u)!==u)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(a)var c=u[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(c===void 0&&(c=u[Symbol.dispose||Symbol.for("Symbol.dispose")],a))var l=c;if(typeof c!="function")throw new TypeError("Object is not disposable.");l&&(c=function(){try{l.call(u)}catch(f){return Promise.reject(f)}}),i.push({v:u,d:c,a})}else a&&i.push({d:u,a});return u}return{e:n,u:o.bind(null,!1),a:o.bind(null,!0),d:function(){var u,c=this.e,l=0;function d(){for(;u=i.pop();)try{if(!u.a&&l===1)return l=0,i.push(u),Promise.resolve().then(d);if(u.d){var p=u.d.call(u.v);if(u.a)return l|=2,Promise.resolve(p).then(d,f)}else l|=1}catch(b){return f(b)}if(l===1)return c!==n?Promise.reject(c):Promise.resolve();if(c!==n)throw c}function f(p){return c=c!==n?new s(p,c):p,d()}return d()}}}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Gr=ue({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function r(s,n){this.v=s,this.k=n}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),ot=ue({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var r=Gr();function s(n){return new r(n,0)}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ue=ue({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var r=Gr();function s(i){return function(){return new n(i.apply(this,arguments))}}function n(i){var o,a;function u(l,d){try{var f=i[l](d),p=f.value,b=p instanceof r;Promise.resolve(b?p.v:p).then(function(h){if(b){var S=l==="return"?"return":"next";if(!p.k||h.done)return u(S,h);h=i[S](h).value}c(f.done?"return":"normal",h)},function(h){u("throw",h)})}catch(h){c("throw",h)}}function c(l,d){switch(l){case"return":o.resolve({value:d,done:!0});break;case"throw":o.reject(d);break;default:o.resolve({value:d,done:!1})}(o=o.next)?u(o.key,o.arg):a=null}this._invoke=function(l,d){return new Promise(function(f,p){var b={key:l,arg:d,resolve:f,reject:p,next:null};a?a=a.next=b:(o=a=b,u(l,d))})},typeof i.return!="function"&&(this.return=void 0)}n.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},n.prototype.next=function(i){return this._invoke("next",i)},n.prototype.throw=function(i){return this._invoke("throw",i)},n.prototype.return=function(i){return this._invoke("return",i)},t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});W(it());W(ot());W(Ue());W(it());W(ot());W(Ue());W(it());W(ot());W(Ue());var Ps=ue({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function r(n){var i,o,a,u=2;for(typeof Symbol<"u"&&(o=Symbol.asyncIterator,a=Symbol.iterator);u--;){if(o&&(i=n[o])!=null)return i.call(n);if(a&&(i=n[a])!=null)return new s(i.call(n));o="@@asyncIterator",a="@@iterator"}throw new TypeError("Object is not async iterable")}function s(n){function i(o){if(Object(o)!==o)return Promise.reject(new TypeError(o+" is not an object."));var a=o.done;return Promise.resolve(o.value).then(function(u){return{value:u,done:a}})}return s=function(a){this.s=a,this.n=a.next},s.prototype={s:null,n:null,next:function(){return i(this.n.apply(this.s,arguments))},return:function(a){var u=this.s.return;return u===void 0?Promise.resolve({value:a,done:!0}):i(u.apply(this.s,arguments))},throw:function(a){var u=this.s.return;return u===void 0?Promise.reject(a):i(u.apply(this.s,arguments))}},new s(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}});W(ot());W(Ue());W(it());W(Ps());var Do=ue({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncGeneratorDelegate.js"(e,t){var r=Gr();function s(n){var i={},o=!1;function a(u,c){return o=!0,c=new Promise(function(l){l(n[u](c))}),{done:!1,value:new r(c,1)}}return i[typeof Symbol<"u"&&Symbol.iterator||"@@iterator"]=function(){return this},i.next=function(u){return o?(o=!1,u):a("next",u)},typeof n.throw=="function"&&(i.throw=function(u){if(o)throw o=!1,u;return a("throw",u)}),typeof n.return=="function"&&(i.return=function(u){return o?(o=!1,u):a("return",u)}),i}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});W(Ps());var On=W(ot()),Mo=W(Ue());W(Do());var Es=W(it());const No="ping",Uo="serialized-error",Qo="connected",qo="return";async function Fo(e){try{var t=(0,Es.default)();const r=t.u(Lo(e.timeoutMs)),s=await xs.race([e.promise,r.start()]);return s===ws?await e.onTimeout():s}catch(r){t.e=r}finally{t.d()}}function Ho(e){const{deserialize:t=a=>a}=e;let r=hs();const s=e.signal;let n=null;const i=()=>new ReadableStream({async start(a){const[u,c]=await Promise.all([e.url(),e.init()]),l=n=new e.EventSource(u,c);a.enqueue({type:"connecting",eventSource:n,event:null}),l.addEventListener(Qo,f=>{const b=JSON.parse(f.data);r=b,a.enqueue({type:"connected",options:b,eventSource:l})}),l.addEventListener(Uo,f=>{const p=f;a.enqueue({type:"serialized-error",error:t(JSON.parse(p.data)),eventSource:l})}),l.addEventListener(No,()=>{a.enqueue({type:"ping",eventSource:l})}),l.addEventListener(qo,()=>{l.close(),a.close(),n=null}),l.addEventListener("error",f=>{l.readyState===l.CLOSED?a.error(f):a.enqueue({type:"connecting",eventSource:l,event:f})}),l.addEventListener("message",f=>{const p=f,h={data:t(JSON.parse(p.data))};p.lastEventId&&(h.id=p.lastEventId),a.enqueue({type:"data",data:h,eventSource:l})});const d=()=>{try{l.close(),a.close()}catch{}};s.aborted?d():s.addEventListener("abort",d)},cancel(){n?.close()}}),o=()=>{let a=i(),u=a.getReader();async function c(){await u.cancel(),n=null}return ko({read(){return u.read()},async recreate(){await c(),a=i(),u=a.getReader()}},c)};return ys((0,Mo.default)(function*(){try{var a=(0,Es.default)();const u=a.a(o());for(;;){let c=u.read();const l=r.reconnectAfterInactivityMs;l&&(c=Fo({promise:c,timeoutMs:l,onTimeout:async()=>{const f={value:{type:"timeout",ms:l,eventSource:n},done:!1};return await u.recreate(),f}}));const d=yield(0,On.default)(c);if(d.done)return d.value;yield d.value}}catch(u){a.e=u}finally{yield(0,On.default)(a.d())}}))}W(Ue());W(st());var mt=z(ke()),De=z(ae());function $o(e){return e instanceof fe}function Wo(e){return Ie(e)&&Ie(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function Ko(e,t){return typeof e=="string"?e:Ie(e)&&typeof e.message=="string"?e.message:t}var fe=class gt extends Error{constructor(t,r){var s,n;const i=r?.cause;super(t,{cause:i}),(0,mt.default)(this,"cause",void 0),(0,mt.default)(this,"shape",void 0),(0,mt.default)(this,"data",void 0),(0,mt.default)(this,"meta",void 0),this.meta=r?.meta,this.cause=i,this.shape=r==null||(s=r.result)===null||s===void 0?void 0:s.error,this.data=r==null||(n=r.result)===null||n===void 0?void 0:n.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,gt.prototype)}static from(t,r={}){const s=t;return $o(s)?(r.meta&&(s.meta=(0,De.default)((0,De.default)({},s.meta),r.meta)),s):Wo(s)?new gt(s.error.message,(0,De.default)((0,De.default)({},r),{},{result:s,cause:r.cause})):new gt(Ko(s,"Unknown error"),(0,De.default)((0,De.default)({},r),{},{cause:s}))}};function js(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:r=>r,deserialize:r=>r},output:{serialize:r=>r,deserialize:r=>r}}}const Sn=e=>typeof e=="function";function Bo(e){if(e)return e;if(typeof window<"u"&&Sn(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Sn(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var ze=z(ae());function Go(e){return{url:e.url.toString(),fetch:e.fetch,transformer:js(e.transformer),methodOverride:e.methodOverride}}function zo(e){const t={};for(let r=0;r<e.length;r++){const s=e[r];t[r]=s}return t}const Vo={query:"GET",mutation:"POST",subscription:"PATCH"};function Cs(e){return"input"in e?e.transformer.input.serialize(e.input):zo(e.inputs.map(t=>e.transformer.input.serialize(t)))}const zr=e=>{const t=e.url.split("?");let s=t[0].replace(/\/$/,"")+"/"+e.path;const n=[];if(t[1]&&n.push(t[1]),"inputs"in e&&n.push("batch=1"),e.type==="query"||e.type==="subscription"){const i=Cs(e);i!==void 0&&e.methodOverride!=="POST"&&n.push(`input=${encodeURIComponent(JSON.stringify(i))}`)}return n.length&&(s+="?"+n.join("&")),s},Yo=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=Cs(e);return t!==void 0?JSON.stringify(t):void 0},Jo=e=>ta((0,ze.default)((0,ze.default)({},e),{},{contentTypeHeader:"application/json",getUrl:zr,getBody:Yo}));var Zo=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const Xo=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Zo};async function ea(e){var t;Xo(e.signal);const r=e.getUrl(e),s=e.getBody(e),n=(t=e.methodOverride)!==null&&t!==void 0?t:Vo[e.type],i=await(async()=>{const a=await e.headers();return Symbol.iterator in a?Object.fromEntries(a):a})(),o=(0,ze.default)((0,ze.default)((0,ze.default)({},e.contentTypeHeader&&n!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0),i);return Bo(e.fetch)(r,{method:n,signal:e.signal,body:s,headers:o})}async function ta(e){const t={},r=await ea(e);t.response=r;const s=await r.json();return t.responseJSON=s,{json:s,meta:t}}z(ae());const xn=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function wn(e){let t=null,r=null;const s=()=>{clearTimeout(r),r=null,t=null};function n(a){const u=[[]];let c=0;for(;;){const f=a[c];if(!f)break;const p=u[u.length-1];if(f.aborted){var l;(l=f.reject)===null||l===void 0||l.call(f,new Error("Aborted")),c++;continue}if(e.validate(p.concat(f).map(h=>h.key))){p.push(f),c++;continue}if(p.length===0){var d;(d=f.reject)===null||d===void 0||d.call(f,new Error("Input is too big for a single dispatch")),c++;continue}u.push([])}return u}function i(){const a=n(t);s();for(const u of a){if(!u.length)continue;const c={items:u};for(const d of u)d.batch=c;e.fetch(c.items.map(d=>d.key)).then(async d=>{await Promise.all(d.map(async(p,b)=>{const h=c.items[b];try{var S;const j=await Promise.resolve(p);(S=h.resolve)===null||S===void 0||S.call(h,j)}catch(j){var P;(P=h.reject)===null||P===void 0||P.call(h,j)}h.batch=null,h.reject=null,h.resolve=null}));for(const p of c.items){var f;(f=p.reject)===null||f===void 0||f.call(p,new Error("Missing result")),p.batch=null}}).catch(d=>{for(const p of c.items){var f;(f=p.reject)===null||f===void 0||f.call(p,d),p.batch=null}})}}function o(a){var u;const c={aborted:!1,key:a,batch:null,resolve:xn,reject:xn},l=new Promise((d,f)=>{var p;c.reject=f,c.resolve=d,(p=t)!==null&&p!==void 0||(t=[]),t.push(c)});return(u=r)!==null&&u!==void 0||(r=setTimeout(i)),l}return{load:o}}function ra(...e){const t=new AbortController,r=e.length;let s=0;const n=()=>{++s===r&&t.abort()};for(const i of e)i?.aborted?n():i?.addEventListener("abort",n,{once:!0});return t.signal}function na(...e){const t=new AbortController;for(const r of e)r?.aborted?t.abort():r?.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}var vt=z(ae());function sa(e){var t,r;const s=Go(e),n=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,i=(r=e.maxItems)!==null&&r!==void 0?r:1/0;return()=>{const o=l=>({validate(d){if(n===1/0&&i===1/0)return!0;if(d.length>i)return!1;const f=d.map(h=>h.path).join(","),p=d.map(h=>h.input);return zr((0,vt.default)((0,vt.default)({},s),{},{type:l,path:f,inputs:p,signal:null})).length<=n},async fetch(d){const f=d.map(j=>j.path).join(","),p=d.map(j=>j.input),b=ra(...d.map(j=>j.signal)),h=await Jo((0,vt.default)((0,vt.default)({},s),{},{path:f,inputs:p,type:l,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:d}):e.headers:{}},signal:b}));return(Array.isArray(h.json)?h.json:d.map(()=>h.json)).map(j=>({meta:h.meta,json:j}))}}),a=wn(o("query")),u=wn(o("mutation")),c={query:a,mutation:u};return({op:l})=>Ne(d=>{if(l.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const p=c[l.type].load(l);let b;return p.then(h=>{b=h;const S=Eo(h.json,s.transformer.output);if(!S.ok){d.error(fe.from(S.error,{meta:h.meta}));return}d.next({context:h.meta,result:S.result}),d.complete()}).catch(h=>{d.error(fe.from(h,{meta:b?.meta}))}),()=>{}})}}z(ae());const et=(e,...t)=>typeof e=="function"?e(...t):e;z(ke());function ia(){let e,t;return{promise:new Promise((s,n)=>{e=s,t=n}),resolve:e,reject:t}}async function oa(e){const t=await et(e.url);if(!e.connectionParams)return t;const s=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+s}async function aa(e,t){const r={method:"connectionParams",data:await et(e)};return t.encode(r)}z(ke());var Oe=z(ke());function ua(e){const{promise:t,resolve:r,reject:s}=ia();return e.addEventListener("open",()=>{e.removeEventListener("error",s),r()}),e.addEventListener("error",s),t}function ca(e,{intervalMs:t,pongTimeoutMs:r}){let s,n;function i(){s=setTimeout(()=>{e.send("PING"),n=setTimeout(()=>{e.close()},r)},t)}function o(){clearTimeout(s),i()}function a(){clearTimeout(n),o()}e.addEventListener("open",i),e.addEventListener("message",({data:u})=>{clearTimeout(s),i(),u==="PONG"&&a()}),e.addEventListener("close",()=>{clearTimeout(s),clearTimeout(n)})}var la=class _r{constructor(t){var r;if((0,Oe.default)(this,"id",++_r.connectCount),(0,Oe.default)(this,"WebSocketPonyfill",void 0),(0,Oe.default)(this,"urlOptions",void 0),(0,Oe.default)(this,"keepAliveOpts",void 0),(0,Oe.default)(this,"encoder",void 0),(0,Oe.default)(this,"wsObservable",ds(null)),(0,Oe.default)(this,"openPromise",null),this.WebSocketPonyfill=(r=t.WebSocketPonyfill)!==null&&r!==void 0?r:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++_r.connectCount;const r=oa(t.urlOptions).then(s=>new t.WebSocketPonyfill(s));t.openPromise=r.then(async s=>{t.ws=s,s.binaryType="arraybuffer",s.addEventListener("message",function({data:n}){n==="PING"&&this.send("PONG")}),t.keepAliveOpts.enabled&&ca(s,t.keepAliveOpts),s.addEventListener("close",()=>{t.ws===s&&(t.ws=null)}),await ua(s),t.urlOptions.connectionParams&&s.send(await aa(t.urlOptions.connectionParams,t.encoder))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var t=this;try{await t.openPromise}finally{var r;(r=t.ws)===null||r===void 0||r.close()}}};(0,Oe.default)(la,"connectCount",0);z(ke());z(ae());var cr=z(ke()),Pn=z(ae()),Xt=class{constructor(e){(0,cr.default)(this,"links",void 0),(0,cr.default)(this,"runtime",void 0),(0,cr.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return fs({links:this.links,op:(0,Pn.default)((0,Pn.default)({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(ho())}async requestAsPromise(e){var t=this;try{const r=t.$request(e);return(await fo(r)).result.data}catch(r){throw fe.from(r)}}query(e,t,r){return this.requestAsPromise({type:"query",path:e,input:t,context:r?.context,signal:r?.signal})}mutation(e,t,r){return this.requestAsPromise({type:"mutation",path:e,input:t,context:r?.context,signal:r?.signal})}subscription(e,t,r){return this.$request({type:"subscription",path:e,input:t,context:r.context,signal:r.signal}).subscribe({next(n){switch(n.result.type){case"state":{var i;(i=r.onConnectionStateChange)===null||i===void 0||i.call(r,n.result);break}case"started":{var o;(o=r.onStarted)===null||o===void 0||o.call(r,{context:n.context});break}case"stopped":{var a;(a=r.onStopped)===null||a===void 0||a.call(r);break}case"data":case void 0:{var u;(u=r.onData)===null||u===void 0||u.call(r,n.result.data);break}}},error(n){var i;(i=r.onError)===null||i===void 0||i.call(r,n)},complete(){var n;(n=r.onComplete)===null||n===void 0||n.call(r)}})}};const Rs=Symbol.for("trpc_untypedClient"),da={query:"query",mutate:"mutation",subscribe:"subscription"},fa=e=>da[e];function _s(e){const t=Zt(({path:r,args:s})=>{const n=[...r],i=fa(n.pop()),o=n.join(".");return e[i](o,...s)});return Kr(r=>r===Rs?e:t[r])}function ha(e){const t=new Xt(e);return _s(t)}function Vr(e){return e[Rs]}z(ae());var En=z(ae());function pa(e,t){return!t||e!=null&&typeof e!="object"?e:(0,En.default)((0,En.default)({},e??{}),{},{lastEventId:t})}var ya=he({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function r(n){var i,o,a,u=2;for(typeof Symbol<"u"&&(o=Symbol.asyncIterator,a=Symbol.iterator);u--;){if(o&&(i=n[o])!=null)return i.call(n);if(a&&(i=n[a])!=null)return new s(i.call(n));o="@@asyncIterator",a="@@iterator"}throw new TypeError("Object is not async iterable")}function s(n){function i(o){if(Object(o)!==o)return Promise.reject(new TypeError(o+" is not an object."));var a=o.done;return Promise.resolve(o.value).then(function(u){return{value:u,done:a}})}return s=function(a){this.s=a,this.n=a.next},s.prototype={s:null,n:null,next:function(){return i(this.n.apply(this.s,arguments))},return:function(a){var u=this.s.return;return u===void 0?Promise.resolve({value:a,done:!0}):i(u.apply(this.s,arguments))},throw:function(a){var u=this.s.return;return u===void 0?Promise.reject(a):i(u.apply(this.s,arguments))}},new s(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),ma=z(ya());async function va(e){let t=await et(e.url);if(e.connectionParams){const r=await et(e.connectionParams),s=t.includes("?")?"&":"?";t+=s+"connectionParams="+encodeURIComponent(JSON.stringify(r))}return t}function ba(e){const t=js(e.transformer);return()=>({op:r})=>Ne(s=>{var n;const{type:i,path:o,input:a}=r;if(i!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");let u;const c=new AbortController,l=na(r.signal,c.signal),d=Ho({url:async()=>zr({transformer:t,url:await va(e),input:pa(a,u),path:o,type:i,signal:null}),init:()=>et(e.eventSourceOptions,{op:r}),signal:l,deserialize:b=>t.output.deserialize(b),EventSource:(n=e.EventSource)!==null&&n!==void 0?n:globalThis.EventSource}),f=ds({type:"state",state:"connecting",error:null}),p=f.subscribe({next(b){s.next({result:b})}});return ys(async()=>{var b=!1,h=!1,S;try{for(var P=(0,ma.default)(d),j;b=!(j=await P.next()).done;b=!1){const k=j.value;switch(k.type){case"ping":break;case"data":const F=k.data;let x;F.id?(u=F.id,x={id:F.id,data:F}):x={data:F.data},s.next({result:x,context:{eventSource:k.eventSource}});break;case"connected":{s.next({result:{type:"started"},context:{eventSource:k.eventSource}}),f.next({type:"state",state:"pending",error:null});break}case"serialized-error":{const w=fe.from({error:k.error});if(mo.includes(k.error.code)){f.next({type:"state",state:"connecting",error:w});break}throw w}case"connecting":{const w=f.get(),m=k.event&&fe.from(k.event);if(!m&&w.state==="connecting")break;f.next({type:"state",state:"connecting",error:m});break}case"timeout":f.next({type:"state",state:"connecting",error:new fe(`Timeout of ${k.ms}ms reached while waiting for a response`)})}}}catch(k){h=!0,S=k}finally{try{b&&P.return!=null&&await P.return()}finally{if(h)throw S}}s.next({result:{type:"stopped"}}),f.next({type:"state",state:"idle",error:null}),s.complete()}).catch(b=>{s.error(fe.from(b))}),()=>{s.complete(),c.abort(),p.unsubscribe()}})}z(ae());var ga=he({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function r(){var s=typeof SuppressedError=="function"?SuppressedError:function(a,u){var c=Error();return c.name="SuppressedError",c.error=a,c.suppressed=u,c},n={},i=[];function o(a,u){if(u!=null){if(Object(u)!==u)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(a)var c=u[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(c===void 0&&(c=u[Symbol.dispose||Symbol.for("Symbol.dispose")],a))var l=c;if(typeof c!="function")throw new TypeError("Object is not disposable.");l&&(c=function(){try{l.call(u)}catch(f){return Promise.reject(f)}}),i.push({v:u,d:c,a})}else a&&i.push({d:u,a});return u}return{e:n,u:o.bind(null,!1),a:o.bind(null,!0),d:function(){var u,c=this.e,l=0;function d(){for(;u=i.pop();)try{if(!u.a&&l===1)return l=0,i.push(u),Promise.resolve().then(d);if(u.d){var p=u.d.call(u.v);if(u.a)return l|=2,Promise.resolve(p).then(d,f)}else l|=1}catch(b){return f(b)}if(l===1)return c!==n?Promise.reject(c):Promise.resolve();if(c!==n)throw c}function f(p){return c=c!==n?new s(p,c):p,d()}return d()}}}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ts=he({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function r(s,n){this.v=s,this.k=n}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Oa=he({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var r=Ts();function s(n){return new r(n,0)}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),Sa=he({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var r=Ts();function s(i){return function(){return new n(i.apply(this,arguments))}}function n(i){var o,a;function u(l,d){try{var f=i[l](d),p=f.value,b=p instanceof r;Promise.resolve(b?p.v:p).then(function(h){if(b){var S=l==="return"?"return":"next";if(!p.k||h.done)return u(S,h);h=i[S](h).value}c(f.done?"return":"normal",h)},function(h){u("throw",h)})}catch(h){c("throw",h)}}function c(l,d){switch(l){case"return":o.resolve({value:d,done:!0});break;case"throw":o.reject(d);break;default:o.resolve({value:d,done:!1})}(o=o.next)?u(o.key,o.arg):a=null}this._invoke=function(l,d){return new Promise(function(f,p){var b={key:l,arg:d,resolve:f,reject:p,next:null};a?a=a.next=b:(o=a=b,u(l,d))})},typeof i.return!="function"&&(this.return=void 0)}n.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},n.prototype.next=function(i){return this._invoke("next",i)},n.prototype.throw=function(i){return this._invoke("throw",i)},n.prototype.return=function(i){return this._invoke("return",i)},t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});z(ga());z(Oa());z(Sa());z(ae());var xa=Object.create,Is=Object.defineProperty,wa=Object.getOwnPropertyDescriptor,As=Object.getOwnPropertyNames,Pa=Object.getPrototypeOf,Ea=Object.prototype.hasOwnProperty,Ee=(e,t)=>function(){return t||(0,e[As(e)[0]])((t={exports:{}}).exports,t),t.exports},ja=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=As(t),i=0,o=n.length,a;i<o;i++)a=n[i],!Ea.call(e,a)&&a!==r&&Is(e,a,{get:(u=>t[u]).bind(null,a),enumerable:!(s=wa(t,a))||s.enumerable});return e},Le=(e,t,r)=>(r=e!=null?xa(Pa(e)):{},ja(t||!e||!e.__esModule?Is(r,"default",{value:e,enumerable:!0}):r,e)),Ca=Ee({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,t){function r(s,n){if(s==null)return{};var i={};for(var o in s)if({}.hasOwnProperty.call(s,o)){if(n.includes(o))continue;i[o]=s[o]}return i}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ra=Ee({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var r=Ca();function s(n,i){if(n==null)return{};var o,a,u=r(n,i);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(n);for(a=0;a<c.length;a++)o=c[a],i.includes(o)||{}.propertyIsEnumerable.call(n,o)&&(u[o]=n[o])}return u}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),ks=Ee({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function r(s){"@babel/helpers - typeof";return t.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t.exports.__esModule=!0,t.exports.default=t.exports,r(s)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),_a=Ee({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var r=ks().default;function s(n,i){if(r(n)!="object"||!n)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var a=o.call(n,i||"default");if(r(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ta=Ee({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var r=ks().default,s=_a();function n(i){var o=s(i,"string");return r(o)=="symbol"?o:o+""}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ia=Ee({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var r=Ta();function s(n,i,o){return(i=r(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o,n}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),at=Ee({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var r=Ia();function s(i,o){var a=Object.keys(i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);o&&(u=u.filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable})),a.push.apply(a,u)}return a}function n(i){for(var o=1;o<arguments.length;o++){var a=arguments[o]!=null?arguments[o]:{};o%2?s(Object(a),!0).forEach(function(u){r(i,u,a[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach(function(u){Object.defineProperty(i,u,Object.getOwnPropertyDescriptor(a,u))})}return i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Aa=Le(Ra(),1),jn=Le(at(),1);const ka=["cursor","direction"];function de(e,t,r){const s=e.flatMap(n=>n.split("."));if(!t&&(!r||r==="any"))return s.length?[s]:[];if(r==="infinite"&&Ie(t)&&("direction"in t||"cursor"in t)){const{cursor:n,direction:i}=t,o=(0,Aa.default)(t,ka);return[s,{input:o,type:"infinite"}]}return[s,(0,jn.default)((0,jn.default)({},typeof t<"u"&&t!==re&&{input:t}),r&&r!=="any"&&{type:r})]}function Ot(e){return de(e,void 0,"any")}function La(e){return Zt(({path:t,args:r})=>{var s;const n=[...t],i=n.pop();if(i==="useMutation")return e[i](n,...r);if(i==="_def")return{path:n};const[o,...a]=r,u=(s=a[0])!==null&&s!==void 0?s:{};return e[i](n,o,u)})}var lr;const Da=["client","ssrContext","ssrState","abortOnUnmount"],Ma=(lr=g.createContext)===null||lr===void 0?void 0:lr.call(Ns,null),Na=e=>{switch(e){case"queryOptions":case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"infiniteQueryOptions":case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"setMutationDefaults":case"getMutationDefaults":case"isMutating":case"cancel":case"invalidate":case"refetch":case"reset":return"any"}};function Ua(e){return Zt(t=>{const r=[...t.path],s=r.pop(),n=[...t.args],i=n.shift(),o=Na(s),a=de(r,i,o);return{infiniteQueryOptions:()=>e.infiniteQueryOptions(r,a,n[0]),queryOptions:()=>e.queryOptions(r,a,...n),fetch:()=>e.fetchQuery(a,...n),fetchInfinite:()=>e.fetchInfiniteQuery(a,n[0]),prefetch:()=>e.prefetchQuery(a,...n),prefetchInfinite:()=>e.prefetchInfiniteQuery(a,n[0]),ensureData:()=>e.ensureQueryData(a,...n),invalidate:()=>e.invalidateQueries(a,...n),reset:()=>e.resetQueries(a,...n),refetch:()=>e.refetchQueries(a,...n),cancel:()=>e.cancelQuery(a,...n),setData:()=>{e.setQueryData(a,n[0],n[1])},setQueriesData:()=>e.setQueriesData(a,n[0],n[1],n[2]),setInfiniteData:()=>{e.setInfiniteQueryData(a,n[0],n[1])},getData:()=>e.getQueryData(a),getInfiniteData:()=>e.getInfiniteQueryData(a),setMutationDefaults:()=>e.setMutationDefaults(Ot(r),i),getMutationDefaults:()=>e.getMutationDefaults(Ot(r)),isMutating:()=>e.isMutating({mutationKey:Ot(r)})}[s]()})}function Qa(e){const t=_s(e.client),r=Ua(e);return Kr(s=>{const n=s;return n==="client"?t:Da.includes(n)?e[n]:r[s]})}var qa=Le(at(),1);function Cn(e){const t=e instanceof Xt?e:Vr(e);return Zt(r=>{const s=r.path,n=s.join("."),[i,o]=r.args;return(0,qa.default)({queryKey:de(s,i,"query"),queryFn:()=>t.query(n,i,o?.trpc)},o)})}var dr=Le(at(),1);function ee(e,t,r){var s;const n=e[0];let i=(s=e[1])===null||s===void 0?void 0:s.input;if(r){var o;i=(0,dr.default)((0,dr.default)((0,dr.default)({},(o=i)!==null&&o!==void 0?o:{}),r.pageParam?{cursor:r.pageParam}:{}),{},{direction:r.direction})}return[n.join("."),i,t?.trpc]}var Fa=Ee({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function r(n){var i,o,a,u=2;for(typeof Symbol<"u"&&(o=Symbol.asyncIterator,a=Symbol.iterator);u--;){if(o&&(i=n[o])!=null)return i.call(n);if(a&&(i=n[a])!=null)return new s(i.call(n));o="@@asyncIterator",a="@@iterator"}throw new TypeError("Object is not async iterable")}function s(n){function i(o){if(Object(o)!==o)return Promise.reject(new TypeError(o+" is not an object."));var a=o.done;return Promise.resolve(o.value).then(function(u){return{value:u,done:a}})}return s=function(a){this.s=a,this.n=a.next},s.prototype={s:null,n:null,next:function(){return i(this.n.apply(this.s,arguments))},return:function(a){var u=this.s.return;return u===void 0?Promise.resolve({value:a,done:!0}):i(u.apply(this.s,arguments))},throw:function(a){var u=this.s.return;return u===void 0?Promise.reject(a):i(u.apply(this.s,arguments))}},new s(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ha=Le(Fa(),1);function Tr(e){return{path:e.path.join(".")}}function qe(e){const t=Tr(e);return g.useMemo(()=>t,[t])}async function Ls(e,t,r){const n=t.getQueryCache().build(t,{queryKey:r});n.setState({data:[],status:"success"});const i=[];var o=!1,a=!1,u;try{for(var c=(0,Ha.default)(e),l;o=!(l=await c.next()).done;o=!1){const d=l.value;i.push(d),n.setState({data:[...i]})}}catch(d){a=!0,u=d}finally{try{o&&c.return!=null&&await c.return()}finally{if(a)throw u}}return i}var U=Le(at(),1);function $a(e){const{client:t,queryClient:r}=e,s=t instanceof Xt?t:Vr(t);return{infiniteQueryOptions:(n,i,o)=>{var a,u;const c=((a=i[1])===null||a===void 0?void 0:a.input)===re,l=async d=>{var f;const p=(0,U.default)((0,U.default)({},o),{},{trpc:(0,U.default)((0,U.default)({},o?.trpc),!(o==null||(f=o.trpc)===null||f===void 0)&&f.abortOnUnmount?{signal:d.signal}:{signal:null})});return await s.query(...ee(i,p,{direction:d.direction,pageParam:d.pageParam}))};return Object.assign((0,U.default)((0,U.default)({},o),{},{initialData:o?.initialData,queryKey:i,queryFn:c?re:l,initialPageParam:(u=o?.initialCursor)!==null&&u!==void 0?u:null}),{trpc:Tr({path:n})})},queryOptions:(n,i,o)=>{var a;const u=((a=i[1])===null||a===void 0?void 0:a.input)===re,c=async l=>{var d;const f=(0,U.default)((0,U.default)({},o),{},{trpc:(0,U.default)((0,U.default)({},o?.trpc),!(o==null||(d=o.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:l.signal}:{signal:null})}),p=await s.query(...ee(i,f));return ps(p)?Ls(p,r,i):p};return Object.assign((0,U.default)((0,U.default)({},o),{},{initialData:o?.initialData,queryKey:i,queryFn:u?re:c}),{trpc:Tr({path:n})})},fetchQuery:(n,i)=>r.fetchQuery((0,U.default)((0,U.default)({},i),{},{queryKey:n,queryFn:()=>s.query(...ee(n,i))})),fetchInfiniteQuery:(n,i)=>{var o;return r.fetchInfiniteQuery((0,U.default)((0,U.default)({},i),{},{queryKey:n,queryFn:({pageParam:a,direction:u})=>s.query(...ee(n,i,{pageParam:a,direction:u})),initialPageParam:(o=i?.initialCursor)!==null&&o!==void 0?o:null}))},prefetchQuery:(n,i)=>r.prefetchQuery((0,U.default)((0,U.default)({},i),{},{queryKey:n,queryFn:()=>s.query(...ee(n,i))})),prefetchInfiniteQuery:(n,i)=>{var o;return r.prefetchInfiniteQuery((0,U.default)((0,U.default)({},i),{},{queryKey:n,queryFn:({pageParam:a,direction:u})=>s.query(...ee(n,i,{pageParam:a,direction:u})),initialPageParam:(o=i?.initialCursor)!==null&&o!==void 0?o:null}))},ensureQueryData:(n,i)=>r.ensureQueryData((0,U.default)((0,U.default)({},i),{},{queryKey:n,queryFn:()=>s.query(...ee(n,i))})),invalidateQueries:(n,i,o)=>r.invalidateQueries((0,U.default)((0,U.default)({},i),{},{queryKey:n}),o),resetQueries:(n,i,o)=>r.resetQueries((0,U.default)((0,U.default)({},i),{},{queryKey:n}),o),refetchQueries:(n,i,o)=>r.refetchQueries((0,U.default)((0,U.default)({},i),{},{queryKey:n}),o),cancelQuery:(n,i)=>r.cancelQueries({queryKey:n},i),setQueryData:(n,i,o)=>r.setQueryData(n,i,o),setQueriesData:(n,i,o,a)=>r.setQueriesData((0,U.default)((0,U.default)({},i),{},{queryKey:n}),o,a),getQueryData:n=>r.getQueryData(n),setInfiniteQueryData:(n,i,o)=>r.setQueryData(n,i,o),getInfiniteQueryData:n=>r.getQueryData(n),setMutationDefaults:(n,i)=>{const o=n[0],a=u=>s.mutation(...ee([o,{input:u}],e));return r.setMutationDefaults(n,typeof i=="function"?i({canonicalMutationFn:a}):i)},getMutationDefaults:n=>r.getMutationDefaults(n),isMutating:n=>r.isMutating((0,U.default)((0,U.default)({},n),{},{exact:!0}))}}var O=Le(at());const Rn=(e,t)=>new Proxy(e,{get(s,n){return t(n),s[n]}});function Wa(e){var t,r;const s=(t=void 0)!==null&&t!==void 0?t:x=>x.originalFn(),n=(r=void 0)!==null&&r!==void 0?r:Ma,i=ha,o=x=>{var w;const{abortOnUnmount:m=!1,queryClient:E,ssrContext:R}=x,[_,A]=g.useState((w=x.ssrState)!==null&&w!==void 0?w:!1),C=x.client instanceof Xt?x.client:Vr(x.client),D=g.useMemo(()=>$a({client:C,queryClient:E}),[C,E]),M=g.useMemo(()=>(0,O.default)({abortOnUnmount:m,queryClient:E,client:C,ssrContext:R??null,ssrState:_},D),[m,C,D,E,R,_]);return g.useEffect(()=>{A(Q=>Q?"mounted":!1)},[]),y.jsx(n.Provider,{value:M,children:x.children})};function a(){const x=g.useContext(n);if(!x)throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return x}function u(x,w){var m;const{queryClient:E,ssrState:R}=a();return R&&R!=="mounted"&&((m=E.getQueryCache().find({queryKey:x}))===null||m===void 0?void 0:m.state.status)==="error"?(0,O.default)({retryOnMount:!1},w):w}function c(x,w,m){var E,R,_,A,C;const D=a(),{abortOnUnmount:M,client:Q,ssrState:N,queryClient:q,prefetchQuery:K}=D,Y=de(x,w,"query"),pe=q.getQueryDefaults(Y),V=w===re;typeof window>"u"&&N==="prepass"&&(m==null||(E=m.trpc)===null||E===void 0?void 0:E.ssr)!==!1&&((R=m?.enabled)!==null&&R!==void 0?R:pe?.enabled)!==!1&&!V&&!q.getQueryCache().find({queryKey:Y})&&K(Y,m);const ne=u(Y,(0,O.default)((0,O.default)({},pe),m)),$=(_=(A=m==null||(C=m.trpc)===null||C===void 0?void 0:C.abortOnUnmount)!==null&&A!==void 0?A:void 0)!==null&&_!==void 0?_:M,H=Vi((0,O.default)((0,O.default)({},ne),{},{queryKey:Y,queryFn:V?w:async J=>{const je=(0,O.default)((0,O.default)({},ne),{},{trpc:(0,O.default)((0,O.default)({},ne?.trpc),$?{signal:J.signal}:{signal:null})}),er=await Q.query(...ee(Y,je));return ps(er)?Ls(er,q,Y):er}}),q);return H.trpc=qe({path:x}),H}function l(x,w,m){var E,R,_;const A=a(),C=de(x,w,"query"),D=w===re,M=(E=(R=m==null||(_=m.trpc)===null||_===void 0?void 0:_.abortOnUnmount)!==null&&R!==void 0?R:void 0)!==null&&E!==void 0?E:A.abortOnUnmount;Xi((0,O.default)((0,O.default)({},m),{},{queryKey:C,queryFn:D?w:Q=>{const N={trpc:(0,O.default)((0,O.default)({},m?.trpc),M?{signal:Q.signal}:{})};return A.client.query(...ee(C,N))}}))}function d(x,w,m){var E,R,_;const A=a(),C=de(x,w,"query"),D=(E=(R=m==null||(_=m.trpc)===null||_===void 0?void 0:_.abortOnUnmount)!==null&&R!==void 0?R:void 0)!==null&&E!==void 0?E:A.abortOnUnmount,M=Yi((0,O.default)((0,O.default)({},m),{},{queryKey:C,queryFn:Q=>{const N=(0,O.default)((0,O.default)({},m),{},{trpc:(0,O.default)((0,O.default)({},m?.trpc),D?{signal:Q.signal}:{signal:null})});return A.client.query(...ee(C,N))}}),A.queryClient);return M.trpc=qe({path:x}),[M.data,M]}function f(x,w){const{client:m,queryClient:E}=a(),R=Ot(x),_=E.defaultMutationOptions(E.getMutationDefaults(R)),A=to((0,O.default)((0,O.default)({},w),{},{mutationKey:R,mutationFn:C=>m.mutation(...ee([x,{input:C}],w)),onSuccess(...C){var D,M;return s({originalFn:()=>{var N,q,K;return(N=w==null||(q=w.onSuccess)===null||q===void 0?void 0:q.call(w,...C))!==null&&N!==void 0?N:_==null||(K=_.onSuccess)===null||K===void 0?void 0:K.call(_,...C)},queryClient:E,meta:(D=(M=w?.meta)!==null&&M!==void 0?M:_?.meta)!==null&&D!==void 0?D:{}})}}),E);return A.trpc=qe({path:x}),A}const p={data:void 0,error:null,status:"idle"},b={data:void 0,error:null,status:"connecting"};function h(x,w,m){var E;const R=(E=m?.enabled)!==null&&E!==void 0?E:w!==re,_=Pe(de(x,w,"any")),{client:A}=a(),C=g.useRef(m);g.useEffect(()=>{C.current=m});const[D]=g.useState(new Set([])),M=g.useCallback(V=>{D.add(V)},[D]),Q=g.useRef(null),N=g.useCallback(V=>{const ne=K.current,$=K.current=V(ne);let H=!1;for(const J of D)if(ne[J]!==$[J]){H=!0;break}H&&pe(Rn($,M))},[M,D]),q=g.useCallback(()=>{var V;if((V=Q.current)===null||V===void 0||V.unsubscribe(),!R){N(()=>(0,O.default)((0,O.default)({},p),{},{reset:q}));return}N(()=>(0,O.default)((0,O.default)({},b),{},{reset:q}));const ne=A.subscription(x.join("."),w??void 0,{onStarted:()=>{var $,H;($=(H=C.current).onStarted)===null||$===void 0||$.call(H),N(J=>(0,O.default)((0,O.default)({},J),{},{status:"pending",error:null}))},onData:$=>{var H,J;(H=(J=C.current).onData)===null||H===void 0||H.call(J,$),N(je=>(0,O.default)((0,O.default)({},je),{},{status:"pending",data:$,error:null}))},onError:$=>{var H,J;(H=(J=C.current).onError)===null||H===void 0||H.call(J,$),N(je=>(0,O.default)((0,O.default)({},je),{},{status:"error",error:$}))},onConnectionStateChange:$=>{N(H=>{switch($.state){case"idle":return(0,O.default)((0,O.default)({},H),{},{status:$.state,error:null,data:void 0});case"connecting":return(0,O.default)((0,O.default)({},H),{},{error:$.error,status:$.state});case"pending":return H}})},onComplete:()=>{var $,H;($=(H=C.current).onComplete)===null||$===void 0||$.call(H),N(J=>(0,O.default)((0,O.default)({},J),{},{status:"idle",error:null,data:void 0}))}});Q.current=ne},[A,_,R,N]);g.useEffect(()=>(q(),()=>{var V;(V=Q.current)===null||V===void 0||V.unsubscribe()}),[q]);const K=g.useRef(R?(0,O.default)((0,O.default)({},b),{},{reset:q}):(0,O.default)((0,O.default)({},p),{},{reset:q})),[Y,pe]=g.useState(Rn(K.current,M));return Y}function S(x,w,m){var E,R,_,A,C;const{client:D,ssrState:M,prefetchInfiniteQuery:Q,queryClient:N,abortOnUnmount:q}=a(),K=de(x,w,"infinite"),Y=N.getQueryDefaults(K),pe=w===re;typeof window>"u"&&M==="prepass"&&(m==null||(E=m.trpc)===null||E===void 0?void 0:E.ssr)!==!1&&((R=m?.enabled)!==null&&R!==void 0?R:Y?.enabled)!==!1&&!pe&&!N.getQueryCache().find({queryKey:K})&&Q(K,(0,O.default)((0,O.default)({},Y),m));const V=u(K,(0,O.default)((0,O.default)({},Y),m)),ne=(_=m==null||(A=m.trpc)===null||A===void 0?void 0:A.abortOnUnmount)!==null&&_!==void 0?_:q,$=ro((0,O.default)((0,O.default)({},V),{},{initialPageParam:(C=m.initialCursor)!==null&&C!==void 0?C:null,persister:m.persister,queryKey:K,queryFn:pe?w:H=>{var J;const je=(0,O.default)((0,O.default)({},V),{},{trpc:(0,O.default)((0,O.default)({},V?.trpc),ne?{signal:H.signal}:{signal:null})});return D.query(...ee(K,je,{pageParam:(J=H.pageParam)!==null&&J!==void 0?J:m.initialCursor,direction:H.direction}))}}),N);return $.trpc=qe({path:x}),$}function P(x,w,m){var E,R,_;const A=a(),C=de(x,w,"infinite"),D=A.queryClient.getQueryDefaults(C),M=w===re,Q=u(C,(0,O.default)((0,O.default)({},D),m)),N=(E=m==null||(R=m.trpc)===null||R===void 0?void 0:R.abortOnUnmount)!==null&&E!==void 0?E:A.abortOnUnmount;eo((0,O.default)((0,O.default)({},m),{},{initialPageParam:(_=m.initialCursor)!==null&&_!==void 0?_:null,queryKey:C,queryFn:M?w:q=>{var K;const Y=(0,O.default)((0,O.default)({},Q),{},{trpc:(0,O.default)((0,O.default)({},Q?.trpc),N?{signal:q.signal}:{})});return A.client.query(...ee(C,Y,{pageParam:(K=q.pageParam)!==null&&K!==void 0?K:m.initialCursor,direction:q.direction}))}}))}function j(x,w,m){var E,R,_;const A=a(),C=de(x,w,"infinite"),D=A.queryClient.getQueryDefaults(C),M=u(C,(0,O.default)((0,O.default)({},D),m)),Q=(E=m==null||(R=m.trpc)===null||R===void 0?void 0:R.abortOnUnmount)!==null&&E!==void 0?E:A.abortOnUnmount,N=Ji((0,O.default)((0,O.default)({},m),{},{initialPageParam:(_=m.initialCursor)!==null&&_!==void 0?_:null,queryKey:C,queryFn:q=>{var K;const Y=(0,O.default)((0,O.default)({},M),{},{trpc:(0,O.default)((0,O.default)({},M?.trpc),Q?{signal:q.signal}:{})});return A.client.query(...ee(C,Y,{pageParam:(K=q.pageParam)!==null&&K!==void 0?K:m.initialCursor,direction:q.direction}))}}),A.queryClient);return N.trpc=qe({path:x}),[N.data,N]}return{Provider:o,createClient:i,useContext:a,useUtils:a,useQuery:c,usePrefetchQuery:l,useSuspenseQuery:d,useQueries:(x,w)=>{const{ssrState:m,queryClient:E,prefetchQuery:R,client:_}=a(),A=Cn(_),C=x(A);if(typeof window>"u"&&m==="prepass")for(const M of C){var D;const Q=M;((D=Q.trpc)===null||D===void 0?void 0:D.ssr)!==!1&&!E.getQueryCache().find({queryKey:Q.queryKey})&&R(Q.queryKey,Q)}return as({queries:C.map(M=>(0,O.default)((0,O.default)({},M),{},{queryKey:M.queryKey})),combine:w?.combine},E)},useSuspenseQueries:x=>{const{queryClient:w,client:m}=a(),E=Cn(m),R=x(E),_=Zi({queries:R.map(A=>(0,O.default)((0,O.default)({},A),{},{queryFn:A.queryFn,queryKey:A.queryKey}))},w);return[_.map(A=>A.data),_]},useMutation:f,useSubscription:h,useInfiniteQuery:S,usePrefetchInfiniteQuery:P,useSuspenseInfiniteQuery:j}}function Ka(e){const t=La(e);return Kr(r=>r==="useContext"||r==="useUtils"?()=>{const s=e.useUtils();return g.useMemo(()=>Qa(s),[s])}:e.hasOwnProperty(r)?e[r]:t[r])}function Ba(e){const t=Wa();return Ka(t)}const Yr=Ba();function Ds(e){e instanceof fe&&e.data?.code==="UNAUTHORIZED"&&location.reload()}const Ga=new Ki({defaultOptions:{queries:{retry:(e,t)=>t instanceof fe&&t.data?.code==="UNAUTHORIZED"?!1:e<2,staleTime:5e3},mutations:{onError:Ds}}});Ga.getQueryCache().subscribe(e=>{e.type==="updated"&&e.action.type==="error"&&Ds(e.action.error)});const cu=Yr.createClient({links:[po({condition:e=>e.type==="subscription",true:ba({url:"/trpc",eventSourceOptions:{withCredentials:!0}}),false:sa({url:"/trpc",fetch:(e,t)=>fetch(e,{...t,credentials:"include"})})})]}),za=({disabled:e=!1,value:t,onChange:r,...s})=>{const[n,i]=g.useState(!1),[o,a]=g.useState(!1),[u,c]=g.useState([]),l=g.useRef(null),d=Yr.useUtils();async function f(){a(!0),c([]);const p=await d.role.list.fetch();c(p.map(b=>b.name)),a(!1)}return g.useEffect(()=>{if(!n)return;function p(b){b.target&&!l.current?.contains(b.target)&&i(!1)}return document.addEventListener("click",p),()=>document.removeEventListener("click",p)},[n]),y.jsxs("div",{className:`role-dropdown ${e?"disabled":""}`,ref:l,...s,children:[n&&y.jsxs("div",{className:"options",children:[o&&y.jsx("div",{className:"option search",style:{position:"relative"},children:y.jsx(_n,{active:!0,size:"small"})}),u.map(p=>y.jsx("div",{onClick:()=>{r(p),i(!1)},className:`option ${t===p?"green":""}`,children:p},p))]}),y.jsxs("div",{className:"selected",onClick:()=>{i(p=>!p),n||f()},children:[y.jsx("div",{className:"value",children:t}),y.jsx(Ir,{})]})]})},lu=({placeholder:e="",disabled:t=!1,type:r,value:s=[],options:n=[],onChange:i})=>{const o=(c,l)=>{const d=s.slice();d[c]=l,i(d)},a=()=>{const c=s.slice();c.push({string:"",number:0,password:"",role:"",enum:n&&n[0]}[r]),i(c)},u=c=>{const l=s.slice();l.splice(c,1),i(l)};return y.jsxs("div",{className:`br-list-input ${t?"disabled":""}`,children:[(s||[]).map((c,l)=>y.jsxs("div",{className:"br-list-item",children:[(r==="string"||r==="password"||r==="number")&&y.jsx(Tn,{value:c,onChange:d=>o(l,d),placeholder:e,type:r==="string"?"text":r,disabled:t}),r==="enum"&&y.jsx(gi,{value:c,options:n,onChange:d=>o(l,d),disabled:t}),r==="role"&&y.jsx(za,{value:c,onChange:d=>o(l,d),disabled:t}),y.jsx(Ve,{icon:!0,warn:!0,"data-tooltip":"Remove this item from the list",onClick:()=>u(l),disabled:t,children:y.jsx(In,{})})]},l)),y.jsx(Ve,{icon:!0,main:!0,"data-tooltip":"Add an item to the list",onClick:a,disabled:t,children:y.jsx(qs,{})})]})},Va=({children:e,attached:t,className:r})=>y.jsx("div",{className:`navbar ${t?"attached":""} ${r??""}`,children:e}),du=({title:e,className:t,children:r})=>{const s=Jr(Xs),n=Jr(ei),[i,o]=g.useState(!1);return y.jsxs("div",{className:`main-nav ${t??""}`,children:[y.jsx("header",{className:"nav-header",children:e}),y.jsxs(Va,{children:[y.jsx("span",{style:{flex:1}}),r,n&&y.jsxs("div",{className:"widgets-container user-menu",children:[y.jsxs(Ve,{normal:!0,boxy:!0,onClick:()=>o(!i),children:[y.jsx(An,{}),y.jsx("span",{className:"user-menu-name",children:s?.username||"Admin"}),i?y.jsx(Fs,{}):y.jsx(Ir,{})]}),y.jsxs("div",{className:"widgets-list",style:{display:i?"block":"none"},children:[y.jsx(tt,{href:"/account",className:"button normal",onClick:()=>o(!1),children:y.jsxs("div",{className:"button-content",children:[y.jsx(kn,{}),"Account"]})}),y.jsxs(Ve,{error:!0,onClick:()=>Js(),children:[y.jsx(Hs,{}),"Logout"]})]})]})]})]})},fu=({children:e})=>y.jsx("div",{className:"main-content",children:e}),hu=({children:e,loading:t})=>y.jsxs("div",{children:[y.jsx(Ms,{}),y.jsx("div",{className:"content-parent",children:!t&&y.jsx("div",{className:"content",children:e})})]}),pu=({disabled:e=!1,value:t,placeholder:r,onChange:s,...n})=>{const[i,o]=g.useState(!1),[a,u]=g.useState(!1),[c,l]=g.useState([]),[d,f]=g.useState(""),p=g.useRef(null),b=Yr.useUtils();g.useEffect(()=>{if(!i)return;function k(F){F.target&&!p.current?.contains(F.target)&&o(!1)}return document.addEventListener("click",k),()=>document.removeEventListener("click",k)},[i]);function h(k){const F=t.slice();F.splice(k,1),s(F)}function S({id:k,name:F}){s([...t,{id:k,name:F}]),o(!1),f("")}const P=g.useRef(d);P.current=d;const j=g.useMemo(()=>Zs(async()=>{if(P.current.length===0){o(!1),u(!1),l([]);return}u(!0),o(!0);const{players:k}=await b.player.list.fetch({page:0,search:P.current,sort:"lastSeen",direction:-1,filter:""});l(k),u(!1)},500),[]);return y.jsxs("div",{className:`br-player-list ${e?"disabled":""}`,...n,children:[t.map((k,F)=>y.jsxs("div",{className:"br-player-item",children:[y.jsx(tt,{href:`/players/${k.id}`,className:"selected","data-tooltip":"Click to navigate to player page",children:k.name}),y.jsx(Ve,{icon:!0,warn:!0,"data-tooltip":"Remove this player from the list",onClick:()=>h(F),children:y.jsx(In,{})})]},k.id)),y.jsxs("div",{className:"player-search",ref:p,children:[y.jsx(Tn,{type:"text",placeholder:"Search Players...",value:d,onChange:k=>{f(k),j()}}),i&&y.jsxs("div",{className:"options",children:[a&&y.jsx("div",{className:"option search",style:{position:"relative"},children:y.jsx(_n,{active:!0,size:"small"})}),c.map(k=>y.jsx("div",{onClick:()=>S(k),className:"option",children:k.name},k.id))]})]})]})},yu=({children:e,className:t,ref:r,...s})=>y.jsx("div",{className:`scroll-container ${t??""}`,...s,children:y.jsx("div",{className:"scroll-scroller",ref:r,children:e})}),T={ChatSend:"chat.send",ChatRecent:"chat.recent",ChatHistory:"chat.history",ChatCalendar:"chat.calendar",PlayerList:"player.list",PlayerGet:"player.get",PlayerBan:"player.ban",PlayerKick:"player.kick",PlayerUnban:"player.unban",PlayerClearBricks:"player.clearBricks",PluginList:"plugin.list",PluginGet:"plugin.get",PluginConfig:"plugin.config",PluginLoad:"plugin.load",PluginUnload:"plugin.unload",PluginToggle:"plugin.toggle",PluginReloadAll:"plugin.reloadAll",ServerStatus:"server.status",ServerStart:"server.start",ServerStop:"server.stop",ServerRestart:"server.restart",ServerUpdateCheck:"server.update.check",ServerUpdateRun:"server.update.run",ServerAutorestartGet:"server.autorestart.get",ServerAutorestartSet:"server.autorestart.set",ServerUtilization:"server.utilization",UserList:"user.list",UserCreate:"user.create",UserPasswd:"user.passwd",UserBan:"user.ban",UserDelete:"user.delete",UserPermissions:"user.permissions",UserReadMfa:"user.readMfa",UserResetMfa:"user.resetMfa",WorldList:"world.list",WorldActive:"world.active",WorldNext:"world.next",WorldRevisions:"world.revisions",WorldMeta:"world.meta",WorldLoad:"world.load",WorldUse:"world.use",WorldSave:"world.save",WorldCreate:"world.create"},I={Chat:"chat",Player:"player",Plugin:"plugin",Server:"server",User:"user",World:"world"},mu={chat:"Chat",player:"Player",plugin:"Plugin",server:"Server",user:"User",world:"World"},vu=[I.Chat,I.Player,I.Plugin,I.Server,I.User,I.World],Ya={[T.ChatSend]:{description:"Send messages in the dashboard chat widget",readOnly:!1,domain:I.Chat},[T.ChatRecent]:{description:"View recent chat on the dashboard",readOnly:!0,domain:I.Chat},[T.ChatHistory]:{description:"Browse past chat logs in the history view",readOnly:!0,domain:I.Chat},[T.ChatCalendar]:{description:"Navigate chat by date in the history view",readOnly:!0,domain:I.Chat},[T.PlayerList]:{description:"View the player list in the players view",readOnly:!0,domain:I.Player},[T.PlayerGet]:{description:"Inspect player details and history",readOnly:!0,domain:I.Player},[T.PlayerBan]:{description:"Ban players from the player inspector",readOnly:!1,domain:I.Player},[T.PlayerKick]:{description:"Kick players from the player inspector",readOnly:!1,domain:I.Player},[T.PlayerUnban]:{description:"Unban players from the player inspector",readOnly:!1,domain:I.Player},[T.PlayerClearBricks]:{description:"Clear a player's bricks from the player inspector",readOnly:!1,domain:I.Player},[T.PluginList]:{description:"View installed plugins in the plugins view",readOnly:!0,domain:I.Plugin},[T.PluginGet]:{description:"Inspect plugin details and configuration",readOnly:!0,domain:I.Plugin},[T.PluginConfig]:{description:"Edit plugin settings in the plugin inspector",readOnly:!1,domain:I.Plugin},[T.PluginLoad]:{description:"Load plugins from the plugin inspector",readOnly:!1,domain:I.Plugin},[T.PluginUnload]:{description:"Unload plugins from the plugin inspector",readOnly:!1,domain:I.Plugin},[T.PluginToggle]:{description:"Enable or disable plugins in the plugins view",readOnly:!1,domain:I.Plugin},[T.PluginReloadAll]:{description:"Reload all plugins from the plugins view",readOnly:!1,domain:I.Plugin},[T.ServerStatus]:{description:"View server status on the dashboard and server view",readOnly:!0,domain:I.Server},[T.ServerStart]:{description:"Start the server from the server view",readOnly:!1,domain:I.Server},[T.ServerStop]:{description:"Stop the server from the server view",readOnly:!1,domain:I.Server},[T.ServerRestart]:{description:"Restart the server from the server view",readOnly:!1,domain:I.Server},[T.ServerUpdateCheck]:{description:"Check for server updates in the server view",readOnly:!1,domain:I.Server},[T.ServerUpdateRun]:{description:"Run server updates from the server view",readOnly:!1,domain:I.Server},[T.ServerAutorestartGet]:{description:"View auto-restart settings in the server view",readOnly:!0,domain:I.Server},[T.ServerAutorestartSet]:{description:"Change auto-restart settings in the server view",readOnly:!1,domain:I.Server},[T.ServerUtilization]:{description:"View CPU, memory, and disk usage on the dashboard",readOnly:!0,domain:I.Server},[T.UserList]:{description:"View web UI user accounts in the users view",readOnly:!0,domain:I.User},[T.UserCreate]:{description:"Create new user accounts in the users view",readOnly:!1,domain:I.User},[T.UserPasswd]:{description:"Change user passwords in the users view",readOnly:!1,domain:I.User},[T.UserBan]:{description:"Disable or re-enable users in the user inspector",readOnly:!1,domain:I.User},[T.UserDelete]:{description:"Permanently delete user accounts",readOnly:!1,domain:I.User},[T.UserPermissions]:{description:"Edit user and default permissions in the users view",readOnly:!1,domain:I.User},[T.UserReadMfa]:{description:"View MFA status of other users in the user inspector",readOnly:!0,domain:I.User},[T.UserResetMfa]:{description:"Reset MFA for other users in the user inspector",readOnly:!1,domain:I.User},[T.WorldList]:{description:"View available worlds in the worlds view",readOnly:!0,domain:I.World},[T.WorldActive]:{description:"See which world is currently loaded",readOnly:!0,domain:I.World},[T.WorldNext]:{description:"See which world will load next",readOnly:!0,domain:I.World},[T.WorldRevisions]:{description:"View world save revisions in the world inspector",readOnly:!0,domain:I.World},[T.WorldMeta]:{description:"View world metadata in the world inspector",readOnly:!0,domain:I.World},[T.WorldLoad]:{description:"Load worlds from the world inspector",readOnly:!1,domain:I.World},[T.WorldUse]:{description:"Set the default world in the worlds view",readOnly:!1,domain:I.World},[T.WorldSave]:{description:"Save the current world from the worlds or server view",readOnly:!1,domain:I.World},[T.WorldCreate]:{description:"Create new worlds in the worlds view",readOnly:!1,domain:I.World}},Ja={};for(const[e,t]of Object.entries(Ya))(Ja[t.domain]??=[]).push(e);const ge=({children:e,disabled:t,to:r,scope:s,...n})=>{const i=ti(...s?[s]:[]);return s&&!i?null:y.jsx(tt,{href:r,className:o=>`menu-button ${t?"disabled":""} ${o?"active":""}`,...n,children:y.jsx("div",{className:"menu-button-content",children:e})})},bu=g.memo(()=>y.jsxs("div",{className:"main-menu-buttons",children:[y.jsxs(ge,{to:"/","data-tooltip":"Chat with players, view server status. Main Dashboard",children:[y.jsx($s,{style:{background:"#de4f43"}}),"Dashboard"]}),y.jsxs(ge,{to:"/worlds",scope:T.WorldList,"data-tooltip":"Manage worlds",children:[y.jsx(Ws,{style:{background:"#f0a500"}}),"Worlds"]}),y.jsxs(ge,{to:"/history",scope:T.ChatHistory,"data-tooltip":"Browse chat history",children:[y.jsx(Ks,{style:{background:"#008bd6"}}),"History"]}),y.jsxs(ge,{to:"/plugins",scope:T.PluginList,"data-tooltip":"Manage, reload, and configure plugins",children:[y.jsx(Bs,{style:{background:"#00b35f"}}),"Plugins"]}),y.jsxs(ge,{to:"/players",scope:T.PlayerList,"data-tooltip":"Browse player info and play time",children:[y.jsx(Gs,{style:{background:"#b3006b"}}),"Players"]}),y.jsxs(ge,{to:"/server",scope:T.ServerStatus,"data-tooltip":"Server management",children:[y.jsx(zs,{style:{background:"#453d9c"}}),"Server"]}),y.jsxs(ge,{to:"/users",scope:T.UserList,"data-tooltip":"Server users",children:[y.jsx(An,{style:{background:"#7f0b8a"}}),"Users"]}),y.jsxs(ge,{to:"/account","data-tooltip":"Your account settings",children:[y.jsx(kn,{style:{background:"#5a5a5a"}}),"Account"]})]})),gu=({name:e,sort:t,direction:r})=>e===t&&y.jsxs(y.Fragment,{children:[r===1&&y.jsx(Vs,{}),r===-1&&y.jsx(Ys,{})]}),Ou=({disabled:e=!1,value:t,onChange:r,tooltip:s})=>y.jsx("div",{"data-tooltip":s,className:`toggle ${e?"disabled":""}`,onClick:()=>r(!t),children:y.jsx("div",{className:`toggle-slider ${t?"on":""}`,children:y.jsx("div",{className:"symbol"})})});export{ou as C,vu as D,au as I,vi as L,du as N,fu as P,uu as Q,za as R,bu as S,fe as T,dt as U,Ja as a,mu as b,Ya as c,Ou as d,T as e,Va as f,yu as g,Ds as h,gi as i,gu as j,lu as k,pu as l,cu as m,hu as n,bi as o,Ga as q,Yr as t};
4
+ //# sourceMappingURL=index-Dkh3HiBz.js.map