@mhmo91/schmancy 0.3.8 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{animated-text-DBk95qoX.cjs → animated-text-C_ISIdDY.cjs} +2 -2
- package/dist/{animated-text-DBk95qoX.cjs.map → animated-text-C_ISIdDY.cjs.map} +1 -1
- package/dist/{animated-text-BhACpxZL.js → animated-text-DE4jCzlq.js} +3 -3
- package/dist/{animated-text-BhACpxZL.js.map → animated-text-DE4jCzlq.js.map} +1 -1
- package/dist/animated-text.cjs +1 -1
- package/dist/animated-text.js +1 -1
- package/dist/area.cjs +1 -1
- package/dist/area.component-Bvd_wwUW.cjs +8 -0
- package/dist/{area.component-CbT_WCUv.cjs.map → area.component-Bvd_wwUW.cjs.map} +1 -1
- package/dist/{area.component-DX2Y6cAp.js → area.component-DQKc0WXK.js} +85 -90
- package/dist/{area.component-DX2Y6cAp.js.map → area.component-DQKc0WXK.js.map} +1 -1
- package/dist/area.js +1 -1
- package/dist/autocomplete-D_XhT92l.cjs +73 -0
- package/dist/{autocomplete-ByVC8MLH.cjs.map → autocomplete-D_XhT92l.cjs.map} +1 -1
- package/dist/autocomplete-ytqc1f_C.js +315 -0
- package/dist/{autocomplete-Qr_SNWus.js.map → autocomplete-ytqc1f_C.js.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/{avatar-Bp8zC0T5.cjs → avatar-DkBLxCT2.cjs} +2 -2
- package/dist/{avatar-Bp8zC0T5.cjs.map → avatar-DkBLxCT2.cjs.map} +1 -1
- package/dist/{avatar-1tMDKnZc.js → avatar-m6kOcWq2.js} +47 -47
- package/dist/{avatar-1tMDKnZc.js.map → avatar-m6kOcWq2.js.map} +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/{boat-ZKuOCC1g.js → boat-BeW5NYdz.js} +2 -2
- package/dist/{boat-ZKuOCC1g.js.map → boat-BeW5NYdz.js.map} +1 -1
- package/dist/{boat-RaIwtGNW.cjs → boat-DigCNXsd.cjs} +2 -2
- package/dist/{boat-RaIwtGNW.cjs.map → boat-DigCNXsd.cjs.map} +1 -1
- package/dist/boat.cjs +1 -1
- package/dist/boat.js +1 -1
- package/dist/busy.cjs +1 -1
- package/dist/busy.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-BZvRSKLj.cjs → checkbox-CFqvhybv.cjs} +4 -4
- package/dist/{checkbox-BZvRSKLj.cjs.map → checkbox-CFqvhybv.cjs.map} +1 -1
- package/dist/{checkbox-Cy3X3PGY.js → checkbox-DSEvvPj1.js} +31 -32
- package/dist/{checkbox-Cy3X3PGY.js.map → checkbox-DSEvvPj1.js.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-Y1qvw2Wa.js → chips-DCKLuDxP.js} +59 -61
- package/dist/{chips-Y1qvw2Wa.js.map → chips-DCKLuDxP.js.map} +1 -1
- package/dist/{chips-5IKm7m8x.cjs → chips-MCF53PoG.cjs} +25 -25
- package/dist/{chips-5IKm7m8x.cjs.map → chips-MCF53PoG.cjs.map} +1 -1
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +1 -1
- package/dist/{circular-progress-BZwI11v0.cjs → circular-progress-CF0ow_gn.cjs} +2 -2
- package/dist/{circular-progress-BZwI11v0.cjs.map → circular-progress-CF0ow_gn.cjs.map} +1 -1
- package/dist/{circular-progress-utG8iIPV.js → circular-progress-CKlT4zjF.js} +3 -3
- package/dist/{circular-progress-utG8iIPV.js.map → circular-progress-CKlT4zjF.js.map} +1 -1
- package/dist/circular-progress.cjs +1 -1
- package/dist/circular-progress.js +1 -1
- package/dist/code-highlight.cjs +1 -1
- package/dist/code-highlight.js +1 -1
- package/dist/{code-preview-CN4mbrHE.cjs → code-preview-Cj_qRKC9.cjs} +9 -9
- package/dist/{code-preview-CN4mbrHE.cjs.map → code-preview-Cj_qRKC9.cjs.map} +1 -1
- package/dist/{code-preview-C_W44LD7.js → code-preview-CuDOLS91.js} +166 -168
- package/dist/{code-preview-C_W44LD7.js.map → code-preview-CuDOLS91.js.map} +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/{consume-B05Dd6qy.js → consume-5D1qfVWM.js} +2 -2
- package/dist/{consume-B05Dd6qy.js.map → consume-5D1qfVWM.js.map} +1 -1
- package/dist/{consume-uKrSupzs.cjs → consume-edta5ng5.cjs} +2 -2
- package/dist/{consume-uKrSupzs.cjs.map → consume-edta5ng5.cjs.map} +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/{context-object-CISes2bD.js → context-object-CDDP4bTk.js} +6 -8
- package/dist/{context-object-CISes2bD.js.map → context-object-CDDP4bTk.js.map} +1 -1
- package/dist/context-object-K_1gDFu-.cjs +2 -0
- package/dist/{context-object-CP7HbDFQ.cjs.map → context-object-K_1gDFu-.cjs.map} +1 -1
- package/dist/date-range-B2f1eXz0.cjs +139 -0
- package/dist/{date-range-BAKeMiFS.cjs.map → date-range-B2f1eXz0.cjs.map} +1 -1
- package/dist/{date-range-dO1-f42P.js → date-range-CmeAQ5QS.js} +107 -109
- package/dist/{date-range-dO1-f42P.js.map → date-range-CmeAQ5QS.js.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/delay-40MKpcZU.cjs +10 -0
- package/dist/{delay-CLGKeX0n.cjs.map → delay-40MKpcZU.cjs.map} +1 -1
- package/dist/{delay-Cd-N6nxZ.js → delay-pKHFTza9.js} +57 -70
- package/dist/{delay-Cd-N6nxZ.js.map → delay-pKHFTza9.js.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/{dialog-content-C835zQHB.js → dialog-content-B_fVl8nu.js} +9 -11
- package/dist/{dialog-content-C835zQHB.js.map → dialog-content-B_fVl8nu.js.map} +1 -1
- package/dist/{dialog-content-DWITDRHy.cjs → dialog-content-CkjibvSc.cjs} +4 -4
- package/dist/{dialog-content-DWITDRHy.cjs.map → dialog-content-CkjibvSc.cjs.map} +1 -1
- package/dist/dialog-service-BgqAlT7T.cjs +2 -0
- package/dist/{dialog-service-Di9NiBao.cjs.map → dialog-service-BgqAlT7T.cjs.map} +1 -1
- package/dist/dialog-service-CnjZCTMj.js +127 -0
- package/dist/{dialog-service-noGCuxg1.js.map → dialog-service-CnjZCTMj.js.map} +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +2 -2
- package/dist/{divider-C7UzzgIj.cjs → divider-BDgmQ4VQ.cjs} +2 -2
- package/dist/{divider-C7UzzgIj.cjs.map → divider-BDgmQ4VQ.cjs.map} +1 -1
- package/dist/{divider-D7pxxtTI.js → divider-njFvOEz7.js} +3 -3
- package/dist/{divider-D7pxxtTI.js.map → divider-njFvOEz7.js.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/{dropdown-content-DJFDnoKm.js → dropdown-content-C4o6Y70E.js} +16 -20
- package/dist/{dropdown-content-DJFDnoKm.js.map → dropdown-content-C4o6Y70E.js.map} +1 -1
- package/dist/{dropdown-content-RMyyjS7G.cjs → dropdown-content-CwEBCQTd.cjs} +4 -4
- package/dist/{dropdown-content-RMyyjS7G.cjs.map → dropdown-content-CwEBCQTd.cjs.map} +1 -1
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/extra.cjs +1 -1
- package/dist/extra.js +1 -1
- package/dist/{flex-Bu7OqH-d.js → flex-CbKzMNEV.js} +63 -64
- package/dist/{flex-Bu7OqH-d.js.map → flex-CbKzMNEV.js.map} +1 -1
- package/dist/{flex-Cg_UtAIG.cjs → flex-_h7Zh750.cjs} +10 -10
- package/dist/{flex-Cg_UtAIG.cjs.map → flex-_h7Zh750.cjs.map} +1 -1
- package/dist/flow-D0e7hGXO.cjs +2 -0
- package/dist/{flow-CnJl1T1A.cjs.map → flow-D0e7hGXO.cjs.map} +1 -1
- package/dist/{flow-B1wMqea2.js → flow-DXYqC9OA.js} +50 -52
- package/dist/{flow-B1wMqea2.js.map → flow-DXYqC9OA.js.map} +1 -1
- package/dist/{form-WeCrsPmp.js → form-eXTuXutS.js} +19 -28
- package/dist/{form-WeCrsPmp.js.map → form-eXTuXutS.js.map} +1 -1
- package/dist/form-gg5B6Dla.cjs +14 -0
- package/dist/{form-DzfdidJO.cjs.map → form-gg5B6Dla.cjs.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/{icon-Be8aUtz9.js → icon-as6C4b0_.js} +8 -9
- package/dist/{icon-Be8aUtz9.js.map → icon-as6C4b0_.js.map} +1 -1
- package/dist/icon-button-D5te6MSD.cjs +69 -0
- package/dist/{icon-button-DNvGlOPI.cjs.map → icon-button-D5te6MSD.cjs.map} +1 -1
- package/dist/{icon-button-Mfs7C_ol.js → icon-button-eM7fkcaa.js} +40 -41
- package/dist/{icon-button-Mfs7C_ol.js.map → icon-button-eM7fkcaa.js.map} +1 -1
- package/dist/{icon-4c4f-QXa.cjs → icon-lc9iKCzt.cjs} +4 -4
- package/dist/{icon-4c4f-QXa.cjs.map → icon-lc9iKCzt.cjs.map} +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +44 -44
- package/dist/{input-CpYu_aUV.js → input-C1JcUy_t.js} +86 -113
- package/dist/{input-CpYu_aUV.js.map → input-C1JcUy_t.js.map} +1 -1
- package/dist/input-KfFWcQk8.cjs +111 -0
- package/dist/{input-CD59n3y-.cjs.map → input-KfFWcQk8.cjs.map} +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/{list-kvjz9d5N.cjs → list-CZlCptFt.cjs} +4 -4
- package/dist/{list-kvjz9d5N.cjs.map → list-CZlCptFt.cjs.map} +1 -1
- package/dist/{list-DNZhjJ-s.js → list-Cn2oKOHN.js} +20 -21
- package/dist/{list-DNZhjJ-s.js.map → list-Cn2oKOHN.js.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-CrXwM_fu.cjs → litElement.mixin-BFfWKABY.cjs} +2 -2
- package/dist/{litElement.mixin-CrXwM_fu.cjs.map → litElement.mixin-BFfWKABY.cjs.map} +1 -1
- package/dist/{litElement.mixin-DMTxmbnz.js → litElement.mixin-CUhEpTgZ.js} +2 -2
- package/dist/{litElement.mixin-DMTxmbnz.js.map → litElement.mixin-CUhEpTgZ.js.map} +1 -1
- package/dist/{menu-CzoGF0Jg.js → menu--0VMi_rl.js} +3 -3
- package/dist/{menu-CzoGF0Jg.js.map → menu--0VMi_rl.js.map} +1 -1
- package/dist/{menu-DSJGu_Le.cjs → menu-ChUQMNtl.cjs} +2 -2
- package/dist/{menu-DSJGu_Le.cjs.map → menu-ChUQMNtl.cjs.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/{notification-service-BUZQ2nOZ.js → notification-service-BSp9bz1i.js} +4 -4
- package/dist/{notification-service-BUZQ2nOZ.js.map → notification-service-BSp9bz1i.js.map} +1 -1
- package/dist/{notification-service-dKoZweFH.cjs → notification-service-Bick5tKQ.cjs} +6 -6
- package/dist/{notification-service-dKoZweFH.cjs.map → notification-service-Bick5tKQ.cjs.map} +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-dBiLTB_w.js → option-BBH03Xsg.js} +3 -4
- package/dist/{option-dBiLTB_w.js.map → option-BBH03Xsg.js.map} +1 -1
- package/dist/{option-BXU6HGLZ.cjs → option-C_1a_vzI.cjs} +3 -3
- package/dist/{option-BXU6HGLZ.cjs.map → option-C_1a_vzI.cjs.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/{payment-card-form-HSho3d5z.cjs → payment-card-form-DDhg71fA.cjs} +2 -2
- package/dist/{payment-card-form-HSho3d5z.cjs.map → payment-card-form-DDhg71fA.cjs.map} +1 -1
- package/dist/{payment-card-form-Bhy7PHzr.js → payment-card-form-DgkNJsE1.js} +3 -3
- package/dist/{payment-card-form-Bhy7PHzr.js.map → payment-card-form-DgkNJsE1.js.map} +1 -1
- package/dist/provide-BxZ2kn_p.cjs +2 -0
- package/dist/{provide-BGGp1Iks.cjs.map → provide-BxZ2kn_p.cjs.map} +1 -1
- package/dist/{provide-hwQSumt-.js → provide-tcktw8xB.js} +41 -42
- package/dist/{provide-hwQSumt-.js.map → provide-tcktw8xB.js.map} +1 -1
- package/dist/radio-button-CCsCtUkU.cjs +41 -0
- package/dist/{radio-button-dwmtJ2ef.cjs.map → radio-button-CCsCtUkU.cjs.map} +1 -1
- package/dist/radio-button-Cuo-ybx9.js +151 -0
- package/dist/{radio-button-DDbyvXw1.js.map → radio-button-Cuo-ybx9.js.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/{redispatch-event-CF5ekzwZ.js → redispatch-event-BLom7yp4.js} +65 -68
- package/dist/{redispatch-event-CF5ekzwZ.js.map → redispatch-event-BLom7yp4.js.map} +1 -1
- package/dist/redispatch-event-DHcobAl6.cjs +4 -0
- package/dist/{redispatch-event-roczetCU.cjs.map → redispatch-event-DHcobAl6.cjs.map} +1 -1
- package/dist/{schmancy-steps-container-BrfKRYkI.js → schmancy-steps-container-CmGuY9sB.js} +5 -6
- package/dist/{schmancy-steps-container-BrfKRYkI.js.map → schmancy-steps-container-CmGuY9sB.js.map} +1 -1
- package/dist/{schmancy-steps-container-COL9P7PV.cjs → schmancy-steps-container-CqsMA2he.cjs} +3 -3
- package/dist/{schmancy-steps-container-COL9P7PV.cjs.map → schmancy-steps-container-CqsMA2he.cjs.map} +1 -1
- package/dist/{select-C6O6NRea.js → select-ChxNr4a9.js} +46 -56
- package/dist/{select-C6O6NRea.js.map → select-ChxNr4a9.js.map} +1 -1
- package/dist/select-fZ2PlQ_3.cjs +56 -0
- package/dist/{select-PrgXr6zf.cjs.map → select-fZ2PlQ_3.cjs.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/{selector-hook-B6uqLA-J.js → selector-hook-BvXML7_4.js} +61 -64
- package/dist/{selector-hook-B6uqLA-J.js.map → selector-hook-BvXML7_4.js.map} +1 -1
- package/dist/selector-hook-CYMLsOvh.cjs +2 -0
- package/dist/{selector-hook-CyvD9WN9.cjs.map → selector-hook-CYMLsOvh.cjs.map} +1 -1
- package/dist/sheet-2FAz4r9B.js +141 -0
- package/dist/{sheet-lcz-71nv.js.map → sheet-2FAz4r9B.js.map} +1 -1
- package/dist/sheet-CaUlNTdn.cjs +47 -0
- package/dist/{sheet-CNvW8vrn.cjs.map → sheet-CaUlNTdn.cjs.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +2 -2
- package/dist/{slider-BNXI3Yj7.cjs → slider-CHlXZvPb.cjs} +8 -8
- package/dist/{slider-BNXI3Yj7.cjs.map → slider-CHlXZvPb.cjs.map} +1 -1
- package/dist/{slider-i-AZp4UF.js → slider-DU3_sk4c.js} +36 -40
- package/dist/{slider-i-AZp4UF.js.map → slider-DU3_sk4c.js.map} +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{spinner-DItpvohq.cjs → spinner-D064VAQ0.cjs} +2 -2
- package/dist/{spinner-DItpvohq.cjs.map → spinner-D064VAQ0.cjs.map} +1 -1
- package/dist/{spinner-Df6JHzWX.js → spinner-RvzzGIF-.js} +3 -3
- package/dist/{spinner-Df6JHzWX.js.map → spinner-RvzzGIF-.js.map} +1 -1
- package/dist/steps.cjs +1 -1
- package/dist/steps.js +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.js +2 -2
- package/dist/{surface-DiP3y6CA.cjs → surface-B3UkH65j.cjs} +2 -2
- package/dist/{surface-DiP3y6CA.cjs.map → surface-B3UkH65j.cjs.map} +1 -1
- package/dist/{surface-BaatMeqX.js → surface-s7dL8dsr.js} +3 -3
- package/dist/{surface-BaatMeqX.js.map → surface-s7dL8dsr.js.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/table-BrbO5sO5.cjs +65 -0
- package/dist/{table-BRQDbCA8.cjs.map → table-BrbO5sO5.cjs.map} +1 -1
- package/dist/{table-BY56H-_F.js → table-DzYvbr4k.js} +58 -68
- package/dist/{table-BY56H-_F.js.map → table-DzYvbr4k.js.map} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/{tabs-compatibility-pq--kZ3e.cjs → tabs-compatibility-CGG-7f7V.cjs} +5 -5
- package/dist/{tabs-compatibility-pq--kZ3e.cjs.map → tabs-compatibility-CGG-7f7V.cjs.map} +1 -1
- package/dist/{tabs-compatibility-qFYA1HDl.js → tabs-compatibility-vhn4Kp7N.js} +20 -21
- package/dist/{tabs-compatibility-qFYA1HDl.js.map → tabs-compatibility-vhn4Kp7N.js.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tailwind.mixin-CgPd8dM4.cjs +2 -0
- package/dist/{tailwind.mixin-CPvz1Npj.cjs.map → tailwind.mixin-CgPd8dM4.cjs.map} +1 -1
- package/dist/tailwind.mixin-t3Yj_Xbu.js +43 -0
- package/dist/{tailwind.mixin-DbsxfE0U.js.map → tailwind.mixin-t3Yj_Xbu.js.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-DPD_F-N6.cjs → textarea-BqzHPEaR.cjs} +12 -12
- package/dist/{textarea-DPD_F-N6.cjs.map → textarea-BqzHPEaR.cjs.map} +1 -1
- package/dist/{textarea-D2m3usht.js → textarea-DB4ma3Yk.js} +31 -45
- package/dist/{textarea-D2m3usht.js.map → textarea-DB4ma3Yk.js.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-button-ucq2VrW0.js → theme-button-DiugvNq0.js} +2 -2
- package/dist/{theme-button-ucq2VrW0.js.map → theme-button-DiugvNq0.js.map} +1 -1
- package/dist/{theme-button-0dEQlWtO.cjs → theme-button-X1T0K-rT.cjs} +2 -2
- package/dist/{theme-button-0dEQlWtO.cjs.map → theme-button-X1T0K-rT.cjs.map} +1 -1
- package/dist/theme-button.cjs +1 -1
- package/dist/theme-button.js +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/{theme.component-DOSuAou9.js → theme.component-DGfwQDsP.js} +7 -8
- package/dist/{theme.component-DOSuAou9.js.map → theme.component-DGfwQDsP.js.map} +1 -1
- package/dist/{theme.component-E4gA7t5r.cjs → theme.component-GbvYp0sg.cjs} +2 -2
- package/dist/{theme.component-E4gA7t5r.cjs.map → theme.component-GbvYp0sg.cjs.map} +1 -1
- package/dist/theme.js +1 -1
- package/dist/{timezone-Bf4J_3By.cjs → timezone-Bp8z4kRR.cjs} +6 -6
- package/dist/{timezone-Bf4J_3By.cjs.map → timezone-Bp8z4kRR.cjs.map} +1 -1
- package/dist/{timezone-xOWMbSDV.js → timezone-pKGsUkVR.js} +22 -28
- package/dist/{timezone-xOWMbSDV.js.map → timezone-pKGsUkVR.js.map} +1 -1
- package/dist/tooltip-DO_tqLiU.cjs +7 -0
- package/dist/{tooltip-6a1_bSeD.cjs.map → tooltip-DO_tqLiU.cjs.map} +1 -1
- package/dist/{tooltip-zsp-xmPP.js → tooltip-OGPdu-15.js} +29 -31
- package/dist/{tooltip-zsp-xmPP.js.map → tooltip-OGPdu-15.js.map} +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/{tree-D0FCXUWg.js → tree-BLnyRUxk.js} +2 -2
- package/dist/{tree-D0FCXUWg.js.map → tree-BLnyRUxk.js.map} +1 -1
- package/dist/{tree-DRa2127p.cjs → tree-Cj9dq4FW.cjs} +2 -2
- package/dist/{tree-DRa2127p.cjs.map → tree-Cj9dq4FW.cjs.map} +1 -1
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/typewriter-CLh00Uvc.cjs +21 -0
- package/dist/{typewriter-XTltzkLy.cjs.map → typewriter-CLh00Uvc.cjs.map} +1 -1
- package/dist/typewriter-P4fs9-rU.js +437 -0
- package/dist/{typewriter-BNTzu9jY.js.map → typewriter-P4fs9-rU.js.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{typography-nVG55_Y6.cjs → typography-BOogKO97.cjs} +2 -2
- package/dist/{typography-nVG55_Y6.cjs.map → typography-BOogKO97.cjs.map} +1 -1
- package/dist/{typography-DCP0jC-m.js → typography-BouLjmvn.js} +2 -2
- package/dist/{typography-DCP0jC-m.js.map → typography-BouLjmvn.js.map} +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/package.json +14 -17
- package/dist/area.component-CbT_WCUv.cjs +0 -8
- package/dist/autocomplete-ByVC8MLH.cjs +0 -73
- package/dist/autocomplete-Qr_SNWus.js +0 -324
- package/dist/context-object-CP7HbDFQ.cjs +0 -2
- package/dist/date-range-BAKeMiFS.cjs +0 -140
- package/dist/delay-CLGKeX0n.cjs +0 -10
- package/dist/dialog-service-Di9NiBao.cjs +0 -2
- package/dist/dialog-service-noGCuxg1.js +0 -127
- package/dist/flow-CnJl1T1A.cjs +0 -2
- package/dist/form-DzfdidJO.cjs +0 -14
- package/dist/icon-button-DNvGlOPI.cjs +0 -69
- package/dist/input-CD59n3y-.cjs +0 -111
- package/dist/provide-BGGp1Iks.cjs +0 -2
- package/dist/radio-button-DDbyvXw1.js +0 -157
- package/dist/radio-button-dwmtJ2ef.cjs +0 -41
- package/dist/redispatch-event-roczetCU.cjs +0 -4
- package/dist/select-PrgXr6zf.cjs +0 -56
- package/dist/selector-hook-CyvD9WN9.cjs +0 -2
- package/dist/sheet-CNvW8vrn.cjs +0 -47
- package/dist/sheet-lcz-71nv.js +0 -146
- package/dist/table-BRQDbCA8.cjs +0 -65
- package/dist/tailwind.mixin-CPvz1Npj.cjs +0 -2
- package/dist/tailwind.mixin-DbsxfE0U.js +0 -43
- package/dist/tooltip-6a1_bSeD.cjs +0 -7
- package/dist/typewriter-BNTzu9jY.js +0 -436
- package/dist/typewriter-XTltzkLy.cjs +0 -21
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";const u=require("rxjs"),E=require("lit/directives/class-map.js");require("lit/directives/style-map.js");const C=require("./litElement.mixin-CrXwM_fu.cjs");require("./tailwind.mixin-CPvz1Npj.cjs");const V=require("lit"),d=require("lit/decorators.js"),w=require("lit/directives/ref.js"),e=require("rxjs/operators");function k(t,i){if(!t||!i)return 0;if(t===i)return 1;const s=t.toLowerCase().trim(),n=i.toLowerCase().trim();if(s===n)return 1;if(n.startsWith(s))return .95+.05*(s.length/n.length);const l=n.split(/[\s\-_]+/);for(const p of l)if(p.startsWith(s))return .85*(1-l.indexOf(p)/l.length*.1);if(n.includes(s))return .7*(1-n.indexOf(s)/n.length*.2);if(function(p,m){let r=0,o=0;for(;r<p.length&&o<m.length;)p[r]===m[o]&&r++,o++;return r===p.length}(s,n))return .5;const a=function(p,m){if(p.length<2||m.length<2)return 0;const r=S(p),o=S(m);let v=0;const y=new Array(o.length).fill(!1);for(const x of r)for(let g=0;g<o.length;g++)if(!y[g]&&o[g]===x){v++,y[g]=!0;break}return 2*v/(r.length+o.length)}(s,n),h=Math.max(s.length,n.length),f=function(p,m){if(p.length===0)return m.length;if(m.length===0)return p.length;const r=[];for(let o=0;o<=m.length;o++)r[o]=[o];for(let o=0;o<=p.length;o++)r[0][o]=o;for(let o=1;o<=m.length;o++)for(let v=1;v<=p.length;v++){const y=p[v-1]===m[o-1]?0:1;r[o][v]=Math.min(r[o-1][v]+1,r[o][v-1]+1,r[o-1][v-1]+y)}return r[m.length][p.length]}(s,n),b=h?1-f/h:0,$=function(p,m){const r=y=>y.split("").reduce((x,g)=>(x[g]=(x[g]||0)+1,x),{}),o=r(p),v=r(m);return Object.keys(o).every(y=>(v[y]||0)>=o[y])}(s,n)?.3:0;return Math.max(.4*a,.4*b,$)}function S(t){const i=[];for(let s=0;s<t.length-1;s++)i.push(t.substring(s,s+2));return i}var R=Object.defineProperty,A=Object.getOwnPropertyDescriptor,_=(t,i,s,n)=>{for(var l,a=n>1?void 0:n?A(i,s):i,h=t.length-1;h>=0;h--)(l=t[h])&&(a=(n?l(i,s,a):l(a))||a);return n&&a&&R(i,s,a),a};let c=class extends C.$LitElement(":host{display:block;border:unset!important;line-height:unset!important;background:unset!important;padding:unset!important;font-size:unset!important;box-shadow:unset!important}:host:focus{box-shadow:unset!important}"){constructor(){super(...arguments),this.required=!1,this.placeholder="",this.label="",this.name="",this.maxHeight="300px",this.multi=!1,this.description="",this.size="md",this.autocomplete="on",this.debounceMs=200,this.similarityThreshold=.3,this._open=!1,this._inputValue="",this._visibleOptionsCount=0,this._hasResults=!0,this._inputElementRef=w.createRef(),this._selectedValue$=new u.BehaviorSubject(""),this._selectedValues$=new u.BehaviorSubject([]),this._inputValue$=new u.BehaviorSubject(""),this._open$=new u.BehaviorSubject(!1),this._options$=new u.BehaviorSubject([]),this._optionSelect$=new u.Subject,this._documentClick$=new u.Subject,this._checkAutofill$=new u.Subject}get values(){return[...this._selectedValues$.value]}set values(t){this._selectedValues$.next(Array.isArray(t)?[...t]:[])}get value(){return this.multi?this._selectedValues$.value.join(","):this._selectedValue$.value}set value(t){this.multi?this._selectedValues$.next(t?t.split(",").map(i=>i.trim()).filter(Boolean):[]):this._selectedValue$.next(t)}connectedCallback(){super.connectedCallback(),this.id||(this.id=`sch-autocomplete-${Math.random().toString(36).slice(2,9)}`),this._setupAutocompleteLogic(),this._setupDocumentClickHandler(),this._setupAutofillDetection()}_setupAutocompleteLogic(){this._options$.pipe(e.tap(t=>{t.forEach((i,s)=>{i.setAttribute("role","option"),i.tabIndex=-1,i.id||(i.id=`${this.id}-option-${s}`),i.hasAttribute("data-event-bound")||(u.fromEvent(i,"click").pipe(e.tap(n=>n.stopPropagation()),e.takeUntil(this.disconnecting)).subscribe(()=>this._optionSelect$.next(i)),i.setAttribute("data-event-bound","true"))})}),e.takeUntil(this.disconnecting)).subscribe(),u.combineLatest([this._selectedValue$,this._selectedValues$,this._options$]).pipe(e.tap(([t,i,s])=>{s.forEach(n=>{n.selected=this.multi?i.includes(n.value):n.value===t,n.setAttribute("aria-selected",String(n.selected))})}),e.takeUntil(this.disconnecting)).subscribe(),this._inputValue$.pipe(e.distinctUntilChanged(),e.debounceTime(this.debounceMs),e.withLatestFrom(this._options$,this._open$),e.tap(([t,i,s])=>{if(!s)return;const n=t.trim();if(n){const l=i.map(h=>{const f=h.label||h.textContent||"",b=h.value,$=k(n,f),p=k(n,b);return{option:h,score:Math.max(1.1*$,p)}});l.sort((h,f)=>f.score-h.score);let a=0;l.forEach((h,f)=>{const{option:b,score:$}=h;$<this.similarityThreshold?b.hidden=!0:(b.hidden=!1,a++,b.style.order=String(f))}),this._visibleOptionsCount=a,this._hasResults=a>0}else i.forEach(l=>{l.hidden=!1,l.style.order="0"}),this._visibleOptionsCount=i.length,this._hasResults=!0;this._announceToScreenReader(this._visibleOptionsCount>0?`${this._visibleOptionsCount} option${this._visibleOptionsCount===1?"":"s"} available.`:"No results found.")}),e.takeUntil(this.disconnecting)).subscribe(),this._optionSelect$.pipe(e.withLatestFrom(this._selectedValue$,this._selectedValues$),e.tap(([t,i,s])=>{if(this.multi){const n=s.indexOf(t.value),l=n>-1?[...s.slice(0,n),...s.slice(n+1)]:[...s,t.value];this._selectedValues$.next(l),this._inputValue$.next(""),this._inputValue="";const a=this._getSelectedLabels();this._announceToScreenReader(a.length>0?`Selected: ${a.join(", ")}`:"No options selected")}else this._selectedValue$.next(t.value),this._open$.next(!1),this._open=!1,this._inputValue=t.label||t.textContent||"",this._inputValue$.next(this._inputValue),u.timer(100).pipe(e.tap(()=>{var n;return(n=this._inputElementRef.value)==null?void 0:n.blur()}),e.take(1)).subscribe(),this._announceToScreenReader(`Selected: ${t.label||t.textContent}`)}),e.tap(()=>this._fireChangeEvent()),e.takeUntil(this.disconnecting)).subscribe(),u.combineLatest([this._open$,this._selectedValue$,this._selectedValues$,this._options$]).pipe(e.filter(()=>!this._open$.value),e.tap(([,t,i,s])=>{if(this.multi){const n=s.filter(l=>i.includes(l.value)).map(l=>l.label||l.textContent||"");this._inputValue=n.join(", ")}else{const n=s.find(l=>l.value===t);this._inputValue=n&&(n.label||n.textContent)||""}this._inputValue$.next(this._inputValue)}),e.takeUntil(this.disconnecting)).subscribe(),this._open$.pipe(e.tap(t=>this._open=t),e.takeUntil(this.disconnecting)).subscribe()}_setupDocumentClickHandler(){this._documentClick$.pipe(e.filter(t=>!t.composedPath().includes(this)),e.filter(t=>!this._options.some(i=>t.composedPath().includes(i))),e.filter(()=>this._open),e.tap(()=>{this._open$.next(!1),this._updateInputDisplay()}),e.takeUntil(this.disconnecting)).subscribe(),this._open$.pipe(e.distinctUntilChanged(),e.switchMap(t=>t?u.timer(10).pipe(e.tap(()=>document.addEventListener("click",i=>this._documentClick$.next(i))),e.switchMap(()=>u.EMPTY)):u.of(null).pipe(e.tap(()=>document.removeEventListener("click",i=>this._documentClick$.next(i))))),e.takeUntil(this.disconnecting)).subscribe()}_setupAutofillDetection(){u.merge(u.timer(100,500).pipe(e.take(10)),this._checkAutofill$,u.timer(100).pipe(e.switchMap(()=>u.fromEvent(window,"load").pipe(e.startWith(null))))).pipe(e.map(()=>{var i,s;const t=this._inputElementRef.value;return t?((i=t.shadowRoot)==null?void 0:i.querySelector("input"))||t.querySelector("input")||((s=t._inputRef)==null?void 0:s.value):null}),e.filter(t=>!!t),e.map(t=>t.value),e.filter(t=>!!t&&t.trim().length>0),e.distinctUntilChanged(),e.withLatestFrom(this._options$),e.tap(([t,i])=>{let s=null,n=0;if(i.forEach(l=>{const a=l.label||l.textContent||"",h=l.value,f=k(t,a),b=k(t,h),$=Math.max(f,b);$>n&&$>=this.similarityThreshold&&(n=$,s=l)}),s){this.multi?this._selectedValues$.next([s.value]):this._selectedValue$.next(s.value);const l=s.label||s.textContent||"";this._inputValue=l,this._inputValue$.next(l);const a=this._inputElementRef.value;a&&(a.value=l),this._open$.next(!1),this._fireChangeEvent(),this._announceToScreenReader(`Autofilled: ${l}`)}}),e.takeUntil(this.disconnecting)).subscribe(),u.timer(100).pipe(e.map(()=>{var i,s;const t=this._inputElementRef.value;return t?((i=t.shadowRoot)==null?void 0:i.querySelector("input"))||t.querySelector("input")||((s=t._inputRef)==null?void 0:s.value):null}),e.filter(t=>!!t),e.switchMap(t=>u.fromEvent(t,"animationstart").pipe(e.filter(i=>i.animationName==="onAutoFillStart"),e.tap(()=>{u.timer(100).pipe(e.tap(()=>this._checkAutofill$.next()),e.take(1)).subscribe()}))),e.takeUntil(this.disconnecting)).subscribe()}_updateInputDisplay(){u.of(null).pipe(e.withLatestFrom(this._selectedValue$,this._selectedValues$,this._options$,this._open$),e.tap(([,t,i,s,n])=>{if(this._inputElementRef.value&&(!n||!this.multi)){if(this.multi){const l=s.filter(a=>i.includes(a.value)).map(a=>a.label||a.textContent||"");this._inputValue=l.join(", ")}else{const l=s.find(a=>a.value===t);this._inputValue=l&&(l.label||l.textContent)||""}this._inputValue$.next(this._inputValue),this._inputElementRef.value.value=this._inputValue}}),e.take(1)).subscribe()}_getSelectedLabels(){return this._options.filter(t=>this.multi?this._selectedValues$.value.includes(t.value):t.value===this._selectedValue$.value).map(t=>t.label||t.textContent||"")}_announceToScreenReader(t){var s;const i=(s=this.shadowRoot)==null?void 0:s.querySelector("#live-status");i&&(i.textContent=t)}_fireChangeEvent(){const t={value:this.value};this.multi&&(t.values=[...this._selectedValues$.value]),this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))}checkValidity(){return!this.required||(this.multi?this._selectedValues$.value.length>0:!!this._selectedValue$.value)}reportValidity(){return this._inputElementRef.value?this._inputElementRef.value.reportValidity():this.checkValidity()}firstUpdated(){u.timer(200).pipe(e.tap(()=>this._checkAutofill$.next()),e.take(1)).subscribe(),this._options$.pipe(e.filter(t=>t.length>0),e.tap(()=>this._checkAutofill$.next()),e.takeUntil(this.disconnecting)).subscribe()}render(){var i;const t=`${this.id}-desc`;return V.html`
|
|
2
|
-
<div class="relative">
|
|
3
|
-
<!-- Screen reader live region -->
|
|
4
|
-
<div id="live-status" role="status" aria-live="polite" class="sr-only"></div>
|
|
5
|
-
|
|
6
|
-
<!-- Description -->
|
|
7
|
-
${this.description?V.html`<div id="${t}" class="sr-only">${this.description}</div>`:""}
|
|
8
|
-
|
|
9
|
-
<!-- Input -->
|
|
10
|
-
<slot name="trigger">
|
|
11
|
-
<sch-input
|
|
12
|
-
.size=${this.size}
|
|
13
|
-
${w.ref(this._inputElementRef)}
|
|
14
|
-
id="autocomplete-input"
|
|
15
|
-
class="w-full"
|
|
16
|
-
.name=${this.name||((i=this.label)==null?void 0:i.toLowerCase().replace(/\s+/g,"-"))}
|
|
17
|
-
.label=${this.label}
|
|
18
|
-
.placeholder=${this.placeholder}
|
|
19
|
-
.required=${this.required}
|
|
20
|
-
.value=${this._inputValue}
|
|
21
|
-
type="text"
|
|
22
|
-
autocomplete=${this.autocomplete}
|
|
23
|
-
clickable
|
|
24
|
-
role="combobox"
|
|
25
|
-
aria-autocomplete="list"
|
|
26
|
-
aria-haspopup="listbox"
|
|
27
|
-
aria-controls="options"
|
|
28
|
-
aria-expanded=${this._open}
|
|
29
|
-
aria-describedby=${this.description?t:void 0}
|
|
30
|
-
@input=${s=>{const n=s.target.value;this._inputValue=n,this._inputValue$.next(n)}}
|
|
31
|
-
@focus=${s=>{s.stopPropagation();const n=this.multi?this._selectedValues$.value.length>0:!!this._selectedValue$.value;this.multi&&!n&&(this._inputValue="",this._inputValue$.next(""),this._inputElementRef.value&&(this._inputElementRef.value.value="")),this._open$.next(!0)}}
|
|
32
|
-
@click=${s=>{s.stopPropagation(),this._open$.next(!0)}}
|
|
33
|
-
@keydown=${s=>{this._handleKeyDown(s)}}
|
|
34
|
-
>
|
|
35
|
-
</sch-input>
|
|
36
|
-
</slot>
|
|
37
|
-
|
|
38
|
-
<!-- Options dropdown -->
|
|
39
|
-
<ul
|
|
40
|
-
id="options"
|
|
41
|
-
class=${E.classMap({absolute:!0,"z-[1000]":!0,"mt-1":!0,"w-full":!0,"rounded-md":!0,"shadow-md":!0,"overflow-auto":!0,"min-w-full":!0,"bg-surface-low":!0,flex:!0,"flex-col":!0})}
|
|
42
|
-
role="listbox"
|
|
43
|
-
aria-multiselectable=${this.multi?"true":"false"}
|
|
44
|
-
aria-label=${`${this.label||"Options"} dropdown`}
|
|
45
|
-
?hidden=${!this._open}
|
|
46
|
-
style="max-height: ${this.maxHeight}; display: ${this._open?"flex":"none"};"
|
|
47
|
-
@slotchange=${()=>{this._options$.next(this._options),u.timer(100).pipe(e.tap(()=>this._checkAutofill$.next()),e.take(1)).subscribe()}}
|
|
48
|
-
>
|
|
49
|
-
<slot></slot>
|
|
50
|
-
${this._hasResults?"":V.html`
|
|
51
|
-
<li class="px-3 py-2 text-sm text-muted">No results found</li>
|
|
52
|
-
`}
|
|
53
|
-
</ul>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
<style>
|
|
57
|
-
:host {
|
|
58
|
-
display: block;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@keyframes onAutoFillStart {
|
|
62
|
-
from {/**/}
|
|
63
|
-
to {/**/}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
sch-input::part(input):-webkit-autofill,
|
|
67
|
-
sch-input input:-webkit-autofill {
|
|
68
|
-
animation-name: onAutoFillStart;
|
|
69
|
-
animation-duration: 1ms;
|
|
70
|
-
}
|
|
71
|
-
</style>
|
|
72
|
-
`}_handleKeyDown(t){u.fromEvent(document,"keydown").pipe(e.take(1),e.withLatestFrom(this._open$,this._options$),e.tap(([i,s,n])=>{var f,b,$,p,m;if(!s&&(i.key==="ArrowDown"||i.key==="Enter"))return i.preventDefault(),this._open$.next(!0),void u.timer(10).pipe(e.tap(()=>{const r=n.find(o=>!o.hidden);r==null||r.focus()}),e.take(1)).subscribe();if(!s)return;const l=n.filter(r=>!r.hidden).sort((r,o)=>parseInt(r.style.order||"0")-parseInt(o.style.order||"0")),a=l.find(r=>r===document.activeElement),h=a?l.indexOf(a):-1;switch(i.key){case"Escape":i.preventDefault(),this._open$.next(!1),this._updateInputDisplay(),(f=this._inputElementRef.value)==null||f.focus();break;case"Tab":this._open$.next(!1),this._updateInputDisplay();break;case"ArrowDown":i.preventDefault();const r=h<l.length-1?h+1:0;(b=l[r])==null||b.focus();break;case"ArrowUp":i.preventDefault();const o=h>0?h-1:l.length-1;($=l[o])==null||$.focus();break;case"Home":i.preventDefault(),(p=l[0])==null||p.focus();break;case"End":i.preventDefault(),(m=l[l.length-1])==null||m.focus();break;case"Enter":case" ":a&&(i.preventDefault(),this._optionSelect$.next(a))}})).subscribe()}};_([d.property({type:Boolean})],c.prototype,"required",2),_([d.property({type:String})],c.prototype,"placeholder",2),_([d.property({type:String,reflect:!0})],c.prototype,"label",2),_([d.property({type:String})],c.prototype,"name",2),_([d.property({type:String})],c.prototype,"maxHeight",2),_([d.property({type:Boolean})],c.prototype,"multi",2),_([d.property({type:String})],c.prototype,"description",2),_([d.property({type:String,reflect:!0})],c.prototype,"size",2),_([d.property({type:String})],c.prototype,"autocomplete",2),_([d.property({type:Number})],c.prototype,"debounceMs",2),_([d.property({type:Number})],c.prototype,"similarityThreshold",2),_([d.property({type:Array})],c.prototype,"values",1),_([d.property({type:String,reflect:!0})],c.prototype,"value",1),_([d.state()],c.prototype,"_open",2),_([d.state()],c.prototype,"_inputValue",2),_([d.state()],c.prototype,"_visibleOptionsCount",2),_([d.state()],c.prototype,"_hasResults",2),_([d.query("#options")],c.prototype,"_listbox",2),_([d.query("sch-input")],c.prototype,"_input",2),_([d.queryAssignedElements({flatten:!0})],c.prototype,"_options",2),c=_([d.customElement("schmancy-autocomplete")],c);
|
|
73
|
-
//# sourceMappingURL=autocomplete-ByVC8MLH.cjs.map
|
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
import { BehaviorSubject as S, Subject as O, fromEvent as E, combineLatest as L, timer as y, of as j, EMPTY as N, merge as z } from "rxjs";
|
|
2
|
-
import { classMap as H } from "lit/directives/class-map.js";
|
|
3
|
-
import "lit/directives/style-map.js";
|
|
4
|
-
import { $ as B } from "./litElement.mixin-DMTxmbnz.js";
|
|
5
|
-
import "./tailwind.mixin-DbsxfE0U.js";
|
|
6
|
-
import { html as M } from "lit";
|
|
7
|
-
import { property as _, state as R, query as I, queryAssignedElements as F, customElement as U } from "lit/decorators.js";
|
|
8
|
-
import { createRef as W, ref as K } from "lit/directives/ref.js";
|
|
9
|
-
import { tap as h, takeUntil as v, distinctUntilChanged as q, debounceTime as Y, withLatestFrom as C, take as w, filter as x, switchMap as A, startWith as G, map as T } from "rxjs/operators";
|
|
10
|
-
function D(e, t) {
|
|
11
|
-
if (!e || !t) return 0;
|
|
12
|
-
if (e === t) return 1;
|
|
13
|
-
const i = e.toLowerCase().trim(), s = t.toLowerCase().trim();
|
|
14
|
-
if (i === s) return 1;
|
|
15
|
-
if (s.startsWith(i))
|
|
16
|
-
return 0.95 + 0.05 * (i.length / s.length);
|
|
17
|
-
const n = s.split(/[\s\-_]+/);
|
|
18
|
-
for (const u of n) if (u.startsWith(i))
|
|
19
|
-
return 0.85 * (1 - n.indexOf(u) / n.length * 0.1);
|
|
20
|
-
if (s.includes(i))
|
|
21
|
-
return 0.7 * (1 - s.indexOf(i) / s.length * 0.2);
|
|
22
|
-
if (function(u, d) {
|
|
23
|
-
let a = 0, l = 0;
|
|
24
|
-
for (; a < u.length && l < d.length; ) u[a] === d[l] && a++, l++;
|
|
25
|
-
return a === u.length;
|
|
26
|
-
}(i, s)) return 0.5;
|
|
27
|
-
const o = function(u, d) {
|
|
28
|
-
if (u.length < 2 || d.length < 2) return 0;
|
|
29
|
-
const a = P(u), l = P(d);
|
|
30
|
-
let $ = 0;
|
|
31
|
-
const g = new Array(l.length).fill(!1);
|
|
32
|
-
for (const k of a) for (let V = 0; V < l.length; V++) if (!g[V] && l[V] === k) {
|
|
33
|
-
$++, g[V] = !0;
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
return 2 * $ / (a.length + l.length);
|
|
37
|
-
}(i, s), r = Math.max(i.length, s.length), m = function(u, d) {
|
|
38
|
-
if (u.length === 0) return d.length;
|
|
39
|
-
if (d.length === 0) return u.length;
|
|
40
|
-
const a = [];
|
|
41
|
-
for (let l = 0; l <= d.length; l++) a[l] = [l];
|
|
42
|
-
for (let l = 0; l <= u.length; l++) a[0][l] = l;
|
|
43
|
-
for (let l = 1; l <= d.length; l++) for (let $ = 1; $ <= u.length; $++) {
|
|
44
|
-
const g = u[$ - 1] === d[l - 1] ? 0 : 1;
|
|
45
|
-
a[l][$] = Math.min(a[l - 1][$] + 1, a[l][$ - 1] + 1, a[l - 1][$ - 1] + g);
|
|
46
|
-
}
|
|
47
|
-
return a[d.length][u.length];
|
|
48
|
-
}(i, s), f = r ? 1 - m / r : 0, b = function(u, d) {
|
|
49
|
-
const a = (g) => g.split("").reduce((k, V) => (k[V] = (k[V] || 0) + 1, k), {}), l = a(u), $ = a(d);
|
|
50
|
-
return Object.keys(l).every((g) => ($[g] || 0) >= l[g]);
|
|
51
|
-
}(i, s) ? 0.3 : 0;
|
|
52
|
-
return Math.max(0.4 * o, 0.4 * f, b);
|
|
53
|
-
}
|
|
54
|
-
function P(e) {
|
|
55
|
-
const t = [];
|
|
56
|
-
for (let i = 0; i < e.length - 1; i++) t.push(e.substring(i, i + 2));
|
|
57
|
-
return t;
|
|
58
|
-
}
|
|
59
|
-
var J = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, c = (e, t, i, s) => {
|
|
60
|
-
for (var n, o = s > 1 ? void 0 : s ? Q(t, i) : t, r = e.length - 1; r >= 0; r--) (n = e[r]) && (o = (s ? n(t, i, o) : n(o)) || o);
|
|
61
|
-
return s && o && J(t, i, o), o;
|
|
62
|
-
};
|
|
63
|
-
let p = class extends B(":host{display:block;border:unset!important;line-height:unset!important;background:unset!important;padding:unset!important;font-size:unset!important;box-shadow:unset!important}:host:focus{box-shadow:unset!important}") {
|
|
64
|
-
constructor() {
|
|
65
|
-
super(...arguments), this.required = !1, this.placeholder = "", this.label = "", this.name = "", this.maxHeight = "300px", this.multi = !1, this.description = "", this.size = "md", this.autocomplete = "on", this.debounceMs = 200, this.similarityThreshold = 0.3, this._open = !1, this._inputValue = "", this._visibleOptionsCount = 0, this._hasResults = !0, this._inputElementRef = W(), this._selectedValue$ = new S(""), this._selectedValues$ = new S([]), this._inputValue$ = new S(""), this._open$ = new S(!1), this._options$ = new S([]), this._optionSelect$ = new O(), this._documentClick$ = new O(), this._checkAutofill$ = new O();
|
|
66
|
-
}
|
|
67
|
-
get values() {
|
|
68
|
-
return [...this._selectedValues$.value];
|
|
69
|
-
}
|
|
70
|
-
set values(e) {
|
|
71
|
-
this._selectedValues$.next(Array.isArray(e) ? [...e] : []);
|
|
72
|
-
}
|
|
73
|
-
get value() {
|
|
74
|
-
return this.multi ? this._selectedValues$.value.join(",") : this._selectedValue$.value;
|
|
75
|
-
}
|
|
76
|
-
set value(e) {
|
|
77
|
-
this.multi ? this._selectedValues$.next(e ? e.split(",").map((t) => t.trim()).filter(Boolean) : []) : this._selectedValue$.next(e);
|
|
78
|
-
}
|
|
79
|
-
connectedCallback() {
|
|
80
|
-
super.connectedCallback(), this.id || (this.id = `sch-autocomplete-${Math.random().toString(36).slice(2, 9)}`), this._setupAutocompleteLogic(), this._setupDocumentClickHandler(), this._setupAutofillDetection();
|
|
81
|
-
}
|
|
82
|
-
_setupAutocompleteLogic() {
|
|
83
|
-
this._options$.pipe(h((e) => {
|
|
84
|
-
e.forEach((t, i) => {
|
|
85
|
-
t.setAttribute("role", "option"), t.tabIndex = -1, t.id || (t.id = `${this.id}-option-${i}`), t.hasAttribute("data-event-bound") || (E(t, "click").pipe(h((s) => s.stopPropagation()), v(this.disconnecting)).subscribe(() => this._optionSelect$.next(t)), t.setAttribute("data-event-bound", "true"));
|
|
86
|
-
});
|
|
87
|
-
}), v(this.disconnecting)).subscribe(), L([this._selectedValue$, this._selectedValues$, this._options$]).pipe(h(([e, t, i]) => {
|
|
88
|
-
i.forEach((s) => {
|
|
89
|
-
s.selected = this.multi ? t.includes(s.value) : s.value === e, s.setAttribute("aria-selected", String(s.selected));
|
|
90
|
-
});
|
|
91
|
-
}), v(this.disconnecting)).subscribe(), this._inputValue$.pipe(q(), Y(this.debounceMs), C(this._options$, this._open$), h(([e, t, i]) => {
|
|
92
|
-
if (!i) return;
|
|
93
|
-
const s = e.trim();
|
|
94
|
-
if (s) {
|
|
95
|
-
const n = t.map((r) => {
|
|
96
|
-
const m = r.label || r.textContent || "", f = r.value, b = D(s, m), u = D(s, f);
|
|
97
|
-
return { option: r, score: Math.max(1.1 * b, u) };
|
|
98
|
-
});
|
|
99
|
-
n.sort((r, m) => m.score - r.score);
|
|
100
|
-
let o = 0;
|
|
101
|
-
n.forEach((r, m) => {
|
|
102
|
-
const { option: f, score: b } = r;
|
|
103
|
-
b < this.similarityThreshold ? f.hidden = !0 : (f.hidden = !1, o++, f.style.order = String(m));
|
|
104
|
-
}), this._visibleOptionsCount = o, this._hasResults = o > 0;
|
|
105
|
-
} else t.forEach((n) => {
|
|
106
|
-
n.hidden = !1, n.style.order = "0";
|
|
107
|
-
}), this._visibleOptionsCount = t.length, this._hasResults = !0;
|
|
108
|
-
this._announceToScreenReader(this._visibleOptionsCount > 0 ? `${this._visibleOptionsCount} option${this._visibleOptionsCount === 1 ? "" : "s"} available.` : "No results found.");
|
|
109
|
-
}), v(this.disconnecting)).subscribe(), this._optionSelect$.pipe(C(this._selectedValue$, this._selectedValues$), h(([e, t, i]) => {
|
|
110
|
-
if (this.multi) {
|
|
111
|
-
const s = i.indexOf(e.value), n = s > -1 ? [...i.slice(0, s), ...i.slice(s + 1)] : [...i, e.value];
|
|
112
|
-
this._selectedValues$.next(n), this._inputValue$.next(""), this._inputValue = "";
|
|
113
|
-
const o = this._getSelectedLabels();
|
|
114
|
-
this._announceToScreenReader(o.length > 0 ? `Selected: ${o.join(", ")}` : "No options selected");
|
|
115
|
-
} else this._selectedValue$.next(e.value), this._open$.next(!1), this._open = !1, this._inputValue = e.label || e.textContent || "", this._inputValue$.next(this._inputValue), y(100).pipe(h(() => {
|
|
116
|
-
var s;
|
|
117
|
-
return (s = this._inputElementRef.value) == null ? void 0 : s.blur();
|
|
118
|
-
}), w(1)).subscribe(), this._announceToScreenReader(`Selected: ${e.label || e.textContent}`);
|
|
119
|
-
}), h(() => this._fireChangeEvent()), v(this.disconnecting)).subscribe(), L([this._open$, this._selectedValue$, this._selectedValues$, this._options$]).pipe(x(() => !this._open$.value), h(([, e, t, i]) => {
|
|
120
|
-
if (this.multi) {
|
|
121
|
-
const s = i.filter((n) => t.includes(n.value)).map((n) => n.label || n.textContent || "");
|
|
122
|
-
this._inputValue = s.join(", ");
|
|
123
|
-
} else {
|
|
124
|
-
const s = i.find((n) => n.value === e);
|
|
125
|
-
this._inputValue = s && (s.label || s.textContent) || "";
|
|
126
|
-
}
|
|
127
|
-
this._inputValue$.next(this._inputValue);
|
|
128
|
-
}), v(this.disconnecting)).subscribe(), this._open$.pipe(h((e) => this._open = e), v(this.disconnecting)).subscribe();
|
|
129
|
-
}
|
|
130
|
-
_setupDocumentClickHandler() {
|
|
131
|
-
this._documentClick$.pipe(x((e) => !e.composedPath().includes(this)), x((e) => !this._options.some((t) => e.composedPath().includes(t))), x(() => this._open), h(() => {
|
|
132
|
-
this._open$.next(!1), this._updateInputDisplay();
|
|
133
|
-
}), v(this.disconnecting)).subscribe(), this._open$.pipe(q(), A((e) => e ? y(10).pipe(h(() => document.addEventListener("click", (t) => this._documentClick$.next(t))), A(() => N)) : j(null).pipe(h(() => document.removeEventListener("click", (t) => this._documentClick$.next(t))))), v(this.disconnecting)).subscribe();
|
|
134
|
-
}
|
|
135
|
-
_setupAutofillDetection() {
|
|
136
|
-
z(y(100, 500).pipe(w(10)), this._checkAutofill$, y(100).pipe(A(() => E(window, "load").pipe(G(null))))).pipe(T(() => {
|
|
137
|
-
var t, i;
|
|
138
|
-
const e = this._inputElementRef.value;
|
|
139
|
-
return e ? ((t = e.shadowRoot) == null ? void 0 : t.querySelector("input")) || e.querySelector("input") || ((i = e._inputRef) == null ? void 0 : i.value) : null;
|
|
140
|
-
}), x((e) => !!e), T((e) => e.value), x((e) => !!e && e.trim().length > 0), q(), C(this._options$), h(([e, t]) => {
|
|
141
|
-
let i = null, s = 0;
|
|
142
|
-
if (t.forEach((n) => {
|
|
143
|
-
const o = n.label || n.textContent || "", r = n.value, m = D(e, o), f = D(e, r), b = Math.max(m, f);
|
|
144
|
-
b > s && b >= this.similarityThreshold && (s = b, i = n);
|
|
145
|
-
}), i) {
|
|
146
|
-
this.multi ? this._selectedValues$.next([i.value]) : this._selectedValue$.next(i.value);
|
|
147
|
-
const n = i.label || i.textContent || "";
|
|
148
|
-
this._inputValue = n, this._inputValue$.next(n);
|
|
149
|
-
const o = this._inputElementRef.value;
|
|
150
|
-
o && (o.value = n), this._open$.next(!1), this._fireChangeEvent(), this._announceToScreenReader(`Autofilled: ${n}`);
|
|
151
|
-
}
|
|
152
|
-
}), v(this.disconnecting)).subscribe(), y(100).pipe(T(() => {
|
|
153
|
-
var t, i;
|
|
154
|
-
const e = this._inputElementRef.value;
|
|
155
|
-
return e ? ((t = e.shadowRoot) == null ? void 0 : t.querySelector("input")) || e.querySelector("input") || ((i = e._inputRef) == null ? void 0 : i.value) : null;
|
|
156
|
-
}), x((e) => !!e), A((e) => E(e, "animationstart").pipe(x((t) => t.animationName === "onAutoFillStart"), h(() => {
|
|
157
|
-
y(100).pipe(h(() => this._checkAutofill$.next()), w(1)).subscribe();
|
|
158
|
-
}))), v(this.disconnecting)).subscribe();
|
|
159
|
-
}
|
|
160
|
-
_updateInputDisplay() {
|
|
161
|
-
j(null).pipe(C(this._selectedValue$, this._selectedValues$, this._options$, this._open$), h(([, e, t, i, s]) => {
|
|
162
|
-
if (this._inputElementRef.value && (!s || !this.multi)) {
|
|
163
|
-
if (this.multi) {
|
|
164
|
-
const n = i.filter((o) => t.includes(o.value)).map((o) => o.label || o.textContent || "");
|
|
165
|
-
this._inputValue = n.join(", ");
|
|
166
|
-
} else {
|
|
167
|
-
const n = i.find((o) => o.value === e);
|
|
168
|
-
this._inputValue = n && (n.label || n.textContent) || "";
|
|
169
|
-
}
|
|
170
|
-
this._inputValue$.next(this._inputValue), this._inputElementRef.value.value = this._inputValue;
|
|
171
|
-
}
|
|
172
|
-
}), w(1)).subscribe();
|
|
173
|
-
}
|
|
174
|
-
_getSelectedLabels() {
|
|
175
|
-
return this._options.filter((e) => this.multi ? this._selectedValues$.value.includes(e.value) : e.value === this._selectedValue$.value).map((e) => e.label || e.textContent || "");
|
|
176
|
-
}
|
|
177
|
-
_announceToScreenReader(e) {
|
|
178
|
-
var i;
|
|
179
|
-
const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector("#live-status");
|
|
180
|
-
t && (t.textContent = e);
|
|
181
|
-
}
|
|
182
|
-
_fireChangeEvent() {
|
|
183
|
-
const e = { value: this.value };
|
|
184
|
-
this.multi && (e.values = [...this._selectedValues$.value]), this.dispatchEvent(new CustomEvent("change", { detail: e, bubbles: !0, composed: !0 }));
|
|
185
|
-
}
|
|
186
|
-
checkValidity() {
|
|
187
|
-
return !this.required || (this.multi ? this._selectedValues$.value.length > 0 : !!this._selectedValue$.value);
|
|
188
|
-
}
|
|
189
|
-
reportValidity() {
|
|
190
|
-
return this._inputElementRef.value ? this._inputElementRef.value.reportValidity() : this.checkValidity();
|
|
191
|
-
}
|
|
192
|
-
firstUpdated() {
|
|
193
|
-
y(200).pipe(h(() => this._checkAutofill$.next()), w(1)).subscribe(), this._options$.pipe(x((e) => e.length > 0), h(() => this._checkAutofill$.next()), v(this.disconnecting)).subscribe();
|
|
194
|
-
}
|
|
195
|
-
render() {
|
|
196
|
-
var t;
|
|
197
|
-
const e = `${this.id}-desc`;
|
|
198
|
-
return M`
|
|
199
|
-
<div class="relative">
|
|
200
|
-
<!-- Screen reader live region -->
|
|
201
|
-
<div id="live-status" role="status" aria-live="polite" class="sr-only"></div>
|
|
202
|
-
|
|
203
|
-
<!-- Description -->
|
|
204
|
-
${this.description ? M`<div id="${e}" class="sr-only">${this.description}</div>` : ""}
|
|
205
|
-
|
|
206
|
-
<!-- Input -->
|
|
207
|
-
<slot name="trigger">
|
|
208
|
-
<sch-input
|
|
209
|
-
.size=${this.size}
|
|
210
|
-
${K(this._inputElementRef)}
|
|
211
|
-
id="autocomplete-input"
|
|
212
|
-
class="w-full"
|
|
213
|
-
.name=${this.name || ((t = this.label) == null ? void 0 : t.toLowerCase().replace(/\s+/g, "-"))}
|
|
214
|
-
.label=${this.label}
|
|
215
|
-
.placeholder=${this.placeholder}
|
|
216
|
-
.required=${this.required}
|
|
217
|
-
.value=${this._inputValue}
|
|
218
|
-
type="text"
|
|
219
|
-
autocomplete=${this.autocomplete}
|
|
220
|
-
clickable
|
|
221
|
-
role="combobox"
|
|
222
|
-
aria-autocomplete="list"
|
|
223
|
-
aria-haspopup="listbox"
|
|
224
|
-
aria-controls="options"
|
|
225
|
-
aria-expanded=${this._open}
|
|
226
|
-
aria-describedby=${this.description ? e : void 0}
|
|
227
|
-
@input=${(i) => {
|
|
228
|
-
const s = i.target.value;
|
|
229
|
-
this._inputValue = s, this._inputValue$.next(s);
|
|
230
|
-
}}
|
|
231
|
-
@focus=${(i) => {
|
|
232
|
-
i.stopPropagation();
|
|
233
|
-
const s = this.multi ? this._selectedValues$.value.length > 0 : !!this._selectedValue$.value;
|
|
234
|
-
this.multi && !s && (this._inputValue = "", this._inputValue$.next(""), this._inputElementRef.value && (this._inputElementRef.value.value = "")), this._open$.next(!0);
|
|
235
|
-
}}
|
|
236
|
-
@click=${(i) => {
|
|
237
|
-
i.stopPropagation(), this._open$.next(!0);
|
|
238
|
-
}}
|
|
239
|
-
@keydown=${(i) => {
|
|
240
|
-
this._handleKeyDown(i);
|
|
241
|
-
}}
|
|
242
|
-
>
|
|
243
|
-
</sch-input>
|
|
244
|
-
</slot>
|
|
245
|
-
|
|
246
|
-
<!-- Options dropdown -->
|
|
247
|
-
<ul
|
|
248
|
-
id="options"
|
|
249
|
-
class=${H({ absolute: !0, "z-[1000]": !0, "mt-1": !0, "w-full": !0, "rounded-md": !0, "shadow-md": !0, "overflow-auto": !0, "min-w-full": !0, "bg-surface-low": !0, flex: !0, "flex-col": !0 })}
|
|
250
|
-
role="listbox"
|
|
251
|
-
aria-multiselectable=${this.multi ? "true" : "false"}
|
|
252
|
-
aria-label=${`${this.label || "Options"} dropdown`}
|
|
253
|
-
?hidden=${!this._open}
|
|
254
|
-
style="max-height: ${this.maxHeight}; display: ${this._open ? "flex" : "none"};"
|
|
255
|
-
@slotchange=${() => {
|
|
256
|
-
this._options$.next(this._options), y(100).pipe(h(() => this._checkAutofill$.next()), w(1)).subscribe();
|
|
257
|
-
}}
|
|
258
|
-
>
|
|
259
|
-
<slot></slot>
|
|
260
|
-
${this._hasResults ? "" : M`
|
|
261
|
-
<li class="px-3 py-2 text-sm text-muted">No results found</li>
|
|
262
|
-
`}
|
|
263
|
-
</ul>
|
|
264
|
-
</div>
|
|
265
|
-
|
|
266
|
-
<style>
|
|
267
|
-
:host {
|
|
268
|
-
display: block;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
@keyframes onAutoFillStart {
|
|
272
|
-
from {/**/}
|
|
273
|
-
to {/**/}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
sch-input::part(input):-webkit-autofill,
|
|
277
|
-
sch-input input:-webkit-autofill {
|
|
278
|
-
animation-name: onAutoFillStart;
|
|
279
|
-
animation-duration: 1ms;
|
|
280
|
-
}
|
|
281
|
-
</style>
|
|
282
|
-
`;
|
|
283
|
-
}
|
|
284
|
-
_handleKeyDown(e) {
|
|
285
|
-
E(document, "keydown").pipe(w(1), C(this._open$, this._options$), h(([t, i, s]) => {
|
|
286
|
-
var m, f, b, u, d;
|
|
287
|
-
if (!i && (t.key === "ArrowDown" || t.key === "Enter")) return t.preventDefault(), this._open$.next(!0), void y(10).pipe(h(() => {
|
|
288
|
-
const a = s.find((l) => !l.hidden);
|
|
289
|
-
a == null || a.focus();
|
|
290
|
-
}), w(1)).subscribe();
|
|
291
|
-
if (!i) return;
|
|
292
|
-
const n = s.filter((a) => !a.hidden).sort((a, l) => parseInt(a.style.order || "0") - parseInt(l.style.order || "0")), o = n.find((a) => a === document.activeElement), r = o ? n.indexOf(o) : -1;
|
|
293
|
-
switch (t.key) {
|
|
294
|
-
case "Escape":
|
|
295
|
-
t.preventDefault(), this._open$.next(!1), this._updateInputDisplay(), (m = this._inputElementRef.value) == null || m.focus();
|
|
296
|
-
break;
|
|
297
|
-
case "Tab":
|
|
298
|
-
this._open$.next(!1), this._updateInputDisplay();
|
|
299
|
-
break;
|
|
300
|
-
case "ArrowDown":
|
|
301
|
-
t.preventDefault();
|
|
302
|
-
const a = r < n.length - 1 ? r + 1 : 0;
|
|
303
|
-
(f = n[a]) == null || f.focus();
|
|
304
|
-
break;
|
|
305
|
-
case "ArrowUp":
|
|
306
|
-
t.preventDefault();
|
|
307
|
-
const l = r > 0 ? r - 1 : n.length - 1;
|
|
308
|
-
(b = n[l]) == null || b.focus();
|
|
309
|
-
break;
|
|
310
|
-
case "Home":
|
|
311
|
-
t.preventDefault(), (u = n[0]) == null || u.focus();
|
|
312
|
-
break;
|
|
313
|
-
case "End":
|
|
314
|
-
t.preventDefault(), (d = n[n.length - 1]) == null || d.focus();
|
|
315
|
-
break;
|
|
316
|
-
case "Enter":
|
|
317
|
-
case " ":
|
|
318
|
-
o && (t.preventDefault(), this._optionSelect$.next(o));
|
|
319
|
-
}
|
|
320
|
-
})).subscribe();
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
c([_({ type: Boolean })], p.prototype, "required", 2), c([_({ type: String })], p.prototype, "placeholder", 2), c([_({ type: String, reflect: !0 })], p.prototype, "label", 2), c([_({ type: String })], p.prototype, "name", 2), c([_({ type: String })], p.prototype, "maxHeight", 2), c([_({ type: Boolean })], p.prototype, "multi", 2), c([_({ type: String })], p.prototype, "description", 2), c([_({ type: String, reflect: !0 })], p.prototype, "size", 2), c([_({ type: String })], p.prototype, "autocomplete", 2), c([_({ type: Number })], p.prototype, "debounceMs", 2), c([_({ type: Number })], p.prototype, "similarityThreshold", 2), c([_({ type: Array })], p.prototype, "values", 1), c([_({ type: String, reflect: !0 })], p.prototype, "value", 1), c([R()], p.prototype, "_open", 2), c([R()], p.prototype, "_inputValue", 2), c([R()], p.prototype, "_visibleOptionsCount", 2), c([R()], p.prototype, "_hasResults", 2), c([I("#options")], p.prototype, "_listbox", 2), c([I("sch-input")], p.prototype, "_input", 2), c([F({ flatten: !0 })], p.prototype, "_options", 2), p = c([U("schmancy-autocomplete")], p);
|
|
324
|
-
//# sourceMappingURL=autocomplete-Qr_SNWus.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const k=require("rxjs");var oe=Symbol.for("immer-nothing"),$=Symbol.for("immer-draftable"),l=Symbol.for("immer-state"),_e=process.env.NODE_ENV!=="production"?[function(t){return`The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`},function(t){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${t}'`},"This object has been frozen and should not be mutated",function(t){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+t},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(t){return`'current' expects a draft, got: ${t}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(t){return`'original' expects a draft, got: ${t}`}]:[];function _(t,...e){if(process.env.NODE_ENV!=="production"){const r=_e[t],s=typeof r=="function"?r.apply(null,e):r;throw new Error(`[Immer] ${s}`)}throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var E=Object.getPrototypeOf;function w(t){return!!t&&!!t[l]}function S(t){var e;return!!t&&(ce(t)||Array.isArray(t)||!!t[$]||!!((e=t.constructor)!=null&&e[$])||F(t)||V(t))}var be=Object.prototype.constructor.toString();function ce(t){if(!t||typeof t!="object")return!1;const e=E(t);if(e===null)return!0;const r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return r===Object||typeof r=="function"&&Function.toString.call(r)===be}function P(t,e){R(t)===0?Reflect.ownKeys(t).forEach(r=>{e(r,t[r],t)}):t.forEach((r,s)=>e(s,r,t))}function R(t){const e=t[l];return e?e.type_:Array.isArray(t)?1:F(t)?2:V(t)?3:0}function K(t,e){return R(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function he(t,e,r){const s=R(t);s===2?t.set(e,r):s===3?t.add(r):t[e]=r}function F(t){return t instanceof Map}function V(t){return t instanceof Set}function f(t){return t.copy_||t.base_}function W(t,e){if(F(t))return new Map(t);if(V(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const r=ce(t);if(e===!0||e==="class_only"&&!r){const s=Object.getOwnPropertyDescriptors(t);delete s[l];let n=Reflect.ownKeys(s);for(let a=0;a<n.length;a++){const h=n[a],c=s[h];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(s[h]={configurable:!0,writable:!0,enumerable:c.enumerable,value:t[h]})}return Object.create(E(t),s)}{const s=E(t);if(s!==null&&r)return{...t};const n=Object.create(s);return Object.assign(n,t)}}function Y(t,e=!1){return B(t)||w(t)||!S(t)||(R(t)>1&&(t.set=t.add=t.clear=t.delete=me),Object.freeze(t),e&&Object.entries(t).forEach(([r,s])=>Y(s,!0))),t}function me(){_(2)}function B(t){return Object.isFrozen(t)}var I,L={};function v(t){const e=L[t];return e||_(0,t),e}function N(){return I}function ee(t,e){e&&(v("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function q(t){G(t),t.drafts_.forEach(ge),t.drafts_=null}function G(t){t===I&&(I=t.parent_)}function te(t){return I={drafts_:[],parent_:I,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ge(t){const e=t[l];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function re(t,e){e.unfinalizedDrafts_=e.drafts_.length;const r=e.drafts_[0];return t!==void 0&&t!==r?(r[l].modified_&&(q(e),_(4)),S(t)&&(t=z(e,t),e.parent_||T(e,t)),e.patches_&&v("Patches").generateReplacementPatches_(r[l].base_,t,e.patches_,e.inversePatches_)):t=z(e,r,[]),q(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==oe?t:void 0}function z(t,e,r){if(B(e))return e;const s=e[l];if(!s)return P(e,(n,a)=>se(t,s,e,n,a,r)),e;if(s.scope_!==t)return e;if(!s.modified_)return T(t,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;const n=s.copy_;let a=n,h=!1;s.type_===3&&(a=new Set(n),n.clear(),h=!0),P(a,(c,i)=>se(t,s,n,c,i,r,h)),T(t,n,!1),r&&t.patches_&&v("Patches").generatePatches_(s,r,t.patches_,t.inversePatches_)}return s.copy_}function se(t,e,r,s,n,a,h){if(process.env.NODE_ENV!=="production"&&n===r&&_(5),w(n)){const c=z(t,n,a&&e&&e.type_!==3&&!K(e.assigned_,s)?a.concat(s):void 0);if(he(r,s,c),!w(c))return;t.canAutoFreeze_=!1}else h&&r.add(n);if(S(n)&&!B(n)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;z(t,n),e&&e.scope_.parent_||typeof s=="symbol"||!Object.prototype.propertyIsEnumerable.call(r,s)||T(t,n)}}function T(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Y(e,r)}var H={get(t,e){if(e===l)return t;const r=f(t);if(!K(r,e))return function(n,a,h){var i;const c=ne(a,h);return c?"value"in c?c.value:(i=c.get)==null?void 0:i.call(n.draft_):void 0}(t,r,e);const s=r[e];return t.finalized_||!S(s)?s:s===J(t.base_,e)?(U(t),t.copy_[e]=M(s,t)):s},has:(t,e)=>e in f(t),ownKeys:t=>Reflect.ownKeys(f(t)),set(t,e,r){const s=ne(f(t),e);if(s!=null&&s.set)return s.set.call(t.draft_,r),!0;if(!t.modified_){const h=J(f(t),e),c=h==null?void 0:h[l];if(c&&c.base_===r)return t.copy_[e]=r,t.assigned_[e]=!1,!0;if(((n=r)===(a=h)?n!==0||1/n==1/a:n!=n&&a!=a)&&(r!==void 0||K(t.base_,e)))return!0;U(t),g(t)}var n,a;return t.copy_[e]===r&&(r!==void 0||e in t.copy_)||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_[e]=!0),!0},deleteProperty:(t,e)=>(J(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,U(t),g(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0),getOwnPropertyDescriptor(t,e){const r=f(t),s=Reflect.getOwnPropertyDescriptor(r,e);return s&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:s.enumerable,value:r[e]}},defineProperty(){_(11)},getPrototypeOf:t=>E(t.base_),setPrototypeOf(){_(12)}},x={};function J(t,e){const r=t[l];return(r?f(r):t)[e]}function ne(t,e){if(!(e in t))return;let r=E(t);for(;r;){const s=Object.getOwnPropertyDescriptor(r,e);if(s)return s;r=E(r)}}function g(t){t.modified_||(t.modified_=!0,t.parent_&&g(t.parent_))}function U(t){t.copy_||(t.copy_=W(t.base_,t.scope_.immer_.useStrictShallowCopy_))}P(H,(t,e)=>{x[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),x.deleteProperty=function(t,e){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(e))&&_(13),x.set.call(this,t,e,void 0)},x.set=function(t,e,r){return process.env.NODE_ENV!=="production"&&e!=="length"&&isNaN(parseInt(e))&&_(14),H.set.call(this,t[0],e,r,t[0])};function M(t,e){const r=F(t)?v("MapSet").proxyMap_(t,e):V(t)?v("MapSet").proxySet_(t,e):function(s,n){const a=Array.isArray(s),h={type_:a?1:0,scope_:n?n.scope_:N(),modified_:!1,finalized_:!1,assigned_:{},parent_:n,base_:s,draft_:null,copy_:null,revoke_:null,isManual_:!1};let c=h,i=H;a&&(c=[h],i=x);const{revoke:o,proxy:p}=Proxy.revocable(c,i);return h.draft_=p,h.revoke_=o,p}(t,e);return(e?e.scope_:N()).drafts_.push(r),r}function ue(t){if(!S(t)||B(t))return t;const e=t[l];let r;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=W(t,e.scope_.immer_.useStrictShallowCopy_)}else r=W(t,!0);return P(r,(s,n)=>{he(r,s,ue(n))}),e&&(e.finalized_=!1),r}var le,ie,ae,b=new class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,r,s)=>{if(typeof e=="function"&&typeof r!="function"){const a=r;r=e;const h=this;return function(c=a,...i){return h.produce(c,o=>r.call(this,o,...i))}}let n;if(typeof r!="function"&&_(6),s!==void 0&&typeof s!="function"&&_(7),S(e)){const a=te(this),h=M(e,void 0);let c=!0;try{n=r(h),c=!1}finally{c?q(a):G(a)}return ee(a,s),re(n,a)}if(!e||typeof e!="object"){if(n=r(e),n===void 0&&(n=e),n===oe&&(n=void 0),this.autoFreeze_&&Y(n,!0),s){const a=[],h=[];v("Patches").generateReplacementPatches_(e,n,a,h),s(a,h)}return n}_(1,e)},this.produceWithPatches=(e,r)=>{if(typeof e=="function")return(a,...h)=>this.produceWithPatches(a,c=>e(c,...h));let s,n;return[this.produce(e,r,(a,h)=>{s=a,n=h}),s,n]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){S(t)||_(8),w(t)&&(t=function(s){return w(s)||_(10,s),ue(s)}(t));const e=te(this),r=M(t,void 0);return r[l].isManual_=!0,G(e),r}finishDraft(t,e){const r=t&&t[l];r&&r.isManual_||_(9);const{scope_:s}=r;return ee(s,e),re(void 0,s)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){const n=e[r];if(n.path.length===0&&n.op==="replace"){t=n.value;break}}r>-1&&(e=e.slice(r+1));const s=v("Patches").applyPatches_;return w(t)?s(t,e):this.produce(t,n=>s(n,e))}},d=b.produce;b.produceWithPatches.bind(b),b.setAutoFreeze.bind(b),b.setUseStrictShallowCopy.bind(b),b.applyPatches.bind(b),b.createDraft.bind(b),b.finishDraft.bind(b);class u extends Error{constructor(e,r,s){super(e),this.name="StoreError",this.cause=r,this.context=s,this.timestamp=new Date,Error.captureStackTrace&&Error.captureStackTrace(this,u)}toJSON(){return{name:this.name,message:this.message,cause:this.cause,context:this.context,timestamp:this.timestamp.toISOString(),stack:this.stack}}}class de{constructor(){this.data=null}async load(){return this.data}async save(e){this.data=e}async clear(){this.data=null}}class pe{constructor(e){this.key=e}async load(){try{const e=localStorage.getItem(this.key);return e?JSON.parse(e):null}catch{return null}}async save(e){try{localStorage.setItem(this.key,JSON.stringify(e))}catch(r){throw new u(`Failed to save to localStorage (${this.key})`,r)}}async clear(){localStorage.removeItem(this.key)}}class fe{constructor(e){this.key=e}async load(){try{const e=sessionStorage.getItem(this.key);return e?JSON.parse(e):null}catch{return null}}async save(e){try{sessionStorage.setItem(this.key,JSON.stringify(e))}catch(r){throw new u(`Failed to save to sessionStorage (${this.key})`,r)}}async clear(){sessionStorage.removeItem(this.key)}}const y=class y{constructor(e){this.key=e}openDB(){return new Promise((e,r)=>{const s=indexedDB.open(y.DB_NAME,y.DB_VERSION);s.onupgradeneeded=()=>{const n=s.result;n.objectStoreNames.contains(y.STORE_NAME)||n.createObjectStore(y.STORE_NAME)},s.onsuccess=()=>e(s.result),s.onerror=()=>r(s.error)})}async load(){try{const e=await this.openDB();return new Promise((r,s)=>{const n=e.transaction(y.STORE_NAME,"readonly").objectStore(y.STORE_NAME).get(this.key);n.onsuccess=()=>{e.close(),r(n.result||null)},n.onerror=()=>{e.close(),s(n.error)}})}catch{return null}}async save(e){try{const r=await this.openDB();return new Promise((s,n)=>{const a=r.transaction(y.STORE_NAME,"readwrite").objectStore(y.STORE_NAME).put(e,this.key);a.onsuccess=()=>{r.close(),s()},a.onerror=()=>{r.close(),n(a.error)}})}catch(r){throw new u(`Failed to save to IndexedDB (${this.key})`,r)}}async clear(){try{const e=await this.openDB();return new Promise((r,s)=>{const n=e.transaction(y.STORE_NAME,"readwrite").objectStore(y.STORE_NAME).delete(this.key);n.onsuccess=()=>{e.close(),r()},n.onerror=()=>{e.close(),s(n.error)}})}catch(e){throw new u(`Failed to clear from IndexedDB (${this.key})`,e)}}};y.DB_NAME="StoreDB",y.STORE_NAME="states",y.DB_VERSION=1;let A=y;function ye(t,e){switch(t){case"local":return new pe(e);case"session":return new fe(e);case"indexeddb":return new A(e);default:return new de}}(function(){class t extends Map{constructor(i,o){super(),this[l]={type_:2,parent_:o,scope_:o?o.scope_:N(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:i,draft_:this,isManual_:!1,revoked_:!1}}get size(){return f(this[l]).size}has(i){return f(this[l]).has(i)}set(i,o){const p=this[l];return n(p),f(p).has(i)&&f(p).get(i)===o||(e(p),g(p),p.assigned_.set(i,!0),p.copy_.set(i,o),p.assigned_.set(i,!0)),this}delete(i){if(!this.has(i))return!1;const o=this[l];return n(o),e(o),g(o),o.base_.has(i)?o.assigned_.set(i,!1):o.assigned_.delete(i),o.copy_.delete(i),!0}clear(){const i=this[l];n(i),f(i).size&&(e(i),g(i),i.assigned_=new Map,P(i.base_,o=>{i.assigned_.set(o,!1)}),i.copy_.clear())}forEach(i,o){f(this[l]).forEach((p,m,Se)=>{i.call(o,this.get(m),m,this)})}get(i){const o=this[l];n(o);const p=f(o).get(i);if(o.finalized_||!S(p)||p!==o.base_.get(i))return p;const m=M(p,o);return e(o),o.copy_.set(i,m),m}keys(){return f(this[l]).keys()}values(){const i=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const o=i.next();return o.done?o:{done:!1,value:this.get(o.value)}}}}entries(){const i=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const o=i.next();if(o.done)return o;const p=this.get(o.value);return{done:!1,value:[o.value,p]}}}}[Symbol.iterator](){return this.entries()}}function e(c){c.copy_||(c.assigned_=new Map,c.copy_=new Map(c.base_))}class r extends Set{constructor(i,o){super(),this[l]={type_:3,parent_:o,scope_:o?o.scope_:N(),modified_:!1,finalized_:!1,copy_:void 0,base_:i,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return f(this[l]).size}has(i){const o=this[l];return n(o),o.copy_?!!o.copy_.has(i)||!(!o.drafts_.has(i)||!o.copy_.has(o.drafts_.get(i))):o.base_.has(i)}add(i){const o=this[l];return n(o),this.has(i)||(s(o),g(o),o.copy_.add(i)),this}delete(i){if(!this.has(i))return!1;const o=this[l];return n(o),s(o),g(o),o.copy_.delete(i)||!!o.drafts_.has(i)&&o.copy_.delete(o.drafts_.get(i))}clear(){const i=this[l];n(i),f(i).size&&(s(i),g(i),i.copy_.clear())}values(){const i=this[l];return n(i),s(i),i.copy_.values()}entries(){const i=this[l];return n(i),s(i),i.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(i,o){const p=this.values();let m=p.next();for(;!m.done;)i.call(o,m.value,m.value,this),m=p.next()}}function s(c){c.copy_||(c.copy_=new Set,c.base_.forEach(i=>{if(S(i)){const o=M(i,c);c.drafts_.set(i,o),c.copy_.add(o)}else c.copy_.add(i)}))}function n(c){c.revoked_&&_(3,JSON.stringify(f(c)))}var a,h;h={proxyMap_:function(c,i){return new t(c,i)},proxySet_:function(c,i){return new r(c,i)}},L[a="MapSet"]||(L[a]=h)})(),le=$;class C{constructor(e,r,s){let n;this.storageType=e,this.key=r,this[le]=!0,this._ready=!1,this._destroy$=new k.Subject,this.error$=new k.BehaviorSubject(null),n=s instanceof Map?new Map(s):Array.isArray(s)?[...s]:s&&typeof s=="object"?{...s}:s;try{this.defaultValue=this.isImmerDraftable(n)?d(n,a=>a):n}catch{this.defaultValue=n}this.$=new k.BehaviorSubject(this.defaultValue),this.storage=ye(e,r),e==="memory"?this._ready=!0:this.initializeFromStorage()}get ready(){return this._ready}set ready(e){this._ready=e,this.updateState(this.$.value)}get value(){return this.$.getValue()}isImmerDraftable(e){return e!==null&&typeof e=="object"&&(Array.isArray(e)||e instanceof Map||e instanceof Set||Object.getPrototypeOf(e)===Object.prototype||e[$]===!0)}destroy(){this._destroy$.next(),this._destroy$.complete(),this.$.complete(),this.error$.complete()}replace(e){try{const r=this.isImmerDraftable(e)?d(e,s=>s):e;this.updateState(r)}catch(r){const s=new u(`Error replacing state in ${this.key}`,r);this.error$.next(s),this.updateState(e)}}updateState(e){try{let r;r=this.isImmerDraftable(e)?d(e,s=>s):e,this.$.next(r),this.storageType!=="memory"&&this.persistToStorage(r).catch(s=>{const n=new u(`Error saving to ${this.storageType} storage for ${this.key}`,s);this.error$.next(n)})}catch(r){const s=new u(`Error updating state in ${this.key}`,r);this.error$.next(s),this.$.next(e)}}async initializeFromStorage(){try{const e=await this.storage.load();if(e){const r=this.processStoredValue(e);try{const s=this.isImmerDraftable(r)?d(r,n=>n):r;this.updateState(s)}catch{this.updateState(r)}}this._ready=!0}catch(e){const r=new u(`Error loading from ${this.storageType} storage for ${this.key}`,e);this.error$.next(r),this._ready=!0}}processStoredValue(e){return e}async persistToStorage(e){return this.storage.save(e)}}const O=class O extends C{static getInstance(e,r,s=[]){const n=`${e}:${r}`;return this.instances.has(n)||this.instances.set(n,new O(e,r,s)),this.instances.get(n)}constructor(e,r,s=[]){super(e,r,s),e!=="memory"&&this.setupPersistence()}setupPersistence(){this.$.pipe(k.throttleTime(100,void 0,{leading:!0,trailing:!0})).subscribe(e=>{this.storage.save(e).catch(r=>{const s=new u(`Error saving to ${this.storageType} storage for ${this.key}`,r);this.error$.next(s)})})}push(...e){try{const r=d(this.value,s=>{s.push(...e.map(n=>n))});this.updateState(r),this.error$.next(null)}catch(r){const s=new u(`Error pushing items in ${this.key}`,r);this.error$.next(s)}}pop(){try{const e=this.value.length>0?this.value[this.value.length-1]:void 0,r=d(this.value,s=>{s.pop()});return this.updateState(r),this.error$.next(null),e}catch(e){const r=new u(`Error popping item from ${this.key}`,e);return void this.error$.next(r)}}unshift(...e){try{const r=d(this.value,s=>{s.unshift(...e.map(n=>n))});this.updateState(r),this.error$.next(null)}catch(r){const s=new u(`Error unshifting items in ${this.key}`,r);this.error$.next(s)}}shift(){try{const e=this.value.length>0?this.value[0]:void 0,r=d(this.value,s=>{s.shift()});return this.updateState(r),this.error$.next(null),e}catch(e){const r=new u(`Error shifting item from ${this.key}`,e);return void this.error$.next(r)}}set(e,r){try{const s=d(this.value,n=>{if(!(e>=0&&e<n.length))throw new Error(`Index ${e} out of bounds (length: ${n.length})`);n[e]=r});this.updateState(s),this.error$.next(null)}catch(s){const n=new u(`Error setting item at index ${e} in ${this.key}`,s);this.error$.next(n)}}get(e){return this.value[e]}splice(e,r,...s){try{const n=[...this.value].splice(e,r??0,...s),a=d(this.value,h=>{h.splice(e,r??0,...s.map(c=>c))});return this.updateState(a),this.error$.next(null),n}catch(n){const a=new u(`Error splicing items in ${this.key}`,n);return this.error$.next(a),[]}}remove(e,r){try{const s=r||((a,h)=>a===h),n=this.value.findIndex(a=>s(a,e));if(n!==-1){const a=d(this.value,h=>{h.splice(n,1)});return this.updateState(a),this.error$.next(null),!0}return this.error$.next(null),!1}catch(s){const n=new u(`Error removing item in ${this.key}`,s);return this.error$.next(n),!1}}replace(e){try{const r=d(e,s=>s);this.updateState(r),this.error$.next(null)}catch(r){const s=new u(`Error replacing array in ${this.key}`,r);this.error$.next(s)}}filter(e){try{const r=this.value.filter(e),s=d(this.value,n=>{n.length=0,n.push(...r.map(a=>a))});this.updateState(s),this.error$.next(null)}catch(r){const s=new u(`Error filtering array in ${this.key}`,r);this.error$.next(s)}}map(e){return this.value.map(e)}sort(e){try{const r=[...this.value].sort(e),s=d(this.value,n=>{n.length=0,n.push(...r.map(a=>a))});this.updateState(s),this.error$.next(null)}catch(r){const s=new u(`Error sorting array in ${this.key}`,r);this.error$.next(s)}}update(e,r){try{const s=d(this.value,n=>{if(!(e>=0&&e<n.length))throw new Error(`Index ${e} out of bounds (length: ${n.length})`);r(n[e])});this.updateState(s),this.error$.next(null)}catch(s){const n=new u(`Error updating item at index ${e} in ${this.key}`,s);this.error$.next(n)}}clear(){this.updateState([])}setupDevTools(){typeof window<"u"&&(window.__STORES__=window.__STORES__||{},window.__STORES__[this.key]={getState:()=>this.value,push:this.push.bind(this),pop:this.pop.bind(this),unshift:this.unshift.bind(this),shift:this.shift.bind(this),set:this.set.bind(this),get:this.get.bind(this),splice:this.splice.bind(this),remove:this.remove.bind(this),replace:this.replace.bind(this),filter:this.filter.bind(this),map:this.map.bind(this),sort:this.sort.bind(this),update:this.update.bind(this),clear:this.clear.bind(this),subscribe:e=>{const r=this.$.subscribe(e);return()=>r.unsubscribe()}})}};O.type="array",O.instances=new Map;let Q=O;const D=class D extends C{static getInstance(e,r,s){const n=`${e}:${r}`;return this.instances.has(n)||this.instances.set(n,new D(e,r,s)),this.instances.get(n)}set(e,r){try{const s=d(this.value,n=>{n.set(e,r)});this.updateState(s),this.error$.next(null)}catch(s){const n=new u(`Error setting value for key ${e} in ${this.key}`,s);this.error$.next(n)}}delete(e){try{const r=d(this.value,s=>{s.delete(e)});this.updateState(r),this.error$.next(null)}catch(r){const s=new u(`Error deleting key ${e} from ${this.key}`,r);this.error$.next(s)}}clear(){this.updateState(new Map)}batchUpdate(e){try{const r=d(this.value,s=>{Object.entries(e).forEach(([n,a])=>{s.set(n,a)})});this.updateState(r),this.error$.next(null)}catch(r){const s=new u(`Error batch updating in ${this.key}`,r);this.error$.next(s)}}update(e,r){try{const s=d(this.value,n=>{const a=n.get(e);a!==void 0&&r(a)});this.updateState(s),this.error$.next(null)}catch(s){const n=new u(`Error updating item ${e} in ${this.key}`,s);this.error$.next(n)}}constructor(e,r,s){super(e,r,s),e!=="memory"&&this.setupPersistence()}setupPersistence(){this.$.pipe(k.throttleTime(100,void 0,{leading:!0,trailing:!0})).subscribe(e=>{this.storage.save(e).catch(r=>{const s=new u(`Error saving to ${this.storageType} storage for ${this.key}`,r);this.error$.next(s)})})}setupDevTools(){typeof window<"u"&&(window.__STORES__=window.__STORES__||{},window.__STORES__[this.key]={getState:()=>this.value,set:this.set.bind(this),delete:this.delete.bind(this),clear:this.clear.bind(this),batchUpdate:this.batchUpdate.bind(this),update:this.update.bind(this),subscribe:e=>{const r=this.$.subscribe(e);return()=>r.unsubscribe()}})}};D.type="collection",D.instances=new Map;let X=D;const j=class j extends(ae=C,ie=$,ae){constructor(){super(...arguments),this[ie]=!0}static getInstance(e,r,s){const n=`${e}:${r}`;return this.instances.has(n)||this.instances.set(n,new j(e,r,s)),this.instances.get(n)}set(e,r=!0){try{if(!this.isImmerDraftable(this.value)){const n=r?{...this.value,...e}:e;return this.updateState(n),void this.error$.next(null)}const s=d(this.value,n=>{if(r){if(e==null)return;try{Object.assign(n,e)}catch{Object.keys(e).forEach(h=>{n[h]=e[h]})}}else try{return e}catch{return e}});this.updateState(s),this.error$.next(null)}catch(s){const n=new u(`Error updating store: ${this.key}`,s,{value:e,merge:r});this.error$.next(n);try{const a=r?{...this.value,...e}:e;this.updateState(a)}catch{}}}clear(){try{if(this.isImmerDraftable(this.defaultValue)){const e=d(this.defaultValue,r=>r);this.set(e,!1)}else this.set(this.defaultValue,!1)}catch(e){const r=new u(`Error clearing store: ${this.key}`,e);this.error$.next(r),this.updateState(this.defaultValue)}}delete(e){try{if(!this.isImmerDraftable(this.value)){const s={...this.value};return delete s[e],void this.updateState(s)}const r=d(this.value,s=>{delete s[e]});this.updateState(r)}catch(r){const s=new u(`Error deleting key ${String(e)} from store: ${this.key}`,r);this.error$.next(s);try{const n={...this.value};delete n[e],this.updateState(n)}catch{}}}setPath(e,r){try{if(!e)return;if(!this.isImmerDraftable(this.value)){const n=e.split("."),a={...this.value};let h=a;for(let c=0;c<n.length-1;c++){const i=n[c];h[i]===void 0?h[i]={}:typeof h[i]=="object"&&h[i]!==null||(h[i]={}),h=h[i]}return h[n[n.length-1]]=r,void this.updateState(a)}const s=d(this.value,n=>{const a=e.split(".");let h=n;for(let i=0;i<a.length-1;i++){const o=a[i];h[o]===void 0?h[o]={}:typeof h[o]=="object"&&h[o]!==null||(h[o]={}),h=h[o]}const c=a[a.length-1];try{h[c]=r}catch{h[c]=r}});this.updateState(s),this.error$.next(null)}catch(s){const n=new u(`Error setting path ${e} in ${this.key}`,s);this.error$.next(n);try{const a=e.split("."),h={...this.value};let c=h;for(let i=0;i<a.length-1;i++){const o=a[i];c[o]===void 0?c[o]={}:typeof c[o]=="object"&&c[o]!==null||(c[o]={}),c=c[o]}c[a[a.length-1]]=r,this.updateState(h)}catch{}}}processStoredValue(e){try{return this.isImmerDraftable(this.defaultValue)&&this.isImmerDraftable(e)?d(this.defaultValue,r=>{Object.assign(r,e)}):{...this.defaultValue,...e}}catch{return e}}setupDevTools(){typeof window<"u"&&(window.__STORES__=window.__STORES__||{},window.__STORES__[this.key]={getState:()=>this.value,set:this.set.bind(this),delete:this.delete.bind(this),clear:this.clear.bind(this),setPath:this.setPath.bind(this),subscribe:e=>{const r=this.$.subscribe(e);return()=>r.unsubscribe()}})}isImmerDraftable(e){return e!==null&&typeof e=="object"&&(super.isImmerDraftable(e)||e[$]===!0)}};j.type="object",j.instances=new Map;let Z=j;exports.BaseStore=C,exports.IndexedDBStorageManager=A,exports.LocalStorageManager=pe,exports.MemoryStorageManager=de,exports.SchmancyArrayStore=Q,exports.SchmancyCollectionStore=X,exports.SchmancyStoreObject=Z,exports.SessionStorageManager=fe,exports.StoreError=u,exports.createStorageManager=ye;
|
|
2
|
-
//# sourceMappingURL=context-object-CP7HbDFQ.cjs.map
|