ranui 0.2.1-alpha.1 → 0.2.1-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abnfDiagram-VRR7QNED-CH_pIv_l.cjs +1 -0
- package/dist/abnfDiagram-VRR7QNED-CTsqwzwi.js +95 -0
- package/dist/arc-D25LhgTs.cjs +1 -0
- package/dist/arc-DRPGof21.js +82 -0
- package/dist/architecture-TIHT7OUA-BbBd15_y.cjs +1 -0
- package/dist/architecture-TIHT7OUA-pbFO1xSx.js +5 -0
- package/dist/architectureDiagram-ZJ3FMSHR-8mjyXr-w.js +4279 -0
- package/dist/architectureDiagram-ZJ3FMSHR-D_jWFFZx.cjs +36 -0
- package/dist/array-By5736M5.js +7 -0
- package/dist/array-C3cbN3GY.cjs +1 -0
- package/dist/blockDiagram-677ZJIJ3-3F79MOSt.js +3321 -0
- package/dist/blockDiagram-677ZJIJ3-Cx35khWe.cjs +132 -0
- package/dist/builder.d.ts +2 -2
- package/dist/builder.js +39 -34
- package/dist/{builtin-D9djWkCE.js → builtin-1lUEp_ro.js} +83 -76
- package/dist/button-Cj-XSCsd.js +117 -0
- package/dist/button.js +1 -1
- package/dist/c4Diagram-LMCZKHZV-Cxn_gqu_.js +3064 -0
- package/dist/c4Diagram-LMCZKHZV-TRNb3Gvl.cjs +10 -0
- package/dist/{card-CqJa4Q_v.js → card-BHN9Xp4S.js} +2 -2
- package/dist/card.js +1 -1
- package/dist/channel-C9WSNwcS.cjs +1 -0
- package/dist/channel-k5-UxdcV.js +5 -0
- package/dist/{checkbox-CThC9-vy.js → checkbox-O_J_n1_W.js} +10 -10
- package/dist/checkbox.js +1 -1
- package/dist/chunk-2Q5K7J3B-CTMy5FII.cjs +1 -0
- package/dist/chunk-2Q5K7J3B-DlFVJRAn.js +15 -0
- package/dist/chunk-32BRIVSS-BXVdG_nV.cjs +1 -0
- package/dist/chunk-32BRIVSS-jAuAwMVV.js +68 -0
- package/dist/chunk-52WLFC77-BChUrU24.cjs +10 -0
- package/dist/chunk-52WLFC77-wpL7en7e.js +630 -0
- package/dist/chunk-5VM5RSS4-Cni2Ogq2.js +19 -0
- package/dist/chunk-5VM5RSS4-DudUFQ_Z.cjs +15 -0
- package/dist/chunk-7BUUIJ7U-9hiBbc7O.js +87 -0
- package/dist/chunk-7BUUIJ7U-DMv_UkjI.cjs +1 -0
- package/dist/chunk-C7G6YPKG-CA-DNpvI.js +71 -0
- package/dist/chunk-C7G6YPKG-CKEeW9TM.cjs +1 -0
- package/dist/chunk-EX3LRPZG-BCmf0iDq.js +2137 -0
- package/dist/chunk-EX3LRPZG-DbfbNdXo.cjs +231 -0
- package/dist/chunk-FWX5IMBZ-D11-gbhc.cjs +1 -0
- package/dist/chunk-FWX5IMBZ-DZ5VYvm5.js +60 -0
- package/dist/chunk-HOUHSVGY-BGB3dOvI.cjs +1 -0
- package/dist/chunk-HOUHSVGY-DRQcQeMT.js +268 -0
- package/dist/chunk-ICXQ74PX-BbT9JaEW.cjs +2 -0
- package/dist/chunk-ICXQ74PX-DR8rL-xF.js +1377 -0
- package/dist/chunk-JWPE2WC7-CGEmUMMZ.js +8 -0
- package/dist/chunk-JWPE2WC7-D8EnWK1B.cjs +1 -0
- package/dist/chunk-KEIR6QF5-B2Op7cFH.js +22155 -0
- package/dist/chunk-KEIR6QF5-C4fcHpY0.cjs +161 -0
- package/dist/chunk-MOJQB5TN-BC46HDyu.js +516 -0
- package/dist/chunk-MOJQB5TN-oOeq982_.cjs +88 -0
- package/dist/chunk-OGEWGWER-BV51ll2w.js +33 -0
- package/dist/chunk-OGEWGWER-DX8sW1dT.cjs +1 -0
- package/dist/chunk-PUDLZKDR-48YaqVoF.cjs +156 -0
- package/dist/chunk-PUDLZKDR-NdMR0Ft5.js +4282 -0
- package/dist/chunk-Q4XR5HBZ-3BHjjc9u.js +1709 -0
- package/dist/chunk-Q4XR5HBZ-aBnPq509.cjs +70 -0
- package/dist/chunk-RYQCIY6F-BER2T9t0.js +246 -0
- package/dist/chunk-RYQCIY6F-DVRzSnsI.cjs +1 -0
- package/dist/chunk-V7JOEXUC-Cr_hr02u.js +3467 -0
- package/dist/chunk-V7JOEXUC-DHizzTla.cjs +206 -0
- package/dist/chunk-VAUOI2AC-DfQf5L2_.cjs +1 -0
- package/dist/chunk-VAUOI2AC-izt0o4id.js +11 -0
- package/dist/chunk-VR4S4FIN-CJi5okl4.js +26 -0
- package/dist/chunk-VR4S4FIN-KiwnPF31.cjs +1 -0
- package/dist/chunk-WYO6CB5R-DDHkKowO.js +4535 -0
- package/dist/chunk-WYO6CB5R-u4mJNOcO.cjs +127 -0
- package/dist/chunk-XXDRQBXY-BB1i_53q.js +9 -0
- package/dist/chunk-XXDRQBXY-C8VGLZmt.cjs +1 -0
- package/dist/chunk-Y2CYZVJY-0JxdZxki.js +13 -0
- package/dist/chunk-Y2CYZVJY-DPaYLFFP.cjs +1 -0
- package/dist/chunk-ZGVPDNZ5-6uMbTJXy.js +3841 -0
- package/dist/chunk-ZGVPDNZ5-Cw5_HJba.cjs +62 -0
- package/dist/chunk-ZIRB5QZD-C7OH2FI2.js +1280 -0
- package/dist/chunk-ZIRB5QZD-aLu-4ITN.cjs +32 -0
- package/dist/classDiagram-OUVF2IWQ-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-OUVF2IWQ-Df0ghim9.js +30 -0
- package/dist/classDiagram-v2-EOCWNBFH-D6rqYIh0.cjs +1 -0
- package/dist/classDiagram-v2-EOCWNBFH-Df0ghim9.js +30 -0
- package/dist/{colorpicker-XNxDRcQ-.js → colorpicker-mebH0XLm.js} +8 -8
- package/dist/colorpicker.js +1 -1
- package/dist/components/glass/index.d.ts +52 -0
- package/dist/components/icon/core-icons.d.ts +13 -0
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/mermaid/index.d.ts +52 -0
- package/dist/components/modal/index.d.ts +9 -0
- package/dist/content-YOKzMoc7.js +39 -0
- package/dist/content.js +5 -0
- package/dist/cose-bilkent-JH36ORCC-BUxFTdey.cjs +1 -0
- package/dist/cose-bilkent-JH36ORCC-DTwvJlGw.js +2353 -0
- package/dist/cynefin-VYW2F7L2-6c1GOGXW.cjs +1 -0
- package/dist/cynefin-VYW2F7L2-ALQKF7N6.js +5 -0
- package/dist/cynefinDiagram-TSTJHNR4-Bjt4QTVh.js +355 -0
- package/dist/cynefinDiagram-TSTJHNR4-ISDORSxO.cjs +62 -0
- package/dist/cytoscape.esm-CFq1_DTa.js +18906 -0
- package/dist/cytoscape.esm-pygMw4dR.cjs +321 -0
- package/dist/dagre-D1-W1tt6.cjs +1 -0
- package/dist/dagre-D8GLTwuf.js +1578 -0
- package/dist/dagre-VKFMJZFB-DXI69qAN.cjs +4 -0
- package/dist/dagre-VKFMJZFB-Dfku86Az.js +341 -0
- package/dist/defaultLocale-0M_kMcEH.js +184 -0
- package/dist/defaultLocale-DSqtvhxg.cjs +1 -0
- package/dist/diagram-FQU43EPY-BAiRt5eL.cjs +3 -0
- package/dist/diagram-FQU43EPY-BvQ5jmVn.js +452 -0
- package/dist/diagram-G47NLZAW-DGnmEa8u.cjs +24 -0
- package/dist/diagram-G47NLZAW-DT2BBA0T.js +498 -0
- package/dist/diagram-NH7WQ7WH-DxgkStA3.cjs +24 -0
- package/dist/diagram-NH7WQ7WH-W7jg4Vh8.js +135 -0
- package/dist/diagram-OA4YK3LP-DkvFII73.cjs +30 -0
- package/dist/diagram-OA4YK3LP-jU--aqQl.js +317 -0
- package/dist/diagram-WEI45ONY-C_Qhf4ny.js +215 -0
- package/dist/diagram-WEI45ONY-XvzRFmmY.cjs +41 -0
- package/dist/dist-C0Fwsvsq.js +70 -0
- package/dist/dist-C20XxSsP.cjs +1 -0
- package/dist/{dropdown-CCvsambb.js → dropdown-CzGAVWYC.js} +4 -4
- package/dist/dropdown.js +1 -1
- package/dist/ebnfDiagram-CCIWWBDH-Cu8bAlhC.cjs +1 -0
- package/dist/ebnfDiagram-CCIWWBDH-Gnr20Oc1.js +112 -0
- package/dist/erDiagram-Q63AITRT-CxLSa9Yv.cjs +85 -0
- package/dist/erDiagram-Q63AITRT-D0Hh9b-W.js +1822 -0
- package/dist/eventmodeling-45OFAUF4-C6VXxUn1.cjs +1 -0
- package/dist/eventmodeling-45OFAUF4-DMpGs2yI.js +5 -0
- package/dist/factory-ZNhcQ4tf.js +482 -0
- package/dist/flowDiagram-23GEKE2U-B6gASEYG.cjs +1 -0
- package/dist/flowDiagram-23GEKE2U-BY4wE2vw.js +19 -0
- package/dist/{form-Ceq3uJzz.js → form-B8afuJlF.js} +5 -5
- package/dist/form.js +1 -1
- package/dist/ganttDiagram-NO4QXBWP-B40Eabk0.js +3125 -0
- package/dist/ganttDiagram-NO4QXBWP-DZT79qJr.cjs +292 -0
- package/dist/gitGraph-TEB2WS4Q-BbtF3MDr.cjs +1 -0
- package/dist/gitGraph-TEB2WS4Q-D6Ru11Cs.js +5 -0
- package/dist/gitGraphDiagram-IHSO6WYX-BUJNSssA.js +754 -0
- package/dist/gitGraphDiagram-IHSO6WYX-DW06165m.cjs +106 -0
- package/dist/glass-BniIptBE.js +115 -0
- package/dist/glass.js +5 -0
- package/dist/graphlib-CCKThIKP.js +1104 -0
- package/dist/graphlib-Du-578Js.cjs +1 -0
- package/dist/{icon-C_ENrJ3F.js → icon-GZrfSeon.js} +77 -25
- package/dist/icon.js +1 -1
- package/dist/icons.js +1 -1
- package/dist/iife/button.iife.js +1 -1
- package/dist/iife/card.iife.js +1 -1
- package/dist/iife/checkbox.iife.js +1 -1
- package/dist/iife/colorpicker.iife.js +2 -2
- package/dist/iife/content.iife.js +1 -0
- package/dist/iife/dropdown.iife.js +1 -1
- package/dist/iife/form.iife.js +1 -1
- package/dist/iife/glass.iife.js +1 -0
- package/dist/iife/icon.iife.js +1 -1
- package/dist/iife/image.iife.js +1 -1
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/loading.iife.js +1 -1
- package/dist/iife/math.iife.js +14 -14
- package/dist/iife/mermaid.iife.js +3535 -0
- package/dist/iife/message.iife.js +1 -1
- package/dist/iife/modal.iife.js +1 -1
- package/dist/iife/player.iife.js +8 -8
- package/dist/iife/popover.iife.js +1 -1
- package/dist/iife/progress.iife.js +1 -1
- package/dist/iife/radar.iife.js +1 -1
- package/dist/iife/route.iife.js +1 -1
- package/dist/iife/router.iife.js +1 -1
- package/dist/iife/scratch.iife.js +1 -1
- package/dist/iife/section.iife.js +1 -1
- package/dist/iife/select.iife.js +2 -2
- package/dist/iife/skeleton.iife.js +1 -1
- package/dist/iife/tab.iife.js +1 -1
- package/dist/iife/tabpane.iife.js +1 -1
- package/dist/iife/theme-switch.iife.js +1 -1
- package/dist/{image-B7MBI5n_.js → image-CqoQfJoV.js} +4 -4
- package/dist/image.js +1 -1
- package/dist/index.cjs +38 -37
- package/dist/index.d.ts +8 -0
- package/dist/index.iife.js +3623 -88
- package/dist/index.js +88 -84
- package/dist/info-DKCQHKI2-DNOtUIin.cjs +1 -0
- package/dist/info-DKCQHKI2-Df7h9MSE.js +5 -0
- package/dist/infoDiagram-FWYZ7A6U-C8dZc-Ki.cjs +2 -0
- package/dist/infoDiagram-FWYZ7A6U-Dc0m9qAx.js +21 -0
- package/dist/init-1VpIn1S3.js +16 -0
- package/dist/init-CbDwVtpO.cjs +1 -0
- package/dist/{input-RNqdEHPf.js → input-BlwAXu7I.js} +6 -6
- package/dist/input.js +1 -1
- package/dist/ishikawaDiagram-FXEZZL3T-BugNyysB.cjs +70 -0
- package/dist/ishikawaDiagram-FXEZZL3T-DuFtHOmf.js +742 -0
- package/dist/journeyDiagram-5HDEW3XC-Bshelnhq.js +928 -0
- package/dist/journeyDiagram-5HDEW3XC-ItmURvA2.cjs +139 -0
- package/dist/kanban-definition-HUTT4EX6-BL512R2A.cjs +89 -0
- package/dist/kanban-definition-HUTT4EX6-Dogv2paU.js +1050 -0
- package/dist/katex-Cq3Y8cmK.cjs +257 -0
- package/dist/katex-Pg2EqTH0.js +23485 -0
- package/dist/line-BIPmUVxO.js +33 -0
- package/dist/line-CAB5QHC6.cjs +1 -0
- package/dist/linear-B2AM4ZBe.js +259 -0
- package/dist/linear-CSAfNEpl.cjs +1 -0
- package/dist/{link-DURZzd7u.js → link-BCrmHvXP.js} +3 -3
- package/dist/link.js +1 -1
- package/dist/{loading-B9MFI03l.js → loading-M6gWxLbm.js} +4 -4
- package/dist/loading.js +1 -1
- package/dist/map-BC2bk_rV.cjs +1 -0
- package/dist/map-DMSWkcq6.js +208 -0
- package/dist/{math-CudIwEXZ.js → math-8E-45Y8e.js} +4 -4
- package/dist/math.js +1 -1
- package/dist/mermaid-C1oQyPE3.js +261 -0
- package/dist/mermaid-parser.core-DYumW1vq.cjs +6 -0
- package/dist/mermaid-parser.core-uIDZYuBu.js +654 -0
- package/dist/mermaid.core-B2d5lQW2.js +1085 -0
- package/dist/mermaid.core-a1hgpWfs.cjs +10 -0
- package/dist/mermaid.js +5 -0
- package/dist/{message-DW7qWpEm.js → message-CNdmbeLf.js} +6 -6
- package/dist/message.js +1 -1
- package/dist/mindmap-definition-LN4V7U3C-DYZgIZym.cjs +96 -0
- package/dist/mindmap-definition-LN4V7U3C-f7s5ZePP.js +1070 -0
- package/dist/{modal-CrvGKL2B.js → modal-gRagDkTb.js} +40 -24
- package/dist/modal.js +1 -1
- package/dist/ordinal-BMN81JG2.js +64 -0
- package/dist/ordinal-BplLHIij.cjs +1 -0
- package/dist/packet-7NZHBO7P-4PLslLZJ.js +5 -0
- package/dist/packet-7NZHBO7P-DeyLCrSn.cjs +1 -0
- package/dist/path-Bja5PoYn.js +82 -0
- package/dist/path-DmfWsuKi.cjs +1 -0
- package/dist/pegDiagram-2B236MQR-B-Xeh55J.js +107 -0
- package/dist/pegDiagram-2B236MQR-Bo5Nj40u.cjs +1 -0
- package/dist/pie-RZYD4A2V-DBE9a8Kz.js +5 -0
- package/dist/pie-RZYD4A2V-pDNZ2ZyB.cjs +1 -0
- package/dist/pieDiagram-ENE6RG2P-BkSiP4iu.cjs +39 -0
- package/dist/pieDiagram-ENE6RG2P-CVSE95zc.js +207 -0
- package/dist/{player-BKQaaT7o.js → player-CAQ5Og2P.js} +196 -195
- package/dist/player.js +1 -1
- package/dist/{popover-CvYIVgUS.js → popover-BZKSLe3D.js} +22 -54
- package/dist/popover.js +1 -1
- package/dist/{progress-C6jctsFH.js → progress-vk40tuhm.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/quadrantDiagram-ABIIQ3AL-BDmdDGsh.cjs +7 -0
- package/dist/quadrantDiagram-ABIIQ3AL-TJ8FmqES.js +2058 -0
- package/dist/{radar-BUb4EzmG.js → radar-Bg0cexzU.js} +5 -5
- package/dist/radar-I7S5WNFK-CY5ycn2a.cjs +1 -0
- package/dist/radar-I7S5WNFK-DFTxtd_t.js +5 -0
- package/dist/radar.js +1 -1
- package/dist/railroad-3IZDKUUU-DALJwv16.js +5 -0
- package/dist/railroad-3IZDKUUU-DGzXHqt7.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-BCIHdSw6.cjs +1 -0
- package/dist/railroad-abnf-AHOZXSZD-CntW2udQ.js +5 -0
- package/dist/railroad-ebnf-EBAXGLYW-4vFZrfHF.cjs +1 -0
- package/dist/railroad-ebnf-EBAXGLYW-s_1ZOb_9.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-CaM5A0Ml.js +5 -0
- package/dist/railroad-peg-LSFZ7HO6-D_oFW1Bo.cjs +1 -0
- package/dist/railroadDiagram-RFXS5EU6-0lS5wYI7.js +83 -0
- package/dist/railroadDiagram-RFXS5EU6-DJKAtnQk.cjs +1 -0
- package/dist/ranui.css +1 -1
- package/dist/requirementDiagram-TGXJPOKE-Bg701bNl.cjs +84 -0
- package/dist/requirementDiagram-TGXJPOKE-viCQLyJd.js +2301 -0
- package/dist/rolldown-runtime-9ZSF5uba.js +16 -0
- package/dist/rolldown-runtime-CAnuVJ4g.cjs +1 -0
- package/dist/rough.esm-BWe9E0Nz.js +1387 -0
- package/dist/rough.esm-BfSi6CZE.cjs +1 -0
- package/dist/{route-Djrf9UR_.js → route-CGwS0cd_.js} +10 -10
- package/dist/route.js +1 -1
- package/dist/{router-BU2KhtxV.js → router-BK6DEkcN.js} +5 -5
- package/dist/router.js +1 -1
- package/dist/sankeyDiagram-HTMAVEWB-CV6_AuMF.js +974 -0
- package/dist/sankeyDiagram-HTMAVEWB-K-nGMsuS.cjs +40 -0
- package/dist/{scratch-CO4I2dIa.js → scratch-ClF1awGi.js} +2 -2
- package/dist/scratch.js +1 -1
- package/dist/{section-CsUkp8bv.js → section-BL0V7Kjf.js} +2 -2
- package/dist/section.js +1 -1
- package/dist/{select-Dn26ajJZ.js → select-BIFVbQIj.js} +13 -13
- package/dist/select.js +1 -1
- package/dist/sequenceDiagram-DBY2YBRQ-4GdkLnUr.cjs +162 -0
- package/dist/sequenceDiagram-DBY2YBRQ-B9WNesh2.js +4326 -0
- package/dist/sizeCapture-X5ZJPWSS-BUY3-n09.cjs +1 -0
- package/dist/sizeCapture-X5ZJPWSS-D7rGsqTl.js +48 -0
- package/dist/{skeleton-BuMLhvzQ.js → skeleton-D7JIbROq.js} +5 -5
- package/dist/skeleton.js +1 -1
- package/dist/src-C9EhKhbk.cjs +1 -0
- package/dist/src-DtRLxcYO.js +2104 -0
- package/dist/stateDiagram-2N3HPSRC-B7VpgjJu.cjs +1 -0
- package/dist/stateDiagram-2N3HPSRC-DxH4BMSh.js +237 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CQv7GIaO.cjs +1 -0
- package/dist/stateDiagram-v2-6OUMAXLB-CWfn6e7n.js +30 -0
- package/dist/swimlanes-5IMT3BWC-DcADNGpg.js +5258 -0
- package/dist/swimlanes-5IMT3BWC-o-MjdPlw.cjs +1 -0
- package/dist/swimlanesDiagram-G3AALYLV-D-rmAGky.cjs +8 -0
- package/dist/swimlanesDiagram-G3AALYLV-DDtDtl1L.js +31 -0
- package/dist/{tab-40fDkuox.js → tab-DFVtDJb2.js} +5 -5
- package/dist/tab.js +1 -1
- package/dist/{tabpane-F4Pd7JtC.js → tabpane-C3qZGN-D.js} +5 -5
- package/dist/tabpane.js +1 -1
- package/dist/test/ssr/stream.test.d.ts +1 -0
- package/dist/{theme-switch-B09egc6h.js → theme-switch-BXNH5uPD.js} +45 -45
- package/dist/theme-switch.js +1 -1
- package/dist/timeline-definition-FHXFAJF6-C80VjPLh.js +1119 -0
- package/dist/timeline-definition-FHXFAJF6-DOwvOb3S.cjs +120 -0
- package/dist/treeView-QDETBFTQ-B1Ejxfpg.cjs +1 -0
- package/dist/treeView-QDETBFTQ-vTKOZls1.js +5 -0
- package/dist/treemap-6X3UGDF4-D0FeO_NX.cjs +1 -0
- package/dist/treemap-6X3UGDF4-Ddzv6Gqd.js +5 -0
- package/dist/utils/builder/core.d.ts +135 -3
- package/dist/utils/builder/index.d.ts +1 -1
- package/dist/{utils-DBfrRFoE.js → utils-D1iZnChu.js} +38 -31
- package/dist/vennDiagram-L72KCM5P-BYHB7OW8.js +1955 -0
- package/dist/vennDiagram-L72KCM5P-CidVJK6y.cjs +34 -0
- package/dist/wardley-OPB4EBWU-C1hXbbD4.cjs +1 -0
- package/dist/wardley-OPB4EBWU-DBgFLc64.js +5 -0
- package/dist/wardleyDiagram-EHGQE667--ubmCaWM.js +652 -0
- package/dist/wardleyDiagram-EHGQE667-K6ckkRZS.cjs +78 -0
- package/dist/xychartDiagram-FW5EYKEG-CzdokxrM.cjs +7 -0
- package/dist/xychartDiagram-FW5EYKEG-DLqWcTPt.js +2154 -0
- package/docs/BUILDER.md +170 -2
- package/package.json +7 -1
- package/dist/button-BfYw0fes.js +0 -117
- package/dist/factory-DCrO37si.js +0 -334
|
@@ -1 +1 @@
|
|
|
1
|
-
var ranui_popover=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=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}},n=(e=8)=>Math.random().toString(36).substring(2,e+2),r=e=>typeof e==`function`,i=typeof window<`u`,a=()=>{if(!i)return!1;let e=window.navigator.userAgent;return!!/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(e)},o=12e4,s=`__ranuts_bridge__`,c=`default`,l=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)}},ee=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,r=c){this.targetOrigin=t,this.channel=r,this.senderId=n(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,l.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:s,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:i,id:a,isResponse:o,isError:s,senderId:c}=t;if(o&&a){let e=this.pendingRequests.get(a);e&&(s?e.reject(Error(typeof i==`string`?i:`Bridge request failed`)):e.resolve(i),this.pendingRequests.delete(a));return}if(c&&c===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let l=this.messageHandlers.get(n);if(r(l)){let t=e.source??this.targetWindow;Promise.resolve(l(i)).then(e=>{a&&this.post(t,{type:n,payload:e,id:a,isResponse:!0})}).catch(e=>{a&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:a,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 r=n(10);return new Promise((n,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(r)&&(this.pendingRequests.delete(r),i(Error(`Request timeout`)))},o),s=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(r,{resolve:e=>{clearTimeout(a),n(e)},reject:s});try{this.post(this.targetWindow,{type:e,payload:t,id:r})}catch(e){this.pendingRequests.delete(r),s(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=()=>{l.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:r,channel:i})=>{let a=new ee(r,t,i);if(e||=n(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,a),{bridge:a,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 t;var u=[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],d=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new d(u[0],3609767458),new d(u[1],602891725),new d(u[2],3964484399),new d(u[3],2173295548),new d(u[4],4081628472),new d(u[5],3053834265),new d(u[6],2937671579),new d(u[7],3664609560),new d(u[8],2734883394),new d(u[9],1164996542),new d(u[10],1323610764),new d(u[11],3590304994),new d(u[12],4068182383),new d(u[13],991336113),new d(u[14],633803317),new d(u[15],3479774868),new d(u[16],2666613458),new d(u[17],944711139),new d(u[18],2341262773),new d(u[19],2007800933),new d(u[20],1495990901),new d(u[21],1856431235),new d(u[22],3175218132),new d(u[23],2198950837),new d(u[24],3999719339),new d(u[25],766784016),new d(u[26],2566594879),new d(u[27],3203337956),new d(u[28],1034457026),new d(u[29],2466948901),new d(u[30],3758326383),new d(u[31],168717936),new d(u[32],1188179964),new d(u[33],1546045734),new d(u[34],1522805485),new d(u[35],2643833823),new d(u[36],2343527390),new d(u[37],1014477480),new d(u[38],1206759142),new d(u[39],344077627),new d(u[40],1290863460),new d(u[41],3158454273),new d(u[42],3505952657),new d(u[43],106217008),new d(u[44],3606008344),new d(u[45],1432725776),new d(u[46],1467031594),new d(u[47],851169720),new d(u[48],3100823752),new d(u[49],1363258195),new d(u[50],3750685593),new d(u[51],3785050280),new d(u[52],3318307427),new d(u[53],3812723403),new d(u[54],2003034995),new d(u[55],3602036899),new d(u[56],1575990012),new d(u[57],1125592928),new d(u[58],2716904306),new d(u[59],442776044),new d(u[60],593698344),new d(u[61],3733110249),new d(u[62],2999351573),new d(u[63],3815920427),new d(3391569614,3928383900),new d(3515267271,566280711),new d(3940187606,3454069534),new d(4118630271,4000239992),new d(116418474,1914138554),new d(174292421,2731055270),new d(289380356,3203993006),new d(460393269,320620315),new d(685471733,587496836),new d(852142971,1086792851),new d(1017036298,365543100),new d(1126000580,2618297676),new d(1288033470,3409855158),new d(1501505948,4234509866),new d(1607167915,987167468),new d(1816402316,1246189591),new d(0,1),new d(0,32898),new d(2147483648,32906),new d(2147483648,2147516416),new d(0,32907),new d(0,2147483649),new d(2147483648,2147516545),new d(2147483648,32777),new d(0,138),new d(0,136),new d(0,2147516425),new d(0,2147483658),new d(0,2147516555),new d(2147483648,139),new d(2147483648,32905),new d(2147483648,32771),new d(2147483648,32770),new d(2147483648,128),new d(0,32778),new d(2147483648,2147483658),new d(2147483648,2147516545),new d(2147483648,32896),new d(0,2147483649),new d(2147483648,2147516424);var f=(e,t=500)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(void 0,r)},t)}},p=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)||n.add(t)},m=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)&&n.remove(t)},h=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})(h),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(h);var g=typeof document>`u`,_=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}},v=0,te=1,y=2,b=null,x=null,ne=new Set;function re(e){let t=ie(e,!0);return ae(t),C(t),()=>T(t)}function ie(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:y,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:x}}function ae(e){x&&x.owned.push(e)}function S(e,t){if(e.disposed||e.state>=t)return;let n=e.state===v;if(e.state=t,e.isEffect)ne.add(e);else if(n)for(let t of e.observers)S(t,te)}function C(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);w(e);let t=b,n=x;b=e,x=e,e.running=!0,e.state=v;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)S(t,y)}}finally{e.running=!1,b=t,x=n}}function w(e){for(let t of e.owned)T(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 T(e){e.disposed||(e.disposed=!0,w(e),e.observers.clear())}function E(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function D(e){return E(e)}var oe=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,se=(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()},O=(e,t,n)=>{for(let r of e)oe(r)&&(se(r,t)&&n.push(r),O(r.childrenList,t,n))},k=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?E(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}},A=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 k)}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 j(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(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}="${D(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${D(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`?E(e):(e instanceof k,e.serialize())).join(``):a+=E(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}>`}},j=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 O(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${E(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?E(e):(e instanceof k,e.serialize())).join(``)}</template>`}},M=class e{el;constructor(e){this.el=g?new A(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?re(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{g?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(...t){let n=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(n(t)):e.concat(t),[]);return n(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?g?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),this}replaceChildren(...e){if(g){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 ce(this.el,t,e)}build(){return this.el}serialize(){if(g)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},ce=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof M?this.root.appendChild(e.build()):typeof e==`string`?g?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(g)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 g?this.root.serialize():this.root.innerHTML}},N=e=>new M(e),P=()=>N(`div`),F=()=>N(`slot`),le=new Map;function I(e,t){g?(le.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var L=typeof document<`u`?HTMLElement:A,R=new Map,z=new Map,ue=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!R.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),R.set(t,e)}let n=R.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},de=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!z.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),z.set(t,e)}let n=z.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},B=new WeakMap,V=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,H=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||B.get(e)||e.attachShadow(n);return B.set(e,r),ue(r,t?`${t}\n${V}`:V),r},U=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},W=(e,t,n=``)=>e.getAttribute(t)??n,G=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},K=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&de(t,a)},q=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{visibility:hidden;position:absolute}`;I(`r-content`,class extends L{observer;_shadowDom;_slot;constructor(){super(),this._shadowDom=H(this,q);let e=U(this._shadowDom,`.slot`,()=>F().class(`slot`).build());this._slot=e,this.observer=new MutationObserver(this.callback)}callback=e=>{for(let t of e)(t.type===`childList`||t.type===`attributes`)&&this.onChange(t)};onChange=e=>{this.dispatchEvent(new CustomEvent(`change`,{detail:{type:e.type,value:{content:this.children,mutation:e}}}))};connectedCallback(){this.observer.observe(this,{attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){this.observer.disconnect()}});var fe=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}@keyframes ranui-dropdown-up-in{0%{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}to{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-up-out{0%{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}to{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-down-in{0%{transform-origin:0 0;opacity:0;transform:scaleY(.8)}to{transform-origin:0 0;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-down-out{0%{transform-origin:0 0;opacity:1;transform:scaleY(1)}to{transform-origin:0 0;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-left-in{0%{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}to{transform-origin:100% 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-left-out{0%{transform-origin:100% 0;opacity:1;transform:scaleX(1)}to{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}}@keyframes ranui-dropdown-right-in{0%{transform-origin:0 0;opacity:0;transform:scaleX(.8)}to{transform-origin:0 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-right-out{0%{transform-origin:0 0;opacity:1;transform:scaleX(1)}to{transform-origin:0 0;opacity:0;transform:scaleX(.8)}}.ran-dropdown-down-in{animation:.1s forwards ranui-dropdown-down-in}.ran-dropdown-down-out{animation:.1s forwards ranui-dropdown-down-out}.ran-dropdown-up-in{animation:.1s forwards ranui-dropdown-up-in}.ran-dropdown-up-out{animation:.1s forwards ranui-dropdown-up-out}.ran-dropdown-left-in{animation:.1s forwards ranui-dropdown-left-in}.ran-dropdown-left-out{animation:.1s forwards ranui-dropdown-left-out}.ran-dropdown-right-in{animation:.1s forwards ranui-dropdown-right-in}.ran-dropdown-right-out{animation:.1s forwards ranui-dropdown-right-out}:host{text-align:var(--ran-dropdown-host-text-align,left);z-index:var(--ran-dropdown-host-z-index,var(--ran-z-dropdown,1100))}.ranui-dropdown{transform-origin:var(--ran-x,50%) var(--ran-y,50%);box-sizing:var(--ran-dropdown-box-sizing,border-box);margin:var(--ran-dropdown-margin,0);padding:var(--ran-dropdown-padding,0);color:var(--ran-dropdown-color,var(--ran-color-text,#000000e0));font-size:var(--ran-dropdown-font-size,14px);list-style:var(--ran-dropdown-list-style,none);font-family:var(--ran-dropdown-font-family,var(--ran-skin-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));z-index:var(--ran-dropdown-z-index,1050);overflow:var(--ran-dropdown-overflow,hidden);font-variant:var(--ran-dropdown-font-variant,initial);background:var(--ran-dropdown-background,var(--ran-color-bg-elevated,#fff));border-radius:var(--ran-dropdown-border-radius,var(--ran-radius-md,12px));outline:var(--ran-dropdown-outline,none);box-shadow:var(--ran-dropdown-box-shadow,var(--ran-shadow-menu,var(--ran-shadow-elevated,0 6px 16px 0 #00000014, 0 3px 6px -4px #0000001f, 0 9px 28px 8px #0000000d)));cursor:var(--ran-dropdown-cursor,auto);width:var(--ran-dropdown-width,100%);height:var(--ran-dropdown-height,100%);min-height:var(--ran-dropdown-min-height,100%);min-width:var(--ran-dropdown-min-width,100%)}.ranui-dropdown-container{position:var(--ran-dropdown-container-position,relative);display:var(--ran-dropdown-container-display,block);width:var(--ran-dropdown-container-width,100%);height:var(--ran-dropdown-container-height,100%);box-sizing:var(--ran-dropdown-container-box-sizing,border-box)}.ranui-dropdown-container .top{transform:translateX(calc(var(--ran-dropdown-arrow-anchor-width,var(--ran-dropdown-min-width,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2))) translateY(calc(-1 * var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px)) + var(--ran-dropdown-arrow-overlap,2px))) rotate(0deg);top:0}.ranui-dropdown-container .bottom{transform:translateX(calc(var(--ran-dropdown-arrow-anchor-width,var(--ran-dropdown-min-width,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2))) translateY(var(--ran-dropdown-arrow-overlap,2px)) rotate(180deg);top:max(0px, calc(var(--ran-dropdown-min-height,100%) - calc(var(--ran-dropdown-arrow-width,16px) / 4)))}.ranui-dropdown-container .left{transform:translateX(calc(0px - var(--ran-dropdown-arrow-width,16px))) translateY(calc(var(--ran-dropdown-arrow-width,16px) / 2 + var(--ran-dropdown-arrow-overlap,2px))) rotate(270deg);top:max(0px, calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - var(--ran-dropdown-arrow-width,16px)))}.ranui-dropdown-container .right{transform:translateX(0) translateY(calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2) + var(--ran-dropdown-arrow-overlap,2px))) rotate(90deg);top:0;left:100%}.ranui-dropdown-arrow{position:var(--ran-dropdown-arrow-position,absolute);box-sizing:var(--ran-dropdown-arrow-box-sizing,border-box);z-index:var(--ran-dropdown-arrow-z-index,1);display:var(--ran-dropdown-arrow-display,block);pointer-events:var(--ran-dropdown-arrow-pointer-events,none);width:var(--ran-dropdown-arrow-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px));overflow:var(--ran-dropdown-arrow-overflow,hidden)}.ranui-dropdown-arrow:before{background:var(--ran-dropdown-arrow-before-background,var(--ran-color-bg-elevated,#fff));position:var(--ran-dropdown-arrow-before-position,absolute);bottom:var(--ran-dropdown-arrow-before-bottom,0);width:var(--ran-dropdown-arrow-before-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-before-height,calc(var(--ran-dropdown-arrow-width,16px) / 2));clip-path:path("M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z");content:var(--ran-dropdown-arrow-before-content,"");inset-inline-start:0}.ranui-dropdown-arrow:after{content:var(--ran-dropdown-arrow-after-content,"");position:var(--ran-dropdown-arrow-after-position,absolute);width:var(--ran-dropdown-arrow-after-width,9px);height:var(--ran-dropdown-arrow-after-height,9px);bottom:var(--ran-dropdown-arrow-after-bottom,0);margin:var(--ran-dropdown-arrow-after-margin,auto);border-radius:var(--ran-dropdown-arrow-after-border-radius,0 0 2px 0);transform:var(--ran-dropdown-arrow-after-transform,translateY(50%) rotate(-135deg));box-shadow:var(--ran-dropdown-arrow-after-box-shadow,2px 2px 5px #0000000d);z-index:var(--ran-dropdown-arrow-after-z-index,0);background:var(--ran-dropdown-arrow-after-background,var(--ran-color-bg-elevated,#fff));inset-inline:0}`,J=300;I(`r-dropdown`,class extends L{dropdown;_slot;_shadowDom;arrowIcon;container;static get observedAttributes(){return[`transit`,`arrow`,`sheet`]}constructor(){super(),this._shadowDom=H(this,fe);let e=U(this._shadowDom,`.ranui-dropdown-container`,()=>P().class(`ranui-dropdown-container`).children(P().style(`-webkit-tap-highlight-color`,`transparent`).style(`outline`,`0`).class(`ranui-dropdown`).part(`dropdown`).children(F().class(`slot`))).build());this.container=e,this.dropdown=e.querySelector(`.ranui-dropdown`),this._slot=e.querySelector(`.slot`)}get transit(){return W(this,`transit`)}set transit(e){G(this,`transit`,e,{removeEmpty:!0})}get arrow(){return W(this,`arrow`)}set arrow(e){G(this,`arrow`,e,{removeEmpty:!0})}get sheet(){return W(this,`sheet`)}set sheet(e){G(this,`sheet`,e)}handlerExternalCss=()=>{K(this,this._shadowDom,`sheet`,null,this.sheet)};handlerTransit=()=>{this.transit&&this.dropdown&&(p(this.dropdown,this.transit),setTimeout(()=>{m(this.dropdown,this.transit)},J))};handlerArrow=()=>{let e=(this.arrow||``).trim();if(!e){this.arrowIcon&&this.container.contains(this.arrowIcon)&&this.container.removeChild(this.arrowIcon),this.arrowIcon=void 0;return}!this.arrowIcon&&this.container&&(this.arrowIcon=P().class(`ranui-dropdown-arrow`).build(),this.container.appendChild(this.arrowIcon)),this.arrowIcon&&(this.arrowIcon.className=`ranui-dropdown-arrow ${e}`)};stopPropagation=e=>{e.stopPropagation()};connectedCallback(){this.handlerExternalCss(),this.handlerTransit(),this.handlerArrow()}disconnectedCallback(){}attributeChangedCallback(e,t,n){e===`transit`&&n&&(p(this.dropdown,this.transit),setTimeout(()=>{m(this.dropdown,this.transit)},J)),e===`arrow`&&this.handlerArrow(),e===`sheet`&&t!==n&&this.handlerExternalCss()}});var pe=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{display:var(--ran-popover-host-display,block)}.ran-popover{box-sizing:var(--ran-popover-box-sizing,border-box);position:var(--ran-popover-position,relative);display:var(--ran-popover-display,block);margin:var(--ran-popover-margin,0);padding:var(--ran-popover-padding,0)}.ran-popover-block{display:var(--ran-popover-block-display,block)}`,Y=8,X=300,Z=16,Q={bottom:{add:`ran-dropdown-down-in`,remove:`ran-dropdown-down-out`},top:{add:`ran-dropdown-up-in`,remove:`ran-dropdown-up-out`},left:{add:`ran-dropdown-left-in`,remove:`ran-dropdown-left-out`},right:{add:`ran-dropdown-right-in`,remove:`ran-dropdown-right-out`}},me=function(e){return e.TOP=`top`,e.BOTTOM=`bottom`,e.LEFT=`left`,e.RIGHT=`right`,e}({}),$=class extends L{_events=new _;_slot;popoverBlock;popoverContent;popoverInner;popoverInnerBlock;_shadowDom;dropDownInTimeId;dropDownOutTimeId;removeTimeId;static get observedAttributes(){return[`placement`,`trigger`,`sheet`]}closePopover=()=>{this.setDropdownDisplayNone()};constructor(){super(),this._shadowDom=H(this,pe);let e=U(this._shadowDom,`.ran-popover-block`,()=>P().class(`ran-popover-block`).role(`tooltip`).children(F().class(`slot`)).build());this.popoverBlock=e,this._slot=e.querySelector(`.slot`)}get placement(){return W(this,`placement`,`top`)}set placement(e){G(this,`placement`,e)}get trigger(){return W(this,`trigger`,`hover`)}set trigger(e){G(this,`trigger`,e)}get getPopupContainerId(){return W(this,`getPopupContainerId`)}set getPopupContainerId(e){G(this,`getPopupContainerId`,e)}get sheet(){return W(this,`sheet`)}set sheet(e){G(this,`sheet`,e)}handlerExternalCss=()=>{K(this,this._shadowDom,`sheet`,null,this.sheet)};initAria=()=>{this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.setAttribute(`aria-haspopup`,`dialog`),this.setAttribute(`aria-expanded`,`false`)};updateAriaExpanded=e=>{this.setAttribute(`aria-expanded`,e?`true`:`false`)};stopPropagation=e=>{e.stopPropagation()};createContent=e=>{if(e){if(!this.popoverContent){this.popoverContent=N(`r-dropdown`).class(`ran-popover-dropdown`).style(`display`,`none`).style(`position`,`absolute`).build(),this.popoverContent?.addEventListener(`click`,this.stopPropagation);let e=P().children(this.popoverContent).build();this.trigger.includes(`hover`)&&!a()&&(this.popoverContent?.addEventListener(`mouseleave`,this.blur),this.popoverContent?.addEventListener(`mouseenter`,this.removeDropDownTimeId)),document.body.appendChild(e)}if(this.popoverContent&&e.length>0){this.popoverContent.innerHTML=``;let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);this.popoverContent.appendChild(t)}}};watchContent=e=>{let{value:t}=e.detail;this.createContent(t.content)};blur=f(()=>{this.removeTimeId&&this.removeDropDownTimeId(),this.removeTimeId=setTimeout(()=>{this.removeDropDownTimeId(),this.setDropdownDisplayNone()},X)},Z);removeDropDownTimeId=f(()=>{this.trigger.includes(`hover`)&&!a()&&(clearTimeout(this.removeTimeId),this.removeTimeId=void 0)},Z);setDropdownDisplayBlock=f(()=>{this.dropDownInTimeId||(clearTimeout(this.dropDownInTimeId),this.dropDownInTimeId=void 0,clearTimeout(this.dropDownOutTimeId),this.dropDownOutTimeId=void 0,this.popoverContent&&this.popoverContent.style.display!==`block`&&(this.updateAriaExpanded(!0),this.popoverContent.setAttribute(`transit`,Q[this.placement].add),this.popoverContent?.style.setProperty(`display`,`block`),this.placementPosition(),this.dropDownInTimeId=setTimeout(()=>{this.popoverContent&&this.popoverContent.removeAttribute(`transit`),clearTimeout(this.dropDownInTimeId),this.dropDownInTimeId=void 0},X)))},Z);setDropdownDisplayNone=f(()=>{this.dropDownOutTimeId||(clearTimeout(this.dropDownInTimeId),this.dropDownInTimeId=void 0,clearTimeout(this.dropDownOutTimeId),this.dropDownOutTimeId=void 0,this.popoverContent&&this.popoverContent.style.display!==`none`&&(this.updateAriaExpanded(!1),this.popoverContent.setAttribute(`transit`,Q[this.placement].remove),this.dropDownOutTimeId=setTimeout(()=>{this.popoverContent?.style.setProperty(`display`,`none`),this.popoverContent&&this.popoverContent.removeAttribute(`transit`),clearTimeout(this.dropDownOutTimeId),this.dropDownOutTimeId=void 0},X)))},Z);placementPosition=()=>{if(!this.popoverContent)return;let{top:e,left:t,bottom:n,width:r,height:i}=this.getBoundingClientRect(),a=n+window.scrollY+Y,o=t+window.scrollX,s=document.getElementById(this.getPopupContainerId),c=this.popoverContent.getBoundingClientRect();this.placement===`top`&&(a=e+window.scrollY-Math.max(c.height,i)-Y,this.getPopupContainerId&&s&&(o=t-s.getBoundingClientRect().left,a=e-s.getBoundingClientRect().top-this.popoverContent.clientHeight-Y,o=t-s.getBoundingClientRect().left)),this.placement===`left`&&(o=t-Math.max(c.width,r)-Y,a=e+window.scrollY),this.placement===`right`&&(o=t+r+Y,a=e+window.scrollY),this.popoverContent.style.setProperty(`inset`,`${a}px auto auto ${o}px`),this.popoverContent.style.setProperty(`--ran-x`,`${o}px`),this.popoverContent.style.setProperty(`--ran-y`,`${a}px`),this.popoverContent.style.setProperty(`--ran-dropdown-arrow-anchor-width`,`${r}px`),this.popoverContent.style.setProperty(`--ran-dropdown-arrow-anchor-height`,`${i}px`),this.popoverContent.style.setProperty(`--ran-dropdown-min-width`,`${c.width}px`),this.popoverContent.style.setProperty(`--ran-dropdown-min-height`,`${c.height}px`)};hoverPopover=e=>{this.clickPopover(e)};clickContent=e=>{e.stopPropagation()};clickPopover=e=>{e.stopPropagation(),e.preventDefault(),this.setDropdownDisplayBlock()};keydownPopover=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.setDropdownDisplayBlock()),e.key===`Escape`&&(e.preventDefault(),this.setDropdownDisplayNone())};clickRemovePopover=e=>{this.hoverRemovePopover(e)};popoverTrigger=()=>{this._events.abort();for(let e of this.children)e.tagName===`R-CONTENT`&&this._events.on(e,`change`,this.watchContent);this.trigger.includes(`hover`)&&(this._events.on(this,`mouseenter`,this.hoverPopover),this._events.on(this,`mouseleave`,this.blur)),this._events.on(this,`click`,this.clickPopover).on(this,`keydown`,this.keydownPopover).on(document,`click`,this.clickRemovePopover)};hoverRemovePopover=e=>{e.stopPropagation(),this.setDropdownDisplayNone()};changePlacement=f(()=>{this.placement===`top`&&this.popoverContent?.setAttribute(`arrow`,`bottom`),this.placement===`bottom`&&this.popoverContent?.setAttribute(`arrow`,`top`),this.placement===`left`&&this.popoverContent?.setAttribute(`arrow`,`right`),this.placement===`right`&&this.popoverContent?.setAttribute(`arrow`,`left`)},Z);connectedCallback(){this.initAria(),this.handlerExternalCss();for(let e of this.children)e.tagName===`R-CONTENT`&&this.createContent(e.children);this.popoverTrigger(),this.changePlacement()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`trigger`&&this.popoverTrigger(),e===`placement`&&this.changePlacement(),e===`sheet`&&this.handlerExternalCss())}};return I(`r-popover`,$),e.PLACEMENT_TYPE=me,e.Popover=$,e.default=$,e})({});
|
|
1
|
+
var ranui_popover=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=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}},n=(e=8)=>Math.random().toString(36).substring(2,e+2),r=e=>typeof e==`function`,i=typeof window<`u`,a=()=>{if(!i)return!1;let e=window.navigator.userAgent;return!!/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(e)},o=12e4,s=`__ranuts_bridge__`,c=`default`,l=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)}},ee=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,r=c){this.targetOrigin=t,this.channel=r,this.senderId=n(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,l.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:s,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:i,id:a,isResponse:o,isError:s,senderId:c}=t;if(o&&a){let e=this.pendingRequests.get(a);e&&(s?e.reject(Error(typeof i==`string`?i:`Bridge request failed`)):e.resolve(i),this.pendingRequests.delete(a));return}if(c&&c===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let l=this.messageHandlers.get(n);if(r(l)){let t=e.source??this.targetWindow;Promise.resolve(l(i)).then(e=>{a&&this.post(t,{type:n,payload:e,id:a,isResponse:!0})}).catch(e=>{a&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:a,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 r=n(10);return new Promise((n,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(r)&&(this.pendingRequests.delete(r),i(Error(`Request timeout`)))},o),s=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(r,{resolve:e=>{clearTimeout(a),n(e)},reject:s});try{this.post(this.targetWindow,{type:e,payload:t,id:r})}catch(e){this.pendingRequests.delete(r),s(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=()=>{l.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:r,channel:i})=>{let a=new ee(r,t,i);if(e||=n(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,a),{bridge:a,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 t;var u=[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],d=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new d(u[0],3609767458),new d(u[1],602891725),new d(u[2],3964484399),new d(u[3],2173295548),new d(u[4],4081628472),new d(u[5],3053834265),new d(u[6],2937671579),new d(u[7],3664609560),new d(u[8],2734883394),new d(u[9],1164996542),new d(u[10],1323610764),new d(u[11],3590304994),new d(u[12],4068182383),new d(u[13],991336113),new d(u[14],633803317),new d(u[15],3479774868),new d(u[16],2666613458),new d(u[17],944711139),new d(u[18],2341262773),new d(u[19],2007800933),new d(u[20],1495990901),new d(u[21],1856431235),new d(u[22],3175218132),new d(u[23],2198950837),new d(u[24],3999719339),new d(u[25],766784016),new d(u[26],2566594879),new d(u[27],3203337956),new d(u[28],1034457026),new d(u[29],2466948901),new d(u[30],3758326383),new d(u[31],168717936),new d(u[32],1188179964),new d(u[33],1546045734),new d(u[34],1522805485),new d(u[35],2643833823),new d(u[36],2343527390),new d(u[37],1014477480),new d(u[38],1206759142),new d(u[39],344077627),new d(u[40],1290863460),new d(u[41],3158454273),new d(u[42],3505952657),new d(u[43],106217008),new d(u[44],3606008344),new d(u[45],1432725776),new d(u[46],1467031594),new d(u[47],851169720),new d(u[48],3100823752),new d(u[49],1363258195),new d(u[50],3750685593),new d(u[51],3785050280),new d(u[52],3318307427),new d(u[53],3812723403),new d(u[54],2003034995),new d(u[55],3602036899),new d(u[56],1575990012),new d(u[57],1125592928),new d(u[58],2716904306),new d(u[59],442776044),new d(u[60],593698344),new d(u[61],3733110249),new d(u[62],2999351573),new d(u[63],3815920427),new d(3391569614,3928383900),new d(3515267271,566280711),new d(3940187606,3454069534),new d(4118630271,4000239992),new d(116418474,1914138554),new d(174292421,2731055270),new d(289380356,3203993006),new d(460393269,320620315),new d(685471733,587496836),new d(852142971,1086792851),new d(1017036298,365543100),new d(1126000580,2618297676),new d(1288033470,3409855158),new d(1501505948,4234509866),new d(1607167915,987167468),new d(1816402316,1246189591),new d(0,1),new d(0,32898),new d(2147483648,32906),new d(2147483648,2147516416),new d(0,32907),new d(0,2147483649),new d(2147483648,2147516545),new d(2147483648,32777),new d(0,138),new d(0,136),new d(0,2147516425),new d(0,2147483658),new d(0,2147516555),new d(2147483648,139),new d(2147483648,32905),new d(2147483648,32771),new d(2147483648,32770),new d(2147483648,128),new d(0,32778),new d(2147483648,2147483658),new d(2147483648,2147516545),new d(2147483648,32896),new d(0,2147483649),new d(2147483648,2147516424);var f=(e,t=500)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(void 0,r)},t)}},te=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)||n.add(t)},ne=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)&&n.remove(t)},re=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})(re),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(re);var p=typeof document>`u`,ie=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}},m=0,h=1,g=2,_=null,v=null,y=0,b=new Set,x=!1;function ae(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ce(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)T(e,g);y===0&&le()}}]}function S(e){let t=oe(e,!0);return se(t),E(t),()=>O(t)}function C(e){let t={owned:[],cleanups:[],owner:v},n=v,r=_;v=t,_=null;try{return e(()=>de(t))}finally{v=n,_=r}}function w(e){v&&v.cleanups.push(e)}function oe(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:g,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:v}}function se(e){v&&v.owned.push(e)}function ce(e){_&&(_.sources.add(e),e.observers.add(_))}function T(e,t){if(e.disposed||e.state>=t)return;let n=e.state===m;if(e.state=t,e.isEffect)b.add(e);else if(n)for(let t of e.observers)T(t,h)}function le(){if(!(y>0||x)){x=!0;try{for(;b.size>0;){let e=[...b];b.clear();for(let t of e)t.disposed||ue(t)}}finally{x=!1}}}function ue(e){if(!(e.disposed||e.state===m)){if(e.state===h)for(let t of e.sources)`fn`in t&&ue(t);e.state===g&&E(e),e.state=m}}function E(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);D(e);let t=_,n=v;_=e,v=e,e.running=!0,e.state=m;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(t,g)}}finally{e.running=!1,_=t,v=n}}function D(e){for(let t of e.owned)O(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 O(e){e.disposed||(e.disposed=!0,D(e),e.observers.clear())}function de(e){for(let t of e.owned)O(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function k(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function fe(e){return k(e)}var pe=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,me=(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()},A=(e,t,n)=>{for(let r of e)pe(r)&&(me(r,t)&&n.push(r),A(r.childrenList,t,n))},j=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?k(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return A(this.childrenList,e,t),t}},M=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 j)}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 he(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return A(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}="${fe(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${fe(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`?k(e):(e instanceof j,e.serialize())).join(``):a+=k(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}>`}},he=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 A(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${k(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?k(e):(e instanceof j,e.serialize())).join(``)}</template>`}},N=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(N(t)):e.concat(t),[]),P=e=>e==null?null:e instanceof Te?e.build():typeof e==`string`?p?e:document.createTextNode(e):e,ge=(e,t)=>{if(p){I(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let i=null,a=()=>{i?.(),i=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};S(()=>{let e=t();a();let n=document.createDocumentFragment();i=C(t=>(I(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),w(()=>i?.())},_e=`__ranFor`,ve=e=>typeof e==`object`&&!!e&&e[_e]===!0,ye=(e,t,n)=>{let[r,i]=ae(t),a=null,o=C(t=>{let i=P(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},F=(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},be=(e,t)=>{if(p){(t.each()??[]).forEach((n,r)=>{let i=P(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;w(()=>{for(let e of r.values())e.dispose();r.clear()}),S(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o))return;let s=r.get(o);s?(r.delete(o),s.index(n)):s=ye(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();F(n,a),r=i})},xe=`__ranIndex`,Se=e=>typeof e==`object`&&!!e&&e[xe]===!0,Ce=(e,t,n)=>{let[r,i]=ae(e),a=null,o=C(e=>{let i=P(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},we=(e,t)=>{if(p){(t.each()??[]).forEach((n,r)=>{let i=P(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];w(()=>{for(let e of r)e.dispose();r=[]}),S(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<r.length?r[n].setItem(e[n]):r.push(Ce(e[n],n,t.render));for(let t=r.length-1;t>=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}F(n,r.map(e=>e.node).filter(e=>e!=null))})},I=(e,t)=>{N(t).forEach(t=>{if(ve(t)){be(e,t);return}if(Se(t)){we(e,t);return}if(typeof t==`function`){ge(e,t);return}let n=P(t);n!=null&&e.appendChild(n)})},Te=class{el;constructor(e){this.el=p?new M(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?S(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{p?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 I(this.el,e),this}replaceChildren(...e){if(p){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 Ee(this.el,t,e)}build(){return this.el}serialize(){if(p)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},Ee=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return I(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(p)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 p?this.root.serialize():this.root.innerHTML}},L=e=>new Te(e),R=()=>L(`div`),z=()=>L(`slot`),De=new Map;function B(e,t){p?(De.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var V=typeof document<`u`?HTMLElement:M,H=new Map,U=new Map,Oe=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!H.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),H.set(t,e)}let n=H.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},ke=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!U.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),U.set(t,e)}let n=U.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},W=new WeakMap,G=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,K=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||W.get(e)||e.attachShadow(n);return W.set(e,r),Oe(r,t?`${t}\n${G}`:G),r},q=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},J=(e,t,n=``)=>e.getAttribute(t)??n,Y=(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&&ke(t,a)},je=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{visibility:hidden;position:absolute}`;B(`r-content`,class extends V{observer;_shadowDom;_slot;constructor(){super(),this._shadowDom=K(this,je);let e=q(this._shadowDom,`.slot`,()=>z().class(`slot`).build());this._slot=e,this.observer=new MutationObserver(this.callback)}callback=e=>{for(let t of e)(t.type===`childList`||t.type===`attributes`)&&this.onChange(t)};onChange=e=>{this.dispatchEvent(new CustomEvent(`change`,{detail:{type:e.type,value:{content:this.children,mutation:e}}}))};connectedCallback(){this.observer.observe(this,{attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){this.observer.disconnect()}});var Me=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}@keyframes ranui-dropdown-up-in{0%{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}to{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-up-out{0%{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}to{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-down-in{0%{transform-origin:0 0;opacity:0;transform:scaleY(.8)}to{transform-origin:0 0;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-down-out{0%{transform-origin:0 0;opacity:1;transform:scaleY(1)}to{transform-origin:0 0;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-left-in{0%{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}to{transform-origin:100% 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-left-out{0%{transform-origin:100% 0;opacity:1;transform:scaleX(1)}to{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}}@keyframes ranui-dropdown-right-in{0%{transform-origin:0 0;opacity:0;transform:scaleX(.8)}to{transform-origin:0 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-right-out{0%{transform-origin:0 0;opacity:1;transform:scaleX(1)}to{transform-origin:0 0;opacity:0;transform:scaleX(.8)}}.ran-dropdown-down-in{animation:.1s forwards ranui-dropdown-down-in}.ran-dropdown-down-out{animation:.1s forwards ranui-dropdown-down-out}.ran-dropdown-up-in{animation:.1s forwards ranui-dropdown-up-in}.ran-dropdown-up-out{animation:.1s forwards ranui-dropdown-up-out}.ran-dropdown-left-in{animation:.1s forwards ranui-dropdown-left-in}.ran-dropdown-left-out{animation:.1s forwards ranui-dropdown-left-out}.ran-dropdown-right-in{animation:.1s forwards ranui-dropdown-right-in}.ran-dropdown-right-out{animation:.1s forwards ranui-dropdown-right-out}:host{text-align:var(--ran-dropdown-host-text-align,left);z-index:var(--ran-dropdown-host-z-index,var(--ran-z-dropdown,1100))}.ranui-dropdown{transform-origin:var(--ran-x,50%) var(--ran-y,50%);box-sizing:var(--ran-dropdown-box-sizing,border-box);margin:var(--ran-dropdown-margin,0);padding:var(--ran-dropdown-padding,0);color:var(--ran-dropdown-color,var(--ran-color-text,#000000e0));font-size:var(--ran-dropdown-font-size,14px);list-style:var(--ran-dropdown-list-style,none);font-family:var(--ran-dropdown-font-family,var(--ran-skin-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));z-index:var(--ran-dropdown-z-index,1050);overflow:var(--ran-dropdown-overflow,hidden);font-variant:var(--ran-dropdown-font-variant,initial);background:var(--ran-dropdown-background,var(--ran-color-bg-elevated,#fff));border-radius:var(--ran-dropdown-border-radius,var(--ran-radius-md,12px));outline:var(--ran-dropdown-outline,none);box-shadow:var(--ran-dropdown-box-shadow,var(--ran-shadow-menu,var(--ran-shadow-elevated,0 6px 16px 0 #00000014, 0 3px 6px -4px #0000001f, 0 9px 28px 8px #0000000d)));cursor:var(--ran-dropdown-cursor,auto);width:var(--ran-dropdown-width,100%);height:var(--ran-dropdown-height,100%);min-height:var(--ran-dropdown-min-height,100%);min-width:var(--ran-dropdown-min-width,100%)}.ranui-dropdown-container{position:var(--ran-dropdown-container-position,relative);display:var(--ran-dropdown-container-display,block);width:var(--ran-dropdown-container-width,100%);height:var(--ran-dropdown-container-height,100%);box-sizing:var(--ran-dropdown-container-box-sizing,border-box)}.ranui-dropdown-container .top{transform:translateX(calc(var(--ran-dropdown-arrow-anchor-width,var(--ran-dropdown-min-width,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2))) translateY(calc(-1 * var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px)) + var(--ran-dropdown-arrow-overlap,2px))) rotate(0deg);top:0}.ranui-dropdown-container .bottom{transform:translateX(calc(var(--ran-dropdown-arrow-anchor-width,var(--ran-dropdown-min-width,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2))) translateY(var(--ran-dropdown-arrow-overlap,2px)) rotate(180deg);top:max(0px, calc(var(--ran-dropdown-min-height,100%) - calc(var(--ran-dropdown-arrow-width,16px) / 4)))}.ranui-dropdown-container .left{transform:translateX(calc(0px - var(--ran-dropdown-arrow-width,16px))) translateY(calc(var(--ran-dropdown-arrow-width,16px) / 2 + var(--ran-dropdown-arrow-overlap,2px))) rotate(270deg);top:max(0px, calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - var(--ran-dropdown-arrow-width,16px)))}.ranui-dropdown-container .right{transform:translateX(0) translateY(calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2) + var(--ran-dropdown-arrow-overlap,2px))) rotate(90deg);top:0;left:100%}.ranui-dropdown-arrow{position:var(--ran-dropdown-arrow-position,absolute);box-sizing:var(--ran-dropdown-arrow-box-sizing,border-box);z-index:var(--ran-dropdown-arrow-z-index,1);display:var(--ran-dropdown-arrow-display,block);pointer-events:var(--ran-dropdown-arrow-pointer-events,none);width:var(--ran-dropdown-arrow-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px));overflow:var(--ran-dropdown-arrow-overflow,hidden)}.ranui-dropdown-arrow:before{background:var(--ran-dropdown-arrow-before-background,var(--ran-color-bg-elevated,#fff));position:var(--ran-dropdown-arrow-before-position,absolute);bottom:var(--ran-dropdown-arrow-before-bottom,0);width:var(--ran-dropdown-arrow-before-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-before-height,calc(var(--ran-dropdown-arrow-width,16px) / 2));clip-path:path("M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z");content:var(--ran-dropdown-arrow-before-content,"");inset-inline-start:0}.ranui-dropdown-arrow:after{content:var(--ran-dropdown-arrow-after-content,"");position:var(--ran-dropdown-arrow-after-position,absolute);width:var(--ran-dropdown-arrow-after-width,9px);height:var(--ran-dropdown-arrow-after-height,9px);bottom:var(--ran-dropdown-arrow-after-bottom,0);margin:var(--ran-dropdown-arrow-after-margin,auto);border-radius:var(--ran-dropdown-arrow-after-border-radius,0 0 2px 0);transform:var(--ran-dropdown-arrow-after-transform,translateY(50%) rotate(-135deg));box-shadow:var(--ran-dropdown-arrow-after-box-shadow,2px 2px 5px #0000000d);z-index:var(--ran-dropdown-arrow-after-z-index,0);background:var(--ran-dropdown-arrow-after-background,var(--ran-color-bg-elevated,#fff));inset-inline:0}`,Ne=300;B(`r-dropdown`,class extends V{dropdown;_slot;_shadowDom;arrowIcon;container;static get observedAttributes(){return[`transit`,`arrow`,`sheet`]}constructor(){super(),this._shadowDom=K(this,Me);let e=q(this._shadowDom,`.ranui-dropdown-container`,()=>R().class(`ranui-dropdown-container`).children(R().style(`-webkit-tap-highlight-color`,`transparent`).style(`outline`,`0`).class(`ranui-dropdown`).part(`dropdown`).children(z().class(`slot`))).build());this.container=e,this.dropdown=e.querySelector(`.ranui-dropdown`),this._slot=e.querySelector(`.slot`)}get transit(){return J(this,`transit`)}set transit(e){Y(this,`transit`,e,{removeEmpty:!0})}get arrow(){return J(this,`arrow`)}set arrow(e){Y(this,`arrow`,e,{removeEmpty:!0})}get sheet(){return J(this,`sheet`)}set sheet(e){Y(this,`sheet`,e)}handlerExternalCss=()=>{Ae(this,this._shadowDom,`sheet`,null,this.sheet)};handlerTransit=()=>{this.transit&&this.dropdown&&(te(this.dropdown,this.transit),setTimeout(()=>{ne(this.dropdown,this.transit)},Ne))};handlerArrow=()=>{let e=(this.arrow||``).trim();if(!e){this.arrowIcon&&this.container.contains(this.arrowIcon)&&this.container.removeChild(this.arrowIcon),this.arrowIcon=void 0;return}!this.arrowIcon&&this.container&&(this.arrowIcon=R().class(`ranui-dropdown-arrow`).build(),this.container.appendChild(this.arrowIcon)),this.arrowIcon&&(this.arrowIcon.className=`ranui-dropdown-arrow ${e}`)};stopPropagation=e=>{e.stopPropagation()};connectedCallback(){this.handlerExternalCss(),this.handlerTransit(),this.handlerArrow()}disconnectedCallback(){}attributeChangedCallback(e,t,n){e===`transit`&&n&&(te(this.dropdown,this.transit),setTimeout(()=>{ne(this.dropdown,this.transit)},Ne)),e===`arrow`&&this.handlerArrow(),e===`sheet`&&t!==n&&this.handlerExternalCss()}});var Pe=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{display:var(--ran-popover-host-display,block)}.ran-popover{box-sizing:var(--ran-popover-box-sizing,border-box);position:var(--ran-popover-position,relative);display:var(--ran-popover-display,block);margin:var(--ran-popover-margin,0);padding:var(--ran-popover-padding,0)}.ran-popover-block{display:var(--ran-popover-block-display,block)}`,X=8,Z=300,Q=16,Fe={bottom:{add:`ran-dropdown-down-in`,remove:`ran-dropdown-down-out`},top:{add:`ran-dropdown-up-in`,remove:`ran-dropdown-up-out`},left:{add:`ran-dropdown-left-in`,remove:`ran-dropdown-left-out`},right:{add:`ran-dropdown-right-in`,remove:`ran-dropdown-right-out`}},Ie=function(e){return e.TOP=`top`,e.BOTTOM=`bottom`,e.LEFT=`left`,e.RIGHT=`right`,e}({}),$=class extends V{_events=new ie;_slot;popoverBlock;popoverContent;popoverInner;popoverInnerBlock;_shadowDom;dropDownInTimeId;dropDownOutTimeId;removeTimeId;static get observedAttributes(){return[`placement`,`trigger`,`sheet`]}closePopover=()=>{this.setDropdownDisplayNone()};constructor(){super(),this._shadowDom=K(this,Pe);let e=q(this._shadowDom,`.ran-popover-block`,()=>R().class(`ran-popover-block`).role(`tooltip`).children(z().class(`slot`)).build());this.popoverBlock=e,this._slot=e.querySelector(`.slot`)}get placement(){return J(this,`placement`,`top`)}set placement(e){Y(this,`placement`,e)}get trigger(){return J(this,`trigger`,`hover`)}set trigger(e){Y(this,`trigger`,e)}get getPopupContainerId(){return J(this,`getPopupContainerId`)}set getPopupContainerId(e){Y(this,`getPopupContainerId`,e)}get sheet(){return J(this,`sheet`)}set sheet(e){Y(this,`sheet`,e)}handlerExternalCss=()=>{Ae(this,this._shadowDom,`sheet`,null,this.sheet)};initAria=()=>{this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.setAttribute(`aria-haspopup`,`dialog`),this.setAttribute(`aria-expanded`,`false`)};updateAriaExpanded=e=>{this.setAttribute(`aria-expanded`,e?`true`:`false`)};stopPropagation=e=>{e.stopPropagation()};createContent=e=>{if(e){if(!this.popoverContent){this.popoverContent=L(`r-dropdown`).class(`ran-popover-dropdown`).style(`display`,`none`).style(`position`,`absolute`).build(),this.popoverContent?.addEventListener(`click`,this.stopPropagation);let e=R().children(this.popoverContent).build();this.trigger.includes(`hover`)&&!a()&&(this.popoverContent?.addEventListener(`mouseleave`,this.blur),this.popoverContent?.addEventListener(`mouseenter`,this.removeDropDownTimeId)),document.body.appendChild(e)}if(this.popoverContent&&e.length>0){this.popoverContent.innerHTML=``;let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);this.popoverContent.appendChild(t)}}};watchContent=e=>{let{value:t}=e.detail;this.createContent(t.content)};blur=f(()=>{this.removeTimeId&&this.removeDropDownTimeId(),this.removeTimeId=setTimeout(()=>{this.removeDropDownTimeId(),this.setDropdownDisplayNone()},Z)},Q);removeDropDownTimeId=f(()=>{this.trigger.includes(`hover`)&&!a()&&(clearTimeout(this.removeTimeId),this.removeTimeId=void 0)},Q);setDropdownDisplayBlock=f(()=>{this.dropDownInTimeId||(clearTimeout(this.dropDownInTimeId),this.dropDownInTimeId=void 0,clearTimeout(this.dropDownOutTimeId),this.dropDownOutTimeId=void 0,this.popoverContent&&this.popoverContent.style.display!==`block`&&(this.updateAriaExpanded(!0),this.popoverContent.setAttribute(`transit`,Fe[this.placement].add),this.popoverContent?.style.setProperty(`display`,`block`),this.placementPosition(),this.dropDownInTimeId=setTimeout(()=>{this.popoverContent&&this.popoverContent.removeAttribute(`transit`),clearTimeout(this.dropDownInTimeId),this.dropDownInTimeId=void 0},Z)))},Q);setDropdownDisplayNone=f(()=>{this.dropDownOutTimeId||(clearTimeout(this.dropDownInTimeId),this.dropDownInTimeId=void 0,clearTimeout(this.dropDownOutTimeId),this.dropDownOutTimeId=void 0,this.popoverContent&&this.popoverContent.style.display!==`none`&&(this.updateAriaExpanded(!1),this.popoverContent.setAttribute(`transit`,Fe[this.placement].remove),this.dropDownOutTimeId=setTimeout(()=>{this.popoverContent?.style.setProperty(`display`,`none`),this.popoverContent&&this.popoverContent.removeAttribute(`transit`),clearTimeout(this.dropDownOutTimeId),this.dropDownOutTimeId=void 0},Z)))},Q);placementPosition=()=>{if(!this.popoverContent)return;let{top:e,left:t,bottom:n,width:r,height:i}=this.getBoundingClientRect(),a=n+window.scrollY+X,o=t+window.scrollX,s=document.getElementById(this.getPopupContainerId),c=this.popoverContent.getBoundingClientRect();this.placement===`top`&&(a=e+window.scrollY-Math.max(c.height,i)-X,this.getPopupContainerId&&s&&(o=t-s.getBoundingClientRect().left,a=e-s.getBoundingClientRect().top-this.popoverContent.clientHeight-X,o=t-s.getBoundingClientRect().left)),this.placement===`left`&&(o=t-Math.max(c.width,r)-X,a=e+window.scrollY),this.placement===`right`&&(o=t+r+X,a=e+window.scrollY),this.popoverContent.style.setProperty(`inset`,`${a}px auto auto ${o}px`),this.popoverContent.style.setProperty(`--ran-x`,`${o}px`),this.popoverContent.style.setProperty(`--ran-y`,`${a}px`),this.popoverContent.style.setProperty(`--ran-dropdown-arrow-anchor-width`,`${r}px`),this.popoverContent.style.setProperty(`--ran-dropdown-arrow-anchor-height`,`${i}px`),this.popoverContent.style.setProperty(`--ran-dropdown-min-width`,`${c.width}px`),this.popoverContent.style.setProperty(`--ran-dropdown-min-height`,`${c.height}px`)};hoverPopover=e=>{this.clickPopover(e)};clickContent=e=>{e.stopPropagation()};clickPopover=e=>{e.stopPropagation(),e.preventDefault(),this.setDropdownDisplayBlock()};keydownPopover=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.setDropdownDisplayBlock()),e.key===`Escape`&&(e.preventDefault(),this.setDropdownDisplayNone())};clickRemovePopover=e=>{this.hoverRemovePopover(e)};popoverTrigger=()=>{this._events.abort();for(let e of this.children)e.tagName===`R-CONTENT`&&this._events.on(e,`change`,this.watchContent);this.trigger.includes(`hover`)&&(this._events.on(this,`mouseenter`,this.hoverPopover),this._events.on(this,`mouseleave`,this.blur)),this._events.on(this,`click`,this.clickPopover).on(this,`keydown`,this.keydownPopover).on(document,`click`,this.clickRemovePopover)};hoverRemovePopover=e=>{e.stopPropagation(),this.setDropdownDisplayNone()};changePlacement=f(()=>{this.placement===`top`&&this.popoverContent?.setAttribute(`arrow`,`bottom`),this.placement===`bottom`&&this.popoverContent?.setAttribute(`arrow`,`top`),this.placement===`left`&&this.popoverContent?.setAttribute(`arrow`,`right`),this.placement===`right`&&this.popoverContent?.setAttribute(`arrow`,`left`)},Q);connectedCallback(){this.initAria(),this.handlerExternalCss();for(let e of this.children)e.tagName===`R-CONTENT`&&this.createContent(e.children);this.popoverTrigger(),this.changePlacement()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`trigger`&&this.popoverTrigger(),e===`placement`&&this.changePlacement(),e===`sheet`&&this.handlerExternalCss())}};return B(`r-popover`,$),e.PLACEMENT_TYPE=Ie,e.Popover=$,e.default=$,e})({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var ranui_progress=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=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}},n=(e=8)=>Math.random().toString(36).substring(2,e+2),r=(e=``)=>{if(e.length===0)return 0;if(e.endsWith(`%`)){let t=Number(e.replace(`%`,``));return t>1?t/100:t}return Number(e)},i=e=>typeof e==`function`,a=12e4,o=`__ranuts_bridge__`,s=`default`,c=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)}},l=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,r=s){this.targetOrigin=t,this.channel=r,this.senderId=n(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,c.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:o,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:a,isResponse:o,isError:s,senderId:c}=t;if(o&&a){let e=this.pendingRequests.get(a);e&&(s?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(a));return}if(c&&c===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let l=this.messageHandlers.get(n);if(i(l)){let t=e.source??this.targetWindow;Promise.resolve(l(r)).then(e=>{a&&this.post(t,{type:n,payload:e,id:a,isResponse:!0})}).catch(e=>{a&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:a,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 r=n(10);return new Promise((n,i)=>{let o=setTimeout(()=>{this.pendingRequests.has(r)&&(this.pendingRequests.delete(r),i(Error(`Request timeout`)))},a),s=e=>{clearTimeout(o),i(e)};this.pendingRequests.set(r,{resolve:e=>{clearTimeout(o),n(e)},reject:s});try{this.post(this.targetWindow,{type:e,payload:t,id:r})}catch(e){this.pendingRequests.delete(r),s(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=()=>{c.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:r,channel:i})=>{let a=new l(r,t,i);if(e||=n(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,a),{bridge:a,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 t;var u=[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],d=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new d(u[0],3609767458),new d(u[1],602891725),new d(u[2],3964484399),new d(u[3],2173295548),new d(u[4],4081628472),new d(u[5],3053834265),new d(u[6],2937671579),new d(u[7],3664609560),new d(u[8],2734883394),new d(u[9],1164996542),new d(u[10],1323610764),new d(u[11],3590304994),new d(u[12],4068182383),new d(u[13],991336113),new d(u[14],633803317),new d(u[15],3479774868),new d(u[16],2666613458),new d(u[17],944711139),new d(u[18],2341262773),new d(u[19],2007800933),new d(u[20],1495990901),new d(u[21],1856431235),new d(u[22],3175218132),new d(u[23],2198950837),new d(u[24],3999719339),new d(u[25],766784016),new d(u[26],2566594879),new d(u[27],3203337956),new d(u[28],1034457026),new d(u[29],2466948901),new d(u[30],3758326383),new d(u[31],168717936),new d(u[32],1188179964),new d(u[33],1546045734),new d(u[34],1522805485),new d(u[35],2643833823),new d(u[36],2343527390),new d(u[37],1014477480),new d(u[38],1206759142),new d(u[39],344077627),new d(u[40],1290863460),new d(u[41],3158454273),new d(u[42],3505952657),new d(u[43],106217008),new d(u[44],3606008344),new d(u[45],1432725776),new d(u[46],1467031594),new d(u[47],851169720),new d(u[48],3100823752),new d(u[49],1363258195),new d(u[50],3750685593),new d(u[51],3785050280),new d(u[52],3318307427),new d(u[53],3812723403),new d(u[54],2003034995),new d(u[55],3602036899),new d(u[56],1575990012),new d(u[57],1125592928),new d(u[58],2716904306),new d(u[59],442776044),new d(u[60],593698344),new d(u[61],3733110249),new d(u[62],2999351573),new d(u[63],3815920427),new d(3391569614,3928383900),new d(3515267271,566280711),new d(3940187606,3454069534),new d(4118630271,4000239992),new d(116418474,1914138554),new d(174292421,2731055270),new d(289380356,3203993006),new d(460393269,320620315),new d(685471733,587496836),new d(852142971,1086792851),new d(1017036298,365543100),new d(1126000580,2618297676),new d(1288033470,3409855158),new d(1501505948,4234509866),new d(1607167915,987167468),new d(1816402316,1246189591),new d(0,1),new d(0,32898),new d(2147483648,32906),new d(2147483648,2147516416),new d(0,32907),new d(0,2147483649),new d(2147483648,2147516545),new d(2147483648,32777),new d(0,138),new d(0,136),new d(0,2147516425),new d(0,2147483658),new d(0,2147516555),new d(2147483648,139),new d(2147483648,32905),new d(2147483648,32771),new d(2147483648,32770),new d(2147483648,128),new d(0,32778),new d(2147483648,2147483658),new d(2147483648,2147516545),new d(2147483648,32896),new d(0,2147483649),new d(2147483648,2147516424);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);var p=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{height:var(--ran-progress-height,20px);display:block}:host:active,:host:focus{-webkit-tap-highlight-color:transparent;outline:0}:host(:focus-visible){outline:var(--ran-progress-focus-outline,2px solid var(--ran-color-primary,#006bff));outline-offset:var(--ran-progress-focus-outline-offset,2px);border-radius:var(--ran-radius-full,9999px)}.ran-progress{position:var(--ran-progress-position,relative);cursor:var(--ran-progress-cursor,pointer);width:var(--ran-progress-width,100%);height:100%}.ran-progress:active,.ran-progress:focus{-webkit-tap-highlight-color:transparent;outline:0}.ran-progress-wrap{width:var(--ran-progress-wrap-width,100%);height:var(--ran-progress-wrap-height,8px);border-radius:var(--ran-progress-wrap-border-radius,20px);background:var(--ran-progress-wrap-background,var(--ran-gray-200,#ebebeb));position:var(--ran-progress-wrap-position,relative);overflow:var(--ran-progress-wrap-overflow,hidden)}.ran-progress-wrap-value{position:var(--ran-progress-wrap-value-position,absolute);top:var(--ran-progress-wrap-value-top,0);left:var(--ran-progress-wrap-value-left,0);height:var(--ran-progress-wrap-value-height,100%);width:var(--ran-progress-wrap-value-width,100%);transform:scaleX(var(--progress-percent,0));transform-origin:var(--ran-progress-wrap-value-transform-origin,0 0);will-change:var(--ran-progress-wrap-value-will-change,transform);background:var(--ran-progress-wrap-value-background,linear-gradient(90deg, #0bc8bb 2.42%, #00d297 98.79%));border-radius:var(--ran-progress-wrap-value-border-radius,20px)}.ran-progress-dot{position:var(--ran-progress-dot-position,absolute);top:var(--ran-progress-dot-top,-5px);left:calc(var(--progress-percent,0) * 100%);border-radius:var(--ran-progress-dot-border-radius,50%);width:var(--ran-progress-dot-width,18px);height:var(--ran-progress-dot-height,18px);background:var(--ran-progress-dot-background,linear-gradient(90deg, #0bc8bb 2.42%, #00d297 98.79%));cursor:var(--ran-progress-dot-cursor,pointer);transform:translate(-50%)}`,m=typeof document>`u`,h=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}},g=0,_=1,v=2,y=null,b=null,x=new Set;function ee(e){let t=S(e,!0);return C(t),T(t),()=>D(t)}function S(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:v,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:b}}function C(e){b&&b.owned.push(e)}function w(e,t){if(e.disposed||e.state>=t)return;let n=e.state===g;if(e.state=t,e.isEffect)x.add(e);else if(n)for(let t of e.observers)w(t,_)}function T(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);E(e);let t=y,n=b;y=e,b=e,e.running=!0,e.state=g;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)w(t,v)}}finally{e.running=!1,y=t,b=n}}function E(e){for(let t of e.owned)D(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 D(e){e.disposed||(e.disposed=!0,E(e),e.observers.clear())}function O(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function k(e){return O(e)}var A=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,j=(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()},M=(e,t,n)=>{for(let r of e)A(r)&&(j(r,t)&&n.push(r),M(r.childrenList,t,n))},N=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?O(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return M(this.childrenList,e,t),t}},P=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 N)}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 F(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return M(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}="${k(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${k(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`?O(e):(e instanceof N,e.serialize())).join(``):a+=O(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}>`}},F=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 M(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${O(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?O(e):(e instanceof N,e.serialize())).join(``)}</template>`}},I=class e{el;constructor(e){this.el=m?new P(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?ee(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{m?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(...t){let n=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(n(t)):e.concat(t),[]);return n(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?m?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),this}replaceChildren(...e){if(m){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 L(this.el,t,e)}build(){return this.el}serialize(){if(m)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},L=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof I?this.root.appendChild(e.build()):typeof e==`string`?m?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(m)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 m?this.root.serialize():this.root.innerHTML}},R=e=>new I(e),z=()=>R(`div`),B=new Map;function V(e,t){m?(B.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var H=typeof document<`u`?HTMLElement:P,U=new Map,W=new Map,G=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!U.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),U.set(t,e)}let n=U.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},K=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!W.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),W.set(t,e)}let n=W.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},q=new WeakMap,J=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Y=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||q.get(e)||e.attachShadow(n);return q.set(e,r),G(r,t?`${t}\n${J}`:J),r},X=(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??``)},te=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&K(t,a)},ne=[`percent`,`type`,`total`,`dot`,`sheet`],$=class extends H{_progress;_progressWrap;_progressWrapValue;_progressDot;_shadowDom;_events=new h;moveProgress={mouseDown:!1};static get observedAttributes(){return ne}constructor(){super(),this._shadowDom=Y(this,p);let e=X(this._shadowDom,`.ran-progress`,()=>z().class(`ran-progress`).role(`progressbar`).children(z().class(`ran-progress-wrap`).part(`track`).children(z().class(`ran-progress-wrap-value`).part(`fill`)),z().class(`ran-progress-dot`).part(`dot`)).build());this._progress=e,this._progressWrap=e.querySelector(`.ran-progress-wrap`),this._progressWrapValue=e.querySelector(`.ran-progress-wrap-value`),this._progressDot=e.querySelector(`.ran-progress-dot`)}get percent(){let e=r(this.getAttribute(`percent`)||`0`),t=Number(this.total);return String(e>t?t:e)}set percent(e){this.setAttribute(`percent`,e||`0`),this.setAttribute(`aria-valuenow`,e||`0`)}get total(){let e=this.getAttribute(`total`);return e?`${r(e)}`:`100`}set total(e){this.setAttribute(`total`,e||`100`)}get type(){let e=this.getAttribute(`type`)||`primary`;return[`primary`,`drag`].includes(e)?e:`primary`}set type(e){this.setAttribute(`type`,e||`primary`)}get dot(){let e=this.getAttribute(`dot`)||`true`;return[`true`,`false`].includes(e)?e:`true`}set dot(e){this.setAttribute(`dot`,e||`true`)}get sheet(){return Z(this,`sheet`)}set sheet(e){Q(this,`sheet`,e)}handlerExternalCss=()=>{te(this,this._shadowDom,`sheet`,null,this.sheet)};progressClick=e=>{if(this.type!==`drag`)return;let t=this._progress.getBoundingClientRect(),n=e.clientX-t.left,r=Math.min(1,Math.max(0,n/this._progress.offsetWidth)),i=r*Number(this.total);this.percent=String(i),this.updateUI(r),this.change()};progressDotMouseDown=e=>{this.moveProgress.mouseDown=!0,e.stopPropagation()};progressDotMouseMove=e=>{if(!this.moveProgress.mouseDown)return;let t=this._progress.getBoundingClientRect(),n=e.clientX-t.left,r=Math.min(1,Math.max(0,n/this._progress.offsetWidth)),i=r*Number(this.total);this.percent=String(i),this.updateUI(r),this.change()};progressDotMouseUp=()=>{this.moveProgress.mouseDown=!1};updateUI=e=>{this.style.setProperty(`--progress-percent`,String(e))};_preSerialize(){let e=Number(this.getAttribute(`percent`)||`0`),t=Number(this.getAttribute(`total`)||`100`),n=Math.min(1,Math.max(0,e/t));this.style.setProperty(`--progress-percent`,String(n))}change=()=>{this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.percent,percent:this.percent,total:this.total}}))};appendProgressDot=()=>{if(!this._progress||!this._progressDot)return;let e=this.dot===`true`&&this.type===`drag`;e&&!this._progress.contains(this._progressDot)&&this._progress.appendChild(this._progressDot),!e&&this._progress.contains(this._progressDot)&&this._progress.removeChild(this._progressDot)};updateCurrentProgress=()=>{if(!this._progress)return;let e=Number(this.total)||100,t=Number(this.percent)/e;this.updateUI(t)};dragEvent=()=>{this.type===`drag`&&this._events.on(this._progress,`click`,this.progressClick).on(this._progressDot,`mousedown`,this.progressDotMouseDown).on(document,`mousemove`,this.progressDotMouseMove).on(document,`mouseup`,this.progressDotMouseUp)};resize=()=>{this.updateCurrentProgress()};connectedCallback(){this.handlerExternalCss(),this.hasAttribute(`type`)||this.setAttribute(`type`,`primary`),this.dragEvent(),this.updateCurrentProgress(),this.appendProgressDot(),this._events.on(window,`resize`,this.resize)}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&((e===`dot`||e===`type`)&&this.appendProgressDot(),(e===`percent`||e===`total`)&&this.updateCurrentProgress(),e===`sheet`&&this.handlerExternalCss())}};return V(`r-progress`,$),e.Progress=$,e.default=$,e})({});
|
|
1
|
+
var ranui_progress=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=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}},n=(e=8)=>Math.random().toString(36).substring(2,e+2),r=(e=``)=>{if(e.length===0)return 0;if(e.endsWith(`%`)){let t=Number(e.replace(`%`,``));return t>1?t/100:t}return Number(e)},i=e=>typeof e==`function`,a=12e4,o=`__ranuts_bridge__`,s=`default`,c=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)}},l=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,r=s){this.targetOrigin=t,this.channel=r,this.senderId=n(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,c.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:o,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:a,isResponse:o,isError:s,senderId:c}=t;if(o&&a){let e=this.pendingRequests.get(a);e&&(s?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(a));return}if(c&&c===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let l=this.messageHandlers.get(n);if(i(l)){let t=e.source??this.targetWindow;Promise.resolve(l(r)).then(e=>{a&&this.post(t,{type:n,payload:e,id:a,isResponse:!0})}).catch(e=>{a&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:a,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 r=n(10);return new Promise((n,i)=>{let o=setTimeout(()=>{this.pendingRequests.has(r)&&(this.pendingRequests.delete(r),i(Error(`Request timeout`)))},a),s=e=>{clearTimeout(o),i(e)};this.pendingRequests.set(r,{resolve:e=>{clearTimeout(o),n(e)},reject:s});try{this.post(this.targetWindow,{type:e,payload:t,id:r})}catch(e){this.pendingRequests.delete(r),s(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=()=>{c.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:r,channel:i})=>{let a=new l(r,t,i);if(e||=n(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,a),{bridge:a,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 t;var u=[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],d=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new d(u[0],3609767458),new d(u[1],602891725),new d(u[2],3964484399),new d(u[3],2173295548),new d(u[4],4081628472),new d(u[5],3053834265),new d(u[6],2937671579),new d(u[7],3664609560),new d(u[8],2734883394),new d(u[9],1164996542),new d(u[10],1323610764),new d(u[11],3590304994),new d(u[12],4068182383),new d(u[13],991336113),new d(u[14],633803317),new d(u[15],3479774868),new d(u[16],2666613458),new d(u[17],944711139),new d(u[18],2341262773),new d(u[19],2007800933),new d(u[20],1495990901),new d(u[21],1856431235),new d(u[22],3175218132),new d(u[23],2198950837),new d(u[24],3999719339),new d(u[25],766784016),new d(u[26],2566594879),new d(u[27],3203337956),new d(u[28],1034457026),new d(u[29],2466948901),new d(u[30],3758326383),new d(u[31],168717936),new d(u[32],1188179964),new d(u[33],1546045734),new d(u[34],1522805485),new d(u[35],2643833823),new d(u[36],2343527390),new d(u[37],1014477480),new d(u[38],1206759142),new d(u[39],344077627),new d(u[40],1290863460),new d(u[41],3158454273),new d(u[42],3505952657),new d(u[43],106217008),new d(u[44],3606008344),new d(u[45],1432725776),new d(u[46],1467031594),new d(u[47],851169720),new d(u[48],3100823752),new d(u[49],1363258195),new d(u[50],3750685593),new d(u[51],3785050280),new d(u[52],3318307427),new d(u[53],3812723403),new d(u[54],2003034995),new d(u[55],3602036899),new d(u[56],1575990012),new d(u[57],1125592928),new d(u[58],2716904306),new d(u[59],442776044),new d(u[60],593698344),new d(u[61],3733110249),new d(u[62],2999351573),new d(u[63],3815920427),new d(3391569614,3928383900),new d(3515267271,566280711),new d(3940187606,3454069534),new d(4118630271,4000239992),new d(116418474,1914138554),new d(174292421,2731055270),new d(289380356,3203993006),new d(460393269,320620315),new d(685471733,587496836),new d(852142971,1086792851),new d(1017036298,365543100),new d(1126000580,2618297676),new d(1288033470,3409855158),new d(1501505948,4234509866),new d(1607167915,987167468),new d(1816402316,1246189591),new d(0,1),new d(0,32898),new d(2147483648,32906),new d(2147483648,2147516416),new d(0,32907),new d(0,2147483649),new d(2147483648,2147516545),new d(2147483648,32777),new d(0,138),new d(0,136),new d(0,2147516425),new d(0,2147483658),new d(0,2147516555),new d(2147483648,139),new d(2147483648,32905),new d(2147483648,32771),new d(2147483648,32770),new d(2147483648,128),new d(0,32778),new d(2147483648,2147483658),new d(2147483648,2147516545),new d(2147483648,32896),new d(0,2147483649),new d(2147483648,2147516424);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);var ee=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{height:var(--ran-progress-height,20px);display:block}:host:active,:host:focus{-webkit-tap-highlight-color:transparent;outline:0}:host(:focus-visible){outline:var(--ran-progress-focus-outline,2px solid var(--ran-color-primary,#006bff));outline-offset:var(--ran-progress-focus-outline-offset,2px);border-radius:var(--ran-radius-full,9999px)}.ran-progress{position:var(--ran-progress-position,relative);cursor:var(--ran-progress-cursor,pointer);width:var(--ran-progress-width,100%);height:100%}.ran-progress:active,.ran-progress:focus{-webkit-tap-highlight-color:transparent;outline:0}.ran-progress-wrap{width:var(--ran-progress-wrap-width,100%);height:var(--ran-progress-wrap-height,8px);border-radius:var(--ran-progress-wrap-border-radius,20px);background:var(--ran-progress-wrap-background,var(--ran-gray-200,#ebebeb));position:var(--ran-progress-wrap-position,relative);overflow:var(--ran-progress-wrap-overflow,hidden)}.ran-progress-wrap-value{position:var(--ran-progress-wrap-value-position,absolute);top:var(--ran-progress-wrap-value-top,0);left:var(--ran-progress-wrap-value-left,0);height:var(--ran-progress-wrap-value-height,100%);width:var(--ran-progress-wrap-value-width,100%);transform:scaleX(var(--progress-percent,0));transform-origin:var(--ran-progress-wrap-value-transform-origin,0 0);will-change:var(--ran-progress-wrap-value-will-change,transform);background:var(--ran-progress-wrap-value-background,linear-gradient(90deg, #0bc8bb 2.42%, #00d297 98.79%));border-radius:var(--ran-progress-wrap-value-border-radius,20px)}.ran-progress-dot{position:var(--ran-progress-dot-position,absolute);top:var(--ran-progress-dot-top,-5px);left:calc(var(--progress-percent,0) * 100%);border-radius:var(--ran-progress-dot-border-radius,50%);width:var(--ran-progress-dot-width,18px);height:var(--ran-progress-dot-height,18px);background:var(--ran-progress-dot-background,linear-gradient(90deg, #0bc8bb 2.42%, #00d297 98.79%));cursor:var(--ran-progress-dot-cursor,pointer);transform:translate(-50%)}`,p=typeof document>`u`,te=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}},m=0,h=1,g=2,_=null,v=null,y=0,b=new Set,x=!1;function S(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ie(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(e,g);y===0&&ae()}}]}function C(e){let t=ne(e,!0);return re(t),O(t),()=>A(t)}function w(e){let t={owned:[],cleanups:[],owner:v},n=v,r=_;v=t,_=null;try{return e(()=>oe(t))}finally{v=n,_=r}}function T(e){v&&v.cleanups.push(e)}function ne(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:g,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:v}}function re(e){v&&v.owned.push(e)}function ie(e){_&&(_.sources.add(e),e.observers.add(_))}function E(e,t){if(e.disposed||e.state>=t)return;let n=e.state===m;if(e.state=t,e.isEffect)b.add(e);else if(n)for(let t of e.observers)E(t,h)}function ae(){if(!(y>0||x)){x=!0;try{for(;b.size>0;){let e=[...b];b.clear();for(let t of e)t.disposed||D(t)}}finally{x=!1}}}function D(e){if(!(e.disposed||e.state===m)){if(e.state===h)for(let t of e.sources)`fn`in t&&D(t);e.state===g&&O(e),e.state=m}}function O(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);k(e);let t=_,n=v;_=e,v=e,e.running=!0,e.state=m;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)E(t,g)}}finally{e.running=!1,_=t,v=n}}function k(e){for(let t of e.owned)A(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 A(e){e.disposed||(e.disposed=!0,k(e),e.observers.clear())}function oe(e){for(let t of e.owned)A(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function j(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function M(e){return j(e)}var N=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,se=(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()},P=(e,t,n)=>{for(let r of e)N(r)&&(se(r,t)&&n.push(r),P(r.childrenList,t,n))},F=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 P(this.childrenList,e,t),t}},I=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 F)}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 ce(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return P(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`?j(e):(e instanceof F,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}>`}},ce=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 P(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 F,e.serialize())).join(``)}</template>`}},L=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(L(t)):e.concat(t),[]),R=e=>e==null?null:e instanceof K?e.build():typeof e==`string`?p?e:document.createTextNode(e):e,z=(e,t)=>{if(p){G(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let i=null,a=()=>{i?.(),i=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};C(()=>{let e=t();a();let n=document.createDocumentFragment();i=w(t=>(G(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),T(()=>i?.())},B=`__ranFor`,V=e=>typeof e==`object`&&!!e&&e[B]===!0,H=(e,t,n)=>{let[r,i]=S(t),a=null,o=w(t=>{let i=R(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},U=(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},W=(e,t)=>{if(p){(t.each()??[]).forEach((n,r)=>{let i=R(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;T(()=>{for(let e of r.values())e.dispose();r.clear()}),C(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o))return;let s=r.get(o);s?(r.delete(o),s.index(n)):s=H(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();U(n,a),r=i})},le=`__ranIndex`,ue=e=>typeof e==`object`&&!!e&&e[le]===!0,de=(e,t,n)=>{let[r,i]=S(e),a=null,o=w(e=>{let i=R(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},fe=(e,t)=>{if(p){(t.each()??[]).forEach((n,r)=>{let i=R(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];T(()=>{for(let e of r)e.dispose();r=[]}),C(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<r.length?r[n].setItem(e[n]):r.push(de(e[n],n,t.render));for(let t=r.length-1;t>=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}U(n,r.map(e=>e.node).filter(e=>e!=null))})},G=(e,t)=>{L(t).forEach(t=>{if(V(t)){W(e,t);return}if(ue(t)){fe(e,t);return}if(typeof t==`function`){z(e,t);return}let n=R(t);n!=null&&e.appendChild(n)})},K=class{el;constructor(e){this.el=p?new I(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?C(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{p?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 G(this.el,e),this}replaceChildren(...e){if(p){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 pe(this.el,t,e)}build(){return this.el}serialize(){if(p)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},pe=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return G(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(p)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 p?this.root.serialize():this.root.innerHTML}},me=e=>new K(e),q=()=>me(`div`),he=new Map;function ge(e,t){p?(he.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var _e=typeof document<`u`?HTMLElement:I,J=new Map,Y=new Map,ve=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!J.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),J.set(t,e)}let n=J.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},X=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!Y.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),Y.set(t,e)}let n=Y.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},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}}`,ye=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||Z.get(e)||e.attachShadow(n);return Z.set(e,r),ve(r,t?`${t}\n${Q}`:Q),r},be=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},xe=(e,t,n=``)=>e.getAttribute(t)??n,Se=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},Ce=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&X(t,a)},we=[`percent`,`type`,`total`,`dot`,`sheet`],$=class extends _e{_progress;_progressWrap;_progressWrapValue;_progressDot;_shadowDom;_events=new te;moveProgress={mouseDown:!1};static get observedAttributes(){return we}constructor(){super(),this._shadowDom=ye(this,ee);let e=be(this._shadowDom,`.ran-progress`,()=>q().class(`ran-progress`).role(`progressbar`).children(q().class(`ran-progress-wrap`).part(`track`).children(q().class(`ran-progress-wrap-value`).part(`fill`)),q().class(`ran-progress-dot`).part(`dot`)).build());this._progress=e,this._progressWrap=e.querySelector(`.ran-progress-wrap`),this._progressWrapValue=e.querySelector(`.ran-progress-wrap-value`),this._progressDot=e.querySelector(`.ran-progress-dot`)}get percent(){let e=r(this.getAttribute(`percent`)||`0`),t=Number(this.total);return String(e>t?t:e)}set percent(e){this.setAttribute(`percent`,e||`0`),this.setAttribute(`aria-valuenow`,e||`0`)}get total(){let e=this.getAttribute(`total`);return e?`${r(e)}`:`100`}set total(e){this.setAttribute(`total`,e||`100`)}get type(){let e=this.getAttribute(`type`)||`primary`;return[`primary`,`drag`].includes(e)?e:`primary`}set type(e){this.setAttribute(`type`,e||`primary`)}get dot(){let e=this.getAttribute(`dot`)||`true`;return[`true`,`false`].includes(e)?e:`true`}set dot(e){this.setAttribute(`dot`,e||`true`)}get sheet(){return xe(this,`sheet`)}set sheet(e){Se(this,`sheet`,e)}handlerExternalCss=()=>{Ce(this,this._shadowDom,`sheet`,null,this.sheet)};progressClick=e=>{if(this.type!==`drag`)return;let t=this._progress.getBoundingClientRect(),n=e.clientX-t.left,r=Math.min(1,Math.max(0,n/this._progress.offsetWidth)),i=r*Number(this.total);this.percent=String(i),this.updateUI(r),this.change()};progressDotMouseDown=e=>{this.moveProgress.mouseDown=!0,e.stopPropagation()};progressDotMouseMove=e=>{if(!this.moveProgress.mouseDown)return;let t=this._progress.getBoundingClientRect(),n=e.clientX-t.left,r=Math.min(1,Math.max(0,n/this._progress.offsetWidth)),i=r*Number(this.total);this.percent=String(i),this.updateUI(r),this.change()};progressDotMouseUp=()=>{this.moveProgress.mouseDown=!1};updateUI=e=>{this.style.setProperty(`--progress-percent`,String(e))};_preSerialize(){let e=Number(this.getAttribute(`percent`)||`0`),t=Number(this.getAttribute(`total`)||`100`),n=Math.min(1,Math.max(0,e/t));this.style.setProperty(`--progress-percent`,String(n))}change=()=>{this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.percent,percent:this.percent,total:this.total}}))};appendProgressDot=()=>{if(!this._progress||!this._progressDot)return;let e=this.dot===`true`&&this.type===`drag`;e&&!this._progress.contains(this._progressDot)&&this._progress.appendChild(this._progressDot),!e&&this._progress.contains(this._progressDot)&&this._progress.removeChild(this._progressDot)};updateCurrentProgress=()=>{if(!this._progress)return;let e=Number(this.total)||100,t=Number(this.percent)/e;this.updateUI(t)};dragEvent=()=>{this.type===`drag`&&this._events.on(this._progress,`click`,this.progressClick).on(this._progressDot,`mousedown`,this.progressDotMouseDown).on(document,`mousemove`,this.progressDotMouseMove).on(document,`mouseup`,this.progressDotMouseUp)};resize=()=>{this.updateCurrentProgress()};connectedCallback(){this.handlerExternalCss(),this.hasAttribute(`type`)||this.setAttribute(`type`,`primary`),this.dragEvent(),this.updateCurrentProgress(),this.appendProgressDot(),this._events.on(window,`resize`,this.resize)}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&((e===`dot`||e===`type`)&&this.appendProgressDot(),(e===`percent`||e===`total`)&&this.updateCurrentProgress(),e===`sheet`&&this.handlerExternalCss())}};return ge(`r-progress`,$),e.Progress=$,e.default=$,e})({});
|
package/dist/iife/radar.iife.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var ranui_radar=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=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}},n=(e=8)=>Math.random().toString(36).substring(2,e+2),r=e=>typeof e==`function`,i=typeof window<`u`,a=e=>{let t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||1;return(i&&window.devicePixelRatio||1)/t},o=12e4,s=`__ranuts_bridge__`,c=`default`,l=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)}},u=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,r=c){this.targetOrigin=t,this.channel=r,this.senderId=n(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,l.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:s,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:i,id:a,isResponse:o,isError:s,senderId:c}=t;if(o&&a){let e=this.pendingRequests.get(a);e&&(s?e.reject(Error(typeof i==`string`?i:`Bridge request failed`)):e.resolve(i),this.pendingRequests.delete(a));return}if(c&&c===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let l=this.messageHandlers.get(n);if(r(l)){let t=e.source??this.targetWindow;Promise.resolve(l(i)).then(e=>{a&&this.post(t,{type:n,payload:e,id:a,isResponse:!0})}).catch(e=>{a&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:a,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 r=n(10);return new Promise((n,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(r)&&(this.pendingRequests.delete(r),i(Error(`Request timeout`)))},o),s=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(r,{resolve:e=>{clearTimeout(a),n(e)},reject:s});try{this.post(this.targetWindow,{type:e,payload:t,id:r})}catch(e){this.pendingRequests.delete(r),s(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=()=>{l.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:r,channel:i})=>{let a=new u(r,t,i);if(e||=n(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,a),{bridge:a,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 t;var d=[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],f=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new f(d[0],3609767458),new f(d[1],602891725),new f(d[2],3964484399),new f(d[3],2173295548),new f(d[4],4081628472),new f(d[5],3053834265),new f(d[6],2937671579),new f(d[7],3664609560),new f(d[8],2734883394),new f(d[9],1164996542),new f(d[10],1323610764),new f(d[11],3590304994),new f(d[12],4068182383),new f(d[13],991336113),new f(d[14],633803317),new f(d[15],3479774868),new f(d[16],2666613458),new f(d[17],944711139),new f(d[18],2341262773),new f(d[19],2007800933),new f(d[20],1495990901),new f(d[21],1856431235),new f(d[22],3175218132),new f(d[23],2198950837),new f(d[24],3999719339),new f(d[25],766784016),new f(d[26],2566594879),new f(d[27],3203337956),new f(d[28],1034457026),new f(d[29],2466948901),new f(d[30],3758326383),new f(d[31],168717936),new f(d[32],1188179964),new f(d[33],1546045734),new f(d[34],1522805485),new f(d[35],2643833823),new f(d[36],2343527390),new f(d[37],1014477480),new f(d[38],1206759142),new f(d[39],344077627),new f(d[40],1290863460),new f(d[41],3158454273),new f(d[42],3505952657),new f(d[43],106217008),new f(d[44],3606008344),new f(d[45],1432725776),new f(d[46],1467031594),new f(d[47],851169720),new f(d[48],3100823752),new f(d[49],1363258195),new f(d[50],3750685593),new f(d[51],3785050280),new f(d[52],3318307427),new f(d[53],3812723403),new f(d[54],2003034995),new f(d[55],3602036899),new f(d[56],1575990012),new f(d[57],1125592928),new f(d[58],2716904306),new f(d[59],442776044),new f(d[60],593698344),new f(d[61],3733110249),new f(d[62],2999351573),new f(d[63],3815920427),new f(3391569614,3928383900),new f(3515267271,566280711),new f(3940187606,3454069534),new f(4118630271,4000239992),new f(116418474,1914138554),new f(174292421,2731055270),new f(289380356,3203993006),new f(460393269,320620315),new f(685471733,587496836),new f(852142971,1086792851),new f(1017036298,365543100),new f(1126000580,2618297676),new f(1288033470,3409855158),new f(1501505948,4234509866),new f(1607167915,987167468),new f(1816402316,1246189591),new f(0,1),new f(0,32898),new f(2147483648,32906),new f(2147483648,2147516416),new f(0,32907),new f(0,2147483649),new f(2147483648,2147516545),new f(2147483648,32777),new f(0,138),new f(0,136),new f(0,2147516425),new f(0,2147483658),new f(0,2147516555),new f(2147483648,139),new f(2147483648,32905),new f(2147483648,32771),new f(2147483648,32770),new f(2147483648,128),new f(0,32778),new f(2147483648,2147483658),new f(2147483648,2147516545),new f(2147483648,32896),new f(0,2147483649),new f(2147483648,2147516424);var p=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})(p),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(p);var m=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{--ran-radar-polygon-color:var(--ran-color-border,#e6e6e6);--ran-radar-line-color:var(--ran-color-border,#e6e6e6);--ran-radar-fill-color:#ff792399;--ran-radar-stroke-color:#ff792399}.ran-radar{position:var(--ran-radar-position,relative);width:var(--ran-radar-width,100%);height:var(--ran-radar-height,100%);display:var(--ran-radar-display,block)}.ran-radar canvas{width:100%;height:100%}`,h=typeof document>`u`,g=0,_=1,v=2,y=null,b=null,ee=new Set;function x(e){let t=S(e,!0);return C(t),T(t),()=>D(t)}function S(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:v,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:b}}function C(e){b&&b.owned.push(e)}function w(e,t){if(e.disposed||e.state>=t)return;let n=e.state===g;if(e.state=t,e.isEffect)ee.add(e);else if(n)for(let t of e.observers)w(t,_)}function T(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);E(e);let t=y,n=b;y=e,b=e,e.running=!0,e.state=g;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)w(t,v)}}finally{e.running=!1,y=t,b=n}}function E(e){for(let t of e.owned)D(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 D(e){e.disposed||(e.disposed=!0,E(e),e.observers.clear())}function O(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function k(e){return O(e)}var te=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,ne=(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()},A=(e,t,n)=>{for(let r of e)te(r)&&(ne(r,t)&&n.push(r),A(r.childrenList,t,n))},j=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?O(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return A(this.childrenList,e,t),t}},M=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 j)}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 re(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return A(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}="${k(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${k(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`?O(e):(e instanceof j,e.serialize())).join(``):a+=O(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}>`}},re=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 A(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${O(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?O(e):(e instanceof j,e.serialize())).join(``)}</template>`}},N=class e{el;constructor(e){this.el=h?new M(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?x(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{h?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(...t){let n=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(n(t)):e.concat(t),[]);return n(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?h?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),this}replaceChildren(...e){if(h){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 ie(this.el,t,e)}build(){return this.el}serialize(){if(h)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},ie=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof N?this.root.appendChild(e.build()):typeof e==`string`?h?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(h)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 h?this.root.serialize():this.root.innerHTML}},P=e=>new N(e),F=()=>P(`div`),I=new Map;function L(e,t){h?(I.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var R=typeof document<`u`?HTMLElement:M,z=new Map,B=new Map,V=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!z.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),z.set(t,e)}let n=z.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},H=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!B.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),B.set(t,e)}let n=B.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},U=new WeakMap,W=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,G=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||U.get(e)||e.attachShadow(n);return U.set(e,r),V(r,t?`${t}\n${W}`:W),r},K=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},q=(e,t,n=``)=>e.getAttribute(t)??n,J=(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&&H(t,a)},oe=`rgba(0,0,0,0)`,se=`rgba(0,0,0,1)`,Y=`#e6e6e6`,X=`#e6e6e6`,ce=`黑体`,Z=`rgba(255,121,35,0.60)`,Q=`rgba(255,121,35,0.60)`,$=class extends R{mData;mCount;mW;mCenter;mRadius;mAngle;static get observedAttributes(){return[`abilitys`,`colorpolygon`,`colorline`,`fillcolor`,`strokecolor`,`sheet`]}abilityRadarChartContainer;abilityRadarChart;_iconElement;_shadowDom;resizeObserver;constructor(){super(),this._shadowDom=G(this,m);let e=K(this._shadowDom,`.ran-radar`,()=>F().class(`ran-radar`).children(P(`canvas`).build()).build()),t=e.querySelector(`canvas`);this.abilityRadarChartContainer=e,this.abilityRadarChart=t,this.resizeObserver=new ResizeObserver(this.resize),this.resizeObserver.observe(this.abilityRadarChartContainer)}resize=()=>{this.refreshData()};get abilitys(){let e=this.getAttribute(`abilitys`);if(typeof e==`string`)try{return JSON.parse(e)}catch(t){return console.error(`Failed to parse the rule in JSON.parse: ${e}, error: ${t}`),e}return e}set abilitys(e){typeof e==`string`?this.setAttribute(`abilitys`,e||``):this.setAttribute(`abilitys`,JSON.stringify(e)||``)}_cssVar(e){return typeof getComputedStyle>`u`?``:getComputedStyle(this).getPropertyValue(e).trim()}get colorPolygon(){return this.getAttribute(`colorPolygon`)||this._cssVar(`--ran-radar-polygon-color`)||Y}set colorPolygon(e){this.setAttribute(`colorPolygon`,e||Y)}get colorLine(){return this.getAttribute(`colorLine`)||this._cssVar(`--ran-radar-line-color`)||X}set colorLine(e){this.setAttribute(`colorLine`,e||X)}get fontColor(){return this._cssVar(`--ran-color-text`)||se}get fillColor(){return this.getAttribute(`fillColor`)||this._cssVar(`--ran-radar-fill-color`)||Z}set fillColor(e){this.setAttribute(`fillColor`,e||Z)}get strokeColor(){return this.getAttribute(`strokeColor`)||this._cssVar(`--ran-radar-stroke-color`)||Q}set strokeColor(e){this.setAttribute(`strokeColor`,e||Q)}get sheet(){return q(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}handlerExternalCss=()=>{ae(this,this._shadowDom,`sheet`,null,this.sheet)};refreshData(){let e=this.abilityRadarChart.getContext(`2d`);if(!this.abilityRadarChartContainer||!e)return;let t=a(e),n=this.abilityRadarChartContainer.clientWidth*t,r=this.abilityRadarChartContainer.clientHeight*t;this.abilityRadarChart.width=n,this.abilityRadarChart.height=r,this.mW=n,this.mData=this.abilitys,this.mCount=this.mData?.length||1,this.mCenter=this.mW/2,this.mRadius=this.mCenter-50*t,this.mAngle=Math.PI*2/this.mCount,this.drawPolygon(e),this.drawSide(e),this.drawLines(e),this.drawText(e),this.drawRegion(e),this.drawCircle(e)}drawSide(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)return;e.save(),e.strokeStyle=this.colorLine;let t=this.mRadius;for(let n=0;n<this.mCount;n++){let r=this.mCenter+t*Math.sin(this.mAngle*n),i=this.mCenter+t*Math.cos(this.mAngle*n);e.lineTo(r,i)}e.closePath(),e.stroke()}drawPolygon(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)return;e.save(),e.strokeStyle=this.colorPolygon;let t=this.mRadius/4;e.setLineDash([6,6]);for(let n=0;n<4;n++){e.beginPath();let r=t*(n+1);for(let t=0;t<this.mCount;t++){let n=this.mCenter+r*Math.sin(this.mAngle*t),i=this.mCenter+r*Math.cos(this.mAngle*t);e.lineTo(n,i)}e.closePath(),e.stroke()}e.restore()}drawLines(e){if(!(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)){e.save(),e.beginPath(),e.strokeStyle=this.colorLine;for(let t=0;t<this.mCount;t++){let n=this.mCenter+this.mRadius*Math.sin(this.mAngle*t),r=this.mCenter+this.mRadius*Math.cos(this.mAngle*t);e.moveTo(this.mCenter,this.mCenter),e.lineTo(n,r)}e.stroke(),e.restore()}}drawText(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;e.save();let t=a(e),n=this.mCenter/12;for(let r=0;r<this.mCount;r++){let i=this.mCenter+this.mRadius*Math.sin(this.mAngle*r),a=this.mCenter+this.mRadius*Math.cos(this.mAngle*r),o=this.mData[r]?.backgroundColor||oe,s=this.mData[r]?.fontColor||this.fontColor,c=this.mData[r]?.fontFamily||ce,l=this.mData[r]?.fontSize||n;e.font=`${l}px ${c}`,this.mAngle*r>=0&&this.mAngle*r<Math.PI/2?this.drawButton(e,o,i,a,44*t,24*t,12*t,this.mData[r].abilityName,s,c,l):this.mAngle*r>=Math.PI/2&&this.mAngle*r<Math.PI?this.drawButton(e,o,i,a-24*t,44*t,24*t,12*t,this.mData[r].abilityName,s,c,l):this.mAngle*r>=Math.PI&&this.mAngle*r<Math.PI*3/2?this.drawButton(e,o,i-44*t,a-24*t,44*t,24*t,12*t,this.mData[r].abilityName,s,c,l):this.drawButton(e,o,i-44*t,a,44*t,24*t,12*t,this.mData[r].abilityName,s,c,l)}e.restore()}drawButton(e,t,n,r,i,o,s,c,l,u,d){e.beginPath();let f=a(e);e.fillStyle=t,e.moveTo(n+s,r),e.lineTo(n+i-s,r),e.arc(n+i-s,r+s,s,Math.PI*3/2,Math.PI*2),e.lineTo(n+i,r+o-s),e.arc(n+i-s,r+o-s,s,Math.PI,Math.PI/2),e.lineTo(n+s,r+o),e.arc(n+s,r+o-s,s,Math.PI/2,Math.PI),e.lineTo(n,r+s),e.arc(n+s,r+s,s,Math.PI,Math.PI*3/2),e.fill(),e.closePath(),e.beginPath(),e.fillStyle=l,e.font=`${d||12*f}px ${u}`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(c,n+i/2,r+o/2)}drawRegion(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;let t=a(e);e.save(),e.beginPath();for(let t=0;t<this.mCount;t++){let n=this.mCenter+this.mRadius*Math.sin(this.mAngle*t)*this.mData[t].scoreRate/100,r=this.mCenter+this.mRadius*Math.cos(this.mAngle*t)*this.mData[t].scoreRate/100;e.lineTo(n,r)}e.closePath(),e.fillStyle=this.fillColor,e.fill(),e.strokeStyle=this.strokeColor,e.lineWidth=1*t,e.stroke(),e.restore()}drawCircle(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;let t=a(e);e.save();for(let n=0;n<this.mCount;n++){let r=this.mCenter+this.mRadius*Math.sin(this.mAngle*n)*this.mData[n].scoreRate/100,i=this.mCenter+this.mRadius*Math.cos(this.mAngle*n)*this.mData[n].scoreRate/100;e.beginPath(),e.arc(r,i,3,0,Math.PI*2),e.lineWidth=1.5*t,e.strokeStyle=this.strokeColor,e.stroke()}e.restore()}connectedCallback(){this.handlerExternalCss(),this.refreshData()}disconnectedCallback(){this.resizeObserver.disconnect()}attributeChangedCallback(e,t,n){t!==n&&([`abilitys`,`colorpolygon`,`colorline`,`fillcolor`,`strokecolor`].includes(e)&&this.abilityRadarChartContainer&&this.refreshData(),e===`sheet`&&this.handlerExternalCss())}};return L(`r-radar`,$),e.RadarChart=$,e.default=$,e})({});
|
|
1
|
+
var ranui_radar=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=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}},n=(e=8)=>Math.random().toString(36).substring(2,e+2),r=e=>typeof e==`function`,i=typeof window<`u`,a=e=>{let t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||1;return(i&&window.devicePixelRatio||1)/t},o=12e4,s=`__ranuts_bridge__`,c=`default`,l=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)}},u=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,r=c){this.targetOrigin=t,this.channel=r,this.senderId=n(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,l.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:s,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:i,id:a,isResponse:o,isError:s,senderId:c}=t;if(o&&a){let e=this.pendingRequests.get(a);e&&(s?e.reject(Error(typeof i==`string`?i:`Bridge request failed`)):e.resolve(i),this.pendingRequests.delete(a));return}if(c&&c===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let l=this.messageHandlers.get(n);if(r(l)){let t=e.source??this.targetWindow;Promise.resolve(l(i)).then(e=>{a&&this.post(t,{type:n,payload:e,id:a,isResponse:!0})}).catch(e=>{a&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:a,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 r=n(10);return new Promise((n,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(r)&&(this.pendingRequests.delete(r),i(Error(`Request timeout`)))},o),s=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(r,{resolve:e=>{clearTimeout(a),n(e)},reject:s});try{this.post(this.targetWindow,{type:e,payload:t,id:r})}catch(e){this.pendingRequests.delete(r),s(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=()=>{l.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:r,channel:i})=>{let a=new u(r,t,i);if(e||=n(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,a),{bridge:a,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 t;var d=[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],f=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new f(d[0],3609767458),new f(d[1],602891725),new f(d[2],3964484399),new f(d[3],2173295548),new f(d[4],4081628472),new f(d[5],3053834265),new f(d[6],2937671579),new f(d[7],3664609560),new f(d[8],2734883394),new f(d[9],1164996542),new f(d[10],1323610764),new f(d[11],3590304994),new f(d[12],4068182383),new f(d[13],991336113),new f(d[14],633803317),new f(d[15],3479774868),new f(d[16],2666613458),new f(d[17],944711139),new f(d[18],2341262773),new f(d[19],2007800933),new f(d[20],1495990901),new f(d[21],1856431235),new f(d[22],3175218132),new f(d[23],2198950837),new f(d[24],3999719339),new f(d[25],766784016),new f(d[26],2566594879),new f(d[27],3203337956),new f(d[28],1034457026),new f(d[29],2466948901),new f(d[30],3758326383),new f(d[31],168717936),new f(d[32],1188179964),new f(d[33],1546045734),new f(d[34],1522805485),new f(d[35],2643833823),new f(d[36],2343527390),new f(d[37],1014477480),new f(d[38],1206759142),new f(d[39],344077627),new f(d[40],1290863460),new f(d[41],3158454273),new f(d[42],3505952657),new f(d[43],106217008),new f(d[44],3606008344),new f(d[45],1432725776),new f(d[46],1467031594),new f(d[47],851169720),new f(d[48],3100823752),new f(d[49],1363258195),new f(d[50],3750685593),new f(d[51],3785050280),new f(d[52],3318307427),new f(d[53],3812723403),new f(d[54],2003034995),new f(d[55],3602036899),new f(d[56],1575990012),new f(d[57],1125592928),new f(d[58],2716904306),new f(d[59],442776044),new f(d[60],593698344),new f(d[61],3733110249),new f(d[62],2999351573),new f(d[63],3815920427),new f(3391569614,3928383900),new f(3515267271,566280711),new f(3940187606,3454069534),new f(4118630271,4000239992),new f(116418474,1914138554),new f(174292421,2731055270),new f(289380356,3203993006),new f(460393269,320620315),new f(685471733,587496836),new f(852142971,1086792851),new f(1017036298,365543100),new f(1126000580,2618297676),new f(1288033470,3409855158),new f(1501505948,4234509866),new f(1607167915,987167468),new f(1816402316,1246189591),new f(0,1),new f(0,32898),new f(2147483648,32906),new f(2147483648,2147516416),new f(0,32907),new f(0,2147483649),new f(2147483648,2147516545),new f(2147483648,32777),new f(0,138),new f(0,136),new f(0,2147516425),new f(0,2147483658),new f(0,2147516555),new f(2147483648,139),new f(2147483648,32905),new f(2147483648,32771),new f(2147483648,32770),new f(2147483648,128),new f(0,32778),new f(2147483648,2147483658),new f(2147483648,2147516545),new f(2147483648,32896),new f(0,2147483649),new f(2147483648,2147516424);var p=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})(p),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(p);var ee=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{--ran-radar-polygon-color:var(--ran-color-border,#e6e6e6);--ran-radar-line-color:var(--ran-color-border,#e6e6e6);--ran-radar-fill-color:#ff792399;--ran-radar-stroke-color:#ff792399}.ran-radar{position:var(--ran-radar-position,relative);width:var(--ran-radar-width,100%);height:var(--ran-radar-height,100%);display:var(--ran-radar-display,block)}.ran-radar canvas{width:100%;height:100%}`,m=typeof document>`u`,h=0,g=1,_=2,v=null,y=null,b=0,x=new Set,S=!1;function C(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(re(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)D(e,_);b===0&&ie()}}]}function w(e){let t=te(e,!0);return ne(t),k(t),()=>j(t)}function T(e){let t={owned:[],cleanups:[],owner:y},n=y,r=v;y=t,v=null;try{return e(()=>ae(t))}finally{y=n,v=r}}function E(e){y&&y.cleanups.push(e)}function te(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:_,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:y}}function ne(e){y&&y.owned.push(e)}function re(e){v&&(v.sources.add(e),e.observers.add(v))}function D(e,t){if(e.disposed||e.state>=t)return;let n=e.state===h;if(e.state=t,e.isEffect)x.add(e);else if(n)for(let t of e.observers)D(t,g)}function ie(){if(!(b>0||S)){S=!0;try{for(;x.size>0;){let e=[...x];x.clear();for(let t of e)t.disposed||O(t)}}finally{S=!1}}}function O(e){if(!(e.disposed||e.state===h)){if(e.state===g)for(let t of e.sources)`fn`in t&&O(t);e.state===_&&k(e),e.state=h}}function k(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);A(e);let t=v,n=y;v=e,y=e,e.running=!0,e.state=h;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)D(t,_)}}finally{e.running=!1,v=t,y=n}}function A(e){for(let t of e.owned)j(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 j(e){e.disposed||(e.disposed=!0,A(e),e.observers.clear())}function ae(e){for(let t of e.owned)j(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function M(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function N(e){return M(e)}var oe=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,se=(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()},P=(e,t,n)=>{for(let r of e)oe(r)&&(se(r,t)&&n.push(r),P(r.childrenList,t,n))},F=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 P(this.childrenList,e,t),t}},I=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 F)}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 ce(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return P(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`?M(e):(e instanceof F,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}>`}},ce=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 P(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 F,e.serialize())).join(``)}</template>`}},L=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(L(t)):e.concat(t),[]),R=e=>e==null?null:e instanceof H?e.build():typeof e==`string`?m?e:document.createTextNode(e):e,le=(e,t)=>{if(m){V(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let i=null,a=()=>{i?.(),i=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};w(()=>{let e=t();a();let n=document.createDocumentFragment();i=T(t=>(V(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),E(()=>i?.())},ue=`__ranFor`,de=e=>typeof e==`object`&&!!e&&e[ue]===!0,fe=(e,t,n)=>{let[r,i]=C(t),a=null,o=T(t=>{let i=R(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},z=(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},B=(e,t)=>{if(m){(t.each()??[]).forEach((n,r)=>{let i=R(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;E(()=>{for(let e of r.values())e.dispose();r.clear()}),w(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o))return;let s=r.get(o);s?(r.delete(o),s.index(n)):s=fe(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();z(n,a),r=i})},pe=`__ranIndex`,me=e=>typeof e==`object`&&!!e&&e[pe]===!0,he=(e,t,n)=>{let[r,i]=C(e),a=null,o=T(e=>{let i=R(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},ge=(e,t)=>{if(m){(t.each()??[]).forEach((n,r)=>{let i=R(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];E(()=>{for(let e of r)e.dispose();r=[]}),w(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<r.length?r[n].setItem(e[n]):r.push(he(e[n],n,t.render));for(let t=r.length-1;t>=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}z(n,r.map(e=>e.node).filter(e=>e!=null))})},V=(e,t)=>{L(t).forEach(t=>{if(de(t)){B(e,t);return}if(me(t)){ge(e,t);return}if(typeof t==`function`){le(e,t);return}let n=R(t);n!=null&&e.appendChild(n)})},H=class{el;constructor(e){this.el=m?new I(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?w(()=>t(e())):t(e)}class(e){return this.bind(e,e=>{m?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 V(this.el,e),this}replaceChildren(...e){if(m){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 _e(this.el,t,e)}build(){return this.el}serialize(){if(m)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},_e=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return V(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(m)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 m?this.root.serialize():this.root.innerHTML}},U=e=>new H(e),ve=()=>U(`div`),ye=new Map;function be(e,t){m?(ye.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var xe=typeof document<`u`?HTMLElement:I,W=new Map,G=new Map,Se=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!W.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),W.set(t,e)}let n=W.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},Ce=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!G.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),G.set(t,e)}let n=G.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},K=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}}`,we=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||K.get(e)||e.attachShadow(n);return K.set(e,r),Se(r,t?`${t}\n${q}`:q),r},Te=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},Ee=(e,t,n=``)=>e.getAttribute(t)??n,J=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},De=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&Ce(t,a)},Oe=`rgba(0,0,0,0)`,ke=`rgba(0,0,0,1)`,Y=`#e6e6e6`,X=`#e6e6e6`,Ae=`黑体`,Z=`rgba(255,121,35,0.60)`,Q=`rgba(255,121,35,0.60)`,$=class extends xe{mData;mCount;mW;mCenter;mRadius;mAngle;static get observedAttributes(){return[`abilitys`,`colorpolygon`,`colorline`,`fillcolor`,`strokecolor`,`sheet`]}abilityRadarChartContainer;abilityRadarChart;_iconElement;_shadowDom;resizeObserver;constructor(){super(),this._shadowDom=we(this,ee);let e=Te(this._shadowDom,`.ran-radar`,()=>ve().class(`ran-radar`).children(U(`canvas`).build()).build()),t=e.querySelector(`canvas`);this.abilityRadarChartContainer=e,this.abilityRadarChart=t,this.resizeObserver=new ResizeObserver(this.resize),this.resizeObserver.observe(this.abilityRadarChartContainer)}resize=()=>{this.refreshData()};get abilitys(){let e=this.getAttribute(`abilitys`);if(typeof e==`string`)try{return JSON.parse(e)}catch(t){return console.error(`Failed to parse the rule in JSON.parse: ${e}, error: ${t}`),e}return e}set abilitys(e){typeof e==`string`?this.setAttribute(`abilitys`,e||``):this.setAttribute(`abilitys`,JSON.stringify(e)||``)}_cssVar(e){return typeof getComputedStyle>`u`?``:getComputedStyle(this).getPropertyValue(e).trim()}get colorPolygon(){return this.getAttribute(`colorPolygon`)||this._cssVar(`--ran-radar-polygon-color`)||Y}set colorPolygon(e){this.setAttribute(`colorPolygon`,e||Y)}get colorLine(){return this.getAttribute(`colorLine`)||this._cssVar(`--ran-radar-line-color`)||X}set colorLine(e){this.setAttribute(`colorLine`,e||X)}get fontColor(){return this._cssVar(`--ran-color-text`)||ke}get fillColor(){return this.getAttribute(`fillColor`)||this._cssVar(`--ran-radar-fill-color`)||Z}set fillColor(e){this.setAttribute(`fillColor`,e||Z)}get strokeColor(){return this.getAttribute(`strokeColor`)||this._cssVar(`--ran-radar-stroke-color`)||Q}set strokeColor(e){this.setAttribute(`strokeColor`,e||Q)}get sheet(){return Ee(this,`sheet`)}set sheet(e){J(this,`sheet`,e)}handlerExternalCss=()=>{De(this,this._shadowDom,`sheet`,null,this.sheet)};refreshData(){let e=this.abilityRadarChart.getContext(`2d`);if(!this.abilityRadarChartContainer||!e)return;let t=a(e),n=this.abilityRadarChartContainer.clientWidth*t,r=this.abilityRadarChartContainer.clientHeight*t;this.abilityRadarChart.width=n,this.abilityRadarChart.height=r,this.mW=n,this.mData=this.abilitys,this.mCount=this.mData?.length||1,this.mCenter=this.mW/2,this.mRadius=this.mCenter-50*t,this.mAngle=Math.PI*2/this.mCount,this.drawPolygon(e),this.drawSide(e),this.drawLines(e),this.drawText(e),this.drawRegion(e),this.drawCircle(e)}drawSide(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)return;e.save(),e.strokeStyle=this.colorLine;let t=this.mRadius;for(let n=0;n<this.mCount;n++){let r=this.mCenter+t*Math.sin(this.mAngle*n),i=this.mCenter+t*Math.cos(this.mAngle*n);e.lineTo(r,i)}e.closePath(),e.stroke()}drawPolygon(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)return;e.save(),e.strokeStyle=this.colorPolygon;let t=this.mRadius/4;e.setLineDash([6,6]);for(let n=0;n<4;n++){e.beginPath();let r=t*(n+1);for(let t=0;t<this.mCount;t++){let n=this.mCenter+r*Math.sin(this.mAngle*t),i=this.mCenter+r*Math.cos(this.mAngle*t);e.lineTo(n,i)}e.closePath(),e.stroke()}e.restore()}drawLines(e){if(!(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)){e.save(),e.beginPath(),e.strokeStyle=this.colorLine;for(let t=0;t<this.mCount;t++){let n=this.mCenter+this.mRadius*Math.sin(this.mAngle*t),r=this.mCenter+this.mRadius*Math.cos(this.mAngle*t);e.moveTo(this.mCenter,this.mCenter),e.lineTo(n,r)}e.stroke(),e.restore()}}drawText(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;e.save();let t=a(e),n=this.mCenter/12;for(let r=0;r<this.mCount;r++){let i=this.mCenter+this.mRadius*Math.sin(this.mAngle*r),a=this.mCenter+this.mRadius*Math.cos(this.mAngle*r),o=this.mData[r]?.backgroundColor||Oe,s=this.mData[r]?.fontColor||this.fontColor,c=this.mData[r]?.fontFamily||Ae,l=this.mData[r]?.fontSize||n;e.font=`${l}px ${c}`,this.mAngle*r>=0&&this.mAngle*r<Math.PI/2?this.drawButton(e,o,i,a,44*t,24*t,12*t,this.mData[r].abilityName,s,c,l):this.mAngle*r>=Math.PI/2&&this.mAngle*r<Math.PI?this.drawButton(e,o,i,a-24*t,44*t,24*t,12*t,this.mData[r].abilityName,s,c,l):this.mAngle*r>=Math.PI&&this.mAngle*r<Math.PI*3/2?this.drawButton(e,o,i-44*t,a-24*t,44*t,24*t,12*t,this.mData[r].abilityName,s,c,l):this.drawButton(e,o,i-44*t,a,44*t,24*t,12*t,this.mData[r].abilityName,s,c,l)}e.restore()}drawButton(e,t,n,r,i,o,s,c,l,u,d){e.beginPath();let f=a(e);e.fillStyle=t,e.moveTo(n+s,r),e.lineTo(n+i-s,r),e.arc(n+i-s,r+s,s,Math.PI*3/2,Math.PI*2),e.lineTo(n+i,r+o-s),e.arc(n+i-s,r+o-s,s,Math.PI,Math.PI/2),e.lineTo(n+s,r+o),e.arc(n+s,r+o-s,s,Math.PI/2,Math.PI),e.lineTo(n,r+s),e.arc(n+s,r+s,s,Math.PI,Math.PI*3/2),e.fill(),e.closePath(),e.beginPath(),e.fillStyle=l,e.font=`${d||12*f}px ${u}`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(c,n+i/2,r+o/2)}drawRegion(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;let t=a(e);e.save(),e.beginPath();for(let t=0;t<this.mCount;t++){let n=this.mCenter+this.mRadius*Math.sin(this.mAngle*t)*this.mData[t].scoreRate/100,r=this.mCenter+this.mRadius*Math.cos(this.mAngle*t)*this.mData[t].scoreRate/100;e.lineTo(n,r)}e.closePath(),e.fillStyle=this.fillColor,e.fill(),e.strokeStyle=this.strokeColor,e.lineWidth=1*t,e.stroke(),e.restore()}drawCircle(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;let t=a(e);e.save();for(let n=0;n<this.mCount;n++){let r=this.mCenter+this.mRadius*Math.sin(this.mAngle*n)*this.mData[n].scoreRate/100,i=this.mCenter+this.mRadius*Math.cos(this.mAngle*n)*this.mData[n].scoreRate/100;e.beginPath(),e.arc(r,i,3,0,Math.PI*2),e.lineWidth=1.5*t,e.strokeStyle=this.strokeColor,e.stroke()}e.restore()}connectedCallback(){this.handlerExternalCss(),this.refreshData()}disconnectedCallback(){this.resizeObserver.disconnect()}attributeChangedCallback(e,t,n){t!==n&&([`abilitys`,`colorpolygon`,`colorline`,`fillcolor`,`strokecolor`].includes(e)&&this.abilityRadarChartContainer&&this.refreshData(),e===`sheet`&&this.handlerExternalCss())}};return be(`r-radar`,$),e.RadarChart=$,e.default=$,e})({});
|
package/dist/iife/route.iife.js
CHANGED
|
@@ -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=new Set;function ee(e){let t=f(e,!0);return p(t),h(t),()=>_(t)}function u(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 d(e){c&&c.cleanups.push(e)}function f(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 p(e){c&&c.owned.push(e)}function m(e,t){if(e.disposed||e.state>=t)return;let n=e.state===i;if(e.state=t,e.isEffect)l.add(e);else if(n)for(let t of e.observers)m(t,a)}function h(e){if(e.running)throw Error(`ranui reactivity: cyclic dependency detected (a computation triggered itself).`);g(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)m(t,o)}}finally{e.running=!1,s=t,c=n}}function g(e){for(let t of e.owned)_(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 _(e){e.disposed||(e.disposed=!0,g(e),e.observers.clear())}function te(e){for(let t of e.owned)_(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function v(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function y(e){return v(e)}var b=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,x=(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()},S=(e,t,n)=>{for(let r of e)b(r)&&(x(r,t)&&n.push(r),S(r.childrenList,t,n))},C=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?v(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return S(this.childrenList,e,t),t}},w=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 C)}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 T(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return S(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}="${y(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${y(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`?v(e):(e instanceof C,e.serialize())).join(``):a+=v(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}>`}},T=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 S(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${v(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?v(e):(e instanceof C,e.serialize())).join(``)}</template>`}},E=class e{el;constructor(e){this.el=n?new w(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){typeof e==`function`?ee(()=>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(...t){let r=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(r(t)):e.concat(t),[]);return r(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?n?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),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 D(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}},D=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof E?this.root.appendChild(e.build()):typeof e==`string`?n?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(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}},ne=e=>new E(e),O=()=>ne(`slot`),k=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}},A=(e=8)=>Math.random().toString(36).substring(2,e+2),j=e=>typeof e==`function`,M=12e4,N=`__ranuts_bridge__`,P=`default`,F=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)}},I=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=P){this.targetOrigin=t,this.channel=n,this.senderId=A(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,F.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:N,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(j(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=A(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},M),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=()=>{F.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 I(n,t,r);if(e||=A(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 k;var L=[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],R=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new R(L[0],3609767458),new R(L[1],602891725),new R(L[2],3964484399),new R(L[3],2173295548),new R(L[4],4081628472),new R(L[5],3053834265),new R(L[6],2937671579),new R(L[7],3664609560),new R(L[8],2734883394),new R(L[9],1164996542),new R(L[10],1323610764),new R(L[11],3590304994),new R(L[12],4068182383),new R(L[13],991336113),new R(L[14],633803317),new R(L[15],3479774868),new R(L[16],2666613458),new R(L[17],944711139),new R(L[18],2341262773),new R(L[19],2007800933),new R(L[20],1495990901),new R(L[21],1856431235),new R(L[22],3175218132),new R(L[23],2198950837),new R(L[24],3999719339),new R(L[25],766784016),new R(L[26],2566594879),new R(L[27],3203337956),new R(L[28],1034457026),new R(L[29],2466948901),new R(L[30],3758326383),new R(L[31],168717936),new R(L[32],1188179964),new R(L[33],1546045734),new R(L[34],1522805485),new R(L[35],2643833823),new R(L[36],2343527390),new R(L[37],1014477480),new R(L[38],1206759142),new R(L[39],344077627),new R(L[40],1290863460),new R(L[41],3158454273),new R(L[42],3505952657),new R(L[43],106217008),new R(L[44],3606008344),new R(L[45],1432725776),new R(L[46],1467031594),new R(L[47],851169720),new R(L[48],3100823752),new R(L[49],1363258195),new R(L[50],3750685593),new R(L[51],3785050280),new R(L[52],3318307427),new R(L[53],3812723403),new R(L[54],2003034995),new R(L[55],3602036899),new R(L[56],1575990012),new R(L[57],1125592928),new R(L[58],2716904306),new R(L[59],442776044),new R(L[60],593698344),new R(L[61],3733110249),new R(L[62],2999351573),new R(L[63],3815920427),new R(3391569614,3928383900),new R(3515267271,566280711),new R(3940187606,3454069534),new R(4118630271,4000239992),new R(116418474,1914138554),new R(174292421,2731055270),new R(289380356,3203993006),new R(460393269,320620315),new R(685471733,587496836),new R(852142971,1086792851),new R(1017036298,365543100),new R(1126000580,2618297676),new R(1288033470,3409855158),new R(1501505948,4234509866),new R(1607167915,987167468),new R(1816402316,1246189591),new R(0,1),new R(0,32898),new R(2147483648,32906),new R(2147483648,2147516416),new R(0,32907),new R(0,2147483649),new R(2147483648,2147516545),new R(2147483648,32777),new R(0,138),new R(0,136),new R(0,2147516425),new R(0,2147483658),new R(0,2147516555),new R(2147483648,139),new R(2147483648,32905),new R(2147483648,32771),new R(2147483648,32770),new R(2147483648,128),new R(0,32778),new R(2147483648,2147483658),new R(2147483648,2147516545),new R(2147483648,32896),new R(0,2147483649),new R(2147483648,2147516424);var z=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})(z),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(z);var B=new Map;function V(e,t){n?(B.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var H=typeof document<`u`?HTMLElement:w,U=new Map,W=new Map,G=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!U.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),U.set(t,e)}let n=U.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},K=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!W.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),W.set(t,e)}let n=W.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},q=new WeakMap,J=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Y=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||q.get(e)||e.attachShadow(n);return q.set(e,r),G(r,t?`${t}\n${J}`:J),r},X=(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??``)},re=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&K(t,a)},ie=null;function ae(){return ie}function oe(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 H{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=Y(this,t),X(this._shadowDom,`slot`,()=>O().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=()=>{re(this,this._shadowDom,`sheet`,null,this.sheet)};_update(e){let{matched:t,params:r}=oe(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=u(e=>{let r=t(n);return typeof r==`function`&&d(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=ae();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 V(`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[()=>(te(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&&v()}}]}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 te(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 v(){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)_(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}function C(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function w(e){return C(e)}var re=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,ie=(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()},T=(e,t,n)=>{for(let r of e)re(r)&&(ie(r,t)&&n.push(r),T(r.childrenList,t,n))},E=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?C(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return T(this.childrenList,e,t),t}},D=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 E)}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 ae(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return T(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}="${w(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${w(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`?C(e):(e instanceof E,e.serialize())).join(``):a+=C(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}>`}},ae=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 T(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${C(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?C(e):(e instanceof E,e.serialize())).join(``)}</template>`}},O=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(O(t)):e.concat(t),[]),k=e=>e==null?null:e instanceof F?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,A=(e,t)=>{if(n){P(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=>(P(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),h(()=>a?.())},j=`__ranFor`,oe=e=>typeof e==`object`&&!!e&&e[j]===!0,se=(e,t,n)=>{let[r,i]=f(t),a=null,o=m(t=>{let i=k(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},M=(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},ce=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=k(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=se(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();M(r,a),i=n})},le=`__ranIndex`,ue=e=>typeof e==`object`&&!!e&&e[le]===!0,de=(e,t,n)=>{let[r,i]=f(e),a=null,o=m(e=>{let i=k(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},N=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=k(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(de(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()}M(r,i.map(e=>e.node).filter(e=>e!=null))})},P=(e,t)=>{O(t).forEach(t=>{if(oe(t)){ce(e,t);return}if(ue(t)){N(e,t);return}if(typeof t==`function`){A(e,t);return}let n=k(t);n!=null&&e.appendChild(n)})},F=class{el;constructor(e){this.el=n?new D(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 P(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 I(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}},I=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){return P(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}},L=e=>new F(e),R=()=>L(`slot`),z=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}},B=(e=8)=>Math.random().toString(36).substring(2,e+2),V=e=>typeof e==`function`,H=12e4,fe=`__ranuts_bridge__`,pe=`default`,U=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)}},me=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=pe){this.targetOrigin=t,this.channel=n,this.senderId=B(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,U.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:fe,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(V(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=B(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},H),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=()=>{U.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 me(n,t,r);if(e||=B(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 z;var W=[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],G=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new G(W[0],3609767458),new G(W[1],602891725),new G(W[2],3964484399),new G(W[3],2173295548),new G(W[4],4081628472),new G(W[5],3053834265),new G(W[6],2937671579),new G(W[7],3664609560),new G(W[8],2734883394),new G(W[9],1164996542),new G(W[10],1323610764),new G(W[11],3590304994),new G(W[12],4068182383),new G(W[13],991336113),new G(W[14],633803317),new G(W[15],3479774868),new G(W[16],2666613458),new G(W[17],944711139),new G(W[18],2341262773),new G(W[19],2007800933),new G(W[20],1495990901),new G(W[21],1856431235),new G(W[22],3175218132),new G(W[23],2198950837),new G(W[24],3999719339),new G(W[25],766784016),new G(W[26],2566594879),new G(W[27],3203337956),new G(W[28],1034457026),new G(W[29],2466948901),new G(W[30],3758326383),new G(W[31],168717936),new G(W[32],1188179964),new G(W[33],1546045734),new G(W[34],1522805485),new G(W[35],2643833823),new G(W[36],2343527390),new G(W[37],1014477480),new G(W[38],1206759142),new G(W[39],344077627),new G(W[40],1290863460),new G(W[41],3158454273),new G(W[42],3505952657),new G(W[43],106217008),new G(W[44],3606008344),new G(W[45],1432725776),new G(W[46],1467031594),new G(W[47],851169720),new G(W[48],3100823752),new G(W[49],1363258195),new G(W[50],3750685593),new G(W[51],3785050280),new G(W[52],3318307427),new G(W[53],3812723403),new G(W[54],2003034995),new G(W[55],3602036899),new G(W[56],1575990012),new G(W[57],1125592928),new G(W[58],2716904306),new G(W[59],442776044),new G(W[60],593698344),new G(W[61],3733110249),new G(W[62],2999351573),new G(W[63],3815920427),new G(3391569614,3928383900),new G(3515267271,566280711),new G(3940187606,3454069534),new G(4118630271,4000239992),new G(116418474,1914138554),new G(174292421,2731055270),new G(289380356,3203993006),new G(460393269,320620315),new G(685471733,587496836),new G(852142971,1086792851),new G(1017036298,365543100),new G(1126000580,2618297676),new G(1288033470,3409855158),new G(1501505948,4234509866),new G(1607167915,987167468),new G(1816402316,1246189591),new G(0,1),new G(0,32898),new G(2147483648,32906),new G(2147483648,2147516416),new G(0,32907),new G(0,2147483649),new G(2147483648,2147516545),new G(2147483648,32777),new G(0,138),new G(0,136),new G(0,2147516425),new G(0,2147483658),new G(0,2147516555),new G(2147483648,139),new G(2147483648,32905),new G(2147483648,32771),new G(2147483648,32770),new G(2147483648,128),new G(0,32778),new G(2147483648,2147483658),new G(2147483648,2147516545),new G(2147483648,32896),new G(0,2147483649),new G(2147483648,2147516424);var K=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})(K),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(K);var he=new Map;function ge(e,t){n?(he.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var _e=typeof document<`u`?HTMLElement:D,q=new Map,J=new Map,ve=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!q.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),q.set(t,e)}let n=q.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},ye=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!J.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),J.set(t,e)}let n=J.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},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}}`,be=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||Y.get(e)||e.attachShadow(n);return Y.set(e,r),ve(r,t?`${t}\n${X}`:X),r},xe=(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??``)},Se=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&ye(t,a)},Ce=null;function we(){return Ce}function Te(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 _e{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=be(this,t),xe(this._shadowDom,`slot`,()=>R().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=()=>{Se(this,this._shadowDom,`sheet`,null,this.sheet)};_update(e){let{matched:t,params:r}=Te(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=we();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 ge(`r-route`,$),e.Route=$,e.default=$,e})({});
|