ranui 0.4.1-alpha.2 → 0.4.2-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/dist/{arc-DOGcyb-0.js → arc-BTq35m9x.js} +2 -2
  2. package/dist/{arc-ByizYZ13.cjs → arc-BjIU7MOi.cjs} +1 -1
  3. package/dist/builder-2HD21I6K.cjs +1 -0
  4. package/dist/builder.js +2 -2
  5. package/dist/{button-DFBA474n.js → button-BgWXCj7-.js} +4 -4
  6. package/dist/button.js +1 -1
  7. package/dist/{card-Cfkb7dIm.js → card-DzVv3ADA.js} +3 -3
  8. package/dist/card.js +1 -1
  9. package/dist/{checkbox-CeVzf_ff.js → checkbox-KOXDiwRr.js} +4 -4
  10. package/dist/checkbox.js +1 -1
  11. package/dist/{circle-DgoPsPmL.cjs → circle-By7YwAJj.cjs} +1 -1
  12. package/dist/{circle-fold-DGHgTbNx.cjs → circle-fold-BJWGLDa6.cjs} +1 -1
  13. package/dist/{circle-fold-CZf63cE1.js → circle-fold-DrwUHB-m.js} +2 -2
  14. package/dist/{circle-line-DDD6hHbp.cjs → circle-line-BsXpw2HA.cjs} +1 -1
  15. package/dist/{circle-line-vsuTmqx8.js → circle-line-DCUX3o9u.js} +2 -2
  16. package/dist/{circle-rotate-B7JrnjYG.cjs → circle-rotate-BK1tW3Jv.cjs} +1 -1
  17. package/dist/{circle-rotate-DDC3CKzB.js → circle-rotate-DeBqoVVp.js} +2 -2
  18. package/dist/{circle-spin-Djuwx9eN.js → circle-spin-Crycoffl.js} +2 -2
  19. package/dist/{circle-spin-CIMhAYj5.cjs → circle-spin-Ctoq0Wil.cjs} +1 -1
  20. package/dist/{circle-turn-DtYjq4Ky.js → circle-turn-DytKZEgU.js} +2 -2
  21. package/dist/{circle-turn-D1Z-dXF8.cjs → circle-turn-J9aToB75.cjs} +1 -1
  22. package/dist/{colorpicker-C8vbgSta.js → colorpicker-7adjGSuz.js} +7 -7
  23. package/dist/colorpicker.js +1 -1
  24. package/dist/{content-WyCTQEb9.js → content-BmwgR8WP.js} +3 -3
  25. package/dist/content.js +1 -1
  26. package/dist/{cube-BHbuhZjD.cjs → cube-BB32JJuI.cjs} +1 -1
  27. package/dist/{cube-dim-JK8OwqXU.cjs → cube-dim-DTcZAlcE.cjs} +1 -1
  28. package/dist/{cube-dim-FDQVX9Sb.js → cube-dim-DgfzlG3p.js} +2 -2
  29. package/dist/{cube-fold-DMmWEicy.cjs → cube-fold-CKVQ1IDZ.cjs} +1 -1
  30. package/dist/{cube-fold-68Pk6igJ.js → cube-fold-Dp4-pf7P.js} +2 -2
  31. package/dist/{cube-grid-C5ONBtr1.cjs → cube-grid-BrxyqSNh.cjs} +1 -1
  32. package/dist/{cube-grid-DTgwN5o-.js → cube-grid-DprxkSoT.js} +2 -2
  33. package/dist/{cube-BJr0a40o.js → cube-iOzgFQbc.js} +2 -2
  34. package/dist/{dot-bar-Ddbyx-0a.cjs → dot-bar-C2PcL7wc.cjs} +1 -1
  35. package/dist/{dot-bar-CXBmT1RL.js → dot-bar-vHWpqnhw.js} +2 -2
  36. package/dist/{dot-circle-DksscvAR.js → dot-circle-DQqpkRr_.js} +2 -2
  37. package/dist/{dot-circle-DxoSLiz7.cjs → dot-circle-EInrpGOw.cjs} +1 -1
  38. package/dist/{dot-D8taMWFZ.cjs → dot-do6V9GYP.cjs} +1 -1
  39. package/dist/{dot-line-CKcmWaBb.cjs → dot-line-BEFriL91.cjs} +1 -1
  40. package/dist/{dot-line-8Z2hpBOL.js → dot-line-CorWP6p2.js} +2 -2
  41. package/dist/{dot-pulse-DVwedcib.cjs → dot-pulse-BGidqqxA.cjs} +1 -1
  42. package/dist/{dot-pulse-BC7xaifX.js → dot-pulse-OtjDlpwG.js} +2 -2
  43. package/dist/{double-bounce-BVGrEHLy.js → double-bounce-CWAE4F5S.js} +2 -2
  44. package/dist/{double-bounce-Cxp3i6ip.cjs → double-bounce-DOehLE4X.cjs} +1 -1
  45. package/dist/{drop-q8qufm5t.cjs → drop-BkBi0TEt.cjs} +1 -1
  46. package/dist/{drop-CTufsC6T.js → drop-CTSvqyOb.js} +2 -2
  47. package/dist/{dropdown-B2Sk5gQF.js → dropdown-DQy4YvVn.js} +4 -4
  48. package/dist/dropdown.js +1 -1
  49. package/dist/{factory-Ce9hR27Y.js → factory-Bbul5tOL.js} +1 -1
  50. package/dist/{form-C0-UiXLj.js → form-DwjKUNz4.js} +3 -3
  51. package/dist/form.js +1 -1
  52. package/dist/{glass-TzHfgesD.js → glass-DKQAEAmc.js} +3 -3
  53. package/dist/glass.js +1 -1
  54. package/dist/{icon-BoaQYEij.js → icon-DSIyi1nQ.js} +3 -3
  55. package/dist/icon.js +1 -1
  56. package/dist/icons.js +1 -1
  57. package/dist/iife/button.iife.js +1 -1
  58. package/dist/iife/card.iife.js +1 -1
  59. package/dist/iife/checkbox.iife.js +1 -1
  60. package/dist/iife/colorpicker.iife.js +1 -1
  61. package/dist/iife/content.iife.js +1 -1
  62. package/dist/iife/dropdown.iife.js +1 -1
  63. package/dist/iife/form.iife.js +1 -1
  64. package/dist/iife/glass.iife.js +1 -1
  65. package/dist/iife/icon.iife.js +1 -1
  66. package/dist/iife/image.iife.js +1 -1
  67. package/dist/iife/input.iife.js +1 -1
  68. package/dist/iife/link.iife.js +1 -1
  69. package/dist/iife/loading.iife.js +1 -1
  70. package/dist/iife/math.iife.js +1 -1
  71. package/dist/iife/mermaid.iife.js +1 -1
  72. package/dist/iife/message.iife.js +1 -1
  73. package/dist/iife/modal.iife.js +1 -1
  74. package/dist/iife/player.iife.js +1 -1
  75. package/dist/iife/popover.iife.js +1 -1
  76. package/dist/iife/progress.iife.js +1 -1
  77. package/dist/iife/radar.iife.js +1 -1
  78. package/dist/iife/route.iife.js +1 -1
  79. package/dist/iife/router.iife.js +1 -1
  80. package/dist/iife/scratch.iife.js +1 -1
  81. package/dist/iife/section.iife.js +1 -1
  82. package/dist/iife/select.iife.js +1 -1
  83. package/dist/iife/skeleton.iife.js +1 -1
  84. package/dist/iife/tab.iife.js +1 -1
  85. package/dist/iife/tabpane.iife.js +1 -1
  86. package/dist/iife/theme-switch.iife.js +1 -1
  87. package/dist/{image-CNpdv9k_.js → image-Bn0VuwO0.js} +3 -3
  88. package/dist/image.js +1 -1
  89. package/dist/index.cjs +3 -3
  90. package/dist/index.iife.js +106 -106
  91. package/dist/index.js +30 -30
  92. package/dist/{input-_iNjylVC.js → input-2Zz1gLzy.js} +4 -4
  93. package/dist/input.js +1 -1
  94. package/dist/{line-qgqu6ngc.cjs → line-BFm46PmI.cjs} +1 -1
  95. package/dist/{line-Bhz15vpy.js → line-Dt7YMxyn.js} +2 -2
  96. package/dist/{line-scale-CtMO8YfX.js → line-scale-BNCCcLKl.js} +2 -2
  97. package/dist/{line-scale-Dr9ILV5d.cjs → line-scale-Mzdq1fTx.cjs} +1 -1
  98. package/dist/{link-CmMSKe18.js → link-DcRMinJ9.js} +2 -2
  99. package/dist/link.js +1 -1
  100. package/dist/{loading-DHQDAkef.js → loading-BXZBOAbH.js} +30 -30
  101. package/dist/loading.js +1 -1
  102. package/dist/{math-DobANAnr.js → math-C6oaCrk-.js} +4 -4
  103. package/dist/math.js +1 -1
  104. package/dist/{mermaid-CwMPhttK.js → mermaid-Cmxzclzv.js} +4 -4
  105. package/dist/mermaid.js +1 -1
  106. package/dist/{message-CT-at-dX.js → message-E92Vu7SO.js} +4 -4
  107. package/dist/message.js +1 -1
  108. package/dist/{modal-COzuPRoz.cjs → modal-BQUM-5G3.cjs} +1 -1
  109. package/dist/{modal-DkFW7_It.js → modal-TayIRDMV.js} +3 -3
  110. package/dist/modal.js +1 -1
  111. package/dist/{pacman-DSIM9KGC.js → pacman-DqDqKzL4.js} +2 -2
  112. package/dist/{pacman-C7_BcAl5.cjs → pacman-hB0Vx_ut.cjs} +1 -1
  113. package/dist/{player-Dhv_QP4a.js → player-BZVIOmdS.js} +5 -5
  114. package/dist/player.js +1 -1
  115. package/dist/{popover-DR5ua2_I.js → popover-Bimxdeql.js} +6 -6
  116. package/dist/popover.js +1 -1
  117. package/dist/{progress-BRIBVXqD.js → progress-CNUdc_VD.js} +4 -4
  118. package/dist/progress.js +1 -1
  119. package/dist/{pulse-QISsDmFE.cjs → pulse-CPV8p0Lr.cjs} +1 -1
  120. package/dist/{pulse-DNmbppj-.js → pulse-IOuRzRUm.js} +2 -2
  121. package/dist/{radar-B9eKnRw8.js → radar-Dse0Dgma.js} +4 -4
  122. package/dist/radar.js +1 -1
  123. package/dist/{rotate-VMR047YI.cjs → rotate-O1KJozW0.cjs} +1 -1
  124. package/dist/{rotate-BX5qIRKZ.js → rotate-uZhtaw8R.js} +2 -2
  125. package/dist/{route-C9sC9d8P.js → route-Dh5S2dSW.js} +3 -3
  126. package/dist/route.js +1 -1
  127. package/dist/{router-CID9Dasr.js → router-DUxBSvIi.js} +3 -3
  128. package/dist/router.js +1 -1
  129. package/dist/{scale-out-aZu3503p.cjs → scale-out-CEERARri.cjs} +1 -1
  130. package/dist/{scale-out-DqffQsuL.js → scale-out-mSsKNtie.js} +2 -2
  131. package/dist/{scratch-y8Op8fTo.js → scratch-4TCqNbat.js} +3 -3
  132. package/dist/scratch.js +1 -1
  133. package/dist/{section-cgPwzwLR.js → section-CMN7tQ-S.js} +3 -3
  134. package/dist/section.js +1 -1
  135. package/dist/{select-Bqo_7nRL.js → select-D48kcwEy.js} +9 -9
  136. package/dist/select.js +1 -1
  137. package/dist/{skeleton-wq2ybbYv.js → skeleton-DbgMcQQ0.js} +3 -3
  138. package/dist/skeleton.js +1 -1
  139. package/dist/{solar-DaoF834l.cjs → solar-CdvkRr5X.cjs} +1 -1
  140. package/dist/{solar-BPmDmWLU.js → solar-Ck7RIK09.js} +2 -2
  141. package/dist/{square-DiBkWYAH.cjs → square-exSvykCu.cjs} +1 -1
  142. package/dist/{square-DKQ0d_O6.js → square-xGODzCyr.js} +2 -2
  143. package/dist/ssg.js +1 -1
  144. package/dist/{ssr-vZNJHtYm.js → ssr-BzHZ2bCe.js} +1 -1
  145. package/dist/ssr-stream.js +1 -1
  146. package/dist/ssr.js +1 -1
  147. package/dist/{stretch-BXJ4labN.js → stretch-Bv60MZD_.js} +2 -2
  148. package/dist/{stretch-LP22YEA3.cjs → stretch-CTFwefaK.cjs} +1 -1
  149. package/dist/{tab-DMUILL_2.js → tab-ADuziXeq.js} +3 -3
  150. package/dist/tab.js +1 -1
  151. package/dist/{tabpane-R8Kyn9jv.js → tabpane-Bisq-qpc.js} +3 -3
  152. package/dist/tabpane.js +1 -1
  153. package/dist/{text-C_XRjuGr.cjs → text-BniFEEB5.cjs} +1 -1
  154. package/dist/{text-8gI5TFOa.js → text-CX8UkbzB.js} +2 -2
  155. package/dist/{theme-DAG2-N5e.js → theme-DL6q_FZu.js} +1 -1
  156. package/dist/{theme-switch-D3MpVw-R.js → theme-switch-GbuiPclm.js} +4 -4
  157. package/dist/theme-switch.js +1 -1
  158. package/dist/theme.js +1 -1
  159. package/dist/{triple-bounce-CMwTsw-f.js → triple-bounce-BwxTDpKz.js} +2 -2
  160. package/dist/{triple-bounce-CNjk5imb.cjs → triple-bounce-BzAtF-TA.cjs} +1 -1
  161. package/dist/{utils-DqjNwwjC.js → utils-X5_TIQTQ.js} +3 -3
  162. package/dist/{utils-nntJky78.js → utils-xccQZnoa.js} +29 -25
  163. package/package.json +2 -2
  164. package/dist/builder-BjRti6oP.cjs +0 -1
@@ -1 +1 @@
1
- var ranui_route=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{display:block}:host([hidden]){display:none!important}`,n=typeof document>`u`,r=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.ac.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}},i=0,a=1,o=2,s=null,c=null,l=0,u=new Set,d=!1;function f(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(_(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)v(e,o);l===0&&y()}}]}function p(e){let t=ee(e,!0);return g(t),x(t),()=>C(t)}function m(e){let t={owned:[],cleanups:[],owner:c},n=c,r=s;c=t,s=null;try{return e(()=>te(t))}finally{c=n,s=r}}function h(e){c&&c.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:o,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:c}}function g(e){c&&c.owned.push(e)}function _(e){s&&(s.sources.add(e),e.observers.add(s))}function v(e,t){if(e.disposed||e.state>=t)return;let n=e.state===i;if(e.state=t,e.isEffect)u.add(e);else if(n)for(let t of e.observers)v(t,a)}function y(){if(!(l>0||d)){d=!0;try{for(;u.size>0;){let e=[...u];u.clear();for(let t of e)t.disposed||b(t)}}finally{d=!1}}}function b(e){if(!(e.disposed||e.state===i)){if(e.state===a)for(let t of e.sources)`fn`in t&&b(t);e.state===o&&x(e),e.state=i}}function x(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);S(e);let t=s,n=c;s=e,c=e,e.running=!0,e.state=i;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)v(t,o)}}finally{e.running=!1,s=t,c=n}}function S(e){for(let t of e.owned)C(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function C(e){e.disposed||(e.disposed=!0,S(e),e.observers.clear())}function te(e){for(let t of e.owned)C(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}var ne=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}};Math.PI/180,180/Math.PI,2*Math.PI;var w=(e=8)=>Math.random().toString(36).substring(2,e+2);Object.freeze({});var re=e=>typeof e==`function`,ie=12e4,ae=`__ranuts_bridge__`,T=`default`,E=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},D=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=T){this.targetOrigin=t,this.channel=n,this.senderId=w(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,E.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:ae,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(re(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=w(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},ie),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{E.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new D(n,t,r);if(e||=w(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new ne;var O=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],k=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new k(O[0],3609767458),new k(O[1],602891725),new k(O[2],3964484399),new k(O[3],2173295548),new k(O[4],4081628472),new k(O[5],3053834265),new k(O[6],2937671579),new k(O[7],3664609560),new k(O[8],2734883394),new k(O[9],1164996542),new k(O[10],1323610764),new k(O[11],3590304994),new k(O[12],4068182383),new k(O[13],991336113),new k(O[14],633803317),new k(O[15],3479774868),new k(O[16],2666613458),new k(O[17],944711139),new k(O[18],2341262773),new k(O[19],2007800933),new k(O[20],1495990901),new k(O[21],1856431235),new k(O[22],3175218132),new k(O[23],2198950837),new k(O[24],3999719339),new k(O[25],766784016),new k(O[26],2566594879),new k(O[27],3203337956),new k(O[28],1034457026),new k(O[29],2466948901),new k(O[30],3758326383),new k(O[31],168717936),new k(O[32],1188179964),new k(O[33],1546045734),new k(O[34],1522805485),new k(O[35],2643833823),new k(O[36],2343527390),new k(O[37],1014477480),new k(O[38],1206759142),new k(O[39],344077627),new k(O[40],1290863460),new k(O[41],3158454273),new k(O[42],3505952657),new k(O[43],106217008),new k(O[44],3606008344),new k(O[45],1432725776),new k(O[46],1467031594),new k(O[47],851169720),new k(O[48],3100823752),new k(O[49],1363258195),new k(O[50],3750685593),new k(O[51],3785050280),new k(O[52],3318307427),new k(O[53],3812723403),new k(O[54],2003034995),new k(O[55],3602036899),new k(O[56],1575990012),new k(O[57],1125592928),new k(O[58],2716904306),new k(O[59],442776044),new k(O[60],593698344),new k(O[61],3733110249),new k(O[62],2999351573),new k(O[63],3815920427),new k(3391569614,3928383900),new k(3515267271,566280711),new k(3940187606,3454069534),new k(4118630271,4000239992),new k(116418474,1914138554),new k(174292421,2731055270),new k(289380356,3203993006),new k(460393269,320620315),new k(685471733,587496836),new k(852142971,1086792851),new k(1017036298,365543100),new k(1126000580,2618297676),new k(1288033470,3409855158),new k(1501505948,4234509866),new k(1607167915,987167468),new k(1816402316,1246189591),new k(0,1),new k(0,32898),new k(2147483648,32906),new k(2147483648,2147516416),new k(0,32907),new k(0,2147483649),new k(2147483648,2147516545),new k(2147483648,32777),new k(0,138),new k(0,136),new k(0,2147516425),new k(0,2147483658),new k(0,2147516555),new k(2147483648,139),new k(2147483648,32905),new k(2147483648,32771),new k(2147483648,32770),new k(2147483648,128),new k(0,32778),new k(2147483648,2147483658),new k(2147483648,2147516545),new k(2147483648,32896),new k(0,2147483649),new k(2147483648,2147516424);var A=/["'&<>]/;function j(e){let t=``+e,n=A.exec(t);if(!n)return t;let r,i=``,a=0,o=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r=`&quot;`;break;case 38:r=`&amp;`;break;case 39:r=`&#39;`;break;case 60:r=`&lt;`;break;case 62:r=`&gt;`;break;default:continue}o!==a&&(i+=t.substring(o,a)),o=a+1,i+=r}return o===a?i:i+t.substring(o,a)}var M=new Map,oe=new Map,se=`data-adopted-style`,ce=`data-adopted-sheet`,N=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},le=(e,t,n=se)=>{if(typeof document<`u`&&t&&!N(e,t,M)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},P=(e,t,n=ce)=>{if(typeof document<`u`&&t&&!N(e,t,oe)&&!Array.from(e.querySelectorAll(`style[${n}]`)).some(e=>e.textContent===t)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},F=new Map([[100,`Continue`],[101,`Switching Protocols`],[102,`Processing`],[103,`Early Hints`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[305,`Use Proxy`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Payload Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Entity`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[509,`Bandwidth Limit Exceeded`],[510,`Not Extended`],[511,`Network Authentication Required`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(F),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(F);function I(e){return j(e)}var L=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,R=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},z=(e,t,n)=>{for(let r of e)L(r)&&(R(r,t)&&n.push(r),z(r.childrenList,t,n))},B=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?j(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return z(this.childrenList,e,t),t}},V=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new B)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new H(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return z(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${I(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${I(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?j(e):(e instanceof B,e.serialize())).join(``):a+=j(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},H=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return z(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${j(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?j(e):(e instanceof B,e.serialize())).join(``)}</template>`}},U=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(U(t)):e.concat(t),[]),W=e=>e==null?null:e instanceof J?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,ue=(e,t)=>{if(n){q(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};p(()=>{let e=t();o();let n=document.createDocumentFragment();a=m(t=>(q(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),h(()=>a?.())},G=`__ranFor`,de=e=>typeof e==`object`&&!!e&&e[G]===!0,fe=(e,t,n)=>{let[r,i]=f(t),a=null,o=m(t=>{let i=W(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},K=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},pe=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=W(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;h(()=>{for(let e of i.values())e.dispose();i.clear()}),p(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o))return;let s=i.get(o);s?(i.delete(o),s.index(r)):s=fe(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();K(r,a),i=n})},me=`__ranIndex`,he=e=>typeof e==`object`&&!!e&&e[me]===!0,ge=(e,t,n)=>{let[r,i]=f(e),a=null,o=m(e=>{let i=W(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},_e=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=W(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];h(()=>{for(let e of i)e.dispose();i=[]}),p(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<i.length?i[n].setItem(e[n]):i.push(ge(e[n],n,t.render));for(let t=i.length-1;t>=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}K(r,i.map(e=>e.node).filter(e=>e!=null))})},q=(e,t)=>{U(t).forEach(t=>{if(de(t)){pe(e,t);return}if(he(t)){_e(e,t);return}if(typeof t==`function`){ue(e,t);return}let n=W(t);n!=null&&e.appendChild(n)})},J=class{el;constructor(e){this.el=n?new V(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?p(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.className=e}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return q(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new ve(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},ve=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return q(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},ye=e=>new J(e),be=()=>ye(`slot`),xe=new Map;function Se(e,t){n?(xe.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ce=typeof document<`u`?HTMLElement:V,we=`data-ranui`,Te=`data-ranui-sheet`,Ee=(e,t)=>le(e,t,we),De=(e,t)=>P(e,t,Te),Y=new WeakMap,X=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Oe=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||Y.get(e)||e.attachShadow(n);return Y.set(e,r),Ee(r,t?`${t}\n${X}`:X),r},ke=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},Z=(e,t,n=``)=>e.getAttribute(t)??n,Q=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},Ae=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&De(t,a)},je=null;function Me(){return je}function Ne(e,t,n){let r=[],i=e.split(`/`).map(e=>e.startsWith(`:`)?(r.push(e.slice(1)),`([^/]+)`):e===`*`?`(.*)`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`/`),a=RegExp(t?`^${i}$`:`^${i}(?:/.*)?$`),o=n.match(a);if(!o)return{matched:!1,params:{}};let s={};return r.forEach((e,t)=>{s[e]=decodeURIComponent(o[t+1]??``)}),{matched:!0,params:s}}var $=class extends Ce{static get observedAttributes(){return[`path`,`exact`,`src`,`sheet`]}_events=new r;_shadowDom;_params={};_mounted=!1;_module=null;_disposePage=null;_pageHost=null;_mountToken=0;constructor(){super(),this._shadowDom=Oe(this,t),ke(this._shadowDom,`slot`,()=>be().build())}get path(){return Z(this,`path`,`/`)}set path(e){Q(this,`path`,e)}get exact(){return this.hasAttribute(`exact`)}get src(){return Z(this,`src`)}set src(e){Q(this,`src`,e)}get params(){return{...this._params}}get sheet(){return Z(this,`sheet`)}set sheet(e){Q(this,`sheet`,e)}handlerExternalCss=()=>{Ae(this,this._shadowDom,`sheet`,null,this.sheet)};_update(e){let{matched:t,params:r}=Ne(this.path,this.exact,e);this._params=r,this.hidden=!t,this.src&&!n&&(t?this._mount():this._unmount()),t&&this.dispatchEvent(new CustomEvent(`routematch`,{detail:{path:e,params:r},bubbles:!0}))}async _mount(){if(this._mounted)return;this._mounted=!0;let e=++this._mountToken;this._pageHost||(this._pageHost=document.createElement(`div`),this._pageHost.setAttribute(`part`,`page`),this.appendChild(this._pageHost));try{if(this._module??=await import(this.src),e!==this._mountToken)return;let t=this._module.default;if(typeof t!=`function`){console.error(`[r-route] "${this.src}" has no default export (host) => void`);return}let n=this._pageHost;this._disposePage=m(e=>{let r=t(n);return typeof r==`function`&&h(r),e})}catch(e){this._mounted=!1,console.error(`[r-route] failed to load "${this.src}":`,e)}}_unmount(){this._mounted&&(this._mounted=!1,this._mountToken++,this._disposePage?.(),this._disposePage=null,this._pageHost?.replaceChildren())}_preSerialize(){let e=Me();e!==null&&this._update(e)}connectedCallback(){this.handlerExternalCss();let e=this.closest(`r-router`);e&&e._currentPath&&this._update(e._currentPath)}disconnectedCallback(){this._unmount(),this._events.abort()}attributeChangedCallback(e,t,n){if(t!==n){if(e===`src`&&(this._module=null,this._unmount()),e===`path`||e===`exact`||e===`src`){let e=this.closest(`r-router`);e&&this._update(e._currentPath)}e===`sheet`&&this.handlerExternalCss()}}};return Se(`r-route`,$),e.Route=$,e.default=$,e})({});
1
+ var ranui_route=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{display:block}:host([hidden]){display:none!important}`,n=typeof document>`u`,r=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.ac.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}},i=0,a=1,o=2,s=null,c=null,l=0,u=new Set,d=!1;function f(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(_(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)v(e,o);l===0&&y()}}]}function p(e){let t=ee(e,!0);return g(t),x(t),()=>C(t)}function m(e){let t={owned:[],cleanups:[],owner:c},n=c,r=s;c=t,s=null;try{return e(()=>te(t))}finally{c=n,s=r}}function h(e){c&&c.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:o,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:c}}function g(e){c&&c.owned.push(e)}function _(e){s&&(s.sources.add(e),e.observers.add(s))}function v(e,t){if(e.disposed||e.state>=t)return;let n=e.state===i;if(e.state=t,e.isEffect)u.add(e);else if(n)for(let t of e.observers)v(t,a)}function y(){if(!(l>0||d)){d=!0;try{for(;u.size>0;){let e=[...u];u.clear();for(let t of e)t.disposed||b(t)}}finally{d=!1}}}function b(e){if(!(e.disposed||e.state===i)){if(e.state===a)for(let t of e.sources)`fn`in t&&b(t);e.state===o&&x(e),e.state=i}}function x(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);S(e);let t=s,n=c;s=e,c=e,e.running=!0,e.state=i;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)v(t,o)}}finally{e.running=!1,s=t,c=n}}function S(e){for(let t of e.owned)C(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function C(e){e.disposed||(e.disposed=!0,S(e),e.observers.clear())}function te(e){for(let t of e.owned)C(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}var ne=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}};Math.PI/180,180/Math.PI,2*Math.PI;var w=(e=8)=>Math.random().toString(36).substring(2,e+2);Object.freeze({});var re=e=>typeof e==`function`,ie=12e4,ae=`__ranuts_bridge__`,T=`default`,E=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},D=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=T){this.targetOrigin=t,this.channel=n,this.senderId=w(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,E.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:ae,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(re(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=w(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},ie),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{E.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new D(n,t,r);if(e||=w(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new ne;var O=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],k=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new k(O[0],3609767458),new k(O[1],602891725),new k(O[2],3964484399),new k(O[3],2173295548),new k(O[4],4081628472),new k(O[5],3053834265),new k(O[6],2937671579),new k(O[7],3664609560),new k(O[8],2734883394),new k(O[9],1164996542),new k(O[10],1323610764),new k(O[11],3590304994),new k(O[12],4068182383),new k(O[13],991336113),new k(O[14],633803317),new k(O[15],3479774868),new k(O[16],2666613458),new k(O[17],944711139),new k(O[18],2341262773),new k(O[19],2007800933),new k(O[20],1495990901),new k(O[21],1856431235),new k(O[22],3175218132),new k(O[23],2198950837),new k(O[24],3999719339),new k(O[25],766784016),new k(O[26],2566594879),new k(O[27],3203337956),new k(O[28],1034457026),new k(O[29],2466948901),new k(O[30],3758326383),new k(O[31],168717936),new k(O[32],1188179964),new k(O[33],1546045734),new k(O[34],1522805485),new k(O[35],2643833823),new k(O[36],2343527390),new k(O[37],1014477480),new k(O[38],1206759142),new k(O[39],344077627),new k(O[40],1290863460),new k(O[41],3158454273),new k(O[42],3505952657),new k(O[43],106217008),new k(O[44],3606008344),new k(O[45],1432725776),new k(O[46],1467031594),new k(O[47],851169720),new k(O[48],3100823752),new k(O[49],1363258195),new k(O[50],3750685593),new k(O[51],3785050280),new k(O[52],3318307427),new k(O[53],3812723403),new k(O[54],2003034995),new k(O[55],3602036899),new k(O[56],1575990012),new k(O[57],1125592928),new k(O[58],2716904306),new k(O[59],442776044),new k(O[60],593698344),new k(O[61],3733110249),new k(O[62],2999351573),new k(O[63],3815920427),new k(3391569614,3928383900),new k(3515267271,566280711),new k(3940187606,3454069534),new k(4118630271,4000239992),new k(116418474,1914138554),new k(174292421,2731055270),new k(289380356,3203993006),new k(460393269,320620315),new k(685471733,587496836),new k(852142971,1086792851),new k(1017036298,365543100),new k(1126000580,2618297676),new k(1288033470,3409855158),new k(1501505948,4234509866),new k(1607167915,987167468),new k(1816402316,1246189591),new k(0,1),new k(0,32898),new k(2147483648,32906),new k(2147483648,2147516416),new k(0,32907),new k(0,2147483649),new k(2147483648,2147516545),new k(2147483648,32777),new k(0,138),new k(0,136),new k(0,2147516425),new k(0,2147483658),new k(0,2147516555),new k(2147483648,139),new k(2147483648,32905),new k(2147483648,32771),new k(2147483648,32770),new k(2147483648,128),new k(0,32778),new k(2147483648,2147483658),new k(2147483648,2147516545),new k(2147483648,32896),new k(0,2147483649),new k(2147483648,2147516424);var A=/["'&<>]/;function j(e){let t=``+e,n=A.exec(t);if(!n)return t;let r,i=``,a=0,o=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r=`&quot;`;break;case 38:r=`&amp;`;break;case 39:r=`&#39;`;break;case 60:r=`&lt;`;break;case 62:r=`&gt;`;break;default:continue}o!==a&&(i+=t.substring(o,a)),o=a+1,i+=r}return o===a?i:i+t.substring(o,a)}var M=new Map,oe=new Map,se=`data-adopted-style`,ce=`data-adopted-sheet`,N=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},le=(e,t,n=se)=>{if(typeof document<`u`&&t&&!N(e,t,M)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},P=(e,t,n=ce)=>{if(typeof document<`u`&&t&&!N(e,t,oe)&&!Array.from(e.querySelectorAll(`style[${n}]`)).some(e=>e.textContent===t)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}};(()=>{let e=new Uint8Array(128);for(let t=0;t<78;t++)e[`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.,!?;:'"()[]{}`.charCodeAt(t)]=1;return e})();var F=new Map([[100,`Continue`],[101,`Switching Protocols`],[102,`Processing`],[103,`Early Hints`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[305,`Use Proxy`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Payload Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Entity`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[509,`Bandwidth Limit Exceeded`],[510,`Not Extended`],[511,`Network Authentication Required`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(F),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(F);function I(e){return j(e)}var L=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,R=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},z=(e,t,n)=>{for(let r of e)L(r)&&(R(r,t)&&n.push(r),z(r.childrenList,t,n))},B=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?j(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return z(this.childrenList,e,t),t}},V=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new B)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new H(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return z(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${I(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${I(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?j(e):(e instanceof B,e.serialize())).join(``):a+=j(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},H=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return z(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${j(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?j(e):(e instanceof B,e.serialize())).join(``)}</template>`}},U=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(U(t)):e.concat(t),[]),W=e=>e==null?null:e instanceof J?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,ue=(e,t)=>{if(n){q(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};p(()=>{let e=t();o();let n=document.createDocumentFragment();a=m(t=>(q(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),h(()=>a?.())},G=`__ranFor`,de=e=>typeof e==`object`&&!!e&&e[G]===!0,fe=(e,t,n)=>{let[r,i]=f(t),a=null,o=m(t=>{let i=W(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},K=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},pe=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=W(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;h(()=>{for(let e of i.values())e.dispose();i.clear()}),p(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o))return;let s=i.get(o);s?(i.delete(o),s.index(r)):s=fe(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();K(r,a),i=n})},me=`__ranIndex`,he=e=>typeof e==`object`&&!!e&&e[me]===!0,ge=(e,t,n)=>{let[r,i]=f(e),a=null,o=m(e=>{let i=W(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},_e=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=W(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];h(()=>{for(let e of i)e.dispose();i=[]}),p(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<i.length?i[n].setItem(e[n]):i.push(ge(e[n],n,t.render));for(let t=i.length-1;t>=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}K(r,i.map(e=>e.node).filter(e=>e!=null))})},q=(e,t)=>{U(t).forEach(t=>{if(de(t)){pe(e,t);return}if(he(t)){_e(e,t);return}if(typeof t==`function`){ue(e,t);return}let n=W(t);n!=null&&e.appendChild(n)})},J=class{el;constructor(e){this.el=n?new V(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?p(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.className=e}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return q(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new ve(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},ve=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return q(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},ye=e=>new J(e),be=()=>ye(`slot`),xe=new Map;function Se(e,t){n?(xe.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ce=typeof document<`u`?HTMLElement:V,we=`data-ranui`,Te=`data-ranui-sheet`,Ee=(e,t)=>le(e,t,we),De=(e,t)=>P(e,t,Te),Y=new WeakMap,X=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Oe=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||Y.get(e)||e.attachShadow(n);return Y.set(e,r),Ee(r,t?`${t}\n${X}`:X),r},ke=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},Z=(e,t,n=``)=>e.getAttribute(t)??n,Q=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},Ae=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&De(t,a)},je=null;function Me(){return je}function Ne(e,t,n){let r=[],i=e.split(`/`).map(e=>e.startsWith(`:`)?(r.push(e.slice(1)),`([^/]+)`):e===`*`?`(.*)`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`/`),a=RegExp(t?`^${i}$`:`^${i}(?:/.*)?$`),o=n.match(a);if(!o)return{matched:!1,params:{}};let s={};return r.forEach((e,t)=>{s[e]=decodeURIComponent(o[t+1]??``)}),{matched:!0,params:s}}var $=class extends Ce{static get observedAttributes(){return[`path`,`exact`,`src`,`sheet`]}_events=new r;_shadowDom;_params={};_mounted=!1;_module=null;_disposePage=null;_pageHost=null;_mountToken=0;constructor(){super(),this._shadowDom=Oe(this,t),ke(this._shadowDom,`slot`,()=>be().build())}get path(){return Z(this,`path`,`/`)}set path(e){Q(this,`path`,e)}get exact(){return this.hasAttribute(`exact`)}get src(){return Z(this,`src`)}set src(e){Q(this,`src`,e)}get params(){return{...this._params}}get sheet(){return Z(this,`sheet`)}set sheet(e){Q(this,`sheet`,e)}handlerExternalCss=()=>{Ae(this,this._shadowDom,`sheet`,null,this.sheet)};_update(e){let{matched:t,params:r}=Ne(this.path,this.exact,e);this._params=r,this.hidden=!t,this.src&&!n&&(t?this._mount():this._unmount()),t&&this.dispatchEvent(new CustomEvent(`routematch`,{detail:{path:e,params:r},bubbles:!0}))}async _mount(){if(this._mounted)return;this._mounted=!0;let e=++this._mountToken;this._pageHost||(this._pageHost=document.createElement(`div`),this._pageHost.setAttribute(`part`,`page`),this.appendChild(this._pageHost));try{if(this._module??=await import(this.src),e!==this._mountToken)return;let t=this._module.default;if(typeof t!=`function`){console.error(`[r-route] "${this.src}" has no default export (host) => void`);return}let n=this._pageHost;this._disposePage=m(e=>{let r=t(n);return typeof r==`function`&&h(r),e})}catch(e){this._mounted=!1,console.error(`[r-route] failed to load "${this.src}":`,e)}}_unmount(){this._mounted&&(this._mounted=!1,this._mountToken++,this._disposePage?.(),this._disposePage=null,this._pageHost?.replaceChildren())}_preSerialize(){let e=Me();e!==null&&this._update(e)}connectedCallback(){this.handlerExternalCss();let e=this.closest(`r-router`);e&&e._currentPath&&this._update(e._currentPath)}disconnectedCallback(){this._unmount(),this._events.abort()}attributeChangedCallback(e,t,n){if(t!==n){if(e===`src`&&(this._module=null,this._unmount()),e===`path`||e===`exact`||e===`src`){let e=this.closest(`r-router`);e&&this._update(e._currentPath)}e===`sheet`&&this.handlerExternalCss()}}};return Se(`r-route`,$),e.Route=$,e.default=$,e})({});
@@ -1 +1 @@
1
- var ranui_router=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{width:100%;display:block}`,n=typeof document>`u`,r=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.ac.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}},i=0,a=1,o=2,s=null,c=null,l=0,u=new Set,d=!1;function f(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(_(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)v(e,o);l===0&&te()}}]}function p(e){let t=ee(e,!0);return g(t),b(t),()=>S(t)}function m(e){let t={owned:[],cleanups:[],owner:c},n=c,r=s;c=t,s=null;try{return e(()=>ne(t))}finally{c=n,s=r}}function h(e){c&&c.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:o,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:c}}function g(e){c&&c.owned.push(e)}function _(e){s&&(s.sources.add(e),e.observers.add(s))}function v(e,t){if(e.disposed||e.state>=t)return;let n=e.state===i;if(e.state=t,e.isEffect)u.add(e);else if(n)for(let t of e.observers)v(t,a)}function te(){if(!(l>0||d)){d=!0;try{for(;u.size>0;){let e=[...u];u.clear();for(let t of e)t.disposed||y(t)}}finally{d=!1}}}function y(e){if(!(e.disposed||e.state===i)){if(e.state===a)for(let t of e.sources)`fn`in t&&y(t);e.state===o&&b(e),e.state=i}}function b(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);x(e);let t=s,n=c;s=e,c=e,e.running=!0,e.state=i;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)v(t,o)}}finally{e.running=!1,s=t,c=n}}function x(e){for(let t of e.owned)S(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function S(e){e.disposed||(e.disposed=!0,x(e),e.observers.clear())}function ne(e){for(let t of e.owned)S(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}var re=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}};Math.PI/180,180/Math.PI,2*Math.PI;var C=(e=8)=>Math.random().toString(36).substring(2,e+2);Object.freeze({});var w=e=>typeof e==`function`,T=12e4,E=`__ranuts_bridge__`,D=`default`,O=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},k=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=D){this.targetOrigin=t,this.channel=n,this.senderId=C(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,O.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:E,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(w(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=C(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},T),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{O.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new k(n,t,r);if(e||=C(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new re;var A=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],j=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new j(A[0],3609767458),new j(A[1],602891725),new j(A[2],3964484399),new j(A[3],2173295548),new j(A[4],4081628472),new j(A[5],3053834265),new j(A[6],2937671579),new j(A[7],3664609560),new j(A[8],2734883394),new j(A[9],1164996542),new j(A[10],1323610764),new j(A[11],3590304994),new j(A[12],4068182383),new j(A[13],991336113),new j(A[14],633803317),new j(A[15],3479774868),new j(A[16],2666613458),new j(A[17],944711139),new j(A[18],2341262773),new j(A[19],2007800933),new j(A[20],1495990901),new j(A[21],1856431235),new j(A[22],3175218132),new j(A[23],2198950837),new j(A[24],3999719339),new j(A[25],766784016),new j(A[26],2566594879),new j(A[27],3203337956),new j(A[28],1034457026),new j(A[29],2466948901),new j(A[30],3758326383),new j(A[31],168717936),new j(A[32],1188179964),new j(A[33],1546045734),new j(A[34],1522805485),new j(A[35],2643833823),new j(A[36],2343527390),new j(A[37],1014477480),new j(A[38],1206759142),new j(A[39],344077627),new j(A[40],1290863460),new j(A[41],3158454273),new j(A[42],3505952657),new j(A[43],106217008),new j(A[44],3606008344),new j(A[45],1432725776),new j(A[46],1467031594),new j(A[47],851169720),new j(A[48],3100823752),new j(A[49],1363258195),new j(A[50],3750685593),new j(A[51],3785050280),new j(A[52],3318307427),new j(A[53],3812723403),new j(A[54],2003034995),new j(A[55],3602036899),new j(A[56],1575990012),new j(A[57],1125592928),new j(A[58],2716904306),new j(A[59],442776044),new j(A[60],593698344),new j(A[61],3733110249),new j(A[62],2999351573),new j(A[63],3815920427),new j(3391569614,3928383900),new j(3515267271,566280711),new j(3940187606,3454069534),new j(4118630271,4000239992),new j(116418474,1914138554),new j(174292421,2731055270),new j(289380356,3203993006),new j(460393269,320620315),new j(685471733,587496836),new j(852142971,1086792851),new j(1017036298,365543100),new j(1126000580,2618297676),new j(1288033470,3409855158),new j(1501505948,4234509866),new j(1607167915,987167468),new j(1816402316,1246189591),new j(0,1),new j(0,32898),new j(2147483648,32906),new j(2147483648,2147516416),new j(0,32907),new j(0,2147483649),new j(2147483648,2147516545),new j(2147483648,32777),new j(0,138),new j(0,136),new j(0,2147516425),new j(0,2147483658),new j(0,2147516555),new j(2147483648,139),new j(2147483648,32905),new j(2147483648,32771),new j(2147483648,32770),new j(2147483648,128),new j(0,32778),new j(2147483648,2147483658),new j(2147483648,2147516545),new j(2147483648,32896),new j(0,2147483649),new j(2147483648,2147516424);var ie=/["'&<>]/;function M(e){let t=``+e,n=ie.exec(t);if(!n)return t;let r,i=``,a=0,o=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r=`&quot;`;break;case 38:r=`&amp;`;break;case 39:r=`&#39;`;break;case 60:r=`&lt;`;break;case 62:r=`&gt;`;break;default:continue}o!==a&&(i+=t.substring(o,a)),o=a+1,i+=r}return o===a?i:i+t.substring(o,a)}var ae=new Map,oe=new Map,se=`data-adopted-style`,ce=`data-adopted-sheet`,N=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},le=(e,t,n=se)=>{if(typeof document<`u`&&t&&!N(e,t,ae)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},P=(e,t,n=ce)=>{if(typeof document<`u`&&t&&!N(e,t,oe)&&!Array.from(e.querySelectorAll(`style[${n}]`)).some(e=>e.textContent===t)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},F=new Map([[100,`Continue`],[101,`Switching Protocols`],[102,`Processing`],[103,`Early Hints`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[305,`Use Proxy`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Payload Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Entity`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[509,`Bandwidth Limit Exceeded`],[510,`Not Extended`],[511,`Network Authentication Required`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(F),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(F);function I(e){return M(e)}var L=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,R=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},z=(e,t,n)=>{for(let r of e)L(r)&&(R(r,t)&&n.push(r),z(r.childrenList,t,n))},B=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?M(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return z(this.childrenList,e,t),t}},V=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new B)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new H(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return z(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${I(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${I(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?M(e):(e instanceof B,e.serialize())).join(``):a+=M(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},H=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return z(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${M(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?M(e):(e instanceof B,e.serialize())).join(``)}</template>`}},U=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(U(t)):e.concat(t),[]),W=e=>e==null?null:e instanceof q?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,ue=(e,t)=>{if(n){K(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};p(()=>{let e=t();o();let n=document.createDocumentFragment();a=m(t=>(K(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),h(()=>a?.())},de=`__ranFor`,fe=e=>typeof e==`object`&&!!e&&e[de]===!0,pe=(e,t,n)=>{let[r,i]=f(t),a=null,o=m(t=>{let i=W(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},G=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},me=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=W(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;h(()=>{for(let e of i.values())e.dispose();i.clear()}),p(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o))return;let s=i.get(o);s?(i.delete(o),s.index(r)):s=pe(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();G(r,a),i=n})},he=`__ranIndex`,ge=e=>typeof e==`object`&&!!e&&e[he]===!0,_e=(e,t,n)=>{let[r,i]=f(e),a=null,o=m(e=>{let i=W(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},ve=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=W(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];h(()=>{for(let e of i)e.dispose();i=[]}),p(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<i.length?i[n].setItem(e[n]):i.push(_e(e[n],n,t.render));for(let t=i.length-1;t>=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}G(r,i.map(e=>e.node).filter(e=>e!=null))})},K=(e,t)=>{U(t).forEach(t=>{if(fe(t)){me(e,t);return}if(ge(t)){ve(e,t);return}if(typeof t==`function`){ue(e,t);return}let n=W(t);n!=null&&e.appendChild(n)})},q=class{el;constructor(e){this.el=n?new V(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?p(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.className=e}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return K(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new ye(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},ye=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return K(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},be=e=>new q(e),xe=()=>be(`slot`),Se=new Map;function Ce(e,t){n?(Se.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var we=typeof document<`u`?HTMLElement:V,Te=`data-ranui`,J=`data-ranui-sheet`,Ee=(e,t)=>le(e,t,Te),De=(e,t)=>P(e,t,J),Y=new WeakMap,X=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Oe=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||Y.get(e)||e.attachShadow(n);return Y.set(e,r),Ee(r,t?`${t}\n${X}`:X),r},ke=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},Z=(e,t,n=``)=>e.getAttribute(t)??n,Ae=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},je=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&De(t,a)},Me=null;function Q(){return Me}var $=class extends we{static get observedAttributes(){return[`mode`,`base`,`sheet`]}_events=new r;_shadowDom;_slot;_currentPath=``;_core=null;constructor(){super(),this._shadowDom=Oe(this,t);let e=ke(this._shadowDom,`slot`,()=>xe().build());this._slot=e}get mode(){return this.getAttribute(`mode`)===`hash`?`hash`:`history`}get base(){return Z(this,`base`)}get sheet(){return Z(this,`sheet`)}set sheet(e){Ae(this,`sheet`,e)}handlerExternalCss=()=>{je(this,this._shadowDom,`sheet`,null,this.sheet)};_getPath(){if(this.mode===`hash`)return window.location.hash.slice(1)||`/`;let e=this.base,t=window.location.pathname;return e&&t.startsWith(e)?t.slice(e.length)||`/`:t}navigate(e,t=!1){if(this._core){t?this._core.replace(e):this._core.push(e);return}let n=this.mode===`hash`?`#${e}`:this.base+e;t?window.history.replaceState(null,``,n):window.history.pushState(null,``,n),this._syncRoutes()}_syncRoutes(){let e=this._getPath();this._currentPath=e,this.querySelectorAll(`r-route`).forEach(t=>{typeof t._update==`function`&&t._update(e)}),this.dispatchEvent(new CustomEvent(`routechange`,{detail:{path:e},bubbles:!0}))}_handlePopState=()=>{this._core?this._core._notify():this._syncRoutes()};_handleNavigate=e=>{let{path:t,replace:n}=e.detail;e.stopPropagation(),this.navigate(t,n)};connectedCallback(){this.handlerExternalCss(),this._events.on(window,`popstate`,this._handlePopState),this._events.on(this,`ran-navigate`,this._handleNavigate),this._events.on(this._slot,`slotchange`,()=>this._syncRoutes());let e=Q();e&&(this._core=e,e._bind(this)),this._syncRoutes(),typeof customElements<`u`&&customElements.whenDefined(`r-route`).then(()=>this._syncRoutes())}disconnectedCallback(){let e=Q();e&&e._unbind(this),this._core=null,this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&e===`sheet`&&this.handlerExternalCss()}};return Ce(`r-router`,$),e.Router=$,e.default=$,e})({});
1
+ var ranui_router=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{width:100%;display:block}`,n=typeof document>`u`,r=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.ac.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}},i=0,a=1,o=2,s=null,c=null,l=0,u=new Set,d=!1;function f(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(_(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)v(e,o);l===0&&te()}}]}function p(e){let t=ee(e,!0);return g(t),b(t),()=>S(t)}function m(e){let t={owned:[],cleanups:[],owner:c},n=c,r=s;c=t,s=null;try{return e(()=>ne(t))}finally{c=n,s=r}}function h(e){c&&c.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:o,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:c}}function g(e){c&&c.owned.push(e)}function _(e){s&&(s.sources.add(e),e.observers.add(s))}function v(e,t){if(e.disposed||e.state>=t)return;let n=e.state===i;if(e.state=t,e.isEffect)u.add(e);else if(n)for(let t of e.observers)v(t,a)}function te(){if(!(l>0||d)){d=!0;try{for(;u.size>0;){let e=[...u];u.clear();for(let t of e)t.disposed||y(t)}}finally{d=!1}}}function y(e){if(!(e.disposed||e.state===i)){if(e.state===a)for(let t of e.sources)`fn`in t&&y(t);e.state===o&&b(e),e.state=i}}function b(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);x(e);let t=s,n=c;s=e,c=e,e.running=!0,e.state=i;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)v(t,o)}}finally{e.running=!1,s=t,c=n}}function x(e){for(let t of e.owned)S(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function S(e){e.disposed||(e.disposed=!0,x(e),e.observers.clear())}function ne(e){for(let t of e.owned)S(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}var re=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}};Math.PI/180,180/Math.PI,2*Math.PI;var C=(e=8)=>Math.random().toString(36).substring(2,e+2);Object.freeze({});var w=e=>typeof e==`function`,T=12e4,E=`__ranuts_bridge__`,D=`default`,O=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},k=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=D){this.targetOrigin=t,this.channel=n,this.senderId=C(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,O.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:E,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(w(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=C(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},T),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{O.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new k(n,t,r);if(e||=C(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new re;var A=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],j=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new j(A[0],3609767458),new j(A[1],602891725),new j(A[2],3964484399),new j(A[3],2173295548),new j(A[4],4081628472),new j(A[5],3053834265),new j(A[6],2937671579),new j(A[7],3664609560),new j(A[8],2734883394),new j(A[9],1164996542),new j(A[10],1323610764),new j(A[11],3590304994),new j(A[12],4068182383),new j(A[13],991336113),new j(A[14],633803317),new j(A[15],3479774868),new j(A[16],2666613458),new j(A[17],944711139),new j(A[18],2341262773),new j(A[19],2007800933),new j(A[20],1495990901),new j(A[21],1856431235),new j(A[22],3175218132),new j(A[23],2198950837),new j(A[24],3999719339),new j(A[25],766784016),new j(A[26],2566594879),new j(A[27],3203337956),new j(A[28],1034457026),new j(A[29],2466948901),new j(A[30],3758326383),new j(A[31],168717936),new j(A[32],1188179964),new j(A[33],1546045734),new j(A[34],1522805485),new j(A[35],2643833823),new j(A[36],2343527390),new j(A[37],1014477480),new j(A[38],1206759142),new j(A[39],344077627),new j(A[40],1290863460),new j(A[41],3158454273),new j(A[42],3505952657),new j(A[43],106217008),new j(A[44],3606008344),new j(A[45],1432725776),new j(A[46],1467031594),new j(A[47],851169720),new j(A[48],3100823752),new j(A[49],1363258195),new j(A[50],3750685593),new j(A[51],3785050280),new j(A[52],3318307427),new j(A[53],3812723403),new j(A[54],2003034995),new j(A[55],3602036899),new j(A[56],1575990012),new j(A[57],1125592928),new j(A[58],2716904306),new j(A[59],442776044),new j(A[60],593698344),new j(A[61],3733110249),new j(A[62],2999351573),new j(A[63],3815920427),new j(3391569614,3928383900),new j(3515267271,566280711),new j(3940187606,3454069534),new j(4118630271,4000239992),new j(116418474,1914138554),new j(174292421,2731055270),new j(289380356,3203993006),new j(460393269,320620315),new j(685471733,587496836),new j(852142971,1086792851),new j(1017036298,365543100),new j(1126000580,2618297676),new j(1288033470,3409855158),new j(1501505948,4234509866),new j(1607167915,987167468),new j(1816402316,1246189591),new j(0,1),new j(0,32898),new j(2147483648,32906),new j(2147483648,2147516416),new j(0,32907),new j(0,2147483649),new j(2147483648,2147516545),new j(2147483648,32777),new j(0,138),new j(0,136),new j(0,2147516425),new j(0,2147483658),new j(0,2147516555),new j(2147483648,139),new j(2147483648,32905),new j(2147483648,32771),new j(2147483648,32770),new j(2147483648,128),new j(0,32778),new j(2147483648,2147483658),new j(2147483648,2147516545),new j(2147483648,32896),new j(0,2147483649),new j(2147483648,2147516424);var ie=/["'&<>]/;function M(e){let t=``+e,n=ie.exec(t);if(!n)return t;let r,i=``,a=0,o=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r=`&quot;`;break;case 38:r=`&amp;`;break;case 39:r=`&#39;`;break;case 60:r=`&lt;`;break;case 62:r=`&gt;`;break;default:continue}o!==a&&(i+=t.substring(o,a)),o=a+1,i+=r}return o===a?i:i+t.substring(o,a)}var ae=new Map,oe=new Map,se=`data-adopted-style`,ce=`data-adopted-sheet`,N=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},le=(e,t,n=se)=>{if(typeof document<`u`&&t&&!N(e,t,ae)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},P=(e,t,n=ce)=>{if(typeof document<`u`&&t&&!N(e,t,oe)&&!Array.from(e.querySelectorAll(`style[${n}]`)).some(e=>e.textContent===t)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}};(()=>{let e=new Uint8Array(128);for(let t=0;t<78;t++)e[`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.,!?;:'"()[]{}`.charCodeAt(t)]=1;return e})();var F=new Map([[100,`Continue`],[101,`Switching Protocols`],[102,`Processing`],[103,`Early Hints`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[305,`Use Proxy`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Payload Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Entity`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[509,`Bandwidth Limit Exceeded`],[510,`Not Extended`],[511,`Network Authentication Required`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(F),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(F);function I(e){return M(e)}var L=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,R=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},z=(e,t,n)=>{for(let r of e)L(r)&&(R(r,t)&&n.push(r),z(r.childrenList,t,n))},B=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?M(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return z(this.childrenList,e,t),t}},V=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new B)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new H(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return z(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${I(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${I(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?M(e):(e instanceof B,e.serialize())).join(``):a+=M(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},H=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return z(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${M(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?M(e):(e instanceof B,e.serialize())).join(``)}</template>`}},U=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(U(t)):e.concat(t),[]),W=e=>e==null?null:e instanceof q?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,ue=(e,t)=>{if(n){K(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};p(()=>{let e=t();o();let n=document.createDocumentFragment();a=m(t=>(K(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),h(()=>a?.())},de=`__ranFor`,fe=e=>typeof e==`object`&&!!e&&e[de]===!0,pe=(e,t,n)=>{let[r,i]=f(t),a=null,o=m(t=>{let i=W(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},G=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},me=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=W(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;h(()=>{for(let e of i.values())e.dispose();i.clear()}),p(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o))return;let s=i.get(o);s?(i.delete(o),s.index(r)):s=pe(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();G(r,a),i=n})},he=`__ranIndex`,ge=e=>typeof e==`object`&&!!e&&e[he]===!0,_e=(e,t,n)=>{let[r,i]=f(e),a=null,o=m(e=>{let i=W(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},ve=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=W(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];h(()=>{for(let e of i)e.dispose();i=[]}),p(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<i.length?i[n].setItem(e[n]):i.push(_e(e[n],n,t.render));for(let t=i.length-1;t>=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}G(r,i.map(e=>e.node).filter(e=>e!=null))})},K=(e,t)=>{U(t).forEach(t=>{if(fe(t)){me(e,t);return}if(ge(t)){ve(e,t);return}if(typeof t==`function`){ue(e,t);return}let n=W(t);n!=null&&e.appendChild(n)})},q=class{el;constructor(e){this.el=n?new V(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?p(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.className=e}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return K(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new ye(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},ye=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return K(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},be=e=>new q(e),xe=()=>be(`slot`),Se=new Map;function Ce(e,t){n?(Se.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var we=typeof document<`u`?HTMLElement:V,Te=`data-ranui`,J=`data-ranui-sheet`,Ee=(e,t)=>le(e,t,Te),De=(e,t)=>P(e,t,J),Y=new WeakMap,X=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Oe=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||Y.get(e)||e.attachShadow(n);return Y.set(e,r),Ee(r,t?`${t}\n${X}`:X),r},ke=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},Z=(e,t,n=``)=>e.getAttribute(t)??n,Ae=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},je=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&De(t,a)},Me=null;function Q(){return Me}var $=class extends we{static get observedAttributes(){return[`mode`,`base`,`sheet`]}_events=new r;_shadowDom;_slot;_currentPath=``;_core=null;constructor(){super(),this._shadowDom=Oe(this,t);let e=ke(this._shadowDom,`slot`,()=>xe().build());this._slot=e}get mode(){return this.getAttribute(`mode`)===`hash`?`hash`:`history`}get base(){return Z(this,`base`)}get sheet(){return Z(this,`sheet`)}set sheet(e){Ae(this,`sheet`,e)}handlerExternalCss=()=>{je(this,this._shadowDom,`sheet`,null,this.sheet)};_getPath(){if(this.mode===`hash`)return window.location.hash.slice(1)||`/`;let e=this.base,t=window.location.pathname;return e&&t.startsWith(e)?t.slice(e.length)||`/`:t}navigate(e,t=!1){if(this._core){t?this._core.replace(e):this._core.push(e);return}let n=this.mode===`hash`?`#${e}`:this.base+e;t?window.history.replaceState(null,``,n):window.history.pushState(null,``,n),this._syncRoutes()}_syncRoutes(){let e=this._getPath();this._currentPath=e,this.querySelectorAll(`r-route`).forEach(t=>{typeof t._update==`function`&&t._update(e)}),this.dispatchEvent(new CustomEvent(`routechange`,{detail:{path:e},bubbles:!0}))}_handlePopState=()=>{this._core?this._core._notify():this._syncRoutes()};_handleNavigate=e=>{let{path:t,replace:n}=e.detail;e.stopPropagation(),this.navigate(t,n)};connectedCallback(){this.handlerExternalCss(),this._events.on(window,`popstate`,this._handlePopState),this._events.on(this,`ran-navigate`,this._handleNavigate),this._events.on(this._slot,`slotchange`,()=>this._syncRoutes());let e=Q();e&&(this._core=e,e._bind(this)),this._syncRoutes(),typeof customElements<`u`&&customElements.whenDefined(`r-route`).then(()=>this._syncRoutes())}disconnectedCallback(){let e=Q();e&&e._unbind(this),this._core=null,this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&e===`sheet`&&this.handlerExternalCss()}};return Ce(`r-router`,$),e.Router=$,e.default=$,e})({});
@@ -1 +1 @@
1
- var ranui_scratch=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{display:block;position:relative}.ran-scratch-ticket{width:100%;height:100%;display:block;position:relative}.ran-scratch-ticket-award{z-index:1;background:#000;width:100%;height:100%;display:block;position:absolute;top:0;left:0}.ran-scratch-ticket-canvas{z-index:2;width:100%;height:100%;display:block;position:absolute;top:0;left:0}`,n=typeof document>`u`,r=0,i=1,a=2,o=null,s=null,c=0,l=new Set,u=!1;function d(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(g(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)_(e,a);c===0&&te()}}]}function f(e){let t=ee(e,!0);return h(t),y(t),()=>x(t)}function p(e){let t={owned:[],cleanups:[],owner:s},n=s,r=o;s=t,o=null;try{return e(()=>ne(t))}finally{s=n,o=r}}function m(e){s&&s.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:a,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:s}}function h(e){s&&s.owned.push(e)}function g(e){o&&(o.sources.add(e),e.observers.add(o))}function _(e,t){if(e.disposed||e.state>=t)return;let n=e.state===r;if(e.state=t,e.isEffect)l.add(e);else if(n)for(let t of e.observers)_(t,i)}function te(){if(!(c>0||u)){u=!0;try{for(;l.size>0;){let e=[...l];l.clear();for(let t of e)t.disposed||v(t)}}finally{u=!1}}}function v(e){if(!(e.disposed||e.state===r)){if(e.state===i)for(let t of e.sources)`fn`in t&&v(t);e.state===a&&y(e),e.state=r}}function y(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);b(e);let t=o,n=s;o=e,s=e,e.running=!0,e.state=r;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)_(t,a)}}finally{e.running=!1,o=t,s=n}}function b(e){for(let t of e.owned)x(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function x(e){e.disposed||(e.disposed=!0,b(e),e.observers.clear())}function ne(e){for(let t of e.owned)x(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}var re=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}};Math.PI/180,180/Math.PI,2*Math.PI;var S=(e=8)=>Math.random().toString(36).substring(2,e+2);Object.freeze({});var C=e=>typeof e==`function`,w=12e4,T=`__ranuts_bridge__`,E=`default`,D=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},ie=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=E){this.targetOrigin=t,this.channel=n,this.senderId=S(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,D.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:T,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(C(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=S(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},w),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{D.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new ie(n,t,r);if(e||=S(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new re;var O=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],k=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new k(O[0],3609767458),new k(O[1],602891725),new k(O[2],3964484399),new k(O[3],2173295548),new k(O[4],4081628472),new k(O[5],3053834265),new k(O[6],2937671579),new k(O[7],3664609560),new k(O[8],2734883394),new k(O[9],1164996542),new k(O[10],1323610764),new k(O[11],3590304994),new k(O[12],4068182383),new k(O[13],991336113),new k(O[14],633803317),new k(O[15],3479774868),new k(O[16],2666613458),new k(O[17],944711139),new k(O[18],2341262773),new k(O[19],2007800933),new k(O[20],1495990901),new k(O[21],1856431235),new k(O[22],3175218132),new k(O[23],2198950837),new k(O[24],3999719339),new k(O[25],766784016),new k(O[26],2566594879),new k(O[27],3203337956),new k(O[28],1034457026),new k(O[29],2466948901),new k(O[30],3758326383),new k(O[31],168717936),new k(O[32],1188179964),new k(O[33],1546045734),new k(O[34],1522805485),new k(O[35],2643833823),new k(O[36],2343527390),new k(O[37],1014477480),new k(O[38],1206759142),new k(O[39],344077627),new k(O[40],1290863460),new k(O[41],3158454273),new k(O[42],3505952657),new k(O[43],106217008),new k(O[44],3606008344),new k(O[45],1432725776),new k(O[46],1467031594),new k(O[47],851169720),new k(O[48],3100823752),new k(O[49],1363258195),new k(O[50],3750685593),new k(O[51],3785050280),new k(O[52],3318307427),new k(O[53],3812723403),new k(O[54],2003034995),new k(O[55],3602036899),new k(O[56],1575990012),new k(O[57],1125592928),new k(O[58],2716904306),new k(O[59],442776044),new k(O[60],593698344),new k(O[61],3733110249),new k(O[62],2999351573),new k(O[63],3815920427),new k(3391569614,3928383900),new k(3515267271,566280711),new k(3940187606,3454069534),new k(4118630271,4000239992),new k(116418474,1914138554),new k(174292421,2731055270),new k(289380356,3203993006),new k(460393269,320620315),new k(685471733,587496836),new k(852142971,1086792851),new k(1017036298,365543100),new k(1126000580,2618297676),new k(1288033470,3409855158),new k(1501505948,4234509866),new k(1607167915,987167468),new k(1816402316,1246189591),new k(0,1),new k(0,32898),new k(2147483648,32906),new k(2147483648,2147516416),new k(0,32907),new k(0,2147483649),new k(2147483648,2147516545),new k(2147483648,32777),new k(0,138),new k(0,136),new k(0,2147516425),new k(0,2147483658),new k(0,2147516555),new k(2147483648,139),new k(2147483648,32905),new k(2147483648,32771),new k(2147483648,32770),new k(2147483648,128),new k(0,32778),new k(2147483648,2147483658),new k(2147483648,2147516545),new k(2147483648,32896),new k(0,2147483649),new k(2147483648,2147516424);var ae=/["'&<>]/;function A(e){let t=``+e,n=ae.exec(t);if(!n)return t;let r,i=``,a=0,o=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r=`&quot;`;break;case 38:r=`&amp;`;break;case 39:r=`&#39;`;break;case 60:r=`&lt;`;break;case 62:r=`&gt;`;break;default:continue}o!==a&&(i+=t.substring(o,a)),o=a+1,i+=r}return o===a?i:i+t.substring(o,a)}var oe=new Map,se=`data-adopted-style`,ce=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},le=(e,t,n=se)=>{if(typeof document<`u`&&t&&!ce(e,t,oe)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},j=new Map([[100,`Continue`],[101,`Switching Protocols`],[102,`Processing`],[103,`Early Hints`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[305,`Use Proxy`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Payload Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Entity`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[509,`Bandwidth Limit Exceeded`],[510,`Not Extended`],[511,`Network Authentication Required`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(j),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(j);function M(e){return A(e)}var N=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,P=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},F=(e,t,n)=>{for(let r of e)N(r)&&(P(r,t)&&n.push(r),F(r.childrenList,t,n))},I=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?A(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return F(this.childrenList,e,t),t}},L=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new I)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new R(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return F(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${M(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${M(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?A(e):(e instanceof I,e.serialize())).join(``):a+=A(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},R=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return F(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${A(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?A(e):(e instanceof I,e.serialize())).join(``)}</template>`}},z=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(z(t)):e.concat(t),[]),B=e=>e==null?null:e instanceof q?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,V=(e,t)=>{if(n){K(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};f(()=>{let e=t();o();let n=document.createDocumentFragment();a=p(t=>(K(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),m(()=>a?.())},H=`__ranFor`,U=e=>typeof e==`object`&&!!e&&e[H]===!0,W=(e,t,n)=>{let[r,i]=d(t),a=null,o=p(t=>{let i=B(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},G=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},ue=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=B(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;m(()=>{for(let e of i.values())e.dispose();i.clear()}),f(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o))return;let s=i.get(o);s?(i.delete(o),s.index(r)):s=W(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();G(r,a),i=n})},de=`__ranIndex`,fe=e=>typeof e==`object`&&!!e&&e[de]===!0,pe=(e,t,n)=>{let[r,i]=d(e),a=null,o=p(e=>{let i=B(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},me=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=B(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];m(()=>{for(let e of i)e.dispose();i=[]}),f(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<i.length?i[n].setItem(e[n]):i.push(pe(e[n],n,t.render));for(let t=i.length-1;t>=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}G(r,i.map(e=>e.node).filter(e=>e!=null))})},K=(e,t)=>{z(t).forEach(t=>{if(U(t)){ue(e,t);return}if(fe(t)){me(e,t);return}if(typeof t==`function`){V(e,t);return}let n=B(t);n!=null&&e.appendChild(n)})},q=class{el;constructor(e){this.el=n?new L(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?f(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.className=e}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return K(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new he(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},he=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return K(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},J=e=>new q(e),Y=()=>J(`div`),ge=new Map;function X(e,t){n?(ge.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var _e=typeof document<`u`?HTMLElement:L,ve=`data-ranui`,ye=(e,t)=>le(e,t,ve),Z=new WeakMap,Q=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,be=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||Z.get(e)||e.attachShadow(n);return Z.set(e,r),ye(r,t?`${t}\n${Q}`:Q),r},xe=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},$=class extends _e{scratchTicketContainer;scratchTicket;state;scratchAward;_shadowDom;static get observedAttributes(){return[`disabled`,`icon`,`effect`,`iconSize`,`sheet`]}constructor(){super(),this._shadowDom=be(this,t);let e=xe(this._shadowDom,`.ran-scratch-ticket`,()=>{let e=J(`canvas`).class(`ran-scratch-ticket-canvas`).style(`width`,`100%`).style(`height`,`100%`).build(),t=Y().class(`ran-scratch-ticket-award`).build();return Y().class(`ran-scratch-ticket`).children(e,t).build()}),n=e.querySelector(`.ran-scratch-ticket-award`),r=e.querySelector(`.ran-scratch-ticket-canvas`);this.scratchTicketContainer=e,this.scratchAward=n,this.scratchTicket=r,this.state={touchStart:!1,scratchArea:0}}touchStartScratch=e=>{console.log(`eeeeee`,e),this.state.touchStart=!0};touchMoveScratch=()=>{if(this.state.touchStart){let e=this.scratchTicket.getContext(`2d`);if(!e)return;this.state.scratchArea+=30,e.beginPath(),e.arc(100,100,30,0,2*Math.PI),e.globalCompositeOperation=`destination-out`,e.fill(),e.closePath()}};touchEndScratch=()=>{this.state.touchStart=!1;let{width:e,height:t}=this.scratchTicket,n=this.scratchTicket.getContext(`2d`);n&&this.state.scratchArea>e*t*.03&&(this.state.scratchArea=0,n.clearRect(0,0,e,t))};drawScratchTicket=()=>{let e=this.scratchTicket.getContext(`2d`);if(!this.scratchTicketContainer||!e)return;let t=new Image;t.src=``,t.onload=()=>{e.drawImage(t,0,0,this.scratchTicket.width,this.scratchTicket.height)},this.scratchTicket.addEventListener(`touchstart`,this.touchStartScratch),this.scratchTicket.addEventListener(`touchmove`,this.touchMoveScratch),this.scratchTicket.addEventListener(`touchend`,this.touchEndScratch)};attributeChangedCallback(){this._shadowDom.contains(this.scratchTicketContainer)||this._shadowDom.appendChild(this.scratchTicketContainer),this.drawScratchTicket()}};return X(`r-scratch`,$),e.default=$,e})({});
1
+ var ranui_scratch=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{display:block;position:relative}.ran-scratch-ticket{width:100%;height:100%;display:block;position:relative}.ran-scratch-ticket-award{z-index:1;background:#000;width:100%;height:100%;display:block;position:absolute;top:0;left:0}.ran-scratch-ticket-canvas{z-index:2;width:100%;height:100%;display:block;position:absolute;top:0;left:0}`,n=typeof document>`u`,r=0,i=1,a=2,o=null,s=null,c=0,l=new Set,u=!1;function d(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(g(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)_(e,a);c===0&&te()}}]}function f(e){let t=ee(e,!0);return h(t),y(t),()=>x(t)}function p(e){let t={owned:[],cleanups:[],owner:s},n=s,r=o;s=t,o=null;try{return e(()=>ne(t))}finally{s=n,o=r}}function m(e){s&&s.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:a,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:s}}function h(e){s&&s.owned.push(e)}function g(e){o&&(o.sources.add(e),e.observers.add(o))}function _(e,t){if(e.disposed||e.state>=t)return;let n=e.state===r;if(e.state=t,e.isEffect)l.add(e);else if(n)for(let t of e.observers)_(t,i)}function te(){if(!(c>0||u)){u=!0;try{for(;l.size>0;){let e=[...l];l.clear();for(let t of e)t.disposed||v(t)}}finally{u=!1}}}function v(e){if(!(e.disposed||e.state===r)){if(e.state===i)for(let t of e.sources)`fn`in t&&v(t);e.state===a&&y(e),e.state=r}}function y(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);b(e);let t=o,n=s;o=e,s=e,e.running=!0,e.state=r;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)_(t,a)}}finally{e.running=!1,o=t,s=n}}function b(e){for(let t of e.owned)x(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function x(e){e.disposed||(e.disposed=!0,b(e),e.observers.clear())}function ne(e){for(let t of e.owned)x(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}var re=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}};Math.PI/180,180/Math.PI,2*Math.PI;var S=(e=8)=>Math.random().toString(36).substring(2,e+2);Object.freeze({});var C=e=>typeof e==`function`,w=12e4,T=`__ranuts_bridge__`,E=`default`,D=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},ie=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=E){this.targetOrigin=t,this.channel=n,this.senderId=S(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,D.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:T,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(C(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=S(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},w),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{D.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new ie(n,t,r);if(e||=S(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new re;var O=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],k=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new k(O[0],3609767458),new k(O[1],602891725),new k(O[2],3964484399),new k(O[3],2173295548),new k(O[4],4081628472),new k(O[5],3053834265),new k(O[6],2937671579),new k(O[7],3664609560),new k(O[8],2734883394),new k(O[9],1164996542),new k(O[10],1323610764),new k(O[11],3590304994),new k(O[12],4068182383),new k(O[13],991336113),new k(O[14],633803317),new k(O[15],3479774868),new k(O[16],2666613458),new k(O[17],944711139),new k(O[18],2341262773),new k(O[19],2007800933),new k(O[20],1495990901),new k(O[21],1856431235),new k(O[22],3175218132),new k(O[23],2198950837),new k(O[24],3999719339),new k(O[25],766784016),new k(O[26],2566594879),new k(O[27],3203337956),new k(O[28],1034457026),new k(O[29],2466948901),new k(O[30],3758326383),new k(O[31],168717936),new k(O[32],1188179964),new k(O[33],1546045734),new k(O[34],1522805485),new k(O[35],2643833823),new k(O[36],2343527390),new k(O[37],1014477480),new k(O[38],1206759142),new k(O[39],344077627),new k(O[40],1290863460),new k(O[41],3158454273),new k(O[42],3505952657),new k(O[43],106217008),new k(O[44],3606008344),new k(O[45],1432725776),new k(O[46],1467031594),new k(O[47],851169720),new k(O[48],3100823752),new k(O[49],1363258195),new k(O[50],3750685593),new k(O[51],3785050280),new k(O[52],3318307427),new k(O[53],3812723403),new k(O[54],2003034995),new k(O[55],3602036899),new k(O[56],1575990012),new k(O[57],1125592928),new k(O[58],2716904306),new k(O[59],442776044),new k(O[60],593698344),new k(O[61],3733110249),new k(O[62],2999351573),new k(O[63],3815920427),new k(3391569614,3928383900),new k(3515267271,566280711),new k(3940187606,3454069534),new k(4118630271,4000239992),new k(116418474,1914138554),new k(174292421,2731055270),new k(289380356,3203993006),new k(460393269,320620315),new k(685471733,587496836),new k(852142971,1086792851),new k(1017036298,365543100),new k(1126000580,2618297676),new k(1288033470,3409855158),new k(1501505948,4234509866),new k(1607167915,987167468),new k(1816402316,1246189591),new k(0,1),new k(0,32898),new k(2147483648,32906),new k(2147483648,2147516416),new k(0,32907),new k(0,2147483649),new k(2147483648,2147516545),new k(2147483648,32777),new k(0,138),new k(0,136),new k(0,2147516425),new k(0,2147483658),new k(0,2147516555),new k(2147483648,139),new k(2147483648,32905),new k(2147483648,32771),new k(2147483648,32770),new k(2147483648,128),new k(0,32778),new k(2147483648,2147483658),new k(2147483648,2147516545),new k(2147483648,32896),new k(0,2147483649),new k(2147483648,2147516424);var ae=/["'&<>]/;function A(e){let t=``+e,n=ae.exec(t);if(!n)return t;let r,i=``,a=0,o=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r=`&quot;`;break;case 38:r=`&amp;`;break;case 39:r=`&#39;`;break;case 60:r=`&lt;`;break;case 62:r=`&gt;`;break;default:continue}o!==a&&(i+=t.substring(o,a)),o=a+1,i+=r}return o===a?i:i+t.substring(o,a)}var oe=new Map,se=`data-adopted-style`,ce=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},le=(e,t,n=se)=>{if(typeof document<`u`&&t&&!ce(e,t,oe)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}};(()=>{let e=new Uint8Array(128);for(let t=0;t<78;t++)e[`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.,!?;:'"()[]{}`.charCodeAt(t)]=1;return e})();var j=new Map([[100,`Continue`],[101,`Switching Protocols`],[102,`Processing`],[103,`Early Hints`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[305,`Use Proxy`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Payload Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Entity`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[509,`Bandwidth Limit Exceeded`],[510,`Not Extended`],[511,`Network Authentication Required`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(j),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(j);function M(e){return A(e)}var N=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,P=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},F=(e,t,n)=>{for(let r of e)N(r)&&(P(r,t)&&n.push(r),F(r.childrenList,t,n))},I=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?A(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return F(this.childrenList,e,t),t}},L=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new I)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new R(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return F(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${M(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${M(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?A(e):(e instanceof I,e.serialize())).join(``):a+=A(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},R=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return F(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${A(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?A(e):(e instanceof I,e.serialize())).join(``)}</template>`}},z=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(z(t)):e.concat(t),[]),B=e=>e==null?null:e instanceof q?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,V=(e,t)=>{if(n){K(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};f(()=>{let e=t();o();let n=document.createDocumentFragment();a=p(t=>(K(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),m(()=>a?.())},H=`__ranFor`,U=e=>typeof e==`object`&&!!e&&e[H]===!0,W=(e,t,n)=>{let[r,i]=d(t),a=null,o=p(t=>{let i=B(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},G=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},ue=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=B(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;m(()=>{for(let e of i.values())e.dispose();i.clear()}),f(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o))return;let s=i.get(o);s?(i.delete(o),s.index(r)):s=W(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();G(r,a),i=n})},de=`__ranIndex`,fe=e=>typeof e==`object`&&!!e&&e[de]===!0,pe=(e,t,n)=>{let[r,i]=d(e),a=null,o=p(e=>{let i=B(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},me=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=B(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];m(()=>{for(let e of i)e.dispose();i=[]}),f(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<i.length?i[n].setItem(e[n]):i.push(pe(e[n],n,t.render));for(let t=i.length-1;t>=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}G(r,i.map(e=>e.node).filter(e=>e!=null))})},K=(e,t)=>{z(t).forEach(t=>{if(U(t)){ue(e,t);return}if(fe(t)){me(e,t);return}if(typeof t==`function`){V(e,t);return}let n=B(t);n!=null&&e.appendChild(n)})},q=class{el;constructor(e){this.el=n?new L(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?f(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.className=e}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return K(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new he(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},he=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return K(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},J=e=>new q(e),Y=()=>J(`div`),ge=new Map;function X(e,t){n?(ge.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var _e=typeof document<`u`?HTMLElement:L,ve=`data-ranui`,ye=(e,t)=>le(e,t,ve),Z=new WeakMap,Q=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,be=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||Z.get(e)||e.attachShadow(n);return Z.set(e,r),ye(r,t?`${t}\n${Q}`:Q),r},xe=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},$=class extends _e{scratchTicketContainer;scratchTicket;state;scratchAward;_shadowDom;static get observedAttributes(){return[`disabled`,`icon`,`effect`,`iconSize`,`sheet`]}constructor(){super(),this._shadowDom=be(this,t);let e=xe(this._shadowDom,`.ran-scratch-ticket`,()=>{let e=J(`canvas`).class(`ran-scratch-ticket-canvas`).style(`width`,`100%`).style(`height`,`100%`).build(),t=Y().class(`ran-scratch-ticket-award`).build();return Y().class(`ran-scratch-ticket`).children(e,t).build()}),n=e.querySelector(`.ran-scratch-ticket-award`),r=e.querySelector(`.ran-scratch-ticket-canvas`);this.scratchTicketContainer=e,this.scratchAward=n,this.scratchTicket=r,this.state={touchStart:!1,scratchArea:0}}touchStartScratch=e=>{console.log(`eeeeee`,e),this.state.touchStart=!0};touchMoveScratch=()=>{if(this.state.touchStart){let e=this.scratchTicket.getContext(`2d`);if(!e)return;this.state.scratchArea+=30,e.beginPath(),e.arc(100,100,30,0,2*Math.PI),e.globalCompositeOperation=`destination-out`,e.fill(),e.closePath()}};touchEndScratch=()=>{this.state.touchStart=!1;let{width:e,height:t}=this.scratchTicket,n=this.scratchTicket.getContext(`2d`);n&&this.state.scratchArea>e*t*.03&&(this.state.scratchArea=0,n.clearRect(0,0,e,t))};drawScratchTicket=()=>{let e=this.scratchTicket.getContext(`2d`);if(!this.scratchTicketContainer||!e)return;let t=new Image;t.src=``,t.onload=()=>{e.drawImage(t,0,0,this.scratchTicket.width,this.scratchTicket.height)},this.scratchTicket.addEventListener(`touchstart`,this.touchStartScratch),this.scratchTicket.addEventListener(`touchmove`,this.touchMoveScratch),this.scratchTicket.addEventListener(`touchend`,this.touchEndScratch)};attributeChangedCallback(){this._shadowDom.contains(this.scratchTicketContainer)||this._shadowDom.appendChild(this.scratchTicketContainer),this.drawScratchTicket()}};return X(`r-scratch`,$),e.default=$,e})({});
@@ -1 +1 @@
1
- var ranui_section=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{border-width:var(--ran-skin-border-width,1px);border-style:var(--ran-skin-border-style,solid);border-color:var(--ran-section-border-color,var(--ran-color-border,#eaeaea));border-radius:var(--ran-section-radius,var(--ran-radius-md,8px));background:var(--ran-section-background,var(--ran-color-bg-elevated,#fff));box-shadow:var(--ran-section-shadow,var(--ran-shadow-elevated,none));padding:var(--ran-section-padding,28px);box-sizing:border-box;scroll-margin-top:96px;display:block}.ran-section-header{gap:8px;max-width:760px;margin-bottom:22px;display:grid}.ran-section-heading{color:var(--ran-section-heading-color,var(--ran-color-text,#0f172a));font-size:var(--ran-section-heading-font-size,24px);font-weight:var(--ran-section-heading-font-weight,700);letter-spacing:0;margin:0;line-height:1.25}.ran-section-heading:empty{display:none}.ran-section-subtitle{max-width:620px;color:var(--ran-section-subtitle-color,var(--ran-color-text-secondary,#607086));margin:0}.ran-section-subtitle:empty{display:none}.ran-section-body{min-width:0}`,n=typeof document>`u`,r=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.ac.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}},i=0,a=1,o=2,s=null,c=null,l=0,u=new Set,d=!1;function f(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(g(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)_(e,o);l===0&&ne()}}]}function p(e){let t=ee(e,!0);return te(t),y(t),()=>x(t)}function m(e){let t={owned:[],cleanups:[],owner:c},n=c,r=s;c=t,s=null;try{return e(()=>re(t))}finally{c=n,s=r}}function h(e){c&&c.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:o,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:c}}function te(e){c&&c.owned.push(e)}function g(e){s&&(s.sources.add(e),e.observers.add(s))}function _(e,t){if(e.disposed||e.state>=t)return;let n=e.state===i;if(e.state=t,e.isEffect)u.add(e);else if(n)for(let t of e.observers)_(t,a)}function ne(){if(!(l>0||d)){d=!0;try{for(;u.size>0;){let e=[...u];u.clear();for(let t of e)t.disposed||v(t)}}finally{d=!1}}}function v(e){if(!(e.disposed||e.state===i)){if(e.state===a)for(let t of e.sources)`fn`in t&&v(t);e.state===o&&y(e),e.state=i}}function y(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);b(e);let t=s,n=c;s=e,c=e,e.running=!0,e.state=i;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)_(t,o)}}finally{e.running=!1,s=t,c=n}}function b(e){for(let t of e.owned)x(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function x(e){e.disposed||(e.disposed=!0,b(e),e.observers.clear())}function re(e){for(let t of e.owned)x(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}var ie=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}};Math.PI/180,180/Math.PI,2*Math.PI;var S=(e=8)=>Math.random().toString(36).substring(2,e+2);Object.freeze({});var ae=e=>typeof e==`function`,C=12e4,w=`__ranuts_bridge__`,T=`default`,E=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},D=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=T){this.targetOrigin=t,this.channel=n,this.senderId=S(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,E.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:w,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(ae(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=S(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},C),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{E.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new D(n,t,r);if(e||=S(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new ie;var O=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],k=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new k(O[0],3609767458),new k(O[1],602891725),new k(O[2],3964484399),new k(O[3],2173295548),new k(O[4],4081628472),new k(O[5],3053834265),new k(O[6],2937671579),new k(O[7],3664609560),new k(O[8],2734883394),new k(O[9],1164996542),new k(O[10],1323610764),new k(O[11],3590304994),new k(O[12],4068182383),new k(O[13],991336113),new k(O[14],633803317),new k(O[15],3479774868),new k(O[16],2666613458),new k(O[17],944711139),new k(O[18],2341262773),new k(O[19],2007800933),new k(O[20],1495990901),new k(O[21],1856431235),new k(O[22],3175218132),new k(O[23],2198950837),new k(O[24],3999719339),new k(O[25],766784016),new k(O[26],2566594879),new k(O[27],3203337956),new k(O[28],1034457026),new k(O[29],2466948901),new k(O[30],3758326383),new k(O[31],168717936),new k(O[32],1188179964),new k(O[33],1546045734),new k(O[34],1522805485),new k(O[35],2643833823),new k(O[36],2343527390),new k(O[37],1014477480),new k(O[38],1206759142),new k(O[39],344077627),new k(O[40],1290863460),new k(O[41],3158454273),new k(O[42],3505952657),new k(O[43],106217008),new k(O[44],3606008344),new k(O[45],1432725776),new k(O[46],1467031594),new k(O[47],851169720),new k(O[48],3100823752),new k(O[49],1363258195),new k(O[50],3750685593),new k(O[51],3785050280),new k(O[52],3318307427),new k(O[53],3812723403),new k(O[54],2003034995),new k(O[55],3602036899),new k(O[56],1575990012),new k(O[57],1125592928),new k(O[58],2716904306),new k(O[59],442776044),new k(O[60],593698344),new k(O[61],3733110249),new k(O[62],2999351573),new k(O[63],3815920427),new k(3391569614,3928383900),new k(3515267271,566280711),new k(3940187606,3454069534),new k(4118630271,4000239992),new k(116418474,1914138554),new k(174292421,2731055270),new k(289380356,3203993006),new k(460393269,320620315),new k(685471733,587496836),new k(852142971,1086792851),new k(1017036298,365543100),new k(1126000580,2618297676),new k(1288033470,3409855158),new k(1501505948,4234509866),new k(1607167915,987167468),new k(1816402316,1246189591),new k(0,1),new k(0,32898),new k(2147483648,32906),new k(2147483648,2147516416),new k(0,32907),new k(0,2147483649),new k(2147483648,2147516545),new k(2147483648,32777),new k(0,138),new k(0,136),new k(0,2147516425),new k(0,2147483658),new k(0,2147516555),new k(2147483648,139),new k(2147483648,32905),new k(2147483648,32771),new k(2147483648,32770),new k(2147483648,128),new k(0,32778),new k(2147483648,2147483658),new k(2147483648,2147516545),new k(2147483648,32896),new k(0,2147483649),new k(2147483648,2147516424);var oe=/["'&<>]/;function A(e){let t=``+e,n=oe.exec(t);if(!n)return t;let r,i=``,a=0,o=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r=`&quot;`;break;case 38:r=`&amp;`;break;case 39:r=`&#39;`;break;case 60:r=`&lt;`;break;case 62:r=`&gt;`;break;default:continue}o!==a&&(i+=t.substring(o,a)),o=a+1,i+=r}return o===a?i:i+t.substring(o,a)}var se=new Map,ce=new Map,le=`data-adopted-style`,ue=`data-adopted-sheet`,j=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},de=(e,t,n=le)=>{if(typeof document<`u`&&t&&!j(e,t,se)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},fe=(e,t,n=ue)=>{if(typeof document<`u`&&t&&!j(e,t,ce)&&!Array.from(e.querySelectorAll(`style[${n}]`)).some(e=>e.textContent===t)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},M=new Map([[100,`Continue`],[101,`Switching Protocols`],[102,`Processing`],[103,`Early Hints`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[305,`Use Proxy`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Payload Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Entity`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[509,`Bandwidth Limit Exceeded`],[510,`Not Extended`],[511,`Network Authentication Required`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(M),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(M);function N(e){return A(e)}var P=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,F=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},I=(e,t,n)=>{for(let r of e)P(r)&&(F(r,t)&&n.push(r),I(r.childrenList,t,n))},L=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?A(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return I(this.childrenList,e,t),t}},R=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new L)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new z(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return I(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${N(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${N(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?A(e):(e instanceof L,e.serialize())).join(``):a+=A(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},z=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return I(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${A(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?A(e):(e instanceof L,e.serialize())).join(``)}</template>`}},B=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(B(t)):e.concat(t),[]),V=e=>e==null?null:e instanceof W?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,pe=(e,t)=>{if(n){U(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};p(()=>{let e=t();o();let n=document.createDocumentFragment();a=m(t=>(U(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),h(()=>a?.())},me=`__ranFor`,he=e=>typeof e==`object`&&!!e&&e[me]===!0,ge=(e,t,n)=>{let[r,i]=f(t),a=null,o=m(t=>{let i=V(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},H=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},_e=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=V(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;h(()=>{for(let e of i.values())e.dispose();i.clear()}),p(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o))return;let s=i.get(o);s?(i.delete(o),s.index(r)):s=ge(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();H(r,a),i=n})},ve=`__ranIndex`,ye=e=>typeof e==`object`&&!!e&&e[ve]===!0,be=(e,t,n)=>{let[r,i]=f(e),a=null,o=m(e=>{let i=V(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},xe=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=V(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];h(()=>{for(let e of i)e.dispose();i=[]}),p(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<i.length?i[n].setItem(e[n]):i.push(be(e[n],n,t.render));for(let t=i.length-1;t>=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}H(r,i.map(e=>e.node).filter(e=>e!=null))})},U=(e,t)=>{B(t).forEach(t=>{if(he(t)){_e(e,t);return}if(ye(t)){xe(e,t);return}if(typeof t==`function`){pe(e,t);return}let n=V(t);n!=null&&e.appendChild(n)})},W=class{el;constructor(e){this.el=n?new R(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?p(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.className=e}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return U(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new Se(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},Se=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return U(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},G=e=>new W(e),K=()=>G(`div`),Ce=()=>G(`slot`),we=new Map;function Te(e,t){n?(we.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ee=typeof document<`u`?HTMLElement:R,q=`data-ranui`,De=`data-ranui-sheet`,Oe=(e,t)=>de(e,t,q),ke=(e,t)=>fe(e,t,De),J=new WeakMap,Y=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Ae=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||J.get(e)||e.attachShadow(n);return J.set(e,r),Oe(r,t?`${t}\n${Y}`:Y),r},je=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},X=(e,t,n=``)=>e.getAttribute(t)??n,Z=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},Q=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&ke(t,a)},$=class extends Ee{_shadowDom;_headerEl;_headingEl;_subtitleEl;_events=new r;static get observedAttributes(){return[`heading`,`subtitle`,`sheet`]}constructor(){super(),this._shadowDom=Ae(this,t);let e=je(this._shadowDom,`.ran-section-header`,()=>{let e=K().class(`ran-section-header`).attr(`part`,`header`).children(K().class(`ran-section-heading`).attr(`part`,`heading`).attr(`role`,`heading`).attr(`aria-level`,`2`),K().class(`ran-section-subtitle`).attr(`part`,`subtitle`)).build(),t=K().class(`ran-section-body`).attr(`part`,`body`).children(Ce()).build();return this._shadowDom.appendChild(e),this._shadowDom.appendChild(t),e});this._headerEl=e,this._headingEl=e.querySelector(`.ran-section-heading`),this._subtitleEl=e.querySelector(`.ran-section-subtitle`)}get heading(){return X(this,`heading`)}set heading(e){Z(this,`heading`,e)}get subtitle(){return X(this,`subtitle`)}set subtitle(e){Z(this,`subtitle`,e)}get sheet(){return X(this,`sheet`)}set sheet(e){Z(this,`sheet`,e)}_syncHeading(){this._headingEl.textContent=this.getAttribute(`heading`)??``,this._headerEl.style.display=this._headingEl.textContent||this._subtitleEl.textContent?``:`none`}_syncSubtitle(){this._subtitleEl.textContent=this.getAttribute(`subtitle`)??``,this._headerEl.style.display=this._headingEl.textContent||this._subtitleEl.textContent?``:`none`}connectedCallback(){this._syncHeading(),this._syncSubtitle(),Q(this,this._shadowDom,`sheet`,null,this.sheet)}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`heading`&&this._syncHeading(),e===`subtitle`&&this._syncSubtitle(),e===`sheet`&&Q(this,this._shadowDom,e,t,n))}};return Te(`r-section`,$),e.Section=$,e.default=$,e})({});
1
+ var ranui_section=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{border-width:var(--ran-skin-border-width,1px);border-style:var(--ran-skin-border-style,solid);border-color:var(--ran-section-border-color,var(--ran-color-border,#eaeaea));border-radius:var(--ran-section-radius,var(--ran-radius-md,8px));background:var(--ran-section-background,var(--ran-color-bg-elevated,#fff));box-shadow:var(--ran-section-shadow,var(--ran-shadow-elevated,none));padding:var(--ran-section-padding,28px);box-sizing:border-box;scroll-margin-top:96px;display:block}.ran-section-header{gap:8px;max-width:760px;margin-bottom:22px;display:grid}.ran-section-heading{color:var(--ran-section-heading-color,var(--ran-color-text,#0f172a));font-size:var(--ran-section-heading-font-size,24px);font-weight:var(--ran-section-heading-font-weight,700);letter-spacing:0;margin:0;line-height:1.25}.ran-section-heading:empty{display:none}.ran-section-subtitle{max-width:620px;color:var(--ran-section-subtitle-color,var(--ran-color-text-secondary,#607086));margin:0}.ran-section-subtitle:empty{display:none}.ran-section-body{min-width:0}`,n=typeof document>`u`,r=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.ac.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}},i=0,a=1,o=2,s=null,c=null,l=0,u=new Set,d=!1;function f(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(g(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)_(e,o);l===0&&ne()}}]}function p(e){let t=ee(e,!0);return te(t),y(t),()=>x(t)}function m(e){let t={owned:[],cleanups:[],owner:c},n=c,r=s;c=t,s=null;try{return e(()=>re(t))}finally{c=n,s=r}}function h(e){c&&c.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:o,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:c}}function te(e){c&&c.owned.push(e)}function g(e){s&&(s.sources.add(e),e.observers.add(s))}function _(e,t){if(e.disposed||e.state>=t)return;let n=e.state===i;if(e.state=t,e.isEffect)u.add(e);else if(n)for(let t of e.observers)_(t,a)}function ne(){if(!(l>0||d)){d=!0;try{for(;u.size>0;){let e=[...u];u.clear();for(let t of e)t.disposed||v(t)}}finally{d=!1}}}function v(e){if(!(e.disposed||e.state===i)){if(e.state===a)for(let t of e.sources)`fn`in t&&v(t);e.state===o&&y(e),e.state=i}}function y(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);b(e);let t=s,n=c;s=e,c=e,e.running=!0,e.state=i;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)_(t,o)}}finally{e.running=!1,s=t,c=n}}function b(e){for(let t of e.owned)x(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function x(e){e.disposed||(e.disposed=!0,b(e),e.observers.clear())}function re(e){for(let t of e.owned)x(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}var ie=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}};Math.PI/180,180/Math.PI,2*Math.PI;var S=(e=8)=>Math.random().toString(36).substring(2,e+2);Object.freeze({});var ae=e=>typeof e==`function`,C=12e4,w=`__ranuts_bridge__`,T=`default`,E=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},D=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=T){this.targetOrigin=t,this.channel=n,this.senderId=S(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,E.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:w,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(ae(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=S(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},C),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{E.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new D(n,t,r);if(e||=S(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new ie;var O=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],k=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new k(O[0],3609767458),new k(O[1],602891725),new k(O[2],3964484399),new k(O[3],2173295548),new k(O[4],4081628472),new k(O[5],3053834265),new k(O[6],2937671579),new k(O[7],3664609560),new k(O[8],2734883394),new k(O[9],1164996542),new k(O[10],1323610764),new k(O[11],3590304994),new k(O[12],4068182383),new k(O[13],991336113),new k(O[14],633803317),new k(O[15],3479774868),new k(O[16],2666613458),new k(O[17],944711139),new k(O[18],2341262773),new k(O[19],2007800933),new k(O[20],1495990901),new k(O[21],1856431235),new k(O[22],3175218132),new k(O[23],2198950837),new k(O[24],3999719339),new k(O[25],766784016),new k(O[26],2566594879),new k(O[27],3203337956),new k(O[28],1034457026),new k(O[29],2466948901),new k(O[30],3758326383),new k(O[31],168717936),new k(O[32],1188179964),new k(O[33],1546045734),new k(O[34],1522805485),new k(O[35],2643833823),new k(O[36],2343527390),new k(O[37],1014477480),new k(O[38],1206759142),new k(O[39],344077627),new k(O[40],1290863460),new k(O[41],3158454273),new k(O[42],3505952657),new k(O[43],106217008),new k(O[44],3606008344),new k(O[45],1432725776),new k(O[46],1467031594),new k(O[47],851169720),new k(O[48],3100823752),new k(O[49],1363258195),new k(O[50],3750685593),new k(O[51],3785050280),new k(O[52],3318307427),new k(O[53],3812723403),new k(O[54],2003034995),new k(O[55],3602036899),new k(O[56],1575990012),new k(O[57],1125592928),new k(O[58],2716904306),new k(O[59],442776044),new k(O[60],593698344),new k(O[61],3733110249),new k(O[62],2999351573),new k(O[63],3815920427),new k(3391569614,3928383900),new k(3515267271,566280711),new k(3940187606,3454069534),new k(4118630271,4000239992),new k(116418474,1914138554),new k(174292421,2731055270),new k(289380356,3203993006),new k(460393269,320620315),new k(685471733,587496836),new k(852142971,1086792851),new k(1017036298,365543100),new k(1126000580,2618297676),new k(1288033470,3409855158),new k(1501505948,4234509866),new k(1607167915,987167468),new k(1816402316,1246189591),new k(0,1),new k(0,32898),new k(2147483648,32906),new k(2147483648,2147516416),new k(0,32907),new k(0,2147483649),new k(2147483648,2147516545),new k(2147483648,32777),new k(0,138),new k(0,136),new k(0,2147516425),new k(0,2147483658),new k(0,2147516555),new k(2147483648,139),new k(2147483648,32905),new k(2147483648,32771),new k(2147483648,32770),new k(2147483648,128),new k(0,32778),new k(2147483648,2147483658),new k(2147483648,2147516545),new k(2147483648,32896),new k(0,2147483649),new k(2147483648,2147516424);var oe=/["'&<>]/;function A(e){let t=``+e,n=oe.exec(t);if(!n)return t;let r,i=``,a=0,o=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r=`&quot;`;break;case 38:r=`&amp;`;break;case 39:r=`&#39;`;break;case 60:r=`&lt;`;break;case 62:r=`&gt;`;break;default:continue}o!==a&&(i+=t.substring(o,a)),o=a+1,i+=r}return o===a?i:i+t.substring(o,a)}var se=new Map,ce=new Map,le=`data-adopted-style`,ue=`data-adopted-sheet`,j=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},de=(e,t,n=le)=>{if(typeof document<`u`&&t&&!j(e,t,se)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}},fe=(e,t,n=ue)=>{if(typeof document<`u`&&t&&!j(e,t,ce)&&!Array.from(e.querySelectorAll(`style[${n}]`)).some(e=>e.textContent===t)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}};(()=>{let e=new Uint8Array(128);for(let t=0;t<78;t++)e[`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.,!?;:'"()[]{}`.charCodeAt(t)]=1;return e})();var M=new Map([[100,`Continue`],[101,`Switching Protocols`],[102,`Processing`],[103,`Early Hints`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[305,`Use Proxy`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Payload Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Entity`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[509,`Bandwidth Limit Exceeded`],[510,`Not Extended`],[511,`Network Authentication Required`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(M),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(M);function N(e){return A(e)}var P=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,F=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},I=(e,t,n)=>{for(let r of e)P(r)&&(F(r,t)&&n.push(r),I(r.childrenList,t,n))},L=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?A(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return I(this.childrenList,e,t),t}},R=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new L)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new z(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return I(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${N(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${N(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?A(e):(e instanceof L,e.serialize())).join(``):a+=A(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},z=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return I(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${A(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?A(e):(e instanceof L,e.serialize())).join(``)}</template>`}},B=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(B(t)):e.concat(t),[]),V=e=>e==null?null:e instanceof W?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,pe=(e,t)=>{if(n){U(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};p(()=>{let e=t();o();let n=document.createDocumentFragment();a=m(t=>(U(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),h(()=>a?.())},me=`__ranFor`,he=e=>typeof e==`object`&&!!e&&e[me]===!0,ge=(e,t,n)=>{let[r,i]=f(t),a=null,o=m(t=>{let i=V(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},H=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},_e=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=V(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;h(()=>{for(let e of i.values())e.dispose();i.clear()}),p(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o))return;let s=i.get(o);s?(i.delete(o),s.index(r)):s=ge(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();H(r,a),i=n})},ve=`__ranIndex`,ye=e=>typeof e==`object`&&!!e&&e[ve]===!0,be=(e,t,n)=>{let[r,i]=f(e),a=null,o=m(e=>{let i=V(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},xe=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=V(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];h(()=>{for(let e of i)e.dispose();i=[]}),p(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<i.length?i[n].setItem(e[n]):i.push(be(e[n],n,t.render));for(let t=i.length-1;t>=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}H(r,i.map(e=>e.node).filter(e=>e!=null))})},U=(e,t)=>{B(t).forEach(t=>{if(he(t)){_e(e,t);return}if(ye(t)){xe(e,t);return}if(typeof t==`function`){pe(e,t);return}let n=V(t);n!=null&&e.appendChild(n)})},W=class{el;constructor(e){this.el=n?new R(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?p(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.className=e}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return U(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new Se(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},Se=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return U(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},G=e=>new W(e),K=()=>G(`div`),Ce=()=>G(`slot`),we=new Map;function Te(e,t){n?(we.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ee=typeof document<`u`?HTMLElement:R,q=`data-ranui`,De=`data-ranui-sheet`,Oe=(e,t)=>de(e,t,q),ke=(e,t)=>fe(e,t,De),J=new WeakMap,Y=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Ae=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||J.get(e)||e.attachShadow(n);return J.set(e,r),Oe(r,t?`${t}\n${Y}`:Y),r},je=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},X=(e,t,n=``)=>e.getAttribute(t)??n,Z=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},Q=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&ke(t,a)},$=class extends Ee{_shadowDom;_headerEl;_headingEl;_subtitleEl;_events=new r;static get observedAttributes(){return[`heading`,`subtitle`,`sheet`]}constructor(){super(),this._shadowDom=Ae(this,t);let e=je(this._shadowDom,`.ran-section-header`,()=>{let e=K().class(`ran-section-header`).attr(`part`,`header`).children(K().class(`ran-section-heading`).attr(`part`,`heading`).attr(`role`,`heading`).attr(`aria-level`,`2`),K().class(`ran-section-subtitle`).attr(`part`,`subtitle`)).build(),t=K().class(`ran-section-body`).attr(`part`,`body`).children(Ce()).build();return this._shadowDom.appendChild(e),this._shadowDom.appendChild(t),e});this._headerEl=e,this._headingEl=e.querySelector(`.ran-section-heading`),this._subtitleEl=e.querySelector(`.ran-section-subtitle`)}get heading(){return X(this,`heading`)}set heading(e){Z(this,`heading`,e)}get subtitle(){return X(this,`subtitle`)}set subtitle(e){Z(this,`subtitle`,e)}get sheet(){return X(this,`sheet`)}set sheet(e){Z(this,`sheet`,e)}_syncHeading(){this._headingEl.textContent=this.getAttribute(`heading`)??``,this._headerEl.style.display=this._headingEl.textContent||this._subtitleEl.textContent?``:`none`}_syncSubtitle(){this._subtitleEl.textContent=this.getAttribute(`subtitle`)??``,this._headerEl.style.display=this._headingEl.textContent||this._subtitleEl.textContent?``:`none`}connectedCallback(){this._syncHeading(),this._syncSubtitle(),Q(this,this._shadowDom,`sheet`,null,this.sheet)}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`heading`&&this._syncHeading(),e===`subtitle`&&this._syncSubtitle(),e===`sheet`&&Q(this,this._shadowDom,e,t,n))}};return Te(`r-section`,$),e.Section=$,e.default=$,e})({});