@tempots/beatui 0.30.2 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2019-BY_FFnZU.cjs +1 -0
- package/dist/{2019-Cd9nHhvg.js → 2019-C660mMK6.js} +9 -10
- package/dist/{2020-CyKJpuK6.js → 2020-C3P-aGet.js} +30 -31
- package/dist/2020-Cyyhc8pv.cjs +1 -0
- package/dist/{ar-Dz8Mg5la.js → ar-BUxQ3yNv.js} +30 -15
- package/dist/ar-DcFl4tkv.cjs +1 -0
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +85 -84
- package/dist/beatui.css +32 -6
- package/dist/beatui.tailwind.css +32 -6
- package/dist/{de-ToWTQGEo.js → de-CKKQr2-K.js} +27 -12
- package/dist/de-DEUS3n0J.cjs +1 -0
- package/dist/{es-CruxS0Tz.js → es-C5VUn_X1.js} +27 -12
- package/dist/es-CIeoDpkc.cjs +1 -0
- package/dist/{fa-Cf0NZLWA.js → fa-Cs2LZsfr.js} +30 -15
- package/dist/fa-gXa9Xdjn.cjs +1 -0
- package/dist/fr-6SpJ-gVV.cjs +1 -0
- package/dist/{fr-YKXmqMGr.js → fr-Dlw8mKFp.js} +20 -5
- package/dist/{he-D8ZOduPw.js → he-Cm4NxsyE.js} +30 -15
- package/dist/he-D9cwxZOb.cjs +1 -0
- package/dist/hi-CNRHnMsQ.cjs +1 -0
- package/dist/{hi-CIamzVEf.js → hi-Cjz1aQX2.js} +30 -15
- package/dist/index-BI5w0jSz.js +2707 -0
- package/dist/index-Bv2gn_kV.cjs +4 -0
- package/dist/index-C-FUCwXi.js +14275 -0
- package/dist/index-CKyH3jwP.cjs +1 -0
- package/dist/index-CXY0yKJD.cjs +34 -0
- package/dist/{index-O9BwR_8P.cjs → index-CYY_JLSN.cjs} +1 -1
- package/dist/index-DKy2mZws.cjs +1 -0
- package/dist/{index-B2079wM-.js → index-DjShJtXp.js} +15 -15
- package/dist/index-DwyUOY3r.js +68 -0
- package/dist/{index-DDpjzV7E.js → index-Jd2O_Iux.js} +304 -307
- package/dist/{index-DFJed4ks.js → index-_Kh76-c2.js} +1 -1
- package/dist/index-klVI8k8O.cjs +8 -0
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +1123 -1229
- package/dist/it-DvBJ31Ls.cjs +1 -0
- package/dist/{it-Bn7tG_KC.js → it-iuFeIEsO.js} +29 -14
- package/dist/{ja-i1ULXeiu.js → ja-D6Dd96v-.js} +25 -10
- package/dist/ja-FKJGj5My.cjs +1 -0
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{ko-BpKDmtvY.js → ko-C8GOsfIU.js} +30 -15
- package/dist/ko-PqVOGPUi.cjs +1 -0
- package/dist/markdown/index.cjs.js +1 -2
- package/dist/markdown/index.es.js +4 -420
- package/dist/{modal-DvGSDVSv.js → modal-CuhK7DqK.js} +14 -13
- package/dist/modal-RQtwnFy9.cjs +1 -0
- package/dist/{nl-Cs4PDWCJ.js → nl-Ct2cyWWi.js} +31 -16
- package/dist/nl-DAhT0vfu.cjs +1 -0
- package/dist/notice-BnX2sRrK.cjs +2 -0
- package/dist/notice-Dz_BJg8D.js +1467 -0
- package/dist/{pl-BFLNf991.js → pl-DewgRE-k.js} +31 -16
- package/dist/pl-JgD0mCRa.cjs +1 -0
- package/dist/prosemirror/index.cjs.js +1 -0
- package/dist/prosemirror/index.es.js +6 -0
- package/dist/prosemirror.css +294 -0
- package/dist/pt-BkoMl_PC.cjs +1 -0
- package/dist/{pt-BRZeOkcE.js → pt-CNyp2zeW.js} +31 -16
- package/dist/ru-9OW0HQFS.cjs +1 -0
- package/dist/{ru-KI7Gowz-.js → ru-U6PdSzha.js} +35 -20
- package/dist/styles-url-CF_019NX.js +4 -0
- package/dist/styles-url-DhmSan6u.cjs +1 -0
- package/dist/toolbar-D7fDCmUn.cjs +1 -0
- package/dist/toolbar-DTh9Ouhs.js +118 -0
- package/dist/{tr-CYk8Fua5.js → tr-CQVvooxi.js} +28 -13
- package/dist/tr-DsOaoQqh.cjs +1 -0
- package/dist/translations-BDRano6u.cjs +1 -0
- package/dist/{translations-DdNHXAWr.js → translations-Cic51rHH.js} +1 -1
- package/dist/translations-D4PjDB1t.js +831 -0
- package/dist/translations-DDFTHcX3.cjs +1 -0
- package/dist/types/beatui-i18n/default.d.ts +14 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +14 -0
- package/dist/types/beatui-i18n/translations.d.ts +14 -0
- package/dist/types/components/form/input/input-container.d.ts +3 -1
- package/dist/types/components/form/input/input-options.d.ts +6 -0
- package/dist/types/components/prosemirror/etoolbar-button.d.ts +11 -0
- package/dist/types/components/prosemirror/etoolbar-group.d.ts +4 -0
- package/dist/types/components/prosemirror/link-control.d.ts +12 -0
- package/dist/types/components/prosemirror/prosemirror-markdown-input.d.ts +76 -0
- package/dist/types/components/prosemirror/prosemirror-toolbar.d.ts +18 -0
- package/dist/types/components/prosemirror/utils.d.ts +12 -0
- package/dist/types/prosemirror/index.d.ts +2 -0
- package/dist/{ur-BIcZGLWt.js → ur-C3LypxEh.js} +30 -15
- package/dist/ur-C8v4y2tI.cjs +1 -0
- package/dist/utils-D8WljbbZ.cjs +1 -0
- package/dist/{utils-D1op9R8_.js → utils-DY9kZecl.js} +74 -73
- package/dist/vi-DzLo7qhK.cjs +1 -0
- package/dist/{vi-BeK62QeB.js → vi-M5ObJg3d.js} +19 -4
- package/dist/zh-BXk4IZBo.cjs +1 -0
- package/dist/{zh-Dt6yWDu2.js → zh-DGA8R46s.js} +32 -17
- package/package.json +20 -13
- package/dist/2019-Bl1mhxeM.cjs +0 -1
- package/dist/2020-BKqFJLj6.cjs +0 -1
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/_commonjsHelpers-DwGv2jUC.cjs +0 -1
- package/dist/apl-B2DGVGxc.js +0 -76
- package/dist/apl-M-DNMvvR.cjs +0 -1
- package/dist/ar-CbsALGhG.cjs +0 -1
- package/dist/asciiarmor-2LVJmxlE.js +0 -34
- package/dist/asciiarmor-BMx3XVjX.cjs +0 -1
- package/dist/asn1-OOsVM4yU.cjs +0 -1
- package/dist/asn1-jKiBa2Ya.js +0 -95
- package/dist/asterisk-B1QUaW1C.cjs +0 -1
- package/dist/asterisk-DS281yxp.js +0 -271
- package/dist/brainfuck-BjUlYKdF.cjs +0 -1
- package/dist/brainfuck-C_p9pTT8.js +0 -34
- package/dist/clike-BEMIzMUI.cjs +0 -1
- package/dist/clike-DGTaUp48.js +0 -620
- package/dist/clojure-Ap_IXD2I.cjs +0 -1
- package/dist/clojure-CCKyeQKf.js +0 -800
- package/dist/cmake-C4D5_VmS.cjs +0 -1
- package/dist/cmake-CuaCgAKt.js +0 -28
- package/dist/cobol-BlTKFDRj.js +0 -72
- package/dist/cobol-Du-cT2hr.cjs +0 -1
- package/dist/coffeescript-BVCvwO8I.js +0 -179
- package/dist/coffeescript-DDFAj2ea.cjs +0 -1
- package/dist/commonlisp-CXBBRCTx.cjs +0 -1
- package/dist/commonlisp-D_kxz07b.js +0 -75
- package/dist/crystal-D309uH6_.js +0 -217
- package/dist/crystal-DAFWRDbh.cjs +0 -1
- package/dist/css-BkF-NPzE.js +0 -1553
- package/dist/css-DzFJyRJ8.cjs +0 -1
- package/dist/cypher-BMq4Fwjl.js +0 -68
- package/dist/cypher-BN0-oCze.cjs +0 -1
- package/dist/d-BHsqGcfm.cjs +0 -1
- package/dist/d-BZcgY6La.js +0 -127
- package/dist/de-MO-u5hoD.cjs +0 -1
- package/dist/diff-CemTHKfk.cjs +0 -1
- package/dist/diff-Cg9d_RX2.js +0 -18
- package/dist/dockerfile-BBTH3voH.cjs +0 -1
- package/dist/dockerfile-DIy8NleC.js +0 -194
- package/dist/dtd-ChoVQPwv.cjs +0 -1
- package/dist/dtd-CtLokQ-U.js +0 -84
- package/dist/dylan-QYeExnWK.js +0 -234
- package/dist/dylan-apTQIgUA.cjs +0 -1
- package/dist/ebnf-DUPDuY4r.js +0 -78
- package/dist/ebnf-LYmLy17h.cjs +0 -1
- package/dist/ecl-C7WNQq7-.cjs +0 -1
- package/dist/ecl-CiXN-g_D.js +0 -121
- package/dist/eiffel-BJThA8RG.cjs +0 -1
- package/dist/eiffel-yQhjl4T1.js +0 -110
- package/dist/elm-CNT9vbN0.js +0 -108
- package/dist/elm-CcXP9T36.cjs +0 -1
- package/dist/erlang-B6mpcObI.cjs +0 -1
- package/dist/erlang-CFOYdy9e.js +0 -487
- package/dist/es-CqkWVfis.cjs +0 -1
- package/dist/fa-DR8j7v-l.cjs +0 -1
- package/dist/factor-B-tsx9yW.cjs +0 -1
- package/dist/factor-DDOC7X6P.js +0 -65
- package/dist/fcl-BzAKklXo.cjs +0 -1
- package/dist/fcl-CPC2WYrI.js +0 -103
- package/dist/forth-BmxRyE9S.js +0 -60
- package/dist/forth-CPAzyZ_n.cjs +0 -1
- package/dist/fortran-9bvPyrOW.js +0 -442
- package/dist/fortran-DHiTlGV1.cjs +0 -1
- package/dist/fr-ClK0mWTO.cjs +0 -1
- package/dist/gas-BiPtGF2E.cjs +0 -1
- package/dist/gas-cpmYfFX2.js +0 -183
- package/dist/gherkin-CJuwpceU.js +0 -34
- package/dist/gherkin-Djo7Y51D.cjs +0 -1
- package/dist/groovy-BMVITiCm.cjs +0 -1
- package/dist/groovy-DZeT_VM-.js +0 -146
- package/dist/haskell-Bvt3Qq1t.js +0 -375
- package/dist/haskell-CngODaW-.cjs +0 -1
- package/dist/haxe-70NVW1pR.js +0 -359
- package/dist/haxe-Dyk-piTh.cjs +0 -1
- package/dist/he-DeJMBRTP.cjs +0 -1
- package/dist/hi-C9Anq8Ae.cjs +0 -1
- package/dist/http-BkLifcnL.cjs +0 -1
- package/dist/http-D9LttvKF.js +0 -44
- package/dist/idl-B6TRFYjl.js +0 -947
- package/dist/idl-FmHDmsE-.cjs +0 -1
- package/dist/index-0dpJGQbC.js +0 -94
- package/dist/index-52kzSRNb.cjs +0 -1
- package/dist/index-5a6_6F3Z.cjs +0 -6
- package/dist/index-BGHGZg_7.js +0 -552
- package/dist/index-BMn-7Ble.js +0 -1307
- package/dist/index-BR0F2BVZ.cjs +0 -1
- package/dist/index-BlCmv2EJ.cjs +0 -1
- package/dist/index-BlamLFdS.js +0 -76
- package/dist/index-By8a3eg5.cjs +0 -1
- package/dist/index-C0sjoDdy.js +0 -309
- package/dist/index-C9RMQY3t.cjs +0 -1
- package/dist/index-CDBeAhhM.js +0 -289
- package/dist/index-CH2HgQJF.cjs +0 -1
- package/dist/index-CT9YDHSn.js +0 -74
- package/dist/index-CUZnWZnQ.cjs +0 -3
- package/dist/index-CVNvgkJN.js +0 -342
- package/dist/index-C_NT6gCL.cjs +0 -1
- package/dist/index-CafCsH0Z.cjs +0 -1
- package/dist/index-Cei6J0b_.cjs +0 -8
- package/dist/index-CmcOKNW2.js +0 -302
- package/dist/index-CvpdOKX2.js +0 -136
- package/dist/index-CxE1PN5L.cjs +0 -1
- package/dist/index-D2BpI4Zz.cjs +0 -2
- package/dist/index-D40RPDMJ.cjs +0 -1
- package/dist/index-D5iq4kyE.cjs +0 -1
- package/dist/index-DFzKuRY8.cjs +0 -1
- package/dist/index-DIO9qaw5.cjs +0 -1
- package/dist/index-DIR2rO5B.cjs +0 -1
- package/dist/index-DPnQDm6f.js +0 -138
- package/dist/index-DU0jpFGR.cjs +0 -1
- package/dist/index-DUvVsNDG.cjs +0 -13
- package/dist/index-DVZnPL32.js +0 -953
- package/dist/index-DiYfLAVQ.js +0 -554
- package/dist/index-DnIheaHS.js +0 -251
- package/dist/index-Dp2K8q6O.cjs +0 -7
- package/dist/index-DrlNzz-e.js +0 -59
- package/dist/index-Dx9UDsJi.cjs +0 -1
- package/dist/index-DxY-AOQA.js +0 -157
- package/dist/index-Mmd0YHPJ.js +0 -960
- package/dist/index-NyiYUSW3.js +0 -101
- package/dist/index-alBMysbQ.js +0 -1874
- package/dist/index-lEkIbMCl.js +0 -612
- package/dist/index-qwDdlmIi.js +0 -270
- package/dist/index-x3mhc_C_.cjs +0 -1
- package/dist/it-5n3LuTHe.cjs +0 -1
- package/dist/ja-Bdp4_B8-.cjs +0 -1
- package/dist/javascript-C2yteZeJ.js +0 -691
- package/dist/javascript-DngSGg_0.cjs +0 -1
- package/dist/jinja2-DnB6dQmV.js +0 -154
- package/dist/jinja2-wbVbDTNi.cjs +0 -1
- package/dist/julia-DA67Qw9E.cjs +0 -1
- package/dist/julia-DpvXAuO6.js +0 -241
- package/dist/ko-B5SwKB-j.cjs +0 -1
- package/dist/livescript-Bg3URadp.cjs +0 -1
- package/dist/livescript-CanGTf8u.js +0 -272
- package/dist/lua-CIsxjGwi.cjs +0 -1
- package/dist/lua-XplVlWi_.js +0 -217
- package/dist/mathematica-BG089QIc.cjs +0 -1
- package/dist/mathematica-jaRHnSxC.js +0 -35
- package/dist/mbox-BctzC1hL.js +0 -76
- package/dist/mbox-CySolFFZ.cjs +0 -1
- package/dist/milkdown/index.cjs.js +0 -1
- package/dist/milkdown/index.es.js +0 -4
- package/dist/milkdown-input-Bkgdi-Bv.cjs +0 -944
- package/dist/milkdown-input-CciSI_a5.js +0 -63967
- package/dist/milkdown-url-D99P-nA-.js +0 -4
- package/dist/milkdown-url-DqoUZH3u.cjs +0 -1
- package/dist/milkdown.css +0 -1914
- package/dist/mirc-BfqEffzk.cjs +0 -1
- package/dist/mirc-CFBPAOaF.js +0 -72
- package/dist/mllike-BSnXJBGA.js +0 -272
- package/dist/mllike-QUjwI6zq.cjs +0 -1
- package/dist/modal-CAKAT7wv.cjs +0 -1
- package/dist/modelica-B6Zhcb-M.cjs +0 -1
- package/dist/modelica-vUgVs--1.js +0 -93
- package/dist/mscgen-BToym4Bs.cjs +0 -1
- package/dist/mscgen-Cpl0NYLN.js +0 -104
- package/dist/mumps-CQoS1kWX.js +0 -25
- package/dist/mumps-wfyQdxSu.cjs +0 -1
- package/dist/nginx-CwqyBUfA.cjs +0 -1
- package/dist/nginx-zDPm3Z74.js +0 -89
- package/dist/nl-Cenl4nr6.cjs +0 -1
- package/dist/notice-DBME6bFw.cjs +0 -2
- package/dist/notice-DVEacWKt.js +0 -2275
- package/dist/nsis-DPj2fUaP.cjs +0 -1
- package/dist/nsis-fePjrhq7.js +0 -62
- package/dist/ntriples-CsNjv2QF.js +0 -79
- package/dist/ntriples-DgwJmozm.cjs +0 -1
- package/dist/octave-1pkKrgAA.cjs +0 -1
- package/dist/octave-C8PmmSRH.js +0 -143
- package/dist/oz-BXOZCt0U.cjs +0 -1
- package/dist/oz-Ce8aN8oE.js +0 -151
- package/dist/pascal-De0D6mP7.js +0 -77
- package/dist/pascal-DtY2LEkJ.cjs +0 -1
- package/dist/perl-B4bSCe1C.js +0 -915
- package/dist/perl-CVDWbEju.cjs +0 -1
- package/dist/pig-D24Z8EXi.js +0 -54
- package/dist/pig-DMByOrnr.cjs +0 -1
- package/dist/pl-7xYNCk-v.cjs +0 -1
- package/dist/powershell-BaoYaFvj.cjs +0 -1
- package/dist/powershell-DkYVfTzP.js +0 -249
- package/dist/preprocess-CvkqwVNt.cjs +0 -3
- package/dist/preprocess-D898zxsP.js +0 -2295
- package/dist/properties-DXHJZ3WE.cjs +0 -1
- package/dist/properties-Dn9wna3M.js +0 -26
- package/dist/protobuf-BKhXdfH6.cjs +0 -1
- package/dist/protobuf-BPIjwpzm.js +0 -49
- package/dist/pt-DOLL0Jpj.cjs +0 -1
- package/dist/pug-CwAQJzGR.js +0 -248
- package/dist/pug-kEfRDOiF.cjs +0 -1
- package/dist/puppet-8mAyuMbW.cjs +0 -1
- package/dist/puppet-nyd4dhjf.js +0 -45
- package/dist/python-BkR3uSy8.js +0 -313
- package/dist/python-D-iU6WXz.cjs +0 -1
- package/dist/q-BPQ45Nxu.cjs +0 -1
- package/dist/q-DXjKs-tC.js +0 -83
- package/dist/r-LKEuhEGI.js +0 -104
- package/dist/r-r2_EZsON.cjs +0 -1
- package/dist/rpm-IznJm2Xc.js +0 -57
- package/dist/rpm-YK81m3qU.cjs +0 -1
- package/dist/ru-DoS9XuqG.cjs +0 -1
- package/dist/ruby-CcYfvIk6.js +0 -228
- package/dist/ruby-Cn1sFkZF.cjs +0 -1
- package/dist/sas-7E8yHoCW.js +0 -105
- package/dist/sas-DAGcJy94.cjs +0 -1
- package/dist/scheme-B0ZrbojV.cjs +0 -1
- package/dist/scheme-DjibxsNh.js +0 -124
- package/dist/shell-BMYo43V6.cjs +0 -1
- package/dist/shell-C0C2sNA_.js +0 -182
- package/dist/sieve-Bwz7vjP5.js +0 -72
- package/dist/sieve-CIYW-b_H.cjs +0 -1
- package/dist/simple-mode-B0dvCdAA.js +0 -89
- package/dist/simple-mode-BIKNPBes.cjs +0 -1
- package/dist/smalltalk-Bhddl2pB.js +0 -48
- package/dist/smalltalk-CSslY-3i.cjs +0 -1
- package/dist/solr-A1kSnAwJ.cjs +0 -1
- package/dist/solr-BNlsLglM.js +0 -41
- package/dist/sparql-DnHMBLLY.cjs +0 -1
- package/dist/sparql-FarWu_Gb.js +0 -197
- package/dist/spreadsheet-B7_BK8hB.cjs +0 -1
- package/dist/spreadsheet-C-cy4P5N.js +0 -49
- package/dist/sql-9VmIWHrZ.cjs +0 -1
- package/dist/sql-CfG5lQ3l.js +0 -282
- package/dist/stex-B4wyjEnp.cjs +0 -1
- package/dist/stex-Du4h4KAU.js +0 -129
- package/dist/stylus-CAdqWld3.js +0 -250
- package/dist/stylus-D6GYOT3Z.cjs +0 -1
- package/dist/swift-DGw6Cgu8.cjs +0 -1
- package/dist/swift-DSxqR9R6.js +0 -230
- package/dist/tcl-ByLXbQFo.cjs +0 -1
- package/dist/tcl-xfoLljhY.js +0 -81
- package/dist/textile-D1AWE-pc.js +0 -295
- package/dist/textile-iryw-lTw.cjs +0 -1
- package/dist/tiddlywiki-5wqsXtSk.js +0 -155
- package/dist/tiddlywiki-D8IJz1k7.cjs +0 -1
- package/dist/tiki-C5p5KSQK.cjs +0 -1
- package/dist/tiki-__Kn3CeS.js +0 -181
- package/dist/toml-3ZsH_4Qa.cjs +0 -1
- package/dist/toml-BHiuTcfn.js +0 -49
- package/dist/tr-BVmoz40w.cjs +0 -1
- package/dist/translations-Dv56lQia.cjs +0 -1
- package/dist/troff-D-3QCOYN.cjs +0 -1
- package/dist/troff-D2UO-fKf.js +0 -35
- package/dist/ttcn-Bsa4sfRm.js +0 -123
- package/dist/ttcn-C2MXAqcM.cjs +0 -1
- package/dist/ttcn-cfg-BYqcMRxC.cjs +0 -1
- package/dist/ttcn-cfg-Bac_acMi.js +0 -88
- package/dist/turtle-DSJNatSv.cjs +0 -1
- package/dist/turtle-xwJUxoPV.js +0 -80
- package/dist/types/components/milkdown/milkdown-input.d.ts +0 -15
- package/dist/types/milkdown/index.d.ts +0 -1
- package/dist/ur-orNTOdMP.cjs +0 -1
- package/dist/utils-Dobqjl2y.cjs +0 -1
- package/dist/vb-c2kQGd6-.js +0 -74
- package/dist/vb-qzHzzvyB.cjs +0 -1
- package/dist/vbscript-1f_Dhg5H.js +0 -324
- package/dist/vbscript-CWm8v9tE.cjs +0 -1
- package/dist/velocity-D3_yAIp3.cjs +0 -1
- package/dist/velocity-DJd0pTTC.js +0 -96
- package/dist/verilog-BOhLNmQo.cjs +0 -1
- package/dist/verilog-CiS1jyi5.js +0 -262
- package/dist/vhdl-CMFbi8Im.cjs +0 -1
- package/dist/vhdl-T9HkrbI2.js +0 -106
- package/dist/vi-BWyUDP07.cjs +0 -1
- package/dist/webidl-CWb_flNk.cjs +0 -1
- package/dist/webidl-CjfDENEo.js +0 -155
- package/dist/xquery-BUQdORAS.js +0 -422
- package/dist/xquery-Cjw5fRnG.cjs +0 -1
- package/dist/yacas-C0absKBh.js +0 -73
- package/dist/yacas-urx_N5C8.cjs +0 -1
- package/dist/z80-CsG3CM6M.cjs +0 -1
- package/dist/z80-Pki2zAjW.js +0 -61
- package/dist/zh-RVJj1NQq.cjs +0 -1
- /package/dist/types/{components/milkdown/milkdown-url.d.ts → prosemirror/styles-url.d.ts} +0 -0
- /package/dist/types/{milkdown → prosemirror}/styles.d.ts +0 -0
package/dist/notice-DVEacWKt.js
DELETED
|
@@ -1,2275 +0,0 @@
|
|
|
1
|
-
import { makeProviderMark as ae, localStorageProp as X, computedOf as y, Use as q, html as p, attr as c, When as E, Fragment as M, aria as S, coalesce as Q, style as H, prop as I, on as C, OnDispose as oe, Value as D, WithElement as ve, Empty as w, dataAttr as J, input as ie, emitValue as P, emitValueAsNumber as ke, Unless as ye, Ensure as we } from "@tempots/dom";
|
|
2
|
-
import { WhenInViewport as Ce, Query as xe, ElementRect as Se } from "@tempots/ui";
|
|
3
|
-
import { b as De, g as Ie } from "./colors-WfmhQ5e1.js";
|
|
4
|
-
function ee(e, {
|
|
5
|
-
units: t = ["B", "KB", "MB", "GB", "TB"],
|
|
6
|
-
decimalPlaces: s = 0,
|
|
7
|
-
locale: n
|
|
8
|
-
} = {}) {
|
|
9
|
-
if (e === 0 || e === 0n)
|
|
10
|
-
return new Intl.NumberFormat(n, {
|
|
11
|
-
style: "unit",
|
|
12
|
-
unit: "byte",
|
|
13
|
-
unitDisplay: "short",
|
|
14
|
-
maximumFractionDigits: 0
|
|
15
|
-
}).format(0).replace("byte", t[0]);
|
|
16
|
-
let r, a;
|
|
17
|
-
if (typeof e == "bigint") {
|
|
18
|
-
let l = e < 0n ? -e : e;
|
|
19
|
-
for (r = 0; l >= 1024n && r < t.length - 1; )
|
|
20
|
-
l = l / 1024n, r++;
|
|
21
|
-
a = Number(e) / Math.pow(1024, r);
|
|
22
|
-
} else
|
|
23
|
-
r = Math.floor(Math.log(Math.abs(e)) / Math.log(1024)), r = Math.min(r, t.length - 1), a = e / Math.pow(1024, r);
|
|
24
|
-
return new Intl.NumberFormat(n, {
|
|
25
|
-
style: "unit",
|
|
26
|
-
unit: "byte",
|
|
27
|
-
unitDisplay: "short",
|
|
28
|
-
minimumFractionDigits: r === 0 ? 0 : s,
|
|
29
|
-
maximumFractionDigits: r === 0 ? 0 : s
|
|
30
|
-
}).format(a).replace("byte", t[r]);
|
|
31
|
-
}
|
|
32
|
-
const te = /* @__PURE__ */ new Map();
|
|
33
|
-
function le(e) {
|
|
34
|
-
const t = te.get(e) ?? 0;
|
|
35
|
-
return te.set(e, t + 1), `${e}-${t}`;
|
|
36
|
-
}
|
|
37
|
-
const x = {
|
|
38
|
-
/**
|
|
39
|
-
* Creates a loading state.
|
|
40
|
-
* @param previousValue - The previous value.
|
|
41
|
-
* @returns A loading state.
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
|
-
notAsked: { type: "NotAsked" },
|
|
45
|
-
/**
|
|
46
|
-
* Creates a loading state.
|
|
47
|
-
* @param previousValue - The previous value.
|
|
48
|
-
* @returns A loading state.
|
|
49
|
-
* @public
|
|
50
|
-
*/
|
|
51
|
-
loading(e = void 0) {
|
|
52
|
-
return { type: "Loading", previousValue: e };
|
|
53
|
-
},
|
|
54
|
-
/**
|
|
55
|
-
* Creates a successful state.
|
|
56
|
-
* @param value - The value.
|
|
57
|
-
* @returns A successful state.
|
|
58
|
-
* @public
|
|
59
|
-
*/
|
|
60
|
-
success(e) {
|
|
61
|
-
return { type: "AsyncSuccess", value: e };
|
|
62
|
-
},
|
|
63
|
-
/**
|
|
64
|
-
* Creates a failure state.
|
|
65
|
-
* @param error - The error.
|
|
66
|
-
* @returns A failure state.
|
|
67
|
-
* @public
|
|
68
|
-
*/
|
|
69
|
-
failure(e) {
|
|
70
|
-
return { type: "AsyncFailure", error: e };
|
|
71
|
-
},
|
|
72
|
-
/**
|
|
73
|
-
* Checks if the result is a success.
|
|
74
|
-
* @param r - The result.
|
|
75
|
-
* @returns `true` if the result is a success; otherwise, `false`.
|
|
76
|
-
* @public
|
|
77
|
-
*/
|
|
78
|
-
isSuccess(e) {
|
|
79
|
-
return e.type === "AsyncSuccess";
|
|
80
|
-
},
|
|
81
|
-
/**
|
|
82
|
-
* Checks if the result is a failure.
|
|
83
|
-
* @param r - The result.
|
|
84
|
-
* @returns `true` if the result is a failure; otherwise, `false`.
|
|
85
|
-
* @public
|
|
86
|
-
*/
|
|
87
|
-
isFailure(e) {
|
|
88
|
-
return e.type === "AsyncFailure";
|
|
89
|
-
},
|
|
90
|
-
/**
|
|
91
|
-
* Checks if the result is a not-asked.
|
|
92
|
-
* @param r - The result.
|
|
93
|
-
* @returns `true` if the result is not-asked; otherwise, `false`.
|
|
94
|
-
* @public
|
|
95
|
-
*/
|
|
96
|
-
isNotAsked(e) {
|
|
97
|
-
return e.type === "NotAsked";
|
|
98
|
-
},
|
|
99
|
-
/**
|
|
100
|
-
* Checks if the result is a loading.
|
|
101
|
-
* @param r - The result.
|
|
102
|
-
* @returns `true` if the result is loading; otherwise, `false`.
|
|
103
|
-
* @public
|
|
104
|
-
*/
|
|
105
|
-
isLoading(e) {
|
|
106
|
-
return e.type === "Loading";
|
|
107
|
-
},
|
|
108
|
-
/**
|
|
109
|
-
* Gets the value if the result is a success; otherwise, returns the alternative value.
|
|
110
|
-
* @param r - The result.
|
|
111
|
-
* @param alt - The alternative value.
|
|
112
|
-
* @returns The value if the result is a success; otherwise, the alternative value.
|
|
113
|
-
* @public
|
|
114
|
-
*/
|
|
115
|
-
getOrElse(e, t) {
|
|
116
|
-
return x.isSuccess(e) ? e.value : t;
|
|
117
|
-
},
|
|
118
|
-
/**
|
|
119
|
-
* Gets the value if the result is a success; otherwise, returns the value from the alternative function.
|
|
120
|
-
* @param r - The result.
|
|
121
|
-
* @param altf - The alternative function.
|
|
122
|
-
* @returns The value if the result is a success; otherwise, the value from the alternative
|
|
123
|
-
* @public
|
|
124
|
-
* function.
|
|
125
|
-
*/
|
|
126
|
-
getOrElseLazy(e, t) {
|
|
127
|
-
return x.isSuccess(e) ? e.value : t();
|
|
128
|
-
},
|
|
129
|
-
/**
|
|
130
|
-
* Gets the value if the result is a success; otherwise, returns `null`.
|
|
131
|
-
* @param r - The result.
|
|
132
|
-
* @returns The value if the result is a success; otherwise, `null`.
|
|
133
|
-
* @public
|
|
134
|
-
*/
|
|
135
|
-
getOrNull(e) {
|
|
136
|
-
return x.isSuccess(e) ? e.value : null;
|
|
137
|
-
},
|
|
138
|
-
/**
|
|
139
|
-
* Gets the value if the result is a success; otherwise, returns `undefined`.
|
|
140
|
-
* @param r - The result.
|
|
141
|
-
* @returns The value if the result is a success; otherwise, `undefined`.
|
|
142
|
-
* @public
|
|
143
|
-
*/
|
|
144
|
-
getOrUndefined(e) {
|
|
145
|
-
return x.isSuccess(e) ? e.value : void 0;
|
|
146
|
-
},
|
|
147
|
-
/**
|
|
148
|
-
* Gets the value of a `AsyncResult` if it is a `Success`, otherwise it throws the error contained in the `Failure`.
|
|
149
|
-
* @param r - The `AsyncResult` to get the value from.
|
|
150
|
-
* @returns The value of the `AsyncResult` if it is a `Success`.
|
|
151
|
-
*/
|
|
152
|
-
getUnsafe: (e) => {
|
|
153
|
-
if (x.isSuccess(e))
|
|
154
|
-
return e.value;
|
|
155
|
-
throw x.isFailure(e) ? e.error : new Error("Cannot get value from a not-asked or loading result");
|
|
156
|
-
},
|
|
157
|
-
/**
|
|
158
|
-
* Based on the state of the result, it picks the appropriate function to call and returns the result.
|
|
159
|
-
* @param success - The function to call if the result is a success.
|
|
160
|
-
* @param failure - The function to call if the result is a failure.
|
|
161
|
-
* @param loading - The function to call if the result is loading.
|
|
162
|
-
* @param notAsked - The function to call if the result is not-asked.
|
|
163
|
-
* @returns The result of calling the appropriate function based on the state of the result.
|
|
164
|
-
* @public
|
|
165
|
-
*/
|
|
166
|
-
match: (e, {
|
|
167
|
-
success: t,
|
|
168
|
-
failure: s,
|
|
169
|
-
loading: n,
|
|
170
|
-
notAsked: r = n
|
|
171
|
-
}) => x.isSuccess(e) ? t(e.value) : x.isFailure(e) ? s(e.error) : x.isNotAsked(e) ? r() : n(e.previousValue),
|
|
172
|
-
/**
|
|
173
|
-
* When the result is a success, it applies the function to the value.
|
|
174
|
-
*
|
|
175
|
-
* @param r - The result.
|
|
176
|
-
* @param apply - The function to apply.
|
|
177
|
-
* @returns The result that was passed in.
|
|
178
|
-
* @public
|
|
179
|
-
*/
|
|
180
|
-
whenSuccess: (e, t) => (x.isSuccess(e) && t(e.value), e),
|
|
181
|
-
/**
|
|
182
|
-
* When the result is a failure, it applies the function to the error.
|
|
183
|
-
*
|
|
184
|
-
* @param r - The result.
|
|
185
|
-
* @param apply - The function to apply.
|
|
186
|
-
* @returns The result that was passed in.
|
|
187
|
-
* @public
|
|
188
|
-
*/
|
|
189
|
-
whenFailure: (e, t) => (x.isFailure(e) && t(e.error), e),
|
|
190
|
-
/**
|
|
191
|
-
* Compares two results for equality.
|
|
192
|
-
* @param r1 - The first result.
|
|
193
|
-
* @param r2 - The second result.
|
|
194
|
-
* @param options - The options to use for comparison. By default, uses strict equality.
|
|
195
|
-
* @returns `true` if the results are equal, `false` otherwise.
|
|
196
|
-
*/
|
|
197
|
-
equals: (e, t, s = {
|
|
198
|
-
valueEquals: (n, r) => n === r,
|
|
199
|
-
errorEquals: (n, r) => n === r
|
|
200
|
-
}) => e.type === "AsyncSuccess" && t.type === "AsyncSuccess" ? s.valueEquals(e.value, t.value) : e.type === "AsyncFailure" && t.type === "AsyncFailure" ? s.errorEquals(e.error, t.error) : e.type === "Loading" && t.type === "Loading" ? s.valueEquals(e.previousValue, t.previousValue) : e.type === "NotAsked" && t.type === "NotAsked",
|
|
201
|
-
/**
|
|
202
|
-
* Combines multiple results into a single result.
|
|
203
|
-
* @param results - The results to combine.
|
|
204
|
-
* @returns A single result that is a success if all the input results are successes, otherwise a failure.
|
|
205
|
-
*/
|
|
206
|
-
all: (e) => {
|
|
207
|
-
const t = [];
|
|
208
|
-
for (const s of e)
|
|
209
|
-
if (x.isSuccess(s))
|
|
210
|
-
t.push(s.value);
|
|
211
|
-
else
|
|
212
|
-
return s;
|
|
213
|
-
return x.success(t);
|
|
214
|
-
},
|
|
215
|
-
/**
|
|
216
|
-
* Converts a Promise to an AsyncResult.
|
|
217
|
-
* @param p - The Promise to convert.
|
|
218
|
-
* @returns A Promise that resolves to an AsyncResult.
|
|
219
|
-
*/
|
|
220
|
-
ofPromise: async (e) => {
|
|
221
|
-
try {
|
|
222
|
-
const t = await e;
|
|
223
|
-
return x.success(t);
|
|
224
|
-
} catch (t) {
|
|
225
|
-
return x.failure(t instanceof Error ? t : new Error(String(t)));
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}, F = (e, t) => e === t || e !== e && t !== t, _ = {
|
|
229
|
-
/**
|
|
230
|
-
* Creates a valid `Validation`.
|
|
231
|
-
* @returns A `Validation` that is `Valid`.
|
|
232
|
-
*/
|
|
233
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
234
|
-
valid: { type: "valid" },
|
|
235
|
-
/**
|
|
236
|
-
* Creates an invalid `Validation`.
|
|
237
|
-
* @param error - The error associated with the invalid value.
|
|
238
|
-
* @returns A `Validation` that is `Invalid`.
|
|
239
|
-
*/
|
|
240
|
-
invalid(e) {
|
|
241
|
-
return { type: "invalid", error: e };
|
|
242
|
-
},
|
|
243
|
-
/**
|
|
244
|
-
* Checks if a `Validation` is `Valid`.
|
|
245
|
-
* @param r - The `Validation` to check.
|
|
246
|
-
* @returns `true` if the `Validation` is `Valid`, otherwise `false`.
|
|
247
|
-
*/
|
|
248
|
-
isValid(e) {
|
|
249
|
-
return e.type === "valid";
|
|
250
|
-
},
|
|
251
|
-
/**
|
|
252
|
-
* Checks if a `Validation` is `Invalid`.
|
|
253
|
-
* @param r - The `Validation` to check.
|
|
254
|
-
* @returns `true` if the `Validation` is `Invalid`, otherwise `false`.
|
|
255
|
-
*/
|
|
256
|
-
isInvalid(e) {
|
|
257
|
-
return e.type === "invalid";
|
|
258
|
-
},
|
|
259
|
-
/**
|
|
260
|
-
* Maps the value of a `Validation` to a new value.
|
|
261
|
-
* @param r - The `Validation` to map.
|
|
262
|
-
* @param valid - The mapping function for a valid value.
|
|
263
|
-
* @param invalid - The mapping function for an invalid value.
|
|
264
|
-
* @returns The mapped value.
|
|
265
|
-
*/
|
|
266
|
-
match: (e, t, s) => _.isValid(e) ? t() : s(e.error),
|
|
267
|
-
/**
|
|
268
|
-
* Maps the value of a `Validation` to a new `Validation`.
|
|
269
|
-
* @param validation - The `Validation` to map.
|
|
270
|
-
* @param value - The value to map.
|
|
271
|
-
* @returns A new `Validation` with the mapped value.
|
|
272
|
-
*/
|
|
273
|
-
toResult: (e, t) => _.match(
|
|
274
|
-
e,
|
|
275
|
-
() => k.success(t),
|
|
276
|
-
(s) => k.failure(s)
|
|
277
|
-
),
|
|
278
|
-
/**
|
|
279
|
-
* Execute a function when the `Validation` is valid.
|
|
280
|
-
*
|
|
281
|
-
* @param r - The `Validation` to check.
|
|
282
|
-
* @param apply - The function to execute when the `Validation` is valid.
|
|
283
|
-
* @returns The `Validation` object.
|
|
284
|
-
*/
|
|
285
|
-
whenValid: (e, t) => (_.isValid(e) && t(), e),
|
|
286
|
-
/**
|
|
287
|
-
* Execute a function when the `Validation` is invalid.
|
|
288
|
-
*
|
|
289
|
-
* @param r - The `Validation` to check.
|
|
290
|
-
* @param apply - The function to execute when the `Validation` is invalid.
|
|
291
|
-
* @returns The `Validation` object.
|
|
292
|
-
*/
|
|
293
|
-
whenInvalid: (e, t) => (_.isInvalid(e) && t(e.error), e)
|
|
294
|
-
}, k = {
|
|
295
|
-
/**
|
|
296
|
-
* Creates a successful `Result`.
|
|
297
|
-
* @param value - The value to wrap in a `Success` type.
|
|
298
|
-
* @returns A `Result` that is a `Success`.
|
|
299
|
-
* @public
|
|
300
|
-
*/
|
|
301
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
302
|
-
success(e) {
|
|
303
|
-
return { type: "Success", value: e };
|
|
304
|
-
},
|
|
305
|
-
/**
|
|
306
|
-
* Creates a failure `Result`.
|
|
307
|
-
* @param error - The error to wrap in a `Failure` type.
|
|
308
|
-
* @returns A `Result` that is a `Failure`.
|
|
309
|
-
* @public
|
|
310
|
-
*/
|
|
311
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
312
|
-
failure(e) {
|
|
313
|
-
return { type: "Failure", error: e };
|
|
314
|
-
},
|
|
315
|
-
/**
|
|
316
|
-
* Maps the value of a `Result` to a new value.
|
|
317
|
-
* @param r - The `Result` to map.
|
|
318
|
-
* @param f - The mapping function.
|
|
319
|
-
* @returns A new `Result` with the mapped value.
|
|
320
|
-
* @public
|
|
321
|
-
*/
|
|
322
|
-
map: (e, t) => e.type === "Success" ? k.success(t(e.value)) : e,
|
|
323
|
-
/**
|
|
324
|
-
* Maps the value of a `Result` to a new `Result`.
|
|
325
|
-
* @param r - The `Result` to map.
|
|
326
|
-
* @param f - The mapping function.
|
|
327
|
-
* @returns A new `Result` with the mapped value.
|
|
328
|
-
* @public
|
|
329
|
-
*/
|
|
330
|
-
flatMap: (e, t) => e.type === "Success" ? t(e.value) : e,
|
|
331
|
-
/**
|
|
332
|
-
* Converts a `Result` to an `AsyncResult`.
|
|
333
|
-
* @param r - The `Result` to convert.
|
|
334
|
-
* @returns An `AsyncResult` that is equivalent to the input `Result`.
|
|
335
|
-
* @public
|
|
336
|
-
*/
|
|
337
|
-
toAsync(e) {
|
|
338
|
-
return k.match(
|
|
339
|
-
e,
|
|
340
|
-
(t) => x.success(t),
|
|
341
|
-
(t) => x.failure(t)
|
|
342
|
-
);
|
|
343
|
-
},
|
|
344
|
-
/**
|
|
345
|
-
* Converts a `Result` to a `Validation`.
|
|
346
|
-
* @param r - The `Result` to convert.
|
|
347
|
-
* @returns A `Validation` that is equivalent to the input `Result`.
|
|
348
|
-
* @public
|
|
349
|
-
*/
|
|
350
|
-
toValidation(e) {
|
|
351
|
-
return k.match(
|
|
352
|
-
e,
|
|
353
|
-
() => _.valid,
|
|
354
|
-
(t) => _.invalid(t)
|
|
355
|
-
);
|
|
356
|
-
},
|
|
357
|
-
/**
|
|
358
|
-
* Checks if a `Result` is a success.
|
|
359
|
-
* @param r - The `Result` to check.
|
|
360
|
-
* @returns `true` if the `Result` is a `Success`, `false` otherwise.
|
|
361
|
-
* @public
|
|
362
|
-
*/
|
|
363
|
-
isSuccess(e) {
|
|
364
|
-
return e.type === "Success";
|
|
365
|
-
},
|
|
366
|
-
/**
|
|
367
|
-
* Checks if a `Result` is a failure.
|
|
368
|
-
* @param r - The `Result` to check.
|
|
369
|
-
* @returns `true` if the `Result` is a `Failure`, `false` otherwise.
|
|
370
|
-
* @public
|
|
371
|
-
*/
|
|
372
|
-
isFailure(e) {
|
|
373
|
-
return e.type === "Failure";
|
|
374
|
-
},
|
|
375
|
-
/**
|
|
376
|
-
* Gets the value of a `Result` if it is a `Success`, otherwise returns the provided default value.
|
|
377
|
-
* @param r - The `Result` to get the value from.
|
|
378
|
-
* @param alt - The default value to return if the `Result` is a `Failure`.
|
|
379
|
-
* @returns The value of the `Result` if it is a `Success`, otherwise the default value.
|
|
380
|
-
* @public
|
|
381
|
-
*/
|
|
382
|
-
getOrElse(e, t) {
|
|
383
|
-
return k.isSuccess(e) ? e.value : t;
|
|
384
|
-
},
|
|
385
|
-
/**
|
|
386
|
-
* Gets the value of a `Result` if it is a `Success`, otherwise returns the result of the provided function.
|
|
387
|
-
* @param r - The `Result` to get the value from.
|
|
388
|
-
* @param altf - The function to call if the `Result` is a `Failure`.
|
|
389
|
-
* @returns The value of the `Result` if it is a `Success`, otherwise the result of the function.
|
|
390
|
-
* @public
|
|
391
|
-
*/
|
|
392
|
-
getOrElseLazy(e, t) {
|
|
393
|
-
return k.isSuccess(e) ? e.value : t();
|
|
394
|
-
},
|
|
395
|
-
/**
|
|
396
|
-
* Gets the value of a `Result` if it is a `Success`, otherwise returns `null`.
|
|
397
|
-
* @param r - The `Result` to get the value from.
|
|
398
|
-
* @returns The value of the `Result` if it is a `Success`, otherwise `null`.
|
|
399
|
-
* @public
|
|
400
|
-
*/
|
|
401
|
-
getOrNull(e) {
|
|
402
|
-
return k.isSuccess(e) ? e.value : null;
|
|
403
|
-
},
|
|
404
|
-
/**
|
|
405
|
-
* Gets the value of a `Result` if it is a `Success`, otherwise returns `undefined`.
|
|
406
|
-
* @param r - The `Result` to get the value from.
|
|
407
|
-
* @returns The value of the `Result` if it is a `Success`, otherwise `undefined`.
|
|
408
|
-
* @public
|
|
409
|
-
*/
|
|
410
|
-
getOrUndefined(e) {
|
|
411
|
-
return k.isSuccess(e) ? e.value : void 0;
|
|
412
|
-
},
|
|
413
|
-
/**
|
|
414
|
-
* Gets the value of a `Result` if it is a `Success`, otherwise it throws the error contained in the `Failure`.
|
|
415
|
-
* @param r - The `Result` to get the value from.
|
|
416
|
-
* @returns The value of the `Result` if it is a `Success`.
|
|
417
|
-
*/
|
|
418
|
-
getUnsafe: (e) => {
|
|
419
|
-
if (k.isSuccess(e))
|
|
420
|
-
return e.value;
|
|
421
|
-
throw e.error;
|
|
422
|
-
},
|
|
423
|
-
/**
|
|
424
|
-
* Based on the state of the result, it picks the appropriate function to call and returns the result.
|
|
425
|
-
* @param success - The function to call if the result is a success.
|
|
426
|
-
* @param failure - The function to call if the result is a failure.
|
|
427
|
-
* @returns The result of calling the appropriate function based on the state of the result.
|
|
428
|
-
* @public
|
|
429
|
-
*/
|
|
430
|
-
match: (e, t, s) => k.isSuccess(e) ? t(e.value) : s(e.error),
|
|
431
|
-
/**
|
|
432
|
-
* Calls the provided function if the result is a success.
|
|
433
|
-
* @param apply - The function to call if the result is a success.
|
|
434
|
-
* @returns A function that takes a `Result` and calls the provided function if the result is a success.
|
|
435
|
-
* @public
|
|
436
|
-
*/
|
|
437
|
-
whenSuccess: (e, t) => (k.isSuccess(e) && t(e.value), e),
|
|
438
|
-
whenFailure: (e, t) => (k.isFailure(e) && t(e.error), e),
|
|
439
|
-
/**
|
|
440
|
-
* Combines two results into a single result.
|
|
441
|
-
* @param r1 - The first result.
|
|
442
|
-
* @param r2 - The second result.
|
|
443
|
-
* @param combineV - The function to combine two values.
|
|
444
|
-
* @param combineE - The function to combine two errors.
|
|
445
|
-
* @returns The combined result.
|
|
446
|
-
* @public
|
|
447
|
-
*/
|
|
448
|
-
combine: (e, t, s, n) => k.match(
|
|
449
|
-
e,
|
|
450
|
-
(r) => k.match(
|
|
451
|
-
t,
|
|
452
|
-
(a) => k.success(s(r, a)),
|
|
453
|
-
(a) => k.failure(a)
|
|
454
|
-
),
|
|
455
|
-
(r) => k.match(
|
|
456
|
-
t,
|
|
457
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
458
|
-
(a) => k.failure(r),
|
|
459
|
-
(a) => k.failure(n(r, a))
|
|
460
|
-
)
|
|
461
|
-
),
|
|
462
|
-
/**
|
|
463
|
-
* Compares two results for equality.
|
|
464
|
-
* @param r1 - The first result.
|
|
465
|
-
* @param r2 - The second result.
|
|
466
|
-
* @param options - The options to use for comparison. By default, uses strict equality.
|
|
467
|
-
* @returns `true` if the results are equal, `false` otherwise.
|
|
468
|
-
*/
|
|
469
|
-
equals: (e, t, s = {
|
|
470
|
-
valueEquals: (n, r) => n === r,
|
|
471
|
-
errorEquals: (n, r) => n === r
|
|
472
|
-
}) => e.type === "Success" && t.type === "Success" ? s.valueEquals(e.value, t.value) : e.type === "Failure" && t.type === "Failure" ? s.errorEquals(e.error, t.error) : !1,
|
|
473
|
-
/**
|
|
474
|
-
* Combines multiple results into a single result.
|
|
475
|
-
* @param results - The results to combine.
|
|
476
|
-
* @returns A single result that is a success if all the input results are successes, otherwise a failure.
|
|
477
|
-
*/
|
|
478
|
-
all: (e) => {
|
|
479
|
-
const t = [];
|
|
480
|
-
for (const s of e)
|
|
481
|
-
if (k.isSuccess(s))
|
|
482
|
-
t.push(s.value);
|
|
483
|
-
else
|
|
484
|
-
return s;
|
|
485
|
-
return k.success(t);
|
|
486
|
-
}
|
|
487
|
-
}, ce = {
|
|
488
|
-
loadingExtended: "Loading, please wait",
|
|
489
|
-
loadingShort: "Loading...",
|
|
490
|
-
locale: "Locale",
|
|
491
|
-
iconDescription: "Icon",
|
|
492
|
-
loadingIcon: "Loading icon",
|
|
493
|
-
failedToLoadIcon: "Failed to load icon",
|
|
494
|
-
editLabel: "Edit",
|
|
495
|
-
selectOne: "Select one",
|
|
496
|
-
selectMany: "Select many",
|
|
497
|
-
noResults: "No results",
|
|
498
|
-
passwordPlaceholderText: "Secret Password",
|
|
499
|
-
togglePasswordVisibility: "Toggle password visibility",
|
|
500
|
-
toggleMenu: "Toggle menu",
|
|
501
|
-
toggleAside: "Toggle aside",
|
|
502
|
-
mainNavigation: "Main navigation",
|
|
503
|
-
sidebar: "Sidebar",
|
|
504
|
-
closeDrawer: "Close drawer",
|
|
505
|
-
closeModal: "Close modal",
|
|
506
|
-
confirm: "Confirm",
|
|
507
|
-
cancel: "Cancel",
|
|
508
|
-
addLabel: "Add",
|
|
509
|
-
removeItem: "Remove item",
|
|
510
|
-
// languages
|
|
511
|
-
currentLocale: "English",
|
|
512
|
-
ar: "Arabic",
|
|
513
|
-
de: "German",
|
|
514
|
-
en: "English",
|
|
515
|
-
es: "Spanish",
|
|
516
|
-
fr: "French",
|
|
517
|
-
hi: "Hindi",
|
|
518
|
-
it: "Italian",
|
|
519
|
-
ja: "Japanese",
|
|
520
|
-
ko: "Korean",
|
|
521
|
-
nl: "Dutch",
|
|
522
|
-
pl: "Polish",
|
|
523
|
-
pt: "Portuguese",
|
|
524
|
-
ru: "Russian",
|
|
525
|
-
tr: "Turkish",
|
|
526
|
-
vi: "Vietnamese",
|
|
527
|
-
zh: "Chinese",
|
|
528
|
-
he: "Hebrew",
|
|
529
|
-
fa: "Persian",
|
|
530
|
-
ur: "Urdu",
|
|
531
|
-
// input
|
|
532
|
-
emailPlaceholderText: "Enter your email",
|
|
533
|
-
incrementValue: "Increment value",
|
|
534
|
-
decrementValue: "Decrement value",
|
|
535
|
-
// drop zone
|
|
536
|
-
dropZoneInstructions: (e) => e ? "Click to choose or drag files here, or press Enter or Space to open file selector" : "Drag files here",
|
|
537
|
-
// size
|
|
538
|
-
fileSizeUnits: ["Bytes", "KB", "MB", "GB", "TB"],
|
|
539
|
-
// file input
|
|
540
|
-
removeFile: "Remove file",
|
|
541
|
-
clearAllFiles: "Clear all files",
|
|
542
|
-
// inputs reset
|
|
543
|
-
clearValue: "Reset",
|
|
544
|
-
unknownType: "Unknown type",
|
|
545
|
-
filesInputInstructions: (e, t, s) => {
|
|
546
|
-
let n = e == null || e > 1 ? "Click to choose or drag files here" : "Click to choose or drag a file here";
|
|
547
|
-
if (e || t) {
|
|
548
|
-
const r = [];
|
|
549
|
-
if (e != null && e > 1 && r.push(`up to ${e} files`), t && s) {
|
|
550
|
-
const a = ee(t, {
|
|
551
|
-
units: s
|
|
552
|
-
});
|
|
553
|
-
r.push(`max ${a} each`);
|
|
554
|
-
}
|
|
555
|
-
r.length > 0 && (n += ` (${r.join(", ")})`);
|
|
556
|
-
} else if (t && s) {
|
|
557
|
-
const r = ee(t, {
|
|
558
|
-
units: s
|
|
559
|
-
});
|
|
560
|
-
n += ` (max ${r})`;
|
|
561
|
-
}
|
|
562
|
-
return n;
|
|
563
|
-
}
|
|
564
|
-
}, _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
565
|
-
__proto__: null,
|
|
566
|
-
default: ce
|
|
567
|
-
}, Symbol.toStringTag, { value: "Module" })), Ee = ce, Te = "en", Le = (e, t, s) => {
|
|
568
|
-
const n = e[t];
|
|
569
|
-
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((r, a) => {
|
|
570
|
-
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(a.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + t + (t.split("/").length !== s ? ". Note that variables only represent file names one level deep." : ""))));
|
|
571
|
-
});
|
|
572
|
-
}, Me = /* @__PURE__ */ new Set([
|
|
573
|
-
"ar",
|
|
574
|
-
// Arabic
|
|
575
|
-
"he",
|
|
576
|
-
// Hebrew
|
|
577
|
-
"fa",
|
|
578
|
-
// Persian/Farsi
|
|
579
|
-
"ur",
|
|
580
|
-
// Urdu
|
|
581
|
-
"ps",
|
|
582
|
-
// Pashto
|
|
583
|
-
"sd",
|
|
584
|
-
// Sindhi
|
|
585
|
-
"ku",
|
|
586
|
-
// Kurdish
|
|
587
|
-
"dv",
|
|
588
|
-
// Divehi/Maldivian
|
|
589
|
-
"yi",
|
|
590
|
-
// Yiddish
|
|
591
|
-
"ji",
|
|
592
|
-
// Yiddish (alternative code)
|
|
593
|
-
"iw",
|
|
594
|
-
// Hebrew (deprecated, but still used)
|
|
595
|
-
"in"
|
|
596
|
-
// Indonesian (deprecated, but sometimes confused)
|
|
597
|
-
]);
|
|
598
|
-
function ue(e) {
|
|
599
|
-
if (!e) return "ltr";
|
|
600
|
-
const t = e.split(/[-_]/)[0].toLowerCase();
|
|
601
|
-
return Me.has(t) ? "rtl" : "ltr";
|
|
602
|
-
}
|
|
603
|
-
function Pe(e, t) {
|
|
604
|
-
return e === "auto" ? ue(t) : e;
|
|
605
|
-
}
|
|
606
|
-
function xt(e) {
|
|
607
|
-
return `b-${e}`;
|
|
608
|
-
}
|
|
609
|
-
function St(e) {
|
|
610
|
-
return ue(e) === "rtl";
|
|
611
|
-
}
|
|
612
|
-
function Dt(e) {
|
|
613
|
-
return e === "ltr" ? "rtl" : "ltr";
|
|
614
|
-
}
|
|
615
|
-
const Ve = {
|
|
616
|
-
ltr: {
|
|
617
|
-
"inline-start": "left",
|
|
618
|
-
"inline-end": "right",
|
|
619
|
-
"block-start": "top",
|
|
620
|
-
"block-end": "bottom"
|
|
621
|
-
},
|
|
622
|
-
rtl: {
|
|
623
|
-
"inline-start": "right",
|
|
624
|
-
"inline-end": "left",
|
|
625
|
-
"block-start": "top",
|
|
626
|
-
"block-end": "bottom"
|
|
627
|
-
}
|
|
628
|
-
};
|
|
629
|
-
function It(e, t) {
|
|
630
|
-
return Ve[t][e];
|
|
631
|
-
}
|
|
632
|
-
const Ae = {
|
|
633
|
-
mark: ae("Locale"),
|
|
634
|
-
create: (e) => {
|
|
635
|
-
const t = X({
|
|
636
|
-
defaultValue: navigator.language ?? "en-US",
|
|
637
|
-
key: "beatui-locale"
|
|
638
|
-
}), s = X({
|
|
639
|
-
defaultValue: "auto",
|
|
640
|
-
key: "beatui-direction-preference"
|
|
641
|
-
}), n = y(
|
|
642
|
-
t,
|
|
643
|
-
s
|
|
644
|
-
)(
|
|
645
|
-
(a, o) => Pe(o, a)
|
|
646
|
-
);
|
|
647
|
-
return {
|
|
648
|
-
value: {
|
|
649
|
-
locale: t,
|
|
650
|
-
setLocale: (a) => t.set(a),
|
|
651
|
-
direction: n,
|
|
652
|
-
directionPreference: s,
|
|
653
|
-
setDirectionPreference: (a) => s.set(a)
|
|
654
|
-
},
|
|
655
|
-
dispose: () => {
|
|
656
|
-
t.dispose(), s.dispose(), n.dispose();
|
|
657
|
-
}
|
|
658
|
-
};
|
|
659
|
-
}
|
|
660
|
-
}, {
|
|
661
|
-
variants: $e,
|
|
662
|
-
special: Be,
|
|
663
|
-
overrides: Y
|
|
664
|
-
} = De;
|
|
665
|
-
function B(e, t) {
|
|
666
|
-
switch (e) {
|
|
667
|
-
case "white":
|
|
668
|
-
return "var(--color-white)";
|
|
669
|
-
case "black":
|
|
670
|
-
return "var(--color-black)";
|
|
671
|
-
case "transparent":
|
|
672
|
-
return "transparent";
|
|
673
|
-
default:
|
|
674
|
-
return Ie(e, t);
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
function de(e, t) {
|
|
678
|
-
const s = Be[e];
|
|
679
|
-
if (!s) return;
|
|
680
|
-
if (t === "light")
|
|
681
|
-
return s;
|
|
682
|
-
const n = Y[e];
|
|
683
|
-
return n ? n[t] : s;
|
|
684
|
-
}
|
|
685
|
-
function j(e, t, s) {
|
|
686
|
-
const n = Y[e];
|
|
687
|
-
if (n) {
|
|
688
|
-
const a = n[s];
|
|
689
|
-
if (a)
|
|
690
|
-
return { backgroundColor: a.backgroundColor, textColor: a.color };
|
|
691
|
-
}
|
|
692
|
-
if (t === "solid") {
|
|
693
|
-
const a = de(e, s);
|
|
694
|
-
if (a)
|
|
695
|
-
return {
|
|
696
|
-
backgroundColor: a.backgroundColor,
|
|
697
|
-
textColor: a.color
|
|
698
|
-
};
|
|
699
|
-
}
|
|
700
|
-
const r = $e[t][s];
|
|
701
|
-
return {
|
|
702
|
-
backgroundColor: B(e, r.bgShade),
|
|
703
|
-
textColor: r.textColor
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
|
-
const Oe = {
|
|
707
|
-
light: { shade: 600, textColor: "var(--color-white)" },
|
|
708
|
-
dark: { shade: 600, textColor: "var(--text-inverted-dark)" }
|
|
709
|
-
}, je = {
|
|
710
|
-
light: { shade: 300, textColor: "var(--text-normal-light)" },
|
|
711
|
-
dark: { shade: 700, textColor: "var(--text-normal-dark)" }
|
|
712
|
-
}, Ne = {
|
|
713
|
-
light: { shade: 400, textColor: "var(--text-normal-light)" },
|
|
714
|
-
dark: { shade: 600, textColor: "var(--text-normal-dark)" }
|
|
715
|
-
};
|
|
716
|
-
function A(e, t, s) {
|
|
717
|
-
const n = Y[e];
|
|
718
|
-
if (n) {
|
|
719
|
-
const a = n[s];
|
|
720
|
-
if (a)
|
|
721
|
-
return { backgroundColor: a.backgroundColor, textColor: a.color };
|
|
722
|
-
}
|
|
723
|
-
if (t === "solid") {
|
|
724
|
-
const a = de(e, s);
|
|
725
|
-
if (a)
|
|
726
|
-
return {
|
|
727
|
-
backgroundColor: a.backgroundColor,
|
|
728
|
-
textColor: a.color
|
|
729
|
-
};
|
|
730
|
-
const o = Oe[s];
|
|
731
|
-
return {
|
|
732
|
-
backgroundColor: B(e, o.shade),
|
|
733
|
-
textColor: o.textColor
|
|
734
|
-
};
|
|
735
|
-
}
|
|
736
|
-
const r = t === "light" ? je[s] : Ne[s];
|
|
737
|
-
return {
|
|
738
|
-
backgroundColor: B(e, r.shade),
|
|
739
|
-
textColor: r.textColor
|
|
740
|
-
};
|
|
741
|
-
}
|
|
742
|
-
function se(e, t) {
|
|
743
|
-
const s = t === "light" ? 500 : 600;
|
|
744
|
-
switch (e) {
|
|
745
|
-
case "white":
|
|
746
|
-
return t === "light" ? "var(--text-inverse-light)" : "var(--text-inverted-dark)";
|
|
747
|
-
case "black":
|
|
748
|
-
return "var(--color-black)";
|
|
749
|
-
case "transparent":
|
|
750
|
-
return "transparent";
|
|
751
|
-
default:
|
|
752
|
-
return B(e, s);
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
function N(e, t) {
|
|
756
|
-
return e === "white" ? "var(--color-white)" : e === "black" ? "var(--color-black)" : e === "transparent" ? "inherit" : B(e, t === "light" ? 800 : 200);
|
|
757
|
-
}
|
|
758
|
-
function ne(e, t, s) {
|
|
759
|
-
return t === "soft" ? B(e, s === "light" ? 300 : 700) : B(e, s === "light" ? 500 : 600);
|
|
760
|
-
}
|
|
761
|
-
const Fe = "bui-icons", U = /* @__PURE__ */ new Map(), he = (() => {
|
|
762
|
-
try {
|
|
763
|
-
return typeof indexedDB < "u" && indexedDB !== null;
|
|
764
|
-
} catch {
|
|
765
|
-
return !1;
|
|
766
|
-
}
|
|
767
|
-
})();
|
|
768
|
-
function qe() {
|
|
769
|
-
return he ? new Promise((e, t) => {
|
|
770
|
-
const s = indexedDB.open(Fe, 1);
|
|
771
|
-
s.onupgradeneeded = function(n) {
|
|
772
|
-
const r = n.target.result;
|
|
773
|
-
r.objectStoreNames.contains("icons") || r.createObjectStore("icons");
|
|
774
|
-
}, s.onsuccess = function() {
|
|
775
|
-
e(s.result);
|
|
776
|
-
}, s.onerror = function() {
|
|
777
|
-
t(s.error);
|
|
778
|
-
};
|
|
779
|
-
}) : Promise.reject(new Error("IndexedDB not available"));
|
|
780
|
-
}
|
|
781
|
-
const z = he ? qe() : null;
|
|
782
|
-
function Re(e, t) {
|
|
783
|
-
return new Promise(async (s, n) => {
|
|
784
|
-
try {
|
|
785
|
-
if (z) {
|
|
786
|
-
const a = (await z).transaction("icons", "readwrite");
|
|
787
|
-
a.objectStore("icons").put(t, e), a.oncomplete = s, a.onerror = n;
|
|
788
|
-
} else
|
|
789
|
-
U.set(e, t), s(void 0);
|
|
790
|
-
} catch {
|
|
791
|
-
U.set(e, t), s(void 0);
|
|
792
|
-
}
|
|
793
|
-
});
|
|
794
|
-
}
|
|
795
|
-
function He(e) {
|
|
796
|
-
return new Promise(async (t, s) => {
|
|
797
|
-
try {
|
|
798
|
-
if (z) {
|
|
799
|
-
const o = (await z).transaction("icons", "readonly").objectStore("icons").get(e);
|
|
800
|
-
o.onsuccess = function() {
|
|
801
|
-
t(o.result);
|
|
802
|
-
}, o.onerror = s;
|
|
803
|
-
} else
|
|
804
|
-
t(U.get(e) || null);
|
|
805
|
-
} catch {
|
|
806
|
-
t(U.get(e) || null);
|
|
807
|
-
}
|
|
808
|
-
});
|
|
809
|
-
}
|
|
810
|
-
async function Ue(e) {
|
|
811
|
-
const t = `https://api.iconify.design/${e}.svg`;
|
|
812
|
-
return fetch(t).then((s) => {
|
|
813
|
-
if (s.status === 200)
|
|
814
|
-
return s.text();
|
|
815
|
-
throw new Error(`Failed to load icon: ${e}`);
|
|
816
|
-
});
|
|
817
|
-
}
|
|
818
|
-
async function ze(e) {
|
|
819
|
-
const t = e.replace(":", "/"), s = await He(t);
|
|
820
|
-
if (s)
|
|
821
|
-
return s;
|
|
822
|
-
const n = await Ue(t);
|
|
823
|
-
return await Re(t, n), n;
|
|
824
|
-
}
|
|
825
|
-
function Ge(e) {
|
|
826
|
-
return ["bc-icon", `bc-icon--${e}`].join(" ");
|
|
827
|
-
}
|
|
828
|
-
function We(e, t = "solid") {
|
|
829
|
-
if (!e) return "";
|
|
830
|
-
const s = ne(e, t, "light"), n = ne(e, t, "dark");
|
|
831
|
-
return `--icon-color: ${s}; --icon-color-dark: ${n}`;
|
|
832
|
-
}
|
|
833
|
-
function O({
|
|
834
|
-
icon: e,
|
|
835
|
-
size: t = "md",
|
|
836
|
-
color: s,
|
|
837
|
-
title: n,
|
|
838
|
-
accessibility: r = "auto",
|
|
839
|
-
tone: a = "solid"
|
|
840
|
-
}, ...o) {
|
|
841
|
-
const i = y(
|
|
842
|
-
r,
|
|
843
|
-
n
|
|
844
|
-
)((l, d) => l === "decorative" ? !1 : l === "informative" ? !0 : d != null && d !== "");
|
|
845
|
-
return q(
|
|
846
|
-
R,
|
|
847
|
-
(l) => p.span(
|
|
848
|
-
c.class(
|
|
849
|
-
y(t, s)((d) => Ge(d ?? "md"))
|
|
850
|
-
),
|
|
851
|
-
c.style(
|
|
852
|
-
y(
|
|
853
|
-
s,
|
|
854
|
-
a
|
|
855
|
-
)(
|
|
856
|
-
(d, u) => We(d ?? void 0, u ?? "solid")
|
|
857
|
-
)
|
|
858
|
-
),
|
|
859
|
-
// Add accessibility attributes based on icon type
|
|
860
|
-
E(
|
|
861
|
-
i,
|
|
862
|
-
() => M(
|
|
863
|
-
c.role("img"),
|
|
864
|
-
S.label(Q(n, l.$.iconDescription))
|
|
865
|
-
),
|
|
866
|
-
() => S.hidden(!0)
|
|
867
|
-
),
|
|
868
|
-
Ce(
|
|
869
|
-
{ once: !0 },
|
|
870
|
-
() => xe({
|
|
871
|
-
request: e,
|
|
872
|
-
load: ({ request: d }) => ze(d),
|
|
873
|
-
convertError: String,
|
|
874
|
-
success: ({ value: d }) => p.span(
|
|
875
|
-
H.width("100%"),
|
|
876
|
-
H.height("100%"),
|
|
877
|
-
c.innerHTML(d)
|
|
878
|
-
),
|
|
879
|
-
pending: () => p.span(
|
|
880
|
-
c.class("animate-spin"),
|
|
881
|
-
// Loading state accessibility
|
|
882
|
-
E(
|
|
883
|
-
i,
|
|
884
|
-
() => M(c.role("img"), S.label(l.$.loadingIcon)),
|
|
885
|
-
() => S.hidden(!0)
|
|
886
|
-
),
|
|
887
|
-
"↻"
|
|
888
|
-
),
|
|
889
|
-
failure: ({ error: d }) => p.span(
|
|
890
|
-
c.title(d),
|
|
891
|
-
c.class("text-red-500"),
|
|
892
|
-
// Error state accessibility
|
|
893
|
-
E(
|
|
894
|
-
i,
|
|
895
|
-
() => M(c.role("img"), S.label(l.$.failedToLoadIcon)),
|
|
896
|
-
() => S.hidden(!0)
|
|
897
|
-
),
|
|
898
|
-
"🚫"
|
|
899
|
-
)
|
|
900
|
-
})
|
|
901
|
-
),
|
|
902
|
-
...o
|
|
903
|
-
)
|
|
904
|
-
);
|
|
905
|
-
}
|
|
906
|
-
function Ke(e, t, s) {
|
|
907
|
-
const n = [
|
|
908
|
-
"bc-button",
|
|
909
|
-
`bc-button--size-${e}`,
|
|
910
|
-
`bc-control--padding-${e}`,
|
|
911
|
-
`bc-control--rounded-${t}`
|
|
912
|
-
];
|
|
913
|
-
return s && n.push("bc-button--loading"), n.join(" ");
|
|
914
|
-
}
|
|
915
|
-
function Je(e, t, s) {
|
|
916
|
-
const n = /* @__PURE__ */ new Map();
|
|
917
|
-
n.set("--button-text-shadow", "var(--text-shadow-none)"), n.set("--button-text-shadow-dark", "var(--text-shadow-none)");
|
|
918
|
-
const r = (a, o, i, l) => {
|
|
919
|
-
s || (n.set("--button-bg-hover", a), n.set("--button-text-hover", i), n.set("--button-bg-hover-dark", o), n.set("--button-text-hover-dark", l));
|
|
920
|
-
};
|
|
921
|
-
switch (e) {
|
|
922
|
-
case "filled": {
|
|
923
|
-
const a = j(t, "solid", "light"), o = j(t, "solid", "dark");
|
|
924
|
-
n.set("--button-bg", a.backgroundColor), n.set("--button-text", a.textColor), n.set("--button-bg-dark", o.backgroundColor), n.set("--button-text-dark", o.textColor), n.set(
|
|
925
|
-
"--button-text-shadow",
|
|
926
|
-
"var(--text-shadow-button-filled, var(--text-shadow-sm))"
|
|
927
|
-
), n.set(
|
|
928
|
-
"--button-text-shadow-dark",
|
|
929
|
-
"var(--text-shadow-button-filled, var(--text-shadow-sm))"
|
|
930
|
-
);
|
|
931
|
-
const i = A(t, "solid", "light"), l = A(t, "solid", "dark");
|
|
932
|
-
r(
|
|
933
|
-
i.backgroundColor,
|
|
934
|
-
l.backgroundColor,
|
|
935
|
-
i.textColor,
|
|
936
|
-
l.textColor
|
|
937
|
-
);
|
|
938
|
-
break;
|
|
939
|
-
}
|
|
940
|
-
case "light": {
|
|
941
|
-
const a = j(t, "light", "light"), o = j(t, "light", "dark");
|
|
942
|
-
n.set("--button-bg", a.backgroundColor), n.set("--button-text", a.textColor), n.set("--button-bg-dark", o.backgroundColor), n.set("--button-text-dark", o.textColor);
|
|
943
|
-
const i = A(t, "light", "light"), l = A(t, "light", "dark");
|
|
944
|
-
r(
|
|
945
|
-
i.backgroundColor,
|
|
946
|
-
l.backgroundColor,
|
|
947
|
-
i.textColor,
|
|
948
|
-
l.textColor
|
|
949
|
-
);
|
|
950
|
-
break;
|
|
951
|
-
}
|
|
952
|
-
case "outline": {
|
|
953
|
-
n.set("--button-bg", "transparent"), n.set("--button-bg-dark", "transparent"), n.set("--button-border", se(t, "light")), n.set("--button-border-dark", se(t, "dark")), n.set("--button-text", N(t, "light")), n.set("--button-text-dark", N(t, "dark")), n.set(
|
|
954
|
-
"--button-text-shadow",
|
|
955
|
-
"var(--text-shadow-button-light, var(--text-shadow-xs))"
|
|
956
|
-
), n.set(
|
|
957
|
-
"--button-text-shadow-dark",
|
|
958
|
-
"var(--text-shadow-button-light, var(--text-shadow-xs))"
|
|
959
|
-
);
|
|
960
|
-
const a = A(t, "light", "light"), o = A(t, "light", "dark");
|
|
961
|
-
r(
|
|
962
|
-
a.backgroundColor,
|
|
963
|
-
o.backgroundColor,
|
|
964
|
-
a.textColor,
|
|
965
|
-
o.textColor
|
|
966
|
-
);
|
|
967
|
-
break;
|
|
968
|
-
}
|
|
969
|
-
case "default": {
|
|
970
|
-
const a = j("neutral", "light", "light"), o = j("neutral", "light", "dark");
|
|
971
|
-
n.set("--button-bg", a.backgroundColor), n.set("--button-text", N(t, "light")), n.set("--button-bg-dark", o.backgroundColor), n.set("--button-text-dark", N(t, "dark")), n.set(
|
|
972
|
-
"--button-text-shadow",
|
|
973
|
-
"var(--text-shadow-button-default, var(--text-shadow-2xs))"
|
|
974
|
-
), n.set(
|
|
975
|
-
"--button-text-shadow-dark",
|
|
976
|
-
"var(--text-shadow-button-default, var(--text-shadow-2xs))"
|
|
977
|
-
);
|
|
978
|
-
const i = A("base", "light", "light"), l = A("base", "light", "dark");
|
|
979
|
-
r(
|
|
980
|
-
i.backgroundColor,
|
|
981
|
-
l.backgroundColor,
|
|
982
|
-
n.get("--button-text") ?? a.textColor,
|
|
983
|
-
n.get("--button-text-dark") ?? o.textColor
|
|
984
|
-
);
|
|
985
|
-
break;
|
|
986
|
-
}
|
|
987
|
-
case "text": {
|
|
988
|
-
n.set("--button-bg", "transparent"), n.set("--button-bg-dark", "transparent"), n.set("--button-text", N(t, "light")), n.set("--button-text-dark", N(t, "dark")), s || n.set("--button-hover-decoration", "underline");
|
|
989
|
-
break;
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
return Array.from(n.entries()).map(([a, o]) => `${a}: ${o}`).join("; ");
|
|
993
|
-
}
|
|
994
|
-
function Qe({
|
|
995
|
-
type: e = "button",
|
|
996
|
-
disabled: t,
|
|
997
|
-
loading: s,
|
|
998
|
-
variant: n = "filled",
|
|
999
|
-
size: r = "md",
|
|
1000
|
-
color: a = "base",
|
|
1001
|
-
roundedness: o = "sm",
|
|
1002
|
-
onClick: i = () => {
|
|
1003
|
-
}
|
|
1004
|
-
}, ...l) {
|
|
1005
|
-
const d = I(null);
|
|
1006
|
-
return q(
|
|
1007
|
-
R,
|
|
1008
|
-
(u) => p.button(
|
|
1009
|
-
c.type(e),
|
|
1010
|
-
c.disabled(
|
|
1011
|
-
y(
|
|
1012
|
-
t,
|
|
1013
|
-
s
|
|
1014
|
-
)((h, g) => h || g)
|
|
1015
|
-
),
|
|
1016
|
-
// Add ARIA attributes for accessibility
|
|
1017
|
-
S.busy(s ?? !1),
|
|
1018
|
-
E(s ?? !1, () => S.label(u.$.loadingExtended)),
|
|
1019
|
-
c.class(
|
|
1020
|
-
y(
|
|
1021
|
-
r,
|
|
1022
|
-
o,
|
|
1023
|
-
s
|
|
1024
|
-
)(
|
|
1025
|
-
(h, g, v) => Ke(h ?? "md", g ?? "sm", v)
|
|
1026
|
-
)
|
|
1027
|
-
),
|
|
1028
|
-
c.style(
|
|
1029
|
-
y(
|
|
1030
|
-
n,
|
|
1031
|
-
a,
|
|
1032
|
-
t
|
|
1033
|
-
)(
|
|
1034
|
-
(h, g, v) => Je(
|
|
1035
|
-
h ?? "filled",
|
|
1036
|
-
g ?? "base",
|
|
1037
|
-
v
|
|
1038
|
-
)
|
|
1039
|
-
)
|
|
1040
|
-
),
|
|
1041
|
-
E(
|
|
1042
|
-
s ?? !1,
|
|
1043
|
-
() => M(
|
|
1044
|
-
H.width(
|
|
1045
|
-
d.map((h) => h == null ? "" : `${h.width}px`)
|
|
1046
|
-
),
|
|
1047
|
-
H.height(
|
|
1048
|
-
d.map((h) => h == null ? "" : `${h.height}px`)
|
|
1049
|
-
),
|
|
1050
|
-
O({ icon: "line-md:loading-twotone-loop", size: r ?? "md" }),
|
|
1051
|
-
// Hidden live region for screen reader announcements
|
|
1052
|
-
p.span(
|
|
1053
|
-
c.class("sr-only"),
|
|
1054
|
-
S.live("polite"),
|
|
1055
|
-
u.$.loadingExtended
|
|
1056
|
-
)
|
|
1057
|
-
),
|
|
1058
|
-
() => M(C.click(i), ...l)
|
|
1059
|
-
),
|
|
1060
|
-
E(
|
|
1061
|
-
s != null,
|
|
1062
|
-
() => Se(
|
|
1063
|
-
(h) => oe(
|
|
1064
|
-
h.on((g) => {
|
|
1065
|
-
D.get(s ?? !1) || d.set(g);
|
|
1066
|
-
})
|
|
1067
|
-
)
|
|
1068
|
-
)
|
|
1069
|
-
)
|
|
1070
|
-
)
|
|
1071
|
-
);
|
|
1072
|
-
}
|
|
1073
|
-
function Ye({
|
|
1074
|
-
size: e = "sm",
|
|
1075
|
-
icon: t = "line-md:close",
|
|
1076
|
-
disabled: s,
|
|
1077
|
-
roundedness: n = "full",
|
|
1078
|
-
color: r = "base",
|
|
1079
|
-
onClick: a,
|
|
1080
|
-
label: o
|
|
1081
|
-
}, ...i) {
|
|
1082
|
-
return q(R, (l) => {
|
|
1083
|
-
const d = Q(o, l.$.closeModal);
|
|
1084
|
-
return Qe(
|
|
1085
|
-
{
|
|
1086
|
-
variant: "text",
|
|
1087
|
-
size: e,
|
|
1088
|
-
roundedness: n,
|
|
1089
|
-
disabled: s,
|
|
1090
|
-
color: r,
|
|
1091
|
-
onClick: a
|
|
1092
|
-
},
|
|
1093
|
-
c.title(d),
|
|
1094
|
-
S.label(d),
|
|
1095
|
-
...i,
|
|
1096
|
-
O({ icon: t, size: e ?? "sm" })
|
|
1097
|
-
);
|
|
1098
|
-
});
|
|
1099
|
-
}
|
|
1100
|
-
function Ze(e, t, s) {
|
|
1101
|
-
const n = [
|
|
1102
|
-
e ? "bc-base-input-container" : "bc-input-container"
|
|
1103
|
-
];
|
|
1104
|
-
return t ? n.push(
|
|
1105
|
-
e ? "bc-base-input-container--disabled" : "bc-input-container--disabled"
|
|
1106
|
-
) : n.push(
|
|
1107
|
-
e ? "bc-base-input-container--default" : "bc-input-container--default"
|
|
1108
|
-
), s && n.push("bc-input-container--error"), n.join(" ");
|
|
1109
|
-
}
|
|
1110
|
-
const W = ({
|
|
1111
|
-
baseContainer: e,
|
|
1112
|
-
disabled: t,
|
|
1113
|
-
input: s,
|
|
1114
|
-
before: n,
|
|
1115
|
-
after: r,
|
|
1116
|
-
hasError: a,
|
|
1117
|
-
focusableSelector: o = "input, select, textarea",
|
|
1118
|
-
growInput: i = !0
|
|
1119
|
-
}, ...l) => {
|
|
1120
|
-
const d = D.map(t ?? !1, (u) => u);
|
|
1121
|
-
return p.div(
|
|
1122
|
-
ve((u) => {
|
|
1123
|
-
const h = () => {
|
|
1124
|
-
u.querySelector(o)?.focus();
|
|
1125
|
-
};
|
|
1126
|
-
return u.addEventListener("click", h), oe(() => u.removeEventListener("click", h));
|
|
1127
|
-
}),
|
|
1128
|
-
c.class(
|
|
1129
|
-
y(
|
|
1130
|
-
e,
|
|
1131
|
-
d,
|
|
1132
|
-
a ?? !1
|
|
1133
|
-
)(
|
|
1134
|
-
(u, h, g) => Ze(
|
|
1135
|
-
u ?? !1,
|
|
1136
|
-
h ?? !1,
|
|
1137
|
-
g ?? !1
|
|
1138
|
-
)
|
|
1139
|
-
)
|
|
1140
|
-
),
|
|
1141
|
-
n != null ? p.span(c.class("bc-input-container__before"), n) : null,
|
|
1142
|
-
p.div(
|
|
1143
|
-
c.class("bc-input-container__input"),
|
|
1144
|
-
c.class(
|
|
1145
|
-
D.map(
|
|
1146
|
-
i,
|
|
1147
|
-
(u) => u ? "bc-input-container__input--grow" : ""
|
|
1148
|
-
)
|
|
1149
|
-
),
|
|
1150
|
-
s
|
|
1151
|
-
),
|
|
1152
|
-
r != null ? p.span(c.class("bc-input-container__after"), r) : null,
|
|
1153
|
-
...l
|
|
1154
|
-
);
|
|
1155
|
-
};
|
|
1156
|
-
function K(e) {
|
|
1157
|
-
return `bc-label bc-label--${e}`;
|
|
1158
|
-
}
|
|
1159
|
-
const _t = (...e) => p.span(c.class(K("emphasis")), ...e), Xe = (...e) => p.span(c.class(K("default")), ...e), et = (...e) => p.span(c.class(K("muted")), ...e), Et = (...e) => p.span(c.class(K("danger")), ...e), Tt = (e) => {
|
|
1160
|
-
const {
|
|
1161
|
-
value: t,
|
|
1162
|
-
onBlur: s,
|
|
1163
|
-
onChange: n,
|
|
1164
|
-
placeholder: r,
|
|
1165
|
-
disabled: a,
|
|
1166
|
-
id: o,
|
|
1167
|
-
checkedIcon: i,
|
|
1168
|
-
uncheckedIcon: l,
|
|
1169
|
-
iconSize: d = "lg"
|
|
1170
|
-
} = e, u = o ?? le("checkbox"), h = `${u}-label`, g = () => {
|
|
1171
|
-
if (D.get(a ?? !1)) return;
|
|
1172
|
-
const f = D.get(t);
|
|
1173
|
-
n?.(!f);
|
|
1174
|
-
}, v = (f) => {
|
|
1175
|
-
D.get(a ?? !1) || (f.key === " " || f.key === "Enter") && (f.preventDefault(), g());
|
|
1176
|
-
};
|
|
1177
|
-
return W(
|
|
1178
|
-
{
|
|
1179
|
-
baseContainer: !0,
|
|
1180
|
-
growInput: !1,
|
|
1181
|
-
...e,
|
|
1182
|
-
input: p.span(
|
|
1183
|
-
c.class("bc-checkbox-input"),
|
|
1184
|
-
p.span(
|
|
1185
|
-
c.class("bc-checkbox-input__checkbox"),
|
|
1186
|
-
c.class(
|
|
1187
|
-
D.map(
|
|
1188
|
-
t,
|
|
1189
|
-
(f) => f ? "bc-checkbox-input__checkbox--checked" : "bc-checkbox-input__checkbox--unchecked"
|
|
1190
|
-
)
|
|
1191
|
-
),
|
|
1192
|
-
c.class(
|
|
1193
|
-
D.map(
|
|
1194
|
-
a ?? !1,
|
|
1195
|
-
(f) => f ? "bc-checkbox-input__checkbox--disabled" : ""
|
|
1196
|
-
)
|
|
1197
|
-
),
|
|
1198
|
-
c.id(u),
|
|
1199
|
-
c.role("checkbox"),
|
|
1200
|
-
c.tabindex(
|
|
1201
|
-
D.map(
|
|
1202
|
-
a ?? !1,
|
|
1203
|
-
(f) => f ? -1 : 0
|
|
1204
|
-
)
|
|
1205
|
-
),
|
|
1206
|
-
S.checked(t),
|
|
1207
|
-
S.disabled(a),
|
|
1208
|
-
r != null ? S.labelledby(h) : w,
|
|
1209
|
-
C.keydown(v),
|
|
1210
|
-
s != null ? C.blur(s) : w,
|
|
1211
|
-
O({
|
|
1212
|
-
icon: y(
|
|
1213
|
-
t,
|
|
1214
|
-
i,
|
|
1215
|
-
l
|
|
1216
|
-
)(
|
|
1217
|
-
(f, b, m) => f ? b ?? "akar-icons/check-box-fill" : m ?? "akar-icons/box"
|
|
1218
|
-
),
|
|
1219
|
-
accessibility: "decorative",
|
|
1220
|
-
size: d
|
|
1221
|
-
})
|
|
1222
|
-
),
|
|
1223
|
-
r != null ? p.label(
|
|
1224
|
-
c.class("bc-checkbox-input__label"),
|
|
1225
|
-
c.id(h),
|
|
1226
|
-
c.for(u),
|
|
1227
|
-
et(r)
|
|
1228
|
-
) : w
|
|
1229
|
-
)
|
|
1230
|
-
},
|
|
1231
|
-
C.click(g)
|
|
1232
|
-
);
|
|
1233
|
-
}, Z = ({
|
|
1234
|
-
autocomplete: e,
|
|
1235
|
-
autofocus: t,
|
|
1236
|
-
class: s,
|
|
1237
|
-
disabled: n,
|
|
1238
|
-
name: r,
|
|
1239
|
-
placeholder: a,
|
|
1240
|
-
id: o,
|
|
1241
|
-
required: i,
|
|
1242
|
-
hasError: l
|
|
1243
|
-
}) => M(
|
|
1244
|
-
c.autocomplete(e),
|
|
1245
|
-
c.autofocus(t),
|
|
1246
|
-
c.class(s),
|
|
1247
|
-
c.disabled(n),
|
|
1248
|
-
c.name(r ?? o),
|
|
1249
|
-
c.placeholder(a),
|
|
1250
|
-
c.id(o),
|
|
1251
|
-
S.required(i),
|
|
1252
|
-
l != null ? S.invalid(
|
|
1253
|
-
l ?? !1
|
|
1254
|
-
) : null
|
|
1255
|
-
), tt = p.span(
|
|
1256
|
-
c.class("bc-input-wrapper__required"),
|
|
1257
|
-
" *"
|
|
1258
|
-
);
|
|
1259
|
-
function st(e) {
|
|
1260
|
-
const t = ["bc-input-wrapper"];
|
|
1261
|
-
return e && t.push("bc-input-wrapper--horizontal"), t.join(" ");
|
|
1262
|
-
}
|
|
1263
|
-
function nt(e, t) {
|
|
1264
|
-
const s = ["bc-input-wrapper__label-text"];
|
|
1265
|
-
return e ? s.push("bc-input-wrapper__label-text--error") : t ? s.push("bc-input-wrapper__label-text--disabled") : s.push("bc-input-wrapper__label-text--default"), s.join(" ");
|
|
1266
|
-
}
|
|
1267
|
-
const pe = ({
|
|
1268
|
-
required: e,
|
|
1269
|
-
label: t,
|
|
1270
|
-
labelChildren: s,
|
|
1271
|
-
context: n,
|
|
1272
|
-
description: r,
|
|
1273
|
-
content: a,
|
|
1274
|
-
error: o,
|
|
1275
|
-
labelFor: i,
|
|
1276
|
-
hasError: l,
|
|
1277
|
-
disabled: d,
|
|
1278
|
-
horizontal: u
|
|
1279
|
-
}, ...h) => {
|
|
1280
|
-
const g = l ?? o != null, v = d ?? !1, f = u ?? !1, b = le("input-wrapper"), m = r ? `${b}-description` : void 0, T = o != null ? `${b}-error` : void 0;
|
|
1281
|
-
return p.div(
|
|
1282
|
-
c.class(
|
|
1283
|
-
D.map(f, (L) => st(L))
|
|
1284
|
-
),
|
|
1285
|
-
t != null || n != null ? p.div(
|
|
1286
|
-
c.class("bc-input-wrapper__header"),
|
|
1287
|
-
p.div(
|
|
1288
|
-
c.class("bc-input-wrapper__label-section"),
|
|
1289
|
-
p.label(
|
|
1290
|
-
c.class("bc-input-wrapper__label"),
|
|
1291
|
-
i != null ? c.for(i) : w,
|
|
1292
|
-
p.span(
|
|
1293
|
-
c.class(
|
|
1294
|
-
y(
|
|
1295
|
-
g,
|
|
1296
|
-
v
|
|
1297
|
-
)(
|
|
1298
|
-
(L, V) => nt(
|
|
1299
|
-
L ?? !1,
|
|
1300
|
-
V ?? !1
|
|
1301
|
-
)
|
|
1302
|
-
)
|
|
1303
|
-
),
|
|
1304
|
-
t
|
|
1305
|
-
),
|
|
1306
|
-
t != null && e ? tt : w
|
|
1307
|
-
),
|
|
1308
|
-
// Show description under label when horizontal
|
|
1309
|
-
E(
|
|
1310
|
-
y(
|
|
1311
|
-
f,
|
|
1312
|
-
r
|
|
1313
|
-
)((L, V) => L && V != null),
|
|
1314
|
-
() => p.div(
|
|
1315
|
-
c.class(
|
|
1316
|
-
"bc-input-wrapper__description bc-input-wrapper__description--under-label"
|
|
1317
|
-
),
|
|
1318
|
-
c.id(m),
|
|
1319
|
-
r
|
|
1320
|
-
)
|
|
1321
|
-
)
|
|
1322
|
-
),
|
|
1323
|
-
n != null ? Xe(n) : w,
|
|
1324
|
-
s
|
|
1325
|
-
) : w,
|
|
1326
|
-
p.div(
|
|
1327
|
-
c.class("bc-input-wrapper__content"),
|
|
1328
|
-
// Add data attributes to help inputs inherit accessibility information
|
|
1329
|
-
[m, T].filter(Boolean).length > 0 ? J.describedby(
|
|
1330
|
-
[m, T].filter(Boolean).join(" ")
|
|
1331
|
-
) : w,
|
|
1332
|
-
e ? J.required("true") : w,
|
|
1333
|
-
E(g, () => J.invalid("true")),
|
|
1334
|
-
a
|
|
1335
|
-
),
|
|
1336
|
-
// Show description at bottom only when not horizontal
|
|
1337
|
-
E(
|
|
1338
|
-
y(
|
|
1339
|
-
f,
|
|
1340
|
-
r
|
|
1341
|
-
)((L, V) => !L && V != null),
|
|
1342
|
-
() => p.div(
|
|
1343
|
-
c.class("bc-input-wrapper__description"),
|
|
1344
|
-
c.id(m),
|
|
1345
|
-
r
|
|
1346
|
-
)
|
|
1347
|
-
),
|
|
1348
|
-
o != null ? E(
|
|
1349
|
-
g,
|
|
1350
|
-
() => p.div(
|
|
1351
|
-
c.class("bc-input-wrapper__error"),
|
|
1352
|
-
c.id(T),
|
|
1353
|
-
S.live("polite"),
|
|
1354
|
-
// Announce errors to screen readers
|
|
1355
|
-
c.role("alert"),
|
|
1356
|
-
// Mark as alert for immediate attention
|
|
1357
|
-
o
|
|
1358
|
-
)
|
|
1359
|
-
) : null,
|
|
1360
|
-
...h
|
|
1361
|
-
);
|
|
1362
|
-
};
|
|
1363
|
-
function Lt(...e) {
|
|
1364
|
-
return p.div(c.class("bc-stack"), ...e);
|
|
1365
|
-
}
|
|
1366
|
-
const Mt = (e) => {
|
|
1367
|
-
const t = {
|
|
1368
|
-
name: "email",
|
|
1369
|
-
autocomplete: "email",
|
|
1370
|
-
...e
|
|
1371
|
-
}, {
|
|
1372
|
-
value: s,
|
|
1373
|
-
before: n,
|
|
1374
|
-
onBlur: r,
|
|
1375
|
-
onChange: a,
|
|
1376
|
-
onInput: o,
|
|
1377
|
-
placeholder: i
|
|
1378
|
-
} = t, l = n ?? O({
|
|
1379
|
-
icon: "line-md:email",
|
|
1380
|
-
size: "sm",
|
|
1381
|
-
color: "neutral"
|
|
1382
|
-
});
|
|
1383
|
-
return q(
|
|
1384
|
-
R,
|
|
1385
|
-
(d) => W({
|
|
1386
|
-
...e,
|
|
1387
|
-
before: l,
|
|
1388
|
-
input: ie.email(
|
|
1389
|
-
Z(t),
|
|
1390
|
-
c.placeholder(Q(i, d.$.emailPlaceholderText)),
|
|
1391
|
-
c.value(s),
|
|
1392
|
-
c.class("bc-input"),
|
|
1393
|
-
r != null ? C.blur(P(r)) : w,
|
|
1394
|
-
a != null ? C.change(P(a)) : w,
|
|
1395
|
-
o != null ? C.input(P(o)) : w
|
|
1396
|
-
)
|
|
1397
|
-
})
|
|
1398
|
-
);
|
|
1399
|
-
}, Pt = (e) => {
|
|
1400
|
-
const { value: t, onBlur: s, onChange: n, onInput: r } = e;
|
|
1401
|
-
return W({
|
|
1402
|
-
...e,
|
|
1403
|
-
input: ie.text(
|
|
1404
|
-
Z(e),
|
|
1405
|
-
c.value(t),
|
|
1406
|
-
c.class("bc-input"),
|
|
1407
|
-
s != null ? C.blur(P(s)) : w,
|
|
1408
|
-
n != null ? C.change(P(n)) : w,
|
|
1409
|
-
r != null ? C.input(P(r)) : w
|
|
1410
|
-
)
|
|
1411
|
-
});
|
|
1412
|
-
}, Vt = (e) => {
|
|
1413
|
-
const {
|
|
1414
|
-
value: t,
|
|
1415
|
-
onBlur: s,
|
|
1416
|
-
onChange: n,
|
|
1417
|
-
onInput: r,
|
|
1418
|
-
before: a,
|
|
1419
|
-
after: o,
|
|
1420
|
-
hasError: i,
|
|
1421
|
-
disabled: l,
|
|
1422
|
-
autocomplete: d,
|
|
1423
|
-
placeholder: u,
|
|
1424
|
-
...h
|
|
1425
|
-
} = e, g = {
|
|
1426
|
-
name: "password",
|
|
1427
|
-
disabled: l,
|
|
1428
|
-
...h
|
|
1429
|
-
}, v = I(!0), f = y(
|
|
1430
|
-
v,
|
|
1431
|
-
d
|
|
1432
|
-
)((b, m) => b ? m ?? "current-password" : "off");
|
|
1433
|
-
return q(R, (b) => {
|
|
1434
|
-
const m = y(
|
|
1435
|
-
b.$.passwordPlaceholderText,
|
|
1436
|
-
v,
|
|
1437
|
-
u
|
|
1438
|
-
)((L, V, me) => V ? "•••••••••••••••" : me ?? L), T = p.button(
|
|
1439
|
-
c.type("button"),
|
|
1440
|
-
c.class("bc-input-container__password-toggle"),
|
|
1441
|
-
S.label(b.$.togglePasswordVisibility),
|
|
1442
|
-
C.click(() => v.update((L) => !L)),
|
|
1443
|
-
E(
|
|
1444
|
-
v,
|
|
1445
|
-
() => O({ icon: "line-md:watch" }),
|
|
1446
|
-
() => O({ icon: "line-md:watch-off" })
|
|
1447
|
-
)
|
|
1448
|
-
);
|
|
1449
|
-
return W({
|
|
1450
|
-
before: a,
|
|
1451
|
-
disabled: l,
|
|
1452
|
-
hasError: i,
|
|
1453
|
-
input: p.input(
|
|
1454
|
-
Z({
|
|
1455
|
-
...g,
|
|
1456
|
-
autocomplete: f,
|
|
1457
|
-
placeholder: m
|
|
1458
|
-
}),
|
|
1459
|
-
E(
|
|
1460
|
-
v,
|
|
1461
|
-
() => M(c.type("password")),
|
|
1462
|
-
() => M(c.type("text"))
|
|
1463
|
-
),
|
|
1464
|
-
c.class("bc-input"),
|
|
1465
|
-
c.value(t),
|
|
1466
|
-
s != null ? C.blur(P(s)) : w,
|
|
1467
|
-
n != null ? C.change(P(n)) : w,
|
|
1468
|
-
r != null ? C.input(P(r)) : w
|
|
1469
|
-
),
|
|
1470
|
-
after: o != null ? M(T, o) : T
|
|
1471
|
-
});
|
|
1472
|
-
});
|
|
1473
|
-
}, rt = (
|
|
1474
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1475
|
-
(e, t) => () => {
|
|
1476
|
-
e.markTouched(), t?.();
|
|
1477
|
-
}
|
|
1478
|
-
), at = (e, t) => (s) => {
|
|
1479
|
-
e.change(s), t?.(s);
|
|
1480
|
-
};
|
|
1481
|
-
function fe(e, t) {
|
|
1482
|
-
const { controller: s, onBlur: n, onChange: r, ...a } = t;
|
|
1483
|
-
return e({
|
|
1484
|
-
id: s.name,
|
|
1485
|
-
disabled: s.disabled,
|
|
1486
|
-
value: s.value,
|
|
1487
|
-
hasError: s.errorVisible,
|
|
1488
|
-
...a,
|
|
1489
|
-
onChange: at(s, r),
|
|
1490
|
-
onBlur: rt(s, n)
|
|
1491
|
-
});
|
|
1492
|
-
}
|
|
1493
|
-
function At(e, t, ...s) {
|
|
1494
|
-
return pe(
|
|
1495
|
-
{
|
|
1496
|
-
...t,
|
|
1497
|
-
content: fe(
|
|
1498
|
-
e,
|
|
1499
|
-
t
|
|
1500
|
-
)
|
|
1501
|
-
},
|
|
1502
|
-
...s
|
|
1503
|
-
);
|
|
1504
|
-
}
|
|
1505
|
-
function ot(e, t) {
|
|
1506
|
-
const { toInput: s, fromInput: n, controller: r, ...a } = t, o = r.transform(s, n);
|
|
1507
|
-
return fe(e, {
|
|
1508
|
-
...a,
|
|
1509
|
-
controller: o
|
|
1510
|
-
});
|
|
1511
|
-
}
|
|
1512
|
-
function $t(e, t, ...s) {
|
|
1513
|
-
return pe(
|
|
1514
|
-
{
|
|
1515
|
-
...t,
|
|
1516
|
-
content: ot(e, t)
|
|
1517
|
-
},
|
|
1518
|
-
...s
|
|
1519
|
-
);
|
|
1520
|
-
}
|
|
1521
|
-
function Bt(e) {
|
|
1522
|
-
return e.split(".").map((s) => {
|
|
1523
|
-
const n = s.match(/^\[(\d+)\]$/);
|
|
1524
|
-
return n ? Number(n[1]) : s;
|
|
1525
|
-
});
|
|
1526
|
-
}
|
|
1527
|
-
function it(e) {
|
|
1528
|
-
return typeof e == "number" ? `[${e}]` : `.${e}`;
|
|
1529
|
-
}
|
|
1530
|
-
function lt(e) {
|
|
1531
|
-
if (e.length === 0) return "";
|
|
1532
|
-
const [t, ...s] = e;
|
|
1533
|
-
return [
|
|
1534
|
-
typeof t == "number" ? `[${t}]` : t,
|
|
1535
|
-
...s.map(it)
|
|
1536
|
-
].join("");
|
|
1537
|
-
}
|
|
1538
|
-
function G(e) {
|
|
1539
|
-
return function(s) {
|
|
1540
|
-
if (s.type === "valid") return s;
|
|
1541
|
-
let n = s.error;
|
|
1542
|
-
for (const r of e)
|
|
1543
|
-
if (n = n?.dependencies?.[r], n == null) return _.valid;
|
|
1544
|
-
return _.invalid(n);
|
|
1545
|
-
};
|
|
1546
|
-
}
|
|
1547
|
-
class $ {
|
|
1548
|
-
path;
|
|
1549
|
-
change;
|
|
1550
|
-
value;
|
|
1551
|
-
status;
|
|
1552
|
-
error;
|
|
1553
|
-
hasError;
|
|
1554
|
-
touched;
|
|
1555
|
-
errorVisible;
|
|
1556
|
-
dirty;
|
|
1557
|
-
dependencyErrors;
|
|
1558
|
-
#e = {
|
|
1559
|
-
disabled: I(!1),
|
|
1560
|
-
touched: I(!1)
|
|
1561
|
-
};
|
|
1562
|
-
#s;
|
|
1563
|
-
#t = I(void 0);
|
|
1564
|
-
parent;
|
|
1565
|
-
disabled;
|
|
1566
|
-
#n = [];
|
|
1567
|
-
disabledOrHasErrors;
|
|
1568
|
-
constructor(t, s, n, r, a, o = F) {
|
|
1569
|
-
this.path = t, this.change = s, this.value = n, this.status = r, this.#s = o, this.#t.set(n.value), this.error = r.map(
|
|
1570
|
-
(i) => i?.type === "invalid" ? i.error?.message : void 0
|
|
1571
|
-
), this.hasError = this.error.map((i) => i != null), this.touched = this.#e.touched, a.validationMode ? this.errorVisible = y(
|
|
1572
|
-
this.hasError,
|
|
1573
|
-
this.touched,
|
|
1574
|
-
a.validationMode
|
|
1575
|
-
)((i, l, d) => d === "continuous" ? !!i : !!i && !!l) : this.errorVisible = y(
|
|
1576
|
-
this.hasError,
|
|
1577
|
-
this.touched
|
|
1578
|
-
)((i, l) => !!i && !!l), this.dirty = y(
|
|
1579
|
-
this.value,
|
|
1580
|
-
this.#t
|
|
1581
|
-
)((i, l) => !this.#s(i, l)), this.dependencyErrors = r.map(
|
|
1582
|
-
(i) => i?.type === "invalid" ? i.error?.dependencies : void 0
|
|
1583
|
-
), this.parent = a, this.disabled = y(
|
|
1584
|
-
this.#e.disabled,
|
|
1585
|
-
a.disabled
|
|
1586
|
-
)((i, l) => i || l), this.disabledOrHasErrors = y(
|
|
1587
|
-
this.disabled,
|
|
1588
|
-
this.hasError
|
|
1589
|
-
)((i, l) => i || l), this.onDispose(() => {
|
|
1590
|
-
this.#e.disabled.dispose(), this.#e.touched.dispose(), this.disabled.dispose(), this.error.dispose(), this.errorVisible.dispose(), this.dirty.dispose(), this.#t.dispose(), this.dependencyErrors.dispose(), this.disabledOrHasErrors.dispose();
|
|
1591
|
-
});
|
|
1592
|
-
}
|
|
1593
|
-
get name() {
|
|
1594
|
-
return lt(this.path);
|
|
1595
|
-
}
|
|
1596
|
-
onDispose = (t) => {
|
|
1597
|
-
this.#n.push(t);
|
|
1598
|
-
};
|
|
1599
|
-
dispose = () => {
|
|
1600
|
-
for (const t of this.#n)
|
|
1601
|
-
try {
|
|
1602
|
-
t();
|
|
1603
|
-
} catch (s) {
|
|
1604
|
-
console.error("Error in dispose callback:", s);
|
|
1605
|
-
}
|
|
1606
|
-
this.#n.length = 0;
|
|
1607
|
-
};
|
|
1608
|
-
setDisabled = (t) => {
|
|
1609
|
-
this.#e.disabled.set(t);
|
|
1610
|
-
};
|
|
1611
|
-
disable = () => this.setDisabled(!0);
|
|
1612
|
-
enable = () => this.setDisabled(!1);
|
|
1613
|
-
markTouched = () => {
|
|
1614
|
-
this.#e.touched.set(!0);
|
|
1615
|
-
};
|
|
1616
|
-
resetTouched = () => {
|
|
1617
|
-
this.#e.touched.set(!1);
|
|
1618
|
-
};
|
|
1619
|
-
markPristine = () => {
|
|
1620
|
-
this.#t.set(this.value.value);
|
|
1621
|
-
};
|
|
1622
|
-
reset = () => {
|
|
1623
|
-
this.change(this.#t.value);
|
|
1624
|
-
};
|
|
1625
|
-
array = (t = F) => new ut(
|
|
1626
|
-
this.path,
|
|
1627
|
-
this.change,
|
|
1628
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1629
|
-
this.value,
|
|
1630
|
-
this.status,
|
|
1631
|
-
this.parent,
|
|
1632
|
-
t
|
|
1633
|
-
);
|
|
1634
|
-
object = (t = F) => new ct(
|
|
1635
|
-
this.path,
|
|
1636
|
-
this.change,
|
|
1637
|
-
this.value,
|
|
1638
|
-
this.status,
|
|
1639
|
-
this.parent,
|
|
1640
|
-
t
|
|
1641
|
-
);
|
|
1642
|
-
transform = (t, s, n = [], r = F) => new $(
|
|
1643
|
-
[...this.path, ...n],
|
|
1644
|
-
(a) => this.change(s(a)),
|
|
1645
|
-
this.value.map(t, r),
|
|
1646
|
-
this.status.map(G(n)),
|
|
1647
|
-
this.parent,
|
|
1648
|
-
r
|
|
1649
|
-
);
|
|
1650
|
-
asyncTransform = (t, s, n, r = [], a = F) => new $(
|
|
1651
|
-
[...this.path, ...r],
|
|
1652
|
-
(o) => {
|
|
1653
|
-
s(o).then((i) => this.change(i));
|
|
1654
|
-
},
|
|
1655
|
-
this.value.mapAsync(t, n, void 0, a),
|
|
1656
|
-
this.status.map(G(r)),
|
|
1657
|
-
this.parent,
|
|
1658
|
-
a
|
|
1659
|
-
);
|
|
1660
|
-
}
|
|
1661
|
-
class ct extends $ {
|
|
1662
|
-
#e = /* @__PURE__ */ new Map();
|
|
1663
|
-
#s = /* @__PURE__ */ new Map();
|
|
1664
|
-
#t = /* @__PURE__ */ new Map();
|
|
1665
|
-
#n = I(!1);
|
|
1666
|
-
touchedDeep = this.#n;
|
|
1667
|
-
#a = /* @__PURE__ */ new Map();
|
|
1668
|
-
#r = /* @__PURE__ */ new Map();
|
|
1669
|
-
#i = I(!1);
|
|
1670
|
-
dirtyDeep = this.#i;
|
|
1671
|
-
#c;
|
|
1672
|
-
#u;
|
|
1673
|
-
#l = () => {
|
|
1674
|
-
let t = !1;
|
|
1675
|
-
for (const s of this.#s.values())
|
|
1676
|
-
if (s) {
|
|
1677
|
-
t = !0;
|
|
1678
|
-
break;
|
|
1679
|
-
}
|
|
1680
|
-
this.#n.set(this.touched.value || t);
|
|
1681
|
-
};
|
|
1682
|
-
constructor(t, s, n, r, a, o) {
|
|
1683
|
-
super(
|
|
1684
|
-
t,
|
|
1685
|
-
s,
|
|
1686
|
-
n.map((l) => l ?? {}, o),
|
|
1687
|
-
r,
|
|
1688
|
-
a,
|
|
1689
|
-
o
|
|
1690
|
-
), this.#c = this.touched.on(() => {
|
|
1691
|
-
this.#l();
|
|
1692
|
-
}), this.#u = this.dirty.on(() => {
|
|
1693
|
-
this.#o();
|
|
1694
|
-
});
|
|
1695
|
-
const i = this.value.on(() => this.#o());
|
|
1696
|
-
this.onDispose(() => {
|
|
1697
|
-
for (const l of this.#e.values())
|
|
1698
|
-
l.dispose();
|
|
1699
|
-
this.#e.clear();
|
|
1700
|
-
for (const l of this.#t.values()) l();
|
|
1701
|
-
this.#t.clear(), this.#s.clear(), this.#n.dispose();
|
|
1702
|
-
for (const l of this.#r.values()) l();
|
|
1703
|
-
this.#r.clear(), this.#a.clear(), this.#i.dispose(), this.#c(), this.#u(), i();
|
|
1704
|
-
});
|
|
1705
|
-
}
|
|
1706
|
-
field = (t) => {
|
|
1707
|
-
if (this.#e.has(t))
|
|
1708
|
-
return this.#e.get(t);
|
|
1709
|
-
const s = async (o) => {
|
|
1710
|
-
this.change({
|
|
1711
|
-
...this.value.value,
|
|
1712
|
-
[t]: o
|
|
1713
|
-
});
|
|
1714
|
-
}, n = new $(
|
|
1715
|
-
[...this.path, t],
|
|
1716
|
-
s,
|
|
1717
|
-
this.value.map((o) => o[t]),
|
|
1718
|
-
this.status.map(G([t])),
|
|
1719
|
-
{
|
|
1720
|
-
disabled: this.disabled,
|
|
1721
|
-
// propagate validationMode to children if present
|
|
1722
|
-
validationMode: this.parent.validationMode
|
|
1723
|
-
}
|
|
1724
|
-
);
|
|
1725
|
-
this.#e.set(t, n);
|
|
1726
|
-
const r = n.touched.on((o) => {
|
|
1727
|
-
this.#s.set(t, o), this.#l();
|
|
1728
|
-
});
|
|
1729
|
-
this.#t.set(t, r);
|
|
1730
|
-
const a = n.dirty.on((o) => {
|
|
1731
|
-
this.#a.set(t, o), this.#o();
|
|
1732
|
-
});
|
|
1733
|
-
return this.#r.set(t, a), n;
|
|
1734
|
-
};
|
|
1735
|
-
markAllTouched = () => {
|
|
1736
|
-
this.markTouched();
|
|
1737
|
-
const t = this.value.value;
|
|
1738
|
-
for (const s of Object.keys(t))
|
|
1739
|
-
this.field(s).markTouched();
|
|
1740
|
-
for (const s of this.#e.values())
|
|
1741
|
-
s.markTouched();
|
|
1742
|
-
};
|
|
1743
|
-
markAllPristine = () => {
|
|
1744
|
-
this.markPristine();
|
|
1745
|
-
const t = this.value.value;
|
|
1746
|
-
for (const s of Object.keys(t))
|
|
1747
|
-
this.field(s).markPristine?.();
|
|
1748
|
-
for (const s of this.#e.values())
|
|
1749
|
-
s.markPristine?.();
|
|
1750
|
-
};
|
|
1751
|
-
#o = () => {
|
|
1752
|
-
let t = !1;
|
|
1753
|
-
for (const s of this.#a.values())
|
|
1754
|
-
if (s) {
|
|
1755
|
-
t = !0;
|
|
1756
|
-
break;
|
|
1757
|
-
}
|
|
1758
|
-
this.#i.set(this.dirty.value || t);
|
|
1759
|
-
};
|
|
1760
|
-
}
|
|
1761
|
-
class ut extends $ {
|
|
1762
|
-
#e = new Array();
|
|
1763
|
-
length;
|
|
1764
|
-
#s = /* @__PURE__ */ new Map();
|
|
1765
|
-
#t = /* @__PURE__ */ new Map();
|
|
1766
|
-
#n = I(!1);
|
|
1767
|
-
touchedDeep = this.#n;
|
|
1768
|
-
#a = /* @__PURE__ */ new Map();
|
|
1769
|
-
#r = /* @__PURE__ */ new Map();
|
|
1770
|
-
#i = I(!1);
|
|
1771
|
-
dirtyDeep = this.#i;
|
|
1772
|
-
#c;
|
|
1773
|
-
#u;
|
|
1774
|
-
#l = () => {
|
|
1775
|
-
let t = !1;
|
|
1776
|
-
for (const s of this.#s.values())
|
|
1777
|
-
if (s) {
|
|
1778
|
-
t = !0;
|
|
1779
|
-
break;
|
|
1780
|
-
}
|
|
1781
|
-
this.#n.set(this.touched.value || t);
|
|
1782
|
-
};
|
|
1783
|
-
constructor(t, s, n, r, a, o) {
|
|
1784
|
-
const i = n.map((u) => u ?? [], o);
|
|
1785
|
-
super(t, s, i, r, a, o);
|
|
1786
|
-
const l = i.on((u) => {
|
|
1787
|
-
const h = this.#e.length - u.length;
|
|
1788
|
-
h > 0 && (this.#e.splice(u.length, h).forEach((g, v) => {
|
|
1789
|
-
const f = u.length + v;
|
|
1790
|
-
g.dispose(), this.#t.get(f)?.(), this.#t.delete(f), this.#s.delete(f), this.#r.get(f)?.(), this.#r.delete(f), this.#a.delete(f);
|
|
1791
|
-
}), this.#l(), this.#o());
|
|
1792
|
-
});
|
|
1793
|
-
this.length = i.map((u) => u.length), this.#c = this.touched.on(() => {
|
|
1794
|
-
this.#l();
|
|
1795
|
-
}), this.#u = this.dirty.on(() => {
|
|
1796
|
-
this.#o();
|
|
1797
|
-
});
|
|
1798
|
-
const d = this.value.on(() => this.#o());
|
|
1799
|
-
this.onDispose(() => {
|
|
1800
|
-
for (const u of this.#e)
|
|
1801
|
-
u.dispose();
|
|
1802
|
-
this.length.dispose(), this.#e.length = 0, l(), i.dispose();
|
|
1803
|
-
for (const u of this.#t.values()) u();
|
|
1804
|
-
this.#t.clear(), this.#s.clear(), this.#n.dispose();
|
|
1805
|
-
for (const u of this.#r.values()) u();
|
|
1806
|
-
this.#r.clear(), this.#a.clear(), this.#i.dispose(), this.#c(), this.#u(), d();
|
|
1807
|
-
});
|
|
1808
|
-
}
|
|
1809
|
-
item = (t) => {
|
|
1810
|
-
if (this.#e[t])
|
|
1811
|
-
return this.#e[t];
|
|
1812
|
-
const s = async (o) => {
|
|
1813
|
-
const i = this.value.value.slice();
|
|
1814
|
-
i[t] = o, this.change(i);
|
|
1815
|
-
}, n = new $(
|
|
1816
|
-
[...this.path, t],
|
|
1817
|
-
s,
|
|
1818
|
-
this.value.map((o) => o[t]),
|
|
1819
|
-
this.status.map(G([t])),
|
|
1820
|
-
{
|
|
1821
|
-
disabled: this.disabled,
|
|
1822
|
-
validationMode: this.parent.validationMode
|
|
1823
|
-
}
|
|
1824
|
-
);
|
|
1825
|
-
this.#e[t] = n;
|
|
1826
|
-
const r = n.touched.on((o) => {
|
|
1827
|
-
this.#s.set(t, o), this.#l();
|
|
1828
|
-
});
|
|
1829
|
-
this.#t.set(t, r);
|
|
1830
|
-
const a = n.dirty.on((o) => {
|
|
1831
|
-
this.#a.set(t, o), this.#o();
|
|
1832
|
-
});
|
|
1833
|
-
return this.#r.set(t, a), n;
|
|
1834
|
-
};
|
|
1835
|
-
push = (...t) => {
|
|
1836
|
-
this.change([...this.value.value, ...t]);
|
|
1837
|
-
};
|
|
1838
|
-
pop = () => {
|
|
1839
|
-
this.splice(this.value.value.length - 1, 1);
|
|
1840
|
-
};
|
|
1841
|
-
shift = () => {
|
|
1842
|
-
this.splice(0, 1);
|
|
1843
|
-
};
|
|
1844
|
-
unshift = (...t) => {
|
|
1845
|
-
this.change([...t, ...this.value.value]);
|
|
1846
|
-
};
|
|
1847
|
-
removeAt = (t) => {
|
|
1848
|
-
this.splice(t, 1);
|
|
1849
|
-
};
|
|
1850
|
-
splice = (t, s) => {
|
|
1851
|
-
const n = this.value.value.slice();
|
|
1852
|
-
n.splice(t, s), this.change(n);
|
|
1853
|
-
};
|
|
1854
|
-
move = (t, s, n = 1) => {
|
|
1855
|
-
if (n < 1 || t === s) return;
|
|
1856
|
-
const r = this.value.value.slice(), a = r.splice(t, n);
|
|
1857
|
-
r.splice(s, 0, ...a), this.change(r);
|
|
1858
|
-
};
|
|
1859
|
-
markAllTouched = () => {
|
|
1860
|
-
this.markTouched();
|
|
1861
|
-
const t = this.value.value.length;
|
|
1862
|
-
for (let s = 0; s < t; s++)
|
|
1863
|
-
this.item(s).markTouched();
|
|
1864
|
-
};
|
|
1865
|
-
markAllPristine = () => {
|
|
1866
|
-
this.markPristine();
|
|
1867
|
-
const t = this.value.value.length;
|
|
1868
|
-
for (let s = 0; s < t; s++)
|
|
1869
|
-
this.item(s).markPristine?.();
|
|
1870
|
-
};
|
|
1871
|
-
#o = () => {
|
|
1872
|
-
let t = !1;
|
|
1873
|
-
for (const s of this.#a.values())
|
|
1874
|
-
if (s) {
|
|
1875
|
-
t = !0;
|
|
1876
|
-
break;
|
|
1877
|
-
}
|
|
1878
|
-
this.#i.set(this.dirty.value || t);
|
|
1879
|
-
};
|
|
1880
|
-
}
|
|
1881
|
-
function dt(e) {
|
|
1882
|
-
function t(s) {
|
|
1883
|
-
return typeof s == "number" ? s : s.toString();
|
|
1884
|
-
}
|
|
1885
|
-
return e.map(
|
|
1886
|
-
(s) => typeof s == "object" && s.key != null ? t(s.key) : t(s)
|
|
1887
|
-
);
|
|
1888
|
-
}
|
|
1889
|
-
function ht(e) {
|
|
1890
|
-
const t = e.filter((r) => r.path == null || r.path.length === 0).map((r) => r.message), s = e.filter((r) => r.path != null && r.path.length > 0).reduce((r, a) => {
|
|
1891
|
-
const o = dt(a.path), i = o.pop();
|
|
1892
|
-
let l = r;
|
|
1893
|
-
for (const d of o)
|
|
1894
|
-
l.dependencies == null && (l.dependencies = {}), l.dependencies[d] == null && (l.dependencies[d] = {}), l = l.dependencies[d];
|
|
1895
|
-
return l.dependencies == null && (l.dependencies = {}), l.dependencies[i] = { message: a.message }, r;
|
|
1896
|
-
}, {}), n = t.join(`
|
|
1897
|
-
`);
|
|
1898
|
-
return {
|
|
1899
|
-
...s,
|
|
1900
|
-
message: n != "" ? n : void 0
|
|
1901
|
-
};
|
|
1902
|
-
}
|
|
1903
|
-
function pt({
|
|
1904
|
-
initialValue: e,
|
|
1905
|
-
onChange: t,
|
|
1906
|
-
validate: s,
|
|
1907
|
-
equals: n,
|
|
1908
|
-
validationMode: r,
|
|
1909
|
-
validateDebounceMs: a
|
|
1910
|
-
}) {
|
|
1911
|
-
const o = D.deriveProp(e), i = I(_.valid), l = I(!1), d = I(r ?? "touchedOrSubmit"), u = (b) => {
|
|
1912
|
-
i.set(b);
|
|
1913
|
-
};
|
|
1914
|
-
let h;
|
|
1915
|
-
const g = async (b) => {
|
|
1916
|
-
if (s != null) {
|
|
1917
|
-
const m = await s(b);
|
|
1918
|
-
u(m);
|
|
1919
|
-
}
|
|
1920
|
-
}, v = async (b) => {
|
|
1921
|
-
o.set(b), t?.(b);
|
|
1922
|
-
const m = d.value;
|
|
1923
|
-
if (s != null) {
|
|
1924
|
-
if (m === "onSubmit")
|
|
1925
|
-
return;
|
|
1926
|
-
const T = a ?? 0;
|
|
1927
|
-
T > 0 ? (h && clearTimeout(h), h = setTimeout(() => {
|
|
1928
|
-
g(b);
|
|
1929
|
-
}, T)) : await g(b);
|
|
1930
|
-
}
|
|
1931
|
-
}, f = new $(
|
|
1932
|
-
[],
|
|
1933
|
-
v,
|
|
1934
|
-
o,
|
|
1935
|
-
i,
|
|
1936
|
-
{
|
|
1937
|
-
disabled: l,
|
|
1938
|
-
validationMode: d
|
|
1939
|
-
},
|
|
1940
|
-
n ?? F
|
|
1941
|
-
);
|
|
1942
|
-
return f.onDispose(() => {
|
|
1943
|
-
l.dispose(), o.dispose(), i.dispose(), d.dispose(), h && clearTimeout(h);
|
|
1944
|
-
}), { controller: f, setStatus: u };
|
|
1945
|
-
}
|
|
1946
|
-
function be(e) {
|
|
1947
|
-
return M(c.disabled(e.disabled), c.name(e.name));
|
|
1948
|
-
}
|
|
1949
|
-
function Ot(e, {
|
|
1950
|
-
triggerOn: t = "change"
|
|
1951
|
-
} = {}) {
|
|
1952
|
-
return M(
|
|
1953
|
-
be(e),
|
|
1954
|
-
c.value(e.value),
|
|
1955
|
-
(t === "input" ? C.input : C.change)(P(e.change))
|
|
1956
|
-
);
|
|
1957
|
-
}
|
|
1958
|
-
function jt(e, {
|
|
1959
|
-
triggerOn: t = "change"
|
|
1960
|
-
} = {}) {
|
|
1961
|
-
return M(
|
|
1962
|
-
be(e),
|
|
1963
|
-
c.valueAsNumber(e.value),
|
|
1964
|
-
(t === "input" ? C.input : C.change)(
|
|
1965
|
-
ke(e.change)
|
|
1966
|
-
)
|
|
1967
|
-
);
|
|
1968
|
-
}
|
|
1969
|
-
function re(e) {
|
|
1970
|
-
return e.issues != null ? _.invalid(ht(e.issues)) : _.valid;
|
|
1971
|
-
}
|
|
1972
|
-
async function Nt({
|
|
1973
|
-
task: e,
|
|
1974
|
-
errorMessage: t,
|
|
1975
|
-
errorPath: s = ["root"],
|
|
1976
|
-
validation: n
|
|
1977
|
-
}) {
|
|
1978
|
-
try {
|
|
1979
|
-
const r = await e();
|
|
1980
|
-
return n != null ? n(r) : _.valid;
|
|
1981
|
-
} catch (r) {
|
|
1982
|
-
const a = t ?? (r instanceof Error ? r.message : "Operation failed");
|
|
1983
|
-
return s.length === 1 && s[0] === "root" ? _.invalid({
|
|
1984
|
-
message: a
|
|
1985
|
-
}) : _.invalid({
|
|
1986
|
-
dependencies: ge(s, a)
|
|
1987
|
-
});
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
function ge(e, t) {
|
|
1991
|
-
if (e.length === 1)
|
|
1992
|
-
return {
|
|
1993
|
-
[e[0]]: { message: t }
|
|
1994
|
-
};
|
|
1995
|
-
const [s, ...n] = e;
|
|
1996
|
-
return {
|
|
1997
|
-
[s]: {
|
|
1998
|
-
dependencies: ge(n, t)
|
|
1999
|
-
}
|
|
2000
|
-
};
|
|
2001
|
-
}
|
|
2002
|
-
function Ft({
|
|
2003
|
-
initialValue: e = {},
|
|
2004
|
-
schema: t,
|
|
2005
|
-
onSubmit: s = async () => _.valid,
|
|
2006
|
-
validationMode: n,
|
|
2007
|
-
validateDebounceMs: r
|
|
2008
|
-
}) {
|
|
2009
|
-
const { controller: a, setStatus: o } = pt({
|
|
2010
|
-
initialValue: e,
|
|
2011
|
-
validationMode: n ?? "touchedOrSubmit",
|
|
2012
|
-
validateDebounceMs: r,
|
|
2013
|
-
validate: (n ?? "touchedOrSubmit") === "onSubmit" ? void 0 : async (u) => re(
|
|
2014
|
-
await t["~standard"].validate(u)
|
|
2015
|
-
)
|
|
2016
|
-
}), i = I(!1), l = a.object();
|
|
2017
|
-
return l.onDispose(i.dispose), {
|
|
2018
|
-
controller: l,
|
|
2019
|
-
setStatus: o,
|
|
2020
|
-
submit: async (u) => {
|
|
2021
|
-
if (i.set(!0), u?.preventDefault(), l.markAllTouched(), (n ?? "touchedOrSubmit") === "onSubmit") {
|
|
2022
|
-
const g = l.value.value, v = re(
|
|
2023
|
-
await t["~standard"].validate(g)
|
|
2024
|
-
);
|
|
2025
|
-
if (o(v), v.type === "invalid") {
|
|
2026
|
-
i.set(!1);
|
|
2027
|
-
return;
|
|
2028
|
-
}
|
|
2029
|
-
}
|
|
2030
|
-
const h = await s(l.value.value);
|
|
2031
|
-
i.set(!1), h.type === "invalid" && o(h);
|
|
2032
|
-
},
|
|
2033
|
-
submitting: i
|
|
2034
|
-
};
|
|
2035
|
-
}
|
|
2036
|
-
function ft(e) {
|
|
2037
|
-
const t = e.split("-"), s = [e];
|
|
2038
|
-
return t.length > 1 && s.push(t[0]), s;
|
|
2039
|
-
}
|
|
2040
|
-
function bt({
|
|
2041
|
-
locale: e,
|
|
2042
|
-
defaultLocale: t = "en-US",
|
|
2043
|
-
defaultMessages: s,
|
|
2044
|
-
localeLoader: n
|
|
2045
|
-
}) {
|
|
2046
|
-
const r = I(t), a = I(s), o = e.on(async (i) => {
|
|
2047
|
-
if (i === r.value) return;
|
|
2048
|
-
r.set(i);
|
|
2049
|
-
const l = ft(i);
|
|
2050
|
-
for (const d of l)
|
|
2051
|
-
try {
|
|
2052
|
-
const u = await n(d);
|
|
2053
|
-
if (
|
|
2054
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2055
|
-
typeof u.default == "object" && Object.keys(u).length === 1
|
|
2056
|
-
) {
|
|
2057
|
-
console.error(
|
|
2058
|
-
"It appears that you are trying to load a translation module without referencing the default export. Please use `(await import(...)).default` in your loader function."
|
|
2059
|
-
);
|
|
2060
|
-
return;
|
|
2061
|
-
}
|
|
2062
|
-
if (i === r.value) {
|
|
2063
|
-
a.set(u);
|
|
2064
|
-
return;
|
|
2065
|
-
}
|
|
2066
|
-
} catch {
|
|
2067
|
-
continue;
|
|
2068
|
-
}
|
|
2069
|
-
console.warn(`No locale found for "${e.value}", using fallback`), i === r.value && a.set(s);
|
|
2070
|
-
});
|
|
2071
|
-
return {
|
|
2072
|
-
/** Clean up all resources and event listeners */
|
|
2073
|
-
dispose: () => {
|
|
2074
|
-
o(), r.dispose(), a.dispose();
|
|
2075
|
-
},
|
|
2076
|
-
/** Translation functions that return reactive signals */
|
|
2077
|
-
t: a
|
|
2078
|
-
};
|
|
2079
|
-
}
|
|
2080
|
-
function gt({
|
|
2081
|
-
defaultLocale: e,
|
|
2082
|
-
defaultMessages: t,
|
|
2083
|
-
localeLoader: s,
|
|
2084
|
-
providerName: n = "I18nProvider"
|
|
2085
|
-
}) {
|
|
2086
|
-
return {
|
|
2087
|
-
mark: ae(n),
|
|
2088
|
-
create: (r, a) => {
|
|
2089
|
-
const {
|
|
2090
|
-
value: { locale: o }
|
|
2091
|
-
} = a.getProvider(Ae.mark), { t: i, dispose: l } = bt({
|
|
2092
|
-
locale: o,
|
|
2093
|
-
defaultMessages: t,
|
|
2094
|
-
defaultLocale: e,
|
|
2095
|
-
localeLoader: s
|
|
2096
|
-
});
|
|
2097
|
-
return {
|
|
2098
|
-
value: i,
|
|
2099
|
-
dispose: l
|
|
2100
|
-
};
|
|
2101
|
-
}
|
|
2102
|
-
};
|
|
2103
|
-
}
|
|
2104
|
-
const R = gt({
|
|
2105
|
-
defaultLocale: Te,
|
|
2106
|
-
defaultMessages: Ee,
|
|
2107
|
-
localeLoader: async (e) => (await Le(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./ar-Dz8Mg5la.js"), "./locales/de.ts": () => import("./de-ToWTQGEo.js"), "./locales/en.ts": () => Promise.resolve().then(() => _e), "./locales/es.ts": () => import("./es-CruxS0Tz.js"), "./locales/fa.ts": () => import("./fa-Cf0NZLWA.js"), "./locales/fr.ts": () => import("./fr-YKXmqMGr.js"), "./locales/he.ts": () => import("./he-D8ZOduPw.js"), "./locales/hi.ts": () => import("./hi-CIamzVEf.js"), "./locales/it.ts": () => import("./it-Bn7tG_KC.js"), "./locales/ja.ts": () => import("./ja-i1ULXeiu.js"), "./locales/ko.ts": () => import("./ko-BpKDmtvY.js"), "./locales/nl.ts": () => import("./nl-Cs4PDWCJ.js"), "./locales/pl.ts": () => import("./pl-BFLNf991.js"), "./locales/pt.ts": () => import("./pt-BRZeOkcE.js"), "./locales/ru.ts": () => import("./ru-KI7Gowz-.js"), "./locales/tr.ts": () => import("./tr-CYk8Fua5.js"), "./locales/ur.ts": () => import("./ur-BIcZGLWt.js"), "./locales/vi.ts": () => import("./vi-BeK62QeB.js"), "./locales/zh.ts": () => import("./zh-Dt6yWDu2.js") }), `./locales/${e}.ts`, 3)).default,
|
|
2108
|
-
providerName: "BeatUII18n"
|
|
2109
|
-
});
|
|
2110
|
-
function mt(e) {
|
|
2111
|
-
switch (e) {
|
|
2112
|
-
case "success":
|
|
2113
|
-
return "material-symbols:check-circle-outline";
|
|
2114
|
-
case "warning":
|
|
2115
|
-
return "material-symbols:warning-outline";
|
|
2116
|
-
case "danger":
|
|
2117
|
-
return "material-symbols:error-outline";
|
|
2118
|
-
case "info":
|
|
2119
|
-
default:
|
|
2120
|
-
return "material-symbols:info-outline";
|
|
2121
|
-
}
|
|
2122
|
-
}
|
|
2123
|
-
function vt(e) {
|
|
2124
|
-
switch (e) {
|
|
2125
|
-
case "success":
|
|
2126
|
-
return "success";
|
|
2127
|
-
case "warning":
|
|
2128
|
-
return "warning";
|
|
2129
|
-
case "danger":
|
|
2130
|
-
return "danger";
|
|
2131
|
-
case "info":
|
|
2132
|
-
default:
|
|
2133
|
-
return "info";
|
|
2134
|
-
}
|
|
2135
|
-
}
|
|
2136
|
-
function kt(e, t, s, n) {
|
|
2137
|
-
const r = [
|
|
2138
|
-
"bc-notice",
|
|
2139
|
-
`bc-notice--${e}`,
|
|
2140
|
-
`bc-notice--tone-${t}`
|
|
2141
|
-
];
|
|
2142
|
-
return s && r.push("bc-notice--dismissible"), n && n.length > 0 && r.push(n), r.join(" ");
|
|
2143
|
-
}
|
|
2144
|
-
function qt({
|
|
2145
|
-
variant: e = "info",
|
|
2146
|
-
tone: t = "subtle",
|
|
2147
|
-
role: s,
|
|
2148
|
-
title: n,
|
|
2149
|
-
icon: r,
|
|
2150
|
-
closable: a = !1,
|
|
2151
|
-
onDismiss: o,
|
|
2152
|
-
class: i
|
|
2153
|
-
}, ...l) {
|
|
2154
|
-
const d = D.map(
|
|
2155
|
-
a,
|
|
2156
|
-
(b) => !!b || o != null
|
|
2157
|
-
), u = D.map(e, (b) => b ?? "info"), h = D.map(t, (b) => b ?? "subtle"), g = y(
|
|
2158
|
-
s,
|
|
2159
|
-
u
|
|
2160
|
-
)(
|
|
2161
|
-
(b, m) => b ?? (m === "danger" ? "alert" : "status")
|
|
2162
|
-
), v = I(!0), f = q(
|
|
2163
|
-
R,
|
|
2164
|
-
(b) => p.div(
|
|
2165
|
-
c.class(
|
|
2166
|
-
y(
|
|
2167
|
-
u,
|
|
2168
|
-
h,
|
|
2169
|
-
d,
|
|
2170
|
-
i
|
|
2171
|
-
)((m, T, L, V) => kt(m, T, L, V))
|
|
2172
|
-
),
|
|
2173
|
-
// Accessibility role mapping (always defined)
|
|
2174
|
-
c.role(D.map(g, (m) => m)),
|
|
2175
|
-
ye(
|
|
2176
|
-
D.map(r, (m) => m === !1),
|
|
2177
|
-
() => p.div(
|
|
2178
|
-
c.class("bc-notice__icon"),
|
|
2179
|
-
O({
|
|
2180
|
-
icon: y(
|
|
2181
|
-
r,
|
|
2182
|
-
u
|
|
2183
|
-
)((m, T) => m === void 0 ? mt(T) : String(m)),
|
|
2184
|
-
size: "md",
|
|
2185
|
-
color: D.map(u, vt)
|
|
2186
|
-
})
|
|
2187
|
-
)
|
|
2188
|
-
),
|
|
2189
|
-
p.div(
|
|
2190
|
-
c.class("bc-notice__body"),
|
|
2191
|
-
we(n, (m) => p.div(c.class("bc-notice__title"), m)),
|
|
2192
|
-
p.div(c.class("bc-notice__content"), ...l)
|
|
2193
|
-
),
|
|
2194
|
-
E(
|
|
2195
|
-
d,
|
|
2196
|
-
() => Ye({
|
|
2197
|
-
size: "xs",
|
|
2198
|
-
label: b.$.closeModal,
|
|
2199
|
-
onClick: () => {
|
|
2200
|
-
v.set(!1), o?.();
|
|
2201
|
-
}
|
|
2202
|
-
})
|
|
2203
|
-
)
|
|
2204
|
-
)
|
|
2205
|
-
);
|
|
2206
|
-
return E(v, () => f);
|
|
2207
|
-
}
|
|
2208
|
-
export {
|
|
2209
|
-
jt as $,
|
|
2210
|
-
he as A,
|
|
2211
|
-
R as B,
|
|
2212
|
-
Ye as C,
|
|
2213
|
-
Re as D,
|
|
2214
|
-
Mt as E,
|
|
2215
|
-
He as F,
|
|
2216
|
-
ot as G,
|
|
2217
|
-
Bt as H,
|
|
2218
|
-
O as I,
|
|
2219
|
-
it as J,
|
|
2220
|
-
lt as K,
|
|
2221
|
-
Xe as L,
|
|
2222
|
-
$t as M,
|
|
2223
|
-
qt as N,
|
|
2224
|
-
F as O,
|
|
2225
|
-
Vt as P,
|
|
2226
|
-
ct as Q,
|
|
2227
|
-
ut as R,
|
|
2228
|
-
Lt as S,
|
|
2229
|
-
Pt as T,
|
|
2230
|
-
tt as U,
|
|
2231
|
-
dt as V,
|
|
2232
|
-
ht as W,
|
|
2233
|
-
pt as X,
|
|
2234
|
-
be as Y,
|
|
2235
|
-
Ot as Z,
|
|
2236
|
-
Le as _,
|
|
2237
|
-
Qe as a,
|
|
2238
|
-
re as a0,
|
|
2239
|
-
_t as a1,
|
|
2240
|
-
et as a2,
|
|
2241
|
-
Et as a3,
|
|
2242
|
-
bt as a4,
|
|
2243
|
-
ue as a5,
|
|
2244
|
-
Pe as a6,
|
|
2245
|
-
xt as a7,
|
|
2246
|
-
St as a8,
|
|
2247
|
-
Dt as a9,
|
|
2248
|
-
Ve as aa,
|
|
2249
|
-
It as ab,
|
|
2250
|
-
_ as b,
|
|
2251
|
-
Tt as c,
|
|
2252
|
-
At as d,
|
|
2253
|
-
W as e,
|
|
2254
|
-
ee as f,
|
|
2255
|
-
Z as g,
|
|
2256
|
-
rt as h,
|
|
2257
|
-
at as i,
|
|
2258
|
-
pe as j,
|
|
2259
|
-
Ee as k,
|
|
2260
|
-
Ae as l,
|
|
2261
|
-
gt as m,
|
|
2262
|
-
j as n,
|
|
2263
|
-
se as o,
|
|
2264
|
-
$ as p,
|
|
2265
|
-
G as q,
|
|
2266
|
-
A as r,
|
|
2267
|
-
le as s,
|
|
2268
|
-
Nt as t,
|
|
2269
|
-
Ft as u,
|
|
2270
|
-
fe as v,
|
|
2271
|
-
N as w,
|
|
2272
|
-
Ke as x,
|
|
2273
|
-
Je as y,
|
|
2274
|
-
Te as z
|
|
2275
|
-
};
|