@mhmo91/schmancy 0.9.9 → 0.9.10
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/{area-D9b9dHQr.cjs → area-BafkBc1f.cjs} +1 -1
- package/dist/{area-D9b9dHQr.cjs.map → area-BafkBc1f.cjs.map} +1 -1
- package/dist/{area-BARjKpE9.js → area-D03HRn1L.js} +1 -1
- package/dist/{area-BARjKpE9.js.map → area-D03HRn1L.js.map} +1 -1
- package/dist/area.cjs +1 -1
- package/dist/area.js +1 -1
- package/dist/{autocomplete-AI2CCJmK.cjs → autocomplete-BeLg4A3T.cjs} +1 -1
- package/dist/{autocomplete-AI2CCJmK.cjs.map → autocomplete-BeLg4A3T.cjs.map} +1 -1
- package/dist/{autocomplete-DOimwVMP.js → autocomplete-BotVnTfP.js} +2 -2
- package/dist/{autocomplete-DOimwVMP.js.map → autocomplete-BotVnTfP.js.map} +1 -1
- package/dist/autocomplete.cjs +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/{boat-Bk4u-LzT.cjs → boat-4hSLFsGy.cjs} +1 -1
- package/dist/{boat-Bk4u-LzT.cjs.map → boat-4hSLFsGy.cjs.map} +1 -1
- package/dist/{boat-DrghVeWK.js → boat-C1wGdoaF.js} +1 -1
- package/dist/{boat-DrghVeWK.js.map → boat-C1wGdoaF.js.map} +1 -1
- package/dist/boat.cjs +1 -1
- package/dist/boat.js +1 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/{busy-c_q_F8O0.cjs → busy-C0qP0TiL.cjs} +1 -1
- package/dist/{busy-c_q_F8O0.cjs.map → busy-C0qP0TiL.cjs.map} +1 -1
- package/dist/{busy-BmFfwyz_.js → busy-D74-XaFn.js} +1 -1
- package/dist/{busy-BmFfwyz_.js.map → busy-D74-XaFn.js.map} +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-BADJHUMA.js → card-C8Ns2mRo.js} +1 -1
- package/dist/{card-BADJHUMA.js.map → card-C8Ns2mRo.js.map} +1 -1
- package/dist/{card-C_E944_Z.cjs → card-DUq_MsxC.cjs} +1 -1
- package/dist/{card-C_E944_Z.cjs.map → card-DUq_MsxC.cjs.map} +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/charts.cjs +1 -1
- package/dist/charts.js +1 -1
- package/dist/{checkbox-D7rvCrGk.js → checkbox-D18r6c0V.js} +1 -1
- package/dist/{checkbox-D7rvCrGk.js.map → checkbox-D18r6c0V.js.map} +1 -1
- package/dist/{checkbox-ZqDoCagB.cjs → checkbox-qPH_5Viu.cjs} +1 -1
- package/dist/{checkbox-ZqDoCagB.cjs.map → checkbox-qPH_5Viu.cjs.map} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{chips-vdzIsesI.js → chips-0rKPqQt8.js} +3 -3
- package/dist/{chips-vdzIsesI.js.map → chips-0rKPqQt8.js.map} +1 -1
- package/dist/{chips-Cux635Qs.cjs → chips-BI_kt5BS.cjs} +1 -1
- package/dist/{chips-Cux635Qs.cjs.map → chips-BI_kt5BS.cjs.map} +1 -1
- package/dist/chips.cjs +1 -1
- package/dist/chips.js +2 -2
- package/dist/{code-highlight-D6yruol6.js → code-highlight-ClzG4FL4.js} +1 -1
- package/dist/{code-highlight-D6yruol6.js.map → code-highlight-ClzG4FL4.js.map} +1 -1
- package/dist/{code-highlight-C9lKek2p.cjs → code-highlight-DGInmDAW.cjs} +1 -1
- package/dist/{code-highlight-C9lKek2p.cjs.map → code-highlight-DGInmDAW.cjs.map} +1 -1
- package/dist/code-highlight.cjs +1 -1
- package/dist/code-highlight.js +1 -1
- package/dist/{components-ByRyEzz5.cjs → components-7hOtFi_q.cjs} +1 -1
- package/dist/{components-ByRyEzz5.cjs.map → components-7hOtFi_q.cjs.map} +1 -1
- package/dist/{components-DSvPKR9Q.js → components-RbvrLE3U.js} +1 -1
- package/dist/{components-DSvPKR9Q.js.map → components-RbvrLE3U.js.map} +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/connectivity.cjs +1 -1
- package/dist/connectivity.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/{date-range-DJsavigf.cjs → date-range-B0kW9np7.cjs} +1 -1
- package/dist/{date-range-DJsavigf.cjs.map → date-range-B0kW9np7.cjs.map} +1 -1
- package/dist/{date-range-tEX2Jx2j.js → date-range-CfIIPIA_.js} +2 -2
- package/dist/{date-range-tEX2Jx2j.js.map → date-range-CfIIPIA_.js.map} +1 -1
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/{delay-CZw37zps.js → delay-CPoyWZuQ.js} +3 -3
- package/dist/{delay-CZw37zps.js.map → delay-CPoyWZuQ.js.map} +1 -1
- package/dist/{delay-BvVdfhAR.cjs → delay-k_HiVnhP.cjs} +1 -1
- package/dist/{delay-BvVdfhAR.cjs.map → delay-k_HiVnhP.cjs.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/delay.js +1 -1
- package/dist/{details-D7VTnLOh.js → details-BU5kx0Jh.js} +1 -1
- package/dist/{details-D7VTnLOh.js.map → details-BU5kx0Jh.js.map} +1 -1
- package/dist/{details-Bhz8_whd.cjs → details-CQIbCUY0.cjs} +1 -1
- package/dist/{details-Bhz8_whd.cjs.map → details-CQIbCUY0.cjs.map} +1 -1
- package/dist/details.cjs +1 -1
- package/dist/details.js +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{divider-zS232JDr.js → divider-D9borfuG.js} +1 -1
- package/dist/{divider-zS232JDr.js.map → divider-D9borfuG.js.map} +1 -1
- package/dist/{divider-S0bHwCCS.cjs → divider-IX9sp29l.cjs} +1 -1
- package/dist/{divider-S0bHwCCS.cjs.map → divider-IX9sp29l.cjs.map} +1 -1
- package/dist/divider.cjs +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +2 -2
- package/dist/{expand-BXt9SqAF.js → expand-Dw9tbuFG.js} +2 -2
- package/dist/{expand-BXt9SqAF.js.map → expand-Dw9tbuFG.js.map} +1 -1
- package/dist/{expand-Dr7TFXpl.cjs → expand-dIrDcH9Y.cjs} +1 -1
- package/dist/{expand-Dr7TFXpl.cjs.map → expand-dIrDcH9Y.cjs.map} +1 -1
- package/dist/expand.cjs +1 -1
- package/dist/expand.js +1 -1
- package/dist/{extra-BmZTXAp0.cjs → extra-BFpPepJn.cjs} +1 -1
- package/dist/{extra-BmZTXAp0.cjs.map → extra-BFpPepJn.cjs.map} +1 -1
- package/dist/{extra-COYhsOyZ.js → extra-D3sZLtFY.js} +1 -1
- package/dist/{extra-COYhsOyZ.js.map → extra-D3sZLtFY.js.map} +1 -1
- package/dist/extra.cjs +1 -1
- package/dist/extra.js +1 -1
- package/dist/{float-DCXafWh6.js → float-BKd4pilD.js} +1 -1
- package/dist/{float-DCXafWh6.js.map → float-BKd4pilD.js.map} +1 -1
- package/dist/{float-CSRW-Rrd.cjs → float-CJ3SuEcG.cjs} +1 -1
- package/dist/{float-CSRW-Rrd.cjs.map → float-CJ3SuEcG.cjs.map} +1 -1
- package/dist/float.cjs +1 -1
- package/dist/float.js +1 -1
- package/dist/{icons-DPUeLS_Y.cjs → icons-1AkKNd7O.cjs} +1 -1
- package/dist/{icons-DPUeLS_Y.cjs.map → icons-1AkKNd7O.cjs.map} +1 -1
- package/dist/{icons-BbaI9Zf-.js → icons-DqIVrIIK.js} +1 -1
- package/dist/{icons-BbaI9Zf-.js.map → icons-DqIVrIIK.js.map} +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/{iframe-Ct50FYXq.cjs → iframe-CtDetaw3.cjs} +1 -1
- package/dist/{iframe-Ct50FYXq.cjs.map → iframe-CtDetaw3.cjs.map} +1 -1
- package/dist/{iframe-CEDOvkql.js → iframe-D4R1Rq7G.js} +1 -1
- package/dist/{iframe-CEDOvkql.js.map → iframe-D4R1Rq7G.js.map} +1 -1
- package/dist/iframe.cjs +1 -1
- package/dist/iframe.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +31 -31
- package/dist/{input-chip-CI4__N8w.js → input-chip-B4uw64rQ.js} +1 -1
- package/dist/{input-chip-CI4__N8w.js.map → input-chip-B4uw64rQ.js.map} +1 -1
- package/dist/{input-chip-BhjGVpc3.cjs → input-chip-DY9IEbQj.cjs} +1 -1
- package/dist/{input-chip-BhjGVpc3.cjs.map → input-chip-DY9IEbQj.cjs.map} +1 -1
- package/dist/json.cjs +1 -1
- package/dist/json.js +2 -2
- package/dist/kbd.cjs +1 -1
- package/dist/kbd.js +1 -1
- package/dist/{layout-D7xOqMkJ.cjs → layout-B1gXjlIO.cjs} +1 -1
- package/dist/{layout-D7xOqMkJ.cjs.map → layout-B1gXjlIO.cjs.map} +1 -1
- package/dist/{layout-uAQpJN31.js → layout-Dh0qW7XU.js} +2 -2
- package/dist/{layout-uAQpJN31.js.map → layout-Dh0qW7XU.js.map} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +2 -2
- package/dist/{lightbox-C0OEHns9.js → lightbox-BM_Bpk_l.js} +2 -2
- package/dist/{lightbox-C0OEHns9.js.map → lightbox-BM_Bpk_l.js.map} +1 -1
- package/dist/{lightbox-cXRnvHMN.cjs → lightbox-BUuGltX9.cjs} +1 -1
- package/dist/{lightbox-cXRnvHMN.cjs.map → lightbox-BUuGltX9.cjs.map} +1 -1
- package/dist/lightbox.cjs +1 -1
- package/dist/lightbox.js +1 -1
- package/dist/{list-CmJ5h35b.cjs → list-C1GMiAi_.cjs} +1 -1
- package/dist/{list-CmJ5h35b.cjs.map → list-C1GMiAi_.cjs.map} +1 -1
- package/dist/{list-d1mHar5p.js → list-DrF_av2K.js} +2 -2
- package/dist/{list-d1mHar5p.js.map → list-DrF_av2K.js.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/{litElement.mixin-CncaUoxz.js → litElement.mixin-D6ZHgGZv.js} +1 -1
- package/dist/{litElement.mixin-CncaUoxz.js.map → litElement.mixin-D6ZHgGZv.js.map} +1 -1
- package/dist/{litElement.mixin-Bj2q1yPw.cjs → litElement.mixin-De5SG5z7.cjs} +1 -1
- package/dist/{litElement.mixin-Bj2q1yPw.cjs.map → litElement.mixin-De5SG5z7.cjs.map} +1 -1
- package/dist/{mailbox-C4-E93be.js → mailbox-BjB502y9.js} +4 -4
- package/dist/{mailbox-C4-E93be.js.map → mailbox-BjB502y9.js.map} +1 -1
- package/dist/{mailbox-BmChskZc.cjs → mailbox-D0iXsqyx.cjs} +1 -1
- package/dist/{mailbox-BmChskZc.cjs.map → mailbox-D0iXsqyx.cjs.map} +1 -1
- package/dist/mailbox.cjs +1 -1
- package/dist/mailbox.js +1 -1
- package/dist/{map-DHyYLhvy.js → map-BZTxFRVH.js} +1 -1
- package/dist/{map-DHyYLhvy.js.map → map-BZTxFRVH.js.map} +1 -1
- package/dist/{map-DYEvlNl0.cjs → map-uRYJeifl.cjs} +1 -1
- package/dist/{map-DYEvlNl0.cjs.map → map-uRYJeifl.cjs.map} +1 -1
- package/dist/map.cjs +1 -1
- package/dist/map.js +1 -1
- package/dist/{menu-DFDBADp4.js → menu-BamT46lt.js} +1 -1
- package/dist/{menu-DFDBADp4.js.map → menu-BamT46lt.js.map} +1 -1
- package/dist/{menu-BlPTI6H9.cjs → menu-CXFa_bk4.cjs} +1 -1
- package/dist/{menu-BlPTI6H9.cjs.map → menu-CXFa_bk4.cjs.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/mixins.cjs +1 -1
- package/dist/mixins.js +2 -2
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/navigation-bar.cjs +1 -1
- package/dist/navigation-bar.js +1 -1
- package/dist/navigation-rail.cjs +1 -1
- package/dist/navigation-rail.js +1 -1
- package/dist/{notification-DGpv8g2H.js → notification-COgjQodt.js} +2 -2
- package/dist/{notification-DGpv8g2H.js.map → notification-COgjQodt.js.map} +1 -1
- package/dist/{notification-DKVWYhqs.cjs → notification-Xid-o7gi.cjs} +1 -1
- package/dist/{notification-DKVWYhqs.cjs.map → notification-Xid-o7gi.cjs.map} +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-LtSDy2xf.cjs → option-CNWUeHW3.cjs} +1 -1
- package/dist/{option-LtSDy2xf.cjs.map → option-CNWUeHW3.cjs.map} +1 -1
- package/dist/{option-BD2eh458.js → option-DdYe_l1A.js} +1 -1
- package/dist/{option-BD2eh458.js.map → option-DdYe_l1A.js.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/page.cjs +1 -1
- package/dist/page.js +2 -2
- package/dist/{progress-B5ChDPbB.cjs → progress-Bw-VD6wH.cjs} +1 -1
- package/dist/{progress-B5ChDPbB.cjs.map → progress-Bw-VD6wH.cjs.map} +1 -1
- package/dist/{progress-CE1Pk2hi.js → progress-OQvbUkDs.js} +1 -1
- package/dist/{progress-CE1Pk2hi.js.map → progress-OQvbUkDs.js.map} +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +1 -1
- package/dist/{provide-jn1Fj1vv.js → provide-C4L6R1lo.js} +1 -1
- package/dist/{provide-jn1Fj1vv.js.map → provide-C4L6R1lo.js.map} +1 -1
- package/dist/{provide-BZ9lq_Be.cjs → provide-Dsoh3FdP.cjs} +1 -1
- package/dist/{provide-BZ9lq_Be.cjs.map → provide-Dsoh3FdP.cjs.map} +1 -1
- package/dist/qr-scanner.cjs +1 -1
- package/dist/qr-scanner.js +1 -1
- package/dist/{radio-group-Cd9pZ2MR.cjs → radio-group-D5t8f2Ob.cjs} +1 -1
- package/dist/{radio-group-Cd9pZ2MR.cjs.map → radio-group-D5t8f2Ob.cjs.map} +1 -1
- package/dist/{radio-group-CyRHgIF3.js → radio-group-DI1JXW5r.js} +1 -1
- package/dist/{radio-group-CyRHgIF3.js.map → radio-group-DI1JXW5r.js.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/range.cjs +1 -1
- package/dist/range.js +1 -1
- package/dist/{scroll-C_iNOi7E.cjs → scroll-BG5qMncw.cjs} +1 -1
- package/dist/{scroll-C_iNOi7E.cjs.map → scroll-BG5qMncw.cjs.map} +1 -1
- package/dist/{scroll-DoliwpRu.js → scroll-Dym-6yPI.js} +1 -1
- package/dist/{scroll-DoliwpRu.js.map → scroll-Dym-6yPI.js.map} +1 -1
- package/dist/{select-CWWuZ2iJ.cjs → select-B1nN5Ac4.cjs} +1 -1
- package/dist/{select-CWWuZ2iJ.cjs.map → select-B1nN5Ac4.cjs.map} +1 -1
- package/dist/{select-_vHPXi30.js → select-C3L3imJM.js} +1 -1
- package/dist/{select-_vHPXi30.js.map → select-C3L3imJM.js.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/{sheet-i1KtxGIj.js → sheet-BS9WlMaj.js} +3 -3
- package/dist/{sheet-i1KtxGIj.js.map → sheet-BS9WlMaj.js.map} +1 -1
- package/dist/{sheet-r0oEYIdi.cjs → sheet-BZRMpyXt.cjs} +1 -1
- package/dist/{sheet-r0oEYIdi.cjs.map → sheet-BZRMpyXt.cjs.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +2 -2
- package/dist/{sheet.service-DUO5_kmI.js → sheet.service-DQWkiYEe.js} +1 -1
- package/dist/{sheet.service-DUO5_kmI.js.map → sheet.service-DQWkiYEe.js.map} +1 -1
- package/dist/{sheet.service-Cr13Oo6G.cjs → sheet.service-l9jTUaot.cjs} +1 -1
- package/dist/{sheet.service-Cr13Oo6G.cjs.map → sheet.service-l9jTUaot.cjs.map} +1 -1
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/skills/INDEX.md +1 -1
- package/dist/skills/SKILL.md +1 -1
- package/dist/skills/schmancy/INDEX.md +1 -1
- package/dist/skills/schmancy/SKILL.md +1 -1
- package/dist/skills/schmancy/surface.md +14 -0
- package/dist/skills/schmancy/theme.md +83 -5
- package/dist/skills/surface.md +14 -0
- package/dist/skills/theme.md +83 -5
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +1 -1
- package/dist/{splash-screen-CquyPP1C.cjs → splash-screen-DuFJ0gbD.cjs} +1 -1
- package/dist/{splash-screen-CquyPP1C.cjs.map → splash-screen-DuFJ0gbD.cjs.map} +1 -1
- package/dist/{splash-screen-CvucPkpD.js → splash-screen-M-v_jiLs.js} +1 -1
- package/dist/{splash-screen-CvucPkpD.js.map → splash-screen-M-v_jiLs.js.map} +1 -1
- package/dist/splash-screen.cjs +1 -1
- package/dist/splash-screen.js +1 -1
- package/dist/{src-Bemk2C2P.cjs → src-Ba-S6DFW.cjs} +1 -1
- package/dist/{src-Bemk2C2P.cjs.map → src-Ba-S6DFW.cjs.map} +1 -1
- package/dist/{src-f5a3W9Mj.js → src-CbR3znbw.js} +40 -40
- package/dist/{src-f5a3W9Mj.js.map → src-CbR3znbw.js.map} +1 -1
- package/dist/steps.cjs +1 -1
- package/dist/steps.js +3 -3
- package/dist/{surface-CDufon40.cjs → surface-PECoCLgx.cjs} +1 -1
- package/dist/{surface-CDufon40.cjs.map → surface-PECoCLgx.cjs.map} +1 -1
- package/dist/{surface-CkEYJCae.js → surface-kM2aYH4g.js} +2 -2
- package/dist/{surface-CkEYJCae.js.map → surface-kM2aYH4g.js.map} +1 -1
- package/dist/surface.cjs +1 -1
- package/dist/surface.js +1 -1
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +1 -1
- package/dist/{table-DWc1mkpj.cjs → table-CENjXiu-.cjs} +1 -1
- package/dist/{table-DWc1mkpj.cjs.map → table-CENjXiu-.cjs.map} +1 -1
- package/dist/{table-P6VGG7NK.js → table-DrMgc8Aw.js} +1 -1
- package/dist/{table-P6VGG7NK.js.map → table-DrMgc8Aw.js.map} +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/{tabs-CjGjGrqY.js → tabs-BvFiM0y-.js} +2 -2
- package/dist/{tabs-CjGjGrqY.js.map → tabs-BvFiM0y-.js.map} +1 -1
- package/dist/{tabs-DGJEKuhC.cjs → tabs-CRA9FMNl.cjs} +1 -1
- package/dist/{tabs-DGJEKuhC.cjs.map → tabs-CRA9FMNl.cjs.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tailwind.mixin-Bug3G6K6.cjs +2 -0
- package/dist/{tailwind.mixin-Cpa-VnnX.cjs.map → tailwind.mixin-Bug3G6K6.cjs.map} +1 -1
- package/dist/tailwind.mixin-ywtUNG2c.js +219 -0
- package/dist/{tailwind.mixin-DufHBjmb.js.map → tailwind.mixin-ywtUNG2c.js.map} +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-jmTOXrzl.cjs → textarea-CfwGEIvf.cjs} +1 -1
- package/dist/{textarea-jmTOXrzl.cjs.map → textarea-CfwGEIvf.cjs.map} +1 -1
- package/dist/{textarea-DZT_Ofp5.js → textarea-DD5gxIsG.js} +1 -1
- package/dist/{textarea-DZT_Ofp5.js.map → textarea-DD5gxIsG.js.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-CCKqaksQ.cjs → theme-BiM_CUpn.cjs} +1 -1
- package/dist/{theme-CCKqaksQ.cjs.map → theme-BiM_CUpn.cjs.map} +1 -1
- package/dist/{theme-CEc32pAv.js → theme-DNJmVFXF.js} +3 -3
- package/dist/{theme-CEc32pAv.js.map → theme-DNJmVFXF.js.map} +1 -1
- package/dist/{theme-button-dOiAvdKU.js → theme-button-19T3SFrv.js} +1 -1
- package/dist/{theme-button-dOiAvdKU.js.map → theme-button-19T3SFrv.js.map} +1 -1
- package/dist/{theme-button-BsJcv-Zv.cjs → theme-button-BwJs6N4k.cjs} +1 -1
- package/dist/{theme-button-BsJcv-Zv.cjs.map → theme-button-BwJs6N4k.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.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/{typewriter-ByIL2Mh-.cjs → typewriter-BH7nsW7R.cjs} +1 -1
- package/dist/{typewriter-ByIL2Mh-.cjs.map → typewriter-BH7nsW7R.cjs.map} +1 -1
- package/dist/{typewriter-vOQ3bDLb.js → typewriter-Z-8bbwOh.js} +3 -3
- package/dist/{typewriter-vOQ3bDLb.js.map → typewriter-Z-8bbwOh.js.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/dist/visually-hidden.cjs +1 -1
- package/dist/visually-hidden.js +1 -1
- package/dist/{window-WnAihpsA.js → window-Du_ougyw.js} +1 -1
- package/dist/{window-WnAihpsA.js.map → window-Du_ougyw.js.map} +1 -1
- package/dist/{window-BS7ZQjgH.cjs → window-NDXXyj5v.cjs} +1 -1
- package/dist/{window-BS7ZQjgH.cjs.map → window-NDXXyj5v.cjs.map} +1 -1
- package/dist/window.cjs +1 -1
- package/dist/window.js +1 -1
- package/package.json +1 -1
- package/skills/schmancy/INDEX.md +1 -1
- package/skills/schmancy/SKILL.md +1 -1
- package/skills/schmancy/surface.md +14 -0
- package/skills/schmancy/theme.md +83 -5
- package/dist/tailwind.mixin-Cpa-VnnX.cjs +0 -2
- package/dist/tailwind.mixin-DufHBjmb.js +0 -219
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-highlight-C9lKek2p.cjs","names":[],"sources":["../src/code-highlight/code-highlight.ts","../src/code-highlight/code-preview.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport hljs from 'highlight.js/lib/core'\nimport bash from 'highlight.js/lib/languages/bash'\nimport javascript from 'highlight.js/lib/languages/javascript'\nimport markdown from 'highlight.js/lib/languages/markdown'\nimport typescript from 'highlight.js/lib/languages/typescript'\nimport xml from 'highlight.js/lib/languages/xml'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'\n\n// Register only the languages we need\nhljs.registerLanguage('javascript', javascript)\nhljs.registerLanguage('typescript', typescript)\nhljs.registerLanguage('html', xml)\nhljs.registerLanguage('xml', xml)\nhljs.registerLanguage('markdown', markdown)\nhljs.registerLanguage('bash', bash)\n\n/**\n * @element schmancy-code\n * Code highlighting component using highlight.js with schmancy theming support\n */\n@customElement('schmancy-code')\nexport class SchmancyCode extends TailwindElement(css`\n\t:host {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\toverflow: hidden;\n\t}\n\n\t/* Code block styling using schmancy color system */\n\t.hljs {\n\t\tdisplay: block;\n\t\toverflow-x: auto;\n\t\tpadding: 0.5em;\n\t\tcolor: var(--md-sys-color-on-surface-variant);\n\t\tbackground: var(--md-sys-color-surface-container-lowest);\n\t\tfont-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;\n\t}\n\n\t/* Comments and documentation */\n\t.hljs-comment,\n\t.hljs-quote {\n\t\tcolor: var(--md-sys-color-outline);\n\t\tfont-style: italic;\n\t}\n\n\t/* Keywords, doctags, formulas */\n\t.hljs-doctag,\n\t.hljs-keyword,\n\t.hljs-formula {\n\t\tcolor: var(--md-sys-color-primary);\n\t}\n\n\t/* Tags, sections, names, deletions */\n\t.hljs-section,\n\t.hljs-name,\n\t.hljs-selector-tag,\n\t.hljs-deletion,\n\t.hljs-subst {\n\t\tcolor: var(--md-sys-color-error);\n\t}\n\n\t/* Literals */\n\t.hljs-literal {\n\t\tcolor: var(--md-sys-color-tertiary);\n\t}\n\n\t/* Strings, regex, additions */\n\t.hljs-string,\n\t.hljs-regexp,\n\t.hljs-addition,\n\t.hljs-attribute,\n\t.hljs-meta-string {\n\t\tcolor: var(--md-sys-color-secondary);\n\t}\n\n\t/* Built-ins and class titles */\n\t.hljs-built_in,\n\t.hljs-class .hljs-title {\n\t\tcolor: var(--md-sys-color-tertiary);\n\t}\n\n\t/* Variables, attributes, types */\n\t.hljs-attr,\n\t.hljs-variable,\n\t.hljs-template-variable,\n\t.hljs-type,\n\t.hljs-selector-class,\n\t.hljs-selector-attr,\n\t.hljs-selector-pseudo,\n\t.hljs-number {\n\t\tcolor: var(--md-sys-color-on-surface);\n\t}\n\n\t/* Symbols, bullets, links, meta */\n\t.hljs-symbol,\n\t.hljs-bullet,\n\t.hljs-link,\n\t.hljs-meta,\n\t.hljs-selector-id,\n\t.hljs-title {\n\t\tcolor: var(--md-sys-color-secondary);\n\t}\n\n\t.hljs-emphasis {\n\t\tfont-style: italic;\n\t}\n\n\t.hljs-strong {\n\t\tfont-weight: bold;\n\t}\n\n\t.hljs-link {\n\t\ttext-decoration: underline;\n\t}\n\n\t/* Line features styling */\n\t.code-with-lines {\n\t\tbackground: transparent;\n\t\tpadding: 0;\n\t}\n\n\t.code-line {\n\t\tdisplay: block;\n\t\tpadding-left: 0;\n\t\ttransition: background-color 0.2s ease;\n\t}\n\n\t.code-line.highlighted {\n\t\tbackground-color: var(--md-sys-color-primary-container);\n\t\topacity: 0.2;\n\t}\n\n\t.line-number {\n\t\tdisplay: inline-block;\n\t\twidth: 3rem;\n\t\tpadding-right: 1rem;\n\t\ttext-align: right;\n\t\tcolor: var(--md-sys-color-outline);\n\t\tuser-select: none;\n\t\tfont-size: inherit;\n\t}\n`) {\n\t/**\n\t * Programming language for syntax highlighting\n\t */\n\t@property({ type: String })\n\tlanguage: string = 'javascript'\n\n\t/**\n\t * Code content to highlight\n\t */\n\t@property({ type: String })\n\tcode: string = ''\n\n\t/**\n\t * Optional filename or title to display in header\n\t */\n\t@property({ type: String })\n\tfilename?: string\n\n\t/**\n\t * Show line numbers\n\t */\n\t@property({ type: Boolean })\n\tlineNumbers: boolean = false\n\n\t/**\n\t * Show copy button\n\t */\n\t@property({ type: Boolean })\n\tcopyButton: boolean = true\n\n\t/**\n\t * Highlighted line numbers (comma-separated or ranges like \"1-3,5,7-9\")\n\t */\n\t@property({ type: String })\n\thighlightLines?: string\n\n\t/**\n\t * Maximum height before scrolling\n\t */\n\t@property({ type: String })\n\tmaxHeight?: string\n\n\t@state()\n\tprivate copied: boolean = false\n\n\tprivate get highlightedCode(): string {\n\t\tif (!this.code) return ''\n\n\t\tlet highlightedHtml = ''\n\n\t\ttry {\n\t\t\t// Use highlight.js to get highlighted code\n\t\t\tconst result = hljs.highlight(this.code.trim(), { language: this.language })\n\t\t\thighlightedHtml = result.value\n\t\t} catch {\n\t\t\t// Fallback to auto-detection if language is not supported\n\t\t\ttry {\n\t\t\t\tconst result = hljs.highlightAuto(this.code.trim())\n\t\t\t\thighlightedHtml = result.value\n\t\t\t} catch {\n\t\t\t\t// Final fallback to escaped plain text\n\t\t\t\thighlightedHtml = this.escapeHtml(this.code.trim())\n\t\t\t}\n\t\t}\n\n\t\t// Process for line numbers and highlighting if needed\n\t\tif (this.lineNumbers || this.highlightLines) {\n\t\t\treturn this.addLineFeatures(highlightedHtml)\n\t\t}\n\n\t\treturn highlightedHtml\n\t}\n\n\tprivate escapeHtml(text: string): string {\n\t\tconst div = document.createElement('div')\n\t\tdiv.textContent = text\n\t\treturn div.innerHTML\n\t}\n\n\tprivate getHighlightedLines(): Set<number> {\n\t\tconst lines = new Set<number>()\n\t\tif (!this.highlightLines) return lines\n\n\t\tconst parts = this.highlightLines.split(',')\n\t\tfor (const part of parts) {\n\t\t\tconst trimmed = part.trim()\n\t\t\tif (trimmed.includes('-')) {\n\t\t\t\tconst [start, end] = trimmed.split('-').map(n => parseInt(n.trim()))\n\t\t\t\tif (!isNaN(start) && !isNaN(end)) {\n\t\t\t\t\tfor (let i = start; i <= end; i++) {\n\t\t\t\t\t\tlines.add(i)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst lineNum = parseInt(trimmed)\n\t\t\t\tif (!isNaN(lineNum)) {\n\t\t\t\t\tlines.add(lineNum)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn lines\n\t}\n\n\tprivate addLineFeatures(highlightedHtml: string): string {\n\t\tconst lines = highlightedHtml.split('\\n')\n\t\tconst highlightedLines = this.getHighlightedLines()\n\n\t\treturn lines\n\t\t\t.map((line, index) => {\n\t\t\t\tconst lineNumber = index + 1\n\t\t\t\tconst isHighlighted = highlightedLines.has(lineNumber)\n\t\t\t\tconst lineClass = isHighlighted ? 'code-line highlighted' : 'code-line'\n\n\t\t\t\tlet content = ''\n\t\t\t\tif (this.lineNumbers) {\n\t\t\t\t\tcontent += `<span class=\"line-number\">${lineNumber}</span>`\n\t\t\t\t}\n\t\t\t\tcontent += line\n\n\t\t\t\treturn `<div class=\"${lineClass}\">${content}</div>`\n\t\t\t})\n\t\t\t.join('')\n\t}\n\n\tprivate async copyCode() {\n\t\ttry {\n\t\t\tawait navigator.clipboard.writeText(this.code)\n\t\t\tthis.copied = true\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.copied = false\n\t\t\t}, 2000)\n\t\t} catch (err) {\n\t\t\tconsole.error('Failed to copy code:', err)\n\t\t}\n\t}\n\n\tprivate getLanguageLabel(): string {\n\t\tconst languageMap: Record<string, string> = {\n\t\t\tjavascript: 'JavaScript',\n\t\t\ttypescript: 'TypeScript',\n\t\t\thtml: 'HTML',\n\t\t\tmarkdown: 'Markdown',\n\t\t\tbash: 'Bash',\n\t\t}\n\n\t\tif (this.filename) {\n\t\t\treturn this.filename\n\t\t}\n\n\t\treturn languageMap[this.language.toLowerCase()] || this.language.toUpperCase()\n\t}\n\n\trender() {\n\t\tconst codeClass = this.lineNumbers || this.highlightLines ? 'code-with-lines' : 'hljs'\n\n\t\treturn html`\n\t\t\t<schmancy-details class=\"bg-surface-default\">\n\t\t\t\t<section slot=\"summary\">\n\t\t\t\t\t<!-- Header -->\n\t\t\t\t\t<div class=\"flex items-center justify-between\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t<div class=\"flex gap-1.5\">\n\t\t\t\t\t\t\t\t<div class=\"w-3 h-3 rounded-full opacity-60\" style=\"background-color: var(--md-sys-color-error);\"></div>\n\t\t\t\t\t\t\t\t<div class=\"w-3 h-3 rounded-full opacity-60\" style=\"background-color: var(--md-sys-color-tertiary);\"></div>\n\t\t\t\t\t\t\t\t<div class=\"w-3 h-3 rounded-full opacity-60\" style=\"background-color: var(--md-sys-color-secondary);\"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<span class=\"text-xs font-medium opacity-70 ml-2\" style=\"color: var(--md-sys-color-on-surface-variant);\">\n\t\t\t\t\t\t\t\t${this.getLanguageLabel()}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t${this.copyButton\n\t\t\t\t\t\t\t? html`\n\t\t\t\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t\t\t\t.variant=\"${this.copied ? 'filled tonal' : 'text'}\"\n\t\t\t\t\t\t\t\t\t\t@click=${this.copyCode}\n\t\t\t\t\t\t\t\t\t\tclass=\"transition-all\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<schmancy-icon > ${this.copied ? 'check' : 'content_copy'} </schmancy-icon>\n\t\t\t\t\t\t\t\t\t\t<span class=\"ml-1\">${this.copied ? 'Copied!' : 'Copy'}</span>\n\t\t\t\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t: ''}\n\t\t\t\t\t</div>\n\t\t\t\t</section>\n\t\t\t\t<!-- Code -->\n\t\t\t\t<div class=\"overflow-auto\" style=\"${this.maxHeight ? `max-height: ${this.maxHeight}` : ''}\">\n\t\t\t\t\t<pre class=\"m-0\"><code class=\"${codeClass}\">${unsafeHTML(this.highlightedCode)}</code></pre>\n\t\t\t\t</div>\n\t\t\t</schmancy-details>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-code': SchmancyCode\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { timer } from 'rxjs'\nimport { take } from 'rxjs/operators'\n\n/**\n * @element schmancy-code-preview\n * A component that shows code and its rendered preview side by side\n * Takes the content as a slot and displays both the source and rendered result\n */\n@customElement('schmancy-code-preview')\nexport class SchmancyCodePreview extends TailwindElement(\n\tcss`:host{\n\t\tdisplay:block;\n\t\toverflow:hidden;\n\t\tposition:relative;\n\t\tinset:0;\n\t}`\n) {\n\t/**\n\t * Programming language for syntax highlighting\n\t */\n\t@property({ type: String })\n\tlanguage: string = 'html'\n\n\t/**\n\t * Show code on top or side-by-side\n\t */\n\t@property({ type: String })\n\tlayout: 'vertical' | 'horizontal' = 'vertical'\n\n\t/**\n\t * Whether to render/execute the code in preview section\n\t * When false, only shows the code without rendering\n\t */\n\t@property({ type: Boolean })\n\tpreview: boolean = true\n\n\t@state()\n\tprivate slotContent: string = ''\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\t// Capture the slot content as HTML string\n\t\ttimer(0).pipe(take(1)).subscribe(() => {\n\t\t\tconst slot = this.shadowRoot?.querySelector('slot')\n\t\t\tif (slot) {\n\t\t\t\tconst nodes = slot.assignedNodes({ flatten: true })\n\t\t\t\tconst htmlStrings = nodes.map(node => {\n\t\t\t\t\tif (node.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\t\t\treturn (node as HTMLElement).outerHTML\n\t\t\t\t\t} else if (node.nodeType === Node.TEXT_NODE) {\n\t\t\t\t\t\treturn node.textContent || ''\n\t\t\t\t\t}\n\t\t\t\t\treturn ''\n\t\t\t\t})\n\t\t\t\t\n\t\t\t\t// Clean up the HTML string\n\t\t\t\tconst rawContent = htmlStrings.join('')\n\t\t\t\t\n\t\t\t\t// Find the minimum indentation (excluding empty lines)\n\t\t\t\tconst lines = rawContent.split('\\n')\n\t\t\t\tconst minIndent = lines\n\t\t\t\t\t.filter(line => line.trim().length > 0)\n\t\t\t\t\t.reduce((min, line) => {\n\t\t\t\t\t\tconst indent = line.match(/^(\\s*)/)?.[1].length || 0\n\t\t\t\t\t\treturn Math.min(min, indent)\n\t\t\t\t\t}, Infinity)\n\t\t\t\t\n\t\t\t\t// Remove the minimum indentation from all lines\n\t\t\t\tthis.slotContent = lines\n\t\t\t\t\t.map(line => line.slice(minIndent))\n\t\t\t\t\t.join('\\n')\n\t\t\t\t\t.trim()\n\t\t\t}\n\t\t})\n\t}\n\n\trender() {\n\t\tconst containerClass = this.layout === 'horizontal' \n\t\t\t? 'grid grid-cols-1 lg:grid-cols-2 gap-0' \n\t\t\t: 'flex flex-col'\n\n\t\tconst showPreview = this.preview && this.language.toLowerCase() === 'html'\n\t\t\n\t\treturn html`\n\t\t\t<schmancy-surface class=\"rounded-lg overflow-hidden\">\n\t\t\t\t<div class=\"${showPreview ? containerClass : ''}\">\n\t\t\t\t\t<!-- Code section with proper overflow handling -->\n\t\t\t\t\t<div class=\"min-w-0 overflow-hidden\">\n\t\t\t\t\t\t<schmancy-code\n\t\t\t\t\t\t\tlanguage=\"${this.language}\"\n\t\t\t\t\t\t\t.code=\"${this.slotContent}\"\n\t\t\t\t\t\t\t?copyButton=\"${true}\"\n\t\t\t\t\t\t\tclass=\"block w-full\"\n\t\t\t\t\t\t></schmancy-code>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<!-- Preview section (only visible for HTML and when preview is enabled) -->\n\t\t\t\t\t${showPreview ? html`\n\t\t\t\t\t\t<div class=\"min-w-0 overflow-auto\">\n\t\t\t\t\t\t\t<schmancy-surface type=\"solid\" class=\"p-2 h-full\">\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t</schmancy-surface>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t` : html`\n\t\t\t\t\t\t<!-- Hidden slot to capture content -->\n\t\t\t\t\t\t<div class=\"hidden\">\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`}\n\t\t\t\t</div>\n\t\t\t</schmancy-surface>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-code-preview': SchmancyCodePreview\n\t}\n}"],"mappings":"0oBAYA,EAAA,QAAK,iBAAiB,aAAc,EAAA,QAAA,CACpC,EAAA,QAAK,iBAAiB,aAAc,EAAA,QAAA,CACpC,EAAA,QAAK,iBAAiB,OAAQ,EAAA,QAAA,CAC9B,EAAA,QAAK,iBAAiB,MAAO,EAAA,QAAA,CAC7B,EAAA,QAAK,iBAAiB,WAAY,EAAA,QAAA,CAClC,EAAA,QAAK,iBAAiB,OAAQ,EAAA,QAAA,CAOvB,IAAA,EAAA,cAA2B,EAAA,EAAgB,EAAA,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA6HjC,aAAA,KAAA,KAMJ,GAAA,KAAA,YAAA,CAYQ,EAAA,KAAA,WAAA,CAMD,EAAA,KAAA,OAAA,CAeI,EAE1B,IAAA,iBAAY,CACX,GAAA,CAAK,KAAK,KAAM,MAAO,GAEvB,IAAI,EAAkB,GAEtB,GAAA,CAGC,EADe,EAAA,QAAK,UAAU,KAAK,KAAK,MAAA,CAAQ,CAAE,SAAU,KAAK,SAAA,CAAA,CACxC,WAAA,CAGzB,GAAA,CAEC,EADe,EAAA,QAAK,cAAc,KAAK,KAAK,MAAA,CAAA,CACnB,WAAA,CAGzB,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;;;;;;;;0BAnFF,CAAE,KAAM,OAAA,CAAA,CAAA,CAAS,EAAA,UAAA,WAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAMjB,CAAE,KAAM,OAAA,CAAA,CAAA,CAAS,EAAA,UAAA,SAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAOjB,CAAE,KAAM,QAAA,CAAA,CAAA,CAAU,EAAA,UAAA,UAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,QAAA,CAAA,CAGpB,EAAA,UAAA,cAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eA5BM,wBAAA,CAAA,CAAwB,EAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"code-highlight-DGInmDAW.cjs","names":[],"sources":["../src/code-highlight/code-highlight.ts","../src/code-highlight/code-preview.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport hljs from 'highlight.js/lib/core'\nimport bash from 'highlight.js/lib/languages/bash'\nimport javascript from 'highlight.js/lib/languages/javascript'\nimport markdown from 'highlight.js/lib/languages/markdown'\nimport typescript from 'highlight.js/lib/languages/typescript'\nimport xml from 'highlight.js/lib/languages/xml'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'\n\n// Register only the languages we need\nhljs.registerLanguage('javascript', javascript)\nhljs.registerLanguage('typescript', typescript)\nhljs.registerLanguage('html', xml)\nhljs.registerLanguage('xml', xml)\nhljs.registerLanguage('markdown', markdown)\nhljs.registerLanguage('bash', bash)\n\n/**\n * @element schmancy-code\n * Code highlighting component using highlight.js with schmancy theming support\n */\n@customElement('schmancy-code')\nexport class SchmancyCode extends TailwindElement(css`\n\t:host {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\toverflow: hidden;\n\t}\n\n\t/* Code block styling using schmancy color system */\n\t.hljs {\n\t\tdisplay: block;\n\t\toverflow-x: auto;\n\t\tpadding: 0.5em;\n\t\tcolor: var(--md-sys-color-on-surface-variant);\n\t\tbackground: var(--md-sys-color-surface-container-lowest);\n\t\tfont-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;\n\t}\n\n\t/* Comments and documentation */\n\t.hljs-comment,\n\t.hljs-quote {\n\t\tcolor: var(--md-sys-color-outline);\n\t\tfont-style: italic;\n\t}\n\n\t/* Keywords, doctags, formulas */\n\t.hljs-doctag,\n\t.hljs-keyword,\n\t.hljs-formula {\n\t\tcolor: var(--md-sys-color-primary);\n\t}\n\n\t/* Tags, sections, names, deletions */\n\t.hljs-section,\n\t.hljs-name,\n\t.hljs-selector-tag,\n\t.hljs-deletion,\n\t.hljs-subst {\n\t\tcolor: var(--md-sys-color-error);\n\t}\n\n\t/* Literals */\n\t.hljs-literal {\n\t\tcolor: var(--md-sys-color-tertiary);\n\t}\n\n\t/* Strings, regex, additions */\n\t.hljs-string,\n\t.hljs-regexp,\n\t.hljs-addition,\n\t.hljs-attribute,\n\t.hljs-meta-string {\n\t\tcolor: var(--md-sys-color-secondary);\n\t}\n\n\t/* Built-ins and class titles */\n\t.hljs-built_in,\n\t.hljs-class .hljs-title {\n\t\tcolor: var(--md-sys-color-tertiary);\n\t}\n\n\t/* Variables, attributes, types */\n\t.hljs-attr,\n\t.hljs-variable,\n\t.hljs-template-variable,\n\t.hljs-type,\n\t.hljs-selector-class,\n\t.hljs-selector-attr,\n\t.hljs-selector-pseudo,\n\t.hljs-number {\n\t\tcolor: var(--md-sys-color-on-surface);\n\t}\n\n\t/* Symbols, bullets, links, meta */\n\t.hljs-symbol,\n\t.hljs-bullet,\n\t.hljs-link,\n\t.hljs-meta,\n\t.hljs-selector-id,\n\t.hljs-title {\n\t\tcolor: var(--md-sys-color-secondary);\n\t}\n\n\t.hljs-emphasis {\n\t\tfont-style: italic;\n\t}\n\n\t.hljs-strong {\n\t\tfont-weight: bold;\n\t}\n\n\t.hljs-link {\n\t\ttext-decoration: underline;\n\t}\n\n\t/* Line features styling */\n\t.code-with-lines {\n\t\tbackground: transparent;\n\t\tpadding: 0;\n\t}\n\n\t.code-line {\n\t\tdisplay: block;\n\t\tpadding-left: 0;\n\t\ttransition: background-color 0.2s ease;\n\t}\n\n\t.code-line.highlighted {\n\t\tbackground-color: var(--md-sys-color-primary-container);\n\t\topacity: 0.2;\n\t}\n\n\t.line-number {\n\t\tdisplay: inline-block;\n\t\twidth: 3rem;\n\t\tpadding-right: 1rem;\n\t\ttext-align: right;\n\t\tcolor: var(--md-sys-color-outline);\n\t\tuser-select: none;\n\t\tfont-size: inherit;\n\t}\n`) {\n\t/**\n\t * Programming language for syntax highlighting\n\t */\n\t@property({ type: String })\n\tlanguage: string = 'javascript'\n\n\t/**\n\t * Code content to highlight\n\t */\n\t@property({ type: String })\n\tcode: string = ''\n\n\t/**\n\t * Optional filename or title to display in header\n\t */\n\t@property({ type: String })\n\tfilename?: string\n\n\t/**\n\t * Show line numbers\n\t */\n\t@property({ type: Boolean })\n\tlineNumbers: boolean = false\n\n\t/**\n\t * Show copy button\n\t */\n\t@property({ type: Boolean })\n\tcopyButton: boolean = true\n\n\t/**\n\t * Highlighted line numbers (comma-separated or ranges like \"1-3,5,7-9\")\n\t */\n\t@property({ type: String })\n\thighlightLines?: string\n\n\t/**\n\t * Maximum height before scrolling\n\t */\n\t@property({ type: String })\n\tmaxHeight?: string\n\n\t@state()\n\tprivate copied: boolean = false\n\n\tprivate get highlightedCode(): string {\n\t\tif (!this.code) return ''\n\n\t\tlet highlightedHtml = ''\n\n\t\ttry {\n\t\t\t// Use highlight.js to get highlighted code\n\t\t\tconst result = hljs.highlight(this.code.trim(), { language: this.language })\n\t\t\thighlightedHtml = result.value\n\t\t} catch {\n\t\t\t// Fallback to auto-detection if language is not supported\n\t\t\ttry {\n\t\t\t\tconst result = hljs.highlightAuto(this.code.trim())\n\t\t\t\thighlightedHtml = result.value\n\t\t\t} catch {\n\t\t\t\t// Final fallback to escaped plain text\n\t\t\t\thighlightedHtml = this.escapeHtml(this.code.trim())\n\t\t\t}\n\t\t}\n\n\t\t// Process for line numbers and highlighting if needed\n\t\tif (this.lineNumbers || this.highlightLines) {\n\t\t\treturn this.addLineFeatures(highlightedHtml)\n\t\t}\n\n\t\treturn highlightedHtml\n\t}\n\n\tprivate escapeHtml(text: string): string {\n\t\tconst div = document.createElement('div')\n\t\tdiv.textContent = text\n\t\treturn div.innerHTML\n\t}\n\n\tprivate getHighlightedLines(): Set<number> {\n\t\tconst lines = new Set<number>()\n\t\tif (!this.highlightLines) return lines\n\n\t\tconst parts = this.highlightLines.split(',')\n\t\tfor (const part of parts) {\n\t\t\tconst trimmed = part.trim()\n\t\t\tif (trimmed.includes('-')) {\n\t\t\t\tconst [start, end] = trimmed.split('-').map(n => parseInt(n.trim()))\n\t\t\t\tif (!isNaN(start) && !isNaN(end)) {\n\t\t\t\t\tfor (let i = start; i <= end; i++) {\n\t\t\t\t\t\tlines.add(i)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst lineNum = parseInt(trimmed)\n\t\t\t\tif (!isNaN(lineNum)) {\n\t\t\t\t\tlines.add(lineNum)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn lines\n\t}\n\n\tprivate addLineFeatures(highlightedHtml: string): string {\n\t\tconst lines = highlightedHtml.split('\\n')\n\t\tconst highlightedLines = this.getHighlightedLines()\n\n\t\treturn lines\n\t\t\t.map((line, index) => {\n\t\t\t\tconst lineNumber = index + 1\n\t\t\t\tconst isHighlighted = highlightedLines.has(lineNumber)\n\t\t\t\tconst lineClass = isHighlighted ? 'code-line highlighted' : 'code-line'\n\n\t\t\t\tlet content = ''\n\t\t\t\tif (this.lineNumbers) {\n\t\t\t\t\tcontent += `<span class=\"line-number\">${lineNumber}</span>`\n\t\t\t\t}\n\t\t\t\tcontent += line\n\n\t\t\t\treturn `<div class=\"${lineClass}\">${content}</div>`\n\t\t\t})\n\t\t\t.join('')\n\t}\n\n\tprivate async copyCode() {\n\t\ttry {\n\t\t\tawait navigator.clipboard.writeText(this.code)\n\t\t\tthis.copied = true\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.copied = false\n\t\t\t}, 2000)\n\t\t} catch (err) {\n\t\t\tconsole.error('Failed to copy code:', err)\n\t\t}\n\t}\n\n\tprivate getLanguageLabel(): string {\n\t\tconst languageMap: Record<string, string> = {\n\t\t\tjavascript: 'JavaScript',\n\t\t\ttypescript: 'TypeScript',\n\t\t\thtml: 'HTML',\n\t\t\tmarkdown: 'Markdown',\n\t\t\tbash: 'Bash',\n\t\t}\n\n\t\tif (this.filename) {\n\t\t\treturn this.filename\n\t\t}\n\n\t\treturn languageMap[this.language.toLowerCase()] || this.language.toUpperCase()\n\t}\n\n\trender() {\n\t\tconst codeClass = this.lineNumbers || this.highlightLines ? 'code-with-lines' : 'hljs'\n\n\t\treturn html`\n\t\t\t<schmancy-details class=\"bg-surface-default\">\n\t\t\t\t<section slot=\"summary\">\n\t\t\t\t\t<!-- Header -->\n\t\t\t\t\t<div class=\"flex items-center justify-between\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t<div class=\"flex gap-1.5\">\n\t\t\t\t\t\t\t\t<div class=\"w-3 h-3 rounded-full opacity-60\" style=\"background-color: var(--md-sys-color-error);\"></div>\n\t\t\t\t\t\t\t\t<div class=\"w-3 h-3 rounded-full opacity-60\" style=\"background-color: var(--md-sys-color-tertiary);\"></div>\n\t\t\t\t\t\t\t\t<div class=\"w-3 h-3 rounded-full opacity-60\" style=\"background-color: var(--md-sys-color-secondary);\"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<span class=\"text-xs font-medium opacity-70 ml-2\" style=\"color: var(--md-sys-color-on-surface-variant);\">\n\t\t\t\t\t\t\t\t${this.getLanguageLabel()}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t${this.copyButton\n\t\t\t\t\t\t\t? html`\n\t\t\t\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t\t\t\t.variant=\"${this.copied ? 'filled tonal' : 'text'}\"\n\t\t\t\t\t\t\t\t\t\t@click=${this.copyCode}\n\t\t\t\t\t\t\t\t\t\tclass=\"transition-all\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<schmancy-icon > ${this.copied ? 'check' : 'content_copy'} </schmancy-icon>\n\t\t\t\t\t\t\t\t\t\t<span class=\"ml-1\">${this.copied ? 'Copied!' : 'Copy'}</span>\n\t\t\t\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t\t\t\t`\n\t\t\t\t\t\t\t: ''}\n\t\t\t\t\t</div>\n\t\t\t\t</section>\n\t\t\t\t<!-- Code -->\n\t\t\t\t<div class=\"overflow-auto\" style=\"${this.maxHeight ? `max-height: ${this.maxHeight}` : ''}\">\n\t\t\t\t\t<pre class=\"m-0\"><code class=\"${codeClass}\">${unsafeHTML(this.highlightedCode)}</code></pre>\n\t\t\t\t</div>\n\t\t\t</schmancy-details>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-code': SchmancyCode\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { timer } from 'rxjs'\nimport { take } from 'rxjs/operators'\n\n/**\n * @element schmancy-code-preview\n * A component that shows code and its rendered preview side by side\n * Takes the content as a slot and displays both the source and rendered result\n */\n@customElement('schmancy-code-preview')\nexport class SchmancyCodePreview extends TailwindElement(\n\tcss`:host{\n\t\tdisplay:block;\n\t\toverflow:hidden;\n\t\tposition:relative;\n\t\tinset:0;\n\t}`\n) {\n\t/**\n\t * Programming language for syntax highlighting\n\t */\n\t@property({ type: String })\n\tlanguage: string = 'html'\n\n\t/**\n\t * Show code on top or side-by-side\n\t */\n\t@property({ type: String })\n\tlayout: 'vertical' | 'horizontal' = 'vertical'\n\n\t/**\n\t * Whether to render/execute the code in preview section\n\t * When false, only shows the code without rendering\n\t */\n\t@property({ type: Boolean })\n\tpreview: boolean = true\n\n\t@state()\n\tprivate slotContent: string = ''\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\t// Capture the slot content as HTML string\n\t\ttimer(0).pipe(take(1)).subscribe(() => {\n\t\t\tconst slot = this.shadowRoot?.querySelector('slot')\n\t\t\tif (slot) {\n\t\t\t\tconst nodes = slot.assignedNodes({ flatten: true })\n\t\t\t\tconst htmlStrings = nodes.map(node => {\n\t\t\t\t\tif (node.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\t\t\treturn (node as HTMLElement).outerHTML\n\t\t\t\t\t} else if (node.nodeType === Node.TEXT_NODE) {\n\t\t\t\t\t\treturn node.textContent || ''\n\t\t\t\t\t}\n\t\t\t\t\treturn ''\n\t\t\t\t})\n\t\t\t\t\n\t\t\t\t// Clean up the HTML string\n\t\t\t\tconst rawContent = htmlStrings.join('')\n\t\t\t\t\n\t\t\t\t// Find the minimum indentation (excluding empty lines)\n\t\t\t\tconst lines = rawContent.split('\\n')\n\t\t\t\tconst minIndent = lines\n\t\t\t\t\t.filter(line => line.trim().length > 0)\n\t\t\t\t\t.reduce((min, line) => {\n\t\t\t\t\t\tconst indent = line.match(/^(\\s*)/)?.[1].length || 0\n\t\t\t\t\t\treturn Math.min(min, indent)\n\t\t\t\t\t}, Infinity)\n\t\t\t\t\n\t\t\t\t// Remove the minimum indentation from all lines\n\t\t\t\tthis.slotContent = lines\n\t\t\t\t\t.map(line => line.slice(minIndent))\n\t\t\t\t\t.join('\\n')\n\t\t\t\t\t.trim()\n\t\t\t}\n\t\t})\n\t}\n\n\trender() {\n\t\tconst containerClass = this.layout === 'horizontal' \n\t\t\t? 'grid grid-cols-1 lg:grid-cols-2 gap-0' \n\t\t\t: 'flex flex-col'\n\n\t\tconst showPreview = this.preview && this.language.toLowerCase() === 'html'\n\t\t\n\t\treturn html`\n\t\t\t<schmancy-surface class=\"rounded-lg overflow-hidden\">\n\t\t\t\t<div class=\"${showPreview ? containerClass : ''}\">\n\t\t\t\t\t<!-- Code section with proper overflow handling -->\n\t\t\t\t\t<div class=\"min-w-0 overflow-hidden\">\n\t\t\t\t\t\t<schmancy-code\n\t\t\t\t\t\t\tlanguage=\"${this.language}\"\n\t\t\t\t\t\t\t.code=\"${this.slotContent}\"\n\t\t\t\t\t\t\t?copyButton=\"${true}\"\n\t\t\t\t\t\t\tclass=\"block w-full\"\n\t\t\t\t\t\t></schmancy-code>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<!-- Preview section (only visible for HTML and when preview is enabled) -->\n\t\t\t\t\t${showPreview ? html`\n\t\t\t\t\t\t<div class=\"min-w-0 overflow-auto\">\n\t\t\t\t\t\t\t<schmancy-surface type=\"solid\" class=\"p-2 h-full\">\n\t\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t</schmancy-surface>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t` : html`\n\t\t\t\t\t\t<!-- Hidden slot to capture content -->\n\t\t\t\t\t\t<div class=\"hidden\">\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`}\n\t\t\t\t</div>\n\t\t\t</schmancy-surface>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-code-preview': SchmancyCodePreview\n\t}\n}"],"mappings":"0oBAYA,EAAA,QAAK,iBAAiB,aAAc,EAAA,QAAA,CACpC,EAAA,QAAK,iBAAiB,aAAc,EAAA,QAAA,CACp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AA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}
|
package/dist/code-highlight.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./code-highlight-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./code-highlight-DGInmDAW.cjs`);Object.defineProperty(exports,`SchmancyCode`,{enumerable:!0,get:function(){return e.n}}),Object.defineProperty(exports,`SchmancyCodeHighlight`,{enumerable:!0,get:function(){return e.n}}),Object.defineProperty(exports,`SchmancyCodePreview`,{enumerable:!0,get:function(){return e.t}});
|
package/dist/code-highlight.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./code-highlight-
|
|
1
|
+
import { n as e, t } from "./code-highlight-ClzG4FL4.js";
|
|
2
2
|
export { e as SchmancyCode, e as SchmancyCodeHighlight, t as SchmancyCodePreview };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require(`./chunk-BCfY8kxB.cjs`);const e=require(`./decorate-F9CuyeHg.cjs`),t=require(`./litElement.mixin-Bj2q1yPw.cjs`);require(`./mixins.cjs`);let n=require(`lit/decorators.js`),r=require(`lit`);var i=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},a=function(e,t,n,r,i,o,s,c,l,u){var d=this;d.numeralDecimalMark=e||`.`,d.numeralIntegerScale=t>0?t:0,d.numeralDecimalScale=n>=0?n:2,d.numeralThousandsGroupStyle=r||a.groupStyle.thousand,d.numeralPositiveOnly=!!i,d.stripLeadingZeroes=!1!==o,d.prefix=s||s===``?s:``,d.signBeforePrefix=!!c,d.tailPrefix=!!l,d.delimiter=u||u===``?u:`,`,d.delimiterRE=u?RegExp(`\\`+u,`g`):``};a.groupStyle={thousand:`thousand`,lakh:`lakh`,wan:`wan`,none:`none`},a.prototype={getRawValue:function(e){return e.replace(this.delimiterRE,``).replace(this.numeralDecimalMark,`.`)},format:function(e){var t,n,r,i,o=this,s=``;switch(e=e.replace(/[A-Za-z]/g,``).replace(o.numeralDecimalMark,`M`).replace(/[^\dM-]/g,``).replace(/^\-/,`N`).replace(/\-/g,``).replace(`N`,o.numeralPositiveOnly?``:`-`).replace(`M`,o.numeralDecimalMark),o.stripLeadingZeroes&&(e=e.replace(/^(-)?0+(?=\d)/,`$1`)),n=e.slice(0,1)===`-`?`-`:``,r=o.prefix===void 0?n:o.signBeforePrefix?n+o.prefix:o.prefix+n,i=e,e.indexOf(o.numeralDecimalMark)>=0&&(i=(t=e.split(o.numeralDecimalMark))[0],s=o.numeralDecimalMark+t[1].slice(0,o.numeralDecimalScale)),n===`-`&&(i=i.slice(1)),o.numeralIntegerScale>0&&(i=i.slice(0,o.numeralIntegerScale)),o.numeralThousandsGroupStyle){case a.groupStyle.lakh:i=i.replace(/(\d)(?=(\d\d)+\d$)/g,`$1`+o.delimiter);break;case a.groupStyle.wan:i=i.replace(/(\d)(?=(\d{4})+$)/g,`$1`+o.delimiter);break;case a.groupStyle.thousand:i=i.replace(/(\d)(?=(\d{3})+$)/g,`$1`+o.delimiter)}return o.tailPrefix?n+i.toString()+(o.numeralDecimalScale>0?s.toString():``)+o.prefix:r+i.toString()+(o.numeralDecimalScale>0?s.toString():``)}};var o=a,s=function(e,t,n){var r=this;r.date=[],r.blocks=[],r.datePattern=e,r.dateMin=t.split(`-`).reverse().map(function(e){return parseInt(e,10)}),r.dateMin.length===2&&r.dateMin.unshift(0),r.dateMax=n.split(`-`).reverse().map(function(e){return parseInt(e,10)}),r.dateMax.length===2&&r.dateMax.unshift(0),r.initBlocks()};s.prototype={initBlocks:function(){var e=this;e.datePattern.forEach(function(t){t===`Y`?e.blocks.push(4):e.blocks.push(2)})},getISOFormatDate:function(){var e=this,t=e.date;return t[2]?t[2]+`-`+e.addLeadingZero(t[1])+`-`+e.addLeadingZero(t[0]):``},getBlocks:function(){return this.blocks},getValidatedDate:function(e){var t=this,n=``;return e=e.replace(/[^\d]/g,``),t.blocks.forEach(function(r,i){if(e.length>0){var a=e.slice(0,r),o=a.slice(0,1),s=e.slice(r);switch(t.datePattern[i]){case`d`:a===`00`?a=`01`:parseInt(o,10)>3?a=`0`+o:parseInt(a,10)>31&&(a=`31`);break;case`m`:a===`00`?a=`01`:parseInt(o,10)>1?a=`0`+o:parseInt(a,10)>12&&(a=`12`)}n+=a,e=s}}),this.getFixedDateString(n)},getFixedDateString:function(e){var t,n,r,i=this,a=i.datePattern,o=[],s=0,c=0,l=0,u=0,d=0,f=0,p=!1;return e.length===4&&a[0].toLowerCase()!==`y`&&a[1].toLowerCase()!==`y`&&(d=2-(u=a[0]===`d`?0:2),t=parseInt(e.slice(u,u+2),10),n=parseInt(e.slice(d,d+2),10),o=this.getFixedDate(t,n,0)),e.length===8&&(a.forEach(function(e,t){switch(e){case`d`:s=t;break;case`m`:c=t;break;default:l=t}}),f=2*l,u=s<=l?2*s:2*s+2,d=c<=l?2*c:2*c+2,t=parseInt(e.slice(u,u+2),10),n=parseInt(e.slice(d,d+2),10),r=parseInt(e.slice(f,f+4),10),p=e.slice(f,f+4).length===4,o=this.getFixedDate(t,n,r)),e.length!==4||a[0]!==`y`&&a[1]!==`y`||(f=2-(d=a[0]===`m`?0:2),n=parseInt(e.slice(d,d+2),10),r=parseInt(e.slice(f,f+2),10),p=e.slice(f,f+2).length===2,o=[0,n,r]),e.length!==6||a[0]!==`Y`&&a[1]!==`Y`||(f=2-.5*(d=a[0]===`m`?0:4),n=parseInt(e.slice(d,d+2),10),r=parseInt(e.slice(f,f+4),10),p=e.slice(f,f+4).length===4,o=[0,n,r]),o=i.getRangeFixedDate(o),i.date=o,o.length===0?e:a.reduce(function(e,t){switch(t){case`d`:return e+(o[0]===0?``:i.addLeadingZero(o[0]));case`m`:return e+(o[1]===0?``:i.addLeadingZero(o[1]));case`y`:return e+(p?i.addLeadingZeroForYear(o[2],!1):``);case`Y`:return e+(p?i.addLeadingZeroForYear(o[2],!0):``)}},``)},getRangeFixedDate:function(e){var t=this,n=t.datePattern,r=t.dateMin||[],i=t.dateMax||[];return!e.length||r.length<3&&i.length<3||n.find(function(e){return e.toLowerCase()===`y`})&&e[2]===0?e:i.length&&(i[2]<e[2]||i[2]===e[2]&&(i[1]<e[1]||i[1]===e[1]&&i[0]<e[0]))?i:r.length&&(r[2]>e[2]||r[2]===e[2]&&(r[1]>e[1]||r[1]===e[1]&&r[0]>e[0]))?r:e},getFixedDate:function(e,t,n){return e=Math.min(e,31),t=Math.min(t,12),n=parseInt(n||0,10),(t<7&&t%2==0||t>8&&t%2==1)&&(e=Math.min(e,t===2?this.isLeapYear(n)?29:28:30)),[e,t,n]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},addLeadingZero:function(e){return(e<10?`0`:``)+e},addLeadingZeroForYear:function(e,t){return t?(e<10?`000`:e<100?`00`:e<1e3?`0`:``)+e:(e<10?`0`:``)+e}};var c=s,l=function(e,t){var n=this;n.time=[],n.blocks=[],n.timePattern=e,n.timeFormat=t,n.initBlocks()};l.prototype={initBlocks:function(){var e=this;e.timePattern.forEach(function(){e.blocks.push(2)})},getISOFormatTime:function(){var e=this,t=e.time;return t[2]?e.addLeadingZero(t[0])+`:`+e.addLeadingZero(t[1])+`:`+e.addLeadingZero(t[2]):``},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){return String(this.timeFormat)===`12`?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(e){var t=this,n=``;e=e.replace(/[^\d]/g,``);var r=t.getTimeFormatOptions();return t.blocks.forEach(function(i,a){if(e.length>0){var o=e.slice(0,i),s=o.slice(0,1),c=e.slice(i);switch(t.timePattern[a]){case`h`:parseInt(s,10)>r.maxHourFirstDigit?o=`0`+s:parseInt(o,10)>r.maxHours&&(o=r.maxHours+``);break;case`m`:case`s`:parseInt(s,10)>r.maxMinutesFirstDigit?o=`0`+s:parseInt(o,10)>r.maxMinutes&&(o=r.maxMinutes+``)}n+=o,e=c}}),this.getFixedTimeString(n)},getFixedTimeString:function(e){var t,n,r,i=this,a=i.timePattern,o=[],s=0,c=0,l=0,u=0,d=0,f=0;return e.length===6&&(a.forEach(function(e,t){switch(e){case`s`:s=2*t;break;case`m`:c=2*t;break;case`h`:l=2*t}}),f=l,d=c,u=s,t=parseInt(e.slice(u,u+2),10),n=parseInt(e.slice(d,d+2),10),r=parseInt(e.slice(f,f+2),10),o=this.getFixedTime(r,n,t)),e.length===4&&i.timePattern.indexOf(`s`)<0&&(a.forEach(function(e,t){switch(e){case`m`:c=2*t;break;case`h`:l=2*t}}),f=l,d=c,t=0,n=parseInt(e.slice(d,d+2),10),r=parseInt(e.slice(f,f+2),10),o=this.getFixedTime(r,n,t)),i.time=o,o.length===0?e:a.reduce(function(e,t){switch(t){case`s`:return e+i.addLeadingZero(o[2]);case`m`:return e+i.addLeadingZero(o[1]);case`h`:return e+i.addLeadingZero(o[0])}},``)},getFixedTime:function(e,t,n){return n=Math.min(parseInt(n||0,10),60),t=Math.min(t,60),[e=Math.min(e,60),t,n]},addLeadingZero:function(e){return(e<10?`0`:``)+e}};var u=l,d=function(e,t){var n=this;n.delimiter=t||t===``?t:` `,n.delimiterRE=t?RegExp(`\\`+t,`g`):``,n.formatter=e};d.prototype={setFormatter:function(e){this.formatter=e},format:function(e){var t=this;t.formatter.clear();for(var n,r=``,i=!1,a=0,o=(e=(e=(e=e.replace(/[^\d+]/g,``)).replace(/^\+/,`B`).replace(/\+/g,``).replace(`B`,`+`)).replace(t.delimiterRE,``)).length;a<o;a++)n=t.formatter.inputDigit(e.charAt(a)),/[\s()-]/g.test(n)?(r=n,i=!0):i||(r=n);return r=(r=r.replace(/[()]/g,``)).replace(/[\s-]/g,t.delimiter)}};var f=d,p={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(e){var t=e.reduce(function(e,t){return e+t},0);return e.concat(19-t)},getInfo:function(e,t){var n=p.blocks,r=p.re;for(var i in t=!!t,r)if(r[i].test(e)){var a=n[i];return{type:i,blocks:t?this.getStrictBlocks(a):a}}return{type:`unknown`,blocks:t?this.getStrictBlocks(n.general):n.general}}},m=p,h={noop:function(){},strip:function(e,t){return e.replace(t,``)},getPostDelimiter:function(e,t,n){if(n.length===0)return e.slice(-t.length)===t?t:``;var r=``;return n.forEach(function(t){e.slice(-t.length)===t&&(r=t)}),r},getDelimiterREByDelimiter:function(e){return new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,`\\$1`),`g`)},getNextCursorPosition:function(e,t,n,r,i){return t.length===e?n.length:e+this.getPositionOffset(e,t,n,r,i)},getPositionOffset:function(e,t,n,r,i){var a=this.stripDelimiters(t.slice(0,e),r,i),o=this.stripDelimiters(n.slice(0,e),r,i),s=a.length-o.length;return s===0?0:s/Math.abs(s)},stripDelimiters:function(e,t,n){var r=this;if(n.length===0){var i=t?r.getDelimiterREByDelimiter(t):``;return e.replace(i,``)}return n.forEach(function(t){t.split(``).forEach(function(t){e=e.replace(r.getDelimiterREByDelimiter(t),``)})}),e},headStr:function(e,t){return e.slice(0,t)},getMaxLength:function(e){return e.reduce(function(e,t){return e+t},0)},getPrefixStrippedValue:function(e,t,n,r,i,a,o,s,c){if(n===0)return e;if(e===t&&e!==``)return``;if(c&&e.slice(0,1)==`-`){var l=r.slice(0,1)==`-`?r.slice(1):r;return`-`+this.getPrefixStrippedValue(e.slice(1),t,n,l,i,a,o,s,c)}if(r.slice(0,n)!==t&&!s||r.slice(-n)!==t&&s)return o&&!r&&e?e:``;var u=this.stripDelimiters(r,i,a);return e.slice(0,n)===t||s?e.slice(-n)!==t&&s?u.slice(0,-n-1):s?e.slice(0,-n):e.slice(n):u.slice(n)},getFirstDiffIndex:function(e,t){for(var n=0;e.charAt(n)===t.charAt(n);)if(e.charAt(n++)===``)return-1;return n},getFormattedValue:function(e,t,n,r,i,a){var o=``,s=i.length>0,c=``;return n===0?e:(t.forEach(function(t,l){if(e.length>0){var u=e.slice(0,t),d=e.slice(t);c=s?i[a?l-1:l]||c:r,a?(l>0&&(o+=c),o+=u):(o+=u,u.length===t&&l<n-1&&(o+=c)),e=d}}),o)},fixPrefixCursor:function(e,t,n,r){if(e){var i=e.value,a=n||r[0]||` `;if(e.setSelectionRange&&t&&!(t.length+a.length<=i.length)){var o=2*i.length;setTimeout(function(){e.setSelectionRange(o,o)},1)}}},checkFullSelection:function(e){try{return(window.getSelection()||document.getSelection()||{}).toString().length===e.length}catch{}return!1},setSelection:function(e,t,n){if(e===this.getActiveElement(n)&&!(e&&e.value.length<=t))if(e.createTextRange){var r=e.createTextRange();r.move(`character`,t),r.select()}else try{e.setSelectionRange(t,t)}catch{}},getActiveElement:function(e){var t=e.activeElement;return t&&t.shadowRoot?this.getActiveElement(t.shadowRoot):t},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(e,t){return!!(this.isAndroid()&&e&&t)&&t===e.slice(0,-1)}},g={assign:function(e,t){return t||={},(e||={}).creditCard=!!t.creditCard,e.creditCardStrictMode=!!t.creditCardStrictMode,e.creditCardType=``,e.onCreditCardTypeChanged=t.onCreditCardTypeChanged||function(){},e.phone=!!t.phone,e.phoneRegionCode=t.phoneRegionCode||`AU`,e.phoneFormatter={},e.time=!!t.time,e.timePattern=t.timePattern||[`h`,`m`,`s`],e.timeFormat=t.timeFormat||`24`,e.timeFormatter={},e.date=!!t.date,e.datePattern=t.datePattern||[`d`,`m`,`Y`],e.dateMin=t.dateMin||``,e.dateMax=t.dateMax||``,e.dateFormatter={},e.numeral=!!t.numeral,e.numeralIntegerScale=t.numeralIntegerScale>0?t.numeralIntegerScale:0,e.numeralDecimalScale=t.numeralDecimalScale>=0?t.numeralDecimalScale:2,e.numeralDecimalMark=t.numeralDecimalMark||`.`,e.numeralThousandsGroupStyle=t.numeralThousandsGroupStyle||`thousand`,e.numeralPositiveOnly=!!t.numeralPositiveOnly,e.stripLeadingZeroes=!1!==t.stripLeadingZeroes,e.signBeforePrefix=!!t.signBeforePrefix,e.tailPrefix=!!t.tailPrefix,e.swapHiddenInput=!!t.swapHiddenInput,e.numericOnly=e.creditCard||e.date||!!t.numericOnly,e.uppercase=!!t.uppercase,e.lowercase=!!t.lowercase,e.prefix=e.creditCard||e.date?``:t.prefix||``,e.noImmediatePrefix=!!t.noImmediatePrefix,e.prefixLength=e.prefix.length,e.rawValueTrimPrefix=!!t.rawValueTrimPrefix,e.copyDelimiter=!!t.copyDelimiter,e.initValue=t.initValue!==void 0&&t.initValue!==null?t.initValue.toString():``,e.delimiter=t.delimiter||t.delimiter===``?t.delimiter:t.date?`/`:t.time?`:`:t.numeral?`,`:(t.phone,` `),e.delimiterLength=e.delimiter.length,e.delimiterLazyShow=!!t.delimiterLazyShow,e.delimiters=t.delimiters||[],e.blocks=t.blocks||[],e.blocksLength=e.blocks.length,e.root=typeof i==`object`&&i?i:window,e.document=t.document||e.root.document,e.maxLength=0,e.backspace=!1,e.result=``,e.onValueChanged=t.onValueChanged||function(){},e}},_=function(e,t){var n=this;if(typeof e==`string`?(n.element=document.querySelector(e),document.querySelectorAll(e).length):e.length!==void 0&&e.length>0?(n.element=e[0],e.length):n.element=e,!n.element)throw Error(`[cleave.js] Please check the element`);t.initValue=n.element.value,n.properties=_.DefaultProperties.assign({},t),n.init()};_.prototype={init:function(){var e=this,t=e.properties;t.numeral||t.phone||t.creditCard||t.time||t.date||t.blocksLength!==0||t.prefix?(t.maxLength=_.Util.getMaxLength(t.blocks),e.isAndroid=_.Util.isAndroid(),e.lastInputValue=``,e.isBackward=``,e.onChangeListener=e.onChange.bind(e),e.onKeyDownListener=e.onKeyDown.bind(e),e.onFocusListener=e.onFocus.bind(e),e.onCutListener=e.onCut.bind(e),e.onCopyListener=e.onCopy.bind(e),e.initSwapHiddenInput(),e.element.addEventListener(`input`,e.onChangeListener),e.element.addEventListener(`keydown`,e.onKeyDownListener),e.element.addEventListener(`focus`,e.onFocusListener),e.element.addEventListener(`cut`,e.onCutListener),e.element.addEventListener(`copy`,e.onCopyListener),e.initPhoneFormatter(),e.initDateFormatter(),e.initTimeFormatter(),e.initNumeralFormatter(),(t.initValue||t.prefix&&!t.noImmediatePrefix)&&e.onInput(t.initValue)):e.onInput(t.initValue)},initSwapHiddenInput:function(){var e=this;if(e.properties.swapHiddenInput){var t=e.element.cloneNode(!0);e.element.parentNode.insertBefore(t,e.element),e.elementSwapHidden=e.element,e.elementSwapHidden.type=`hidden`,e.element=t,e.element.id=``}},initNumeralFormatter:function(){var e=this.properties;e.numeral&&(e.numeralFormatter=new _.NumeralFormatter(e.numeralDecimalMark,e.numeralIntegerScale,e.numeralDecimalScale,e.numeralThousandsGroupStyle,e.numeralPositiveOnly,e.stripLeadingZeroes,e.prefix,e.signBeforePrefix,e.tailPrefix,e.delimiter))},initTimeFormatter:function(){var e=this.properties;e.time&&(e.timeFormatter=new _.TimeFormatter(e.timePattern,e.timeFormat),e.blocks=e.timeFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=_.Util.getMaxLength(e.blocks))},initDateFormatter:function(){var e=this.properties;e.date&&(e.dateFormatter=new _.DateFormatter(e.datePattern,e.dateMin,e.dateMax),e.blocks=e.dateFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=_.Util.getMaxLength(e.blocks))},initPhoneFormatter:function(){var e=this.properties;if(e.phone)try{e.phoneFormatter=new _.PhoneFormatter(new e.root.Cleave.AsYouTypeFormatter(e.phoneRegionCode),e.delimiter)}catch{throw Error(`[cleave.js] Please include phone-type-formatter.{country}.js lib`)}},onKeyDown:function(e){var t=this,n=e.which||e.keyCode;t.lastInputValue=t.element.value,t.isBackward=n===8},onChange:function(e){var t=this,n=t.properties,r=_.Util;t.isBackward=t.isBackward||e.inputType===`deleteContentBackward`;var i=r.getPostDelimiter(t.lastInputValue,n.delimiter,n.delimiters);t.isBackward&&i?n.postDelimiterBackspace=i:n.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var e=this,t=e.properties;e.lastInputValue=e.element.value,t.prefix&&t.noImmediatePrefix&&!e.element.value&&this.onInput(t.prefix),_.Util.fixPrefixCursor(e.element,t.prefix,t.delimiter,t.delimiters)},onCut:function(e){_.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(e),this.onInput(``))},onCopy:function(e){_.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(e)},copyClipboardData:function(e){var t=this.properties,n=_.Util,r=this.element.value,i=``;i=t.copyDelimiter?r:n.stripDelimiters(r,t.delimiter,t.delimiters);try{e.clipboardData?e.clipboardData.setData(`Text`,i):window.clipboardData.setData(`Text`,i),e.preventDefault()}catch{}},onInput:function(e){var t=this,n=t.properties,r=_.Util,i=r.getPostDelimiter(e,n.delimiter,n.delimiters);n.numeral||!n.postDelimiterBackspace||i||(e=r.headStr(e,e.length-n.postDelimiterBackspace.length)),n.phone?(!n.prefix||n.noImmediatePrefix&&!e.length?n.result=n.phoneFormatter.format(e):n.result=n.prefix+n.phoneFormatter.format(e).slice(n.prefix.length),t.updateValueState()):n.numeral?(n.prefix&&n.noImmediatePrefix&&e.length===0?n.result=``:n.result=n.numeralFormatter.format(e),t.updateValueState()):(n.date&&(e=n.dateFormatter.getValidatedDate(e)),n.time&&(e=n.timeFormatter.getValidatedTime(e)),e=r.stripDelimiters(e,n.delimiter,n.delimiters),e=r.getPrefixStrippedValue(e,n.prefix,n.prefixLength,n.result,n.delimiter,n.delimiters,n.noImmediatePrefix,n.tailPrefix,n.signBeforePrefix),e=n.numericOnly?r.strip(e,/[^\d]/g):e,e=n.uppercase?e.toUpperCase():e,e=n.lowercase?e.toLowerCase():e,n.prefix&&(n.tailPrefix?e+=n.prefix:e=n.prefix+e,n.blocksLength===0)?(n.result=e,t.updateValueState()):(n.creditCard&&t.updateCreditCardPropsByValue(e),e=r.headStr(e,n.maxLength),n.result=r.getFormattedValue(e,n.blocks,n.blocksLength,n.delimiter,n.delimiters,n.delimiterLazyShow),t.updateValueState()))},updateCreditCardPropsByValue:function(e){var t,n=this.properties,r=_.Util;r.headStr(n.result,4)!==r.headStr(e,4)&&(t=_.CreditCardDetector.getInfo(e,n.creditCardStrictMode),n.blocks=t.blocks,n.blocksLength=n.blocks.length,n.maxLength=r.getMaxLength(n.blocks),n.creditCardType!==t.type&&(n.creditCardType=t.type,n.onCreditCardTypeChanged.call(this,n.creditCardType)))},updateValueState:function(){var e=this,t=_.Util,n=e.properties;if(e.element){var r=e.element.selectionEnd,i=e.element.value,a=n.result;r=t.getNextCursorPosition(r,i,a,n.delimiter,n.delimiters),e.isAndroid?window.setTimeout(function(){e.element.value=a,t.setSelection(e.element,r,n.document,!1),e.callOnValueChanged()},1):(e.element.value=a,n.swapHiddenInput&&(e.elementSwapHidden.value=e.getRawValue()),t.setSelection(e.element,r,n.document,!1),e.callOnValueChanged())}},callOnValueChanged:function(){var e=this,t=e.properties;t.onValueChanged.call(e,{target:{name:e.element.name,value:t.result,rawValue:e.getRawValue()}})},setPhoneRegionCode:function(e){var t=this;t.properties.phoneRegionCode=e,t.initPhoneFormatter(),t.onChange()},setRawValue:function(e){var t=this,n=t.properties;e=e==null?``:e.toString(),n.numeral&&(e=e.replace(`.`,n.numeralDecimalMark)),n.postDelimiterBackspace=!1,t.element.value=e,t.onInput(e)},getRawValue:function(){var e=this.properties,t=_.Util,n=this.element.value;return e.rawValueTrimPrefix&&(n=t.getPrefixStrippedValue(n,e.prefix,e.prefixLength,e.result,e.delimiter,e.delimiters,e.noImmediatePrefix,e.tailPrefix,e.signBeforePrefix)),n=e.numeral?e.numeralFormatter.getRawValue(n):t.stripDelimiters(n,e.delimiter,e.delimiters)},getISOFormatDate:function(){var e=this.properties;return e.date?e.dateFormatter.getISOFormatDate():``},getISOFormatTime:function(){var e=this.properties;return e.time?e.timeFormatter.getISOFormatTime():``},getFormattedValue:function(){return this.element.value},destroy:function(){var e=this;e.element.removeEventListener(`input`,e.onChangeListener),e.element.removeEventListener(`keydown`,e.onKeyDownListener),e.element.removeEventListener(`focus`,e.onFocusListener),e.element.removeEventListener(`cut`,e.onCutListener),e.element.removeEventListener(`copy`,e.onCopyListener)},toString:function(){return`[Cleave Object]`}},_.NumeralFormatter=o,_.DateFormatter=c,_.TimeFormatter=u,_.PhoneFormatter=f,_.CreditCardDetector=m,_.Util=h,_.DefaultProperties=g,(typeof i==`object`&&i?i:window).Cleave=_;var v=_,y=class extends t.t(){constructor(...e){super(...e),this.value={cardName:``,cardNumber:``,expirationDate:``,cvv:``},this.cardType=``,this.isCardNameValid=!0,this.isCardNumberValid=!0,this.isExpirationDateValid=!0,this.isCvvValid=!0}firstUpdated(){new v(this.cardNumberInput,{creditCard:!0,creditCardStrictMode:!0,onCreditCardTypeChanged:e=>{this.cardType=e,e===`unknown`?(this.isCardNumberValid=!1,this.cardNumberInput.setCustomValidity(`Please enter a valid card number.`),this.cardNumberInput.error=!0):(this.isCardNumberValid=!0,this.cardNumberInput.setCustomValidity(``),this.cardNumberInput.error=!1,this.cvvInput.maxlength=e===`amex`?4:3)}}),new v(this.expirationDateInput,{date:!0,datePattern:[`m`,`y`],onValueChanged:e=>{let t=e.target.value;if(!t||t.length<5)this.isExpirationDateValid=!1,this.expirationDateInput.setCustomValidity(`Please enter a valid expiration date (MM/YY).`),this.expirationDateInput.error=!0;else{let[e,n]=t.split(`/`),r=new Date,i=r.getFullYear()%100,a=r.getMonth()+1,o=parseInt(e,10),s=parseInt(n,10);s<i||s===i&&o<a?(this.isExpirationDateValid=!1,this.expirationDateInput.setCustomValidity(`Card has expired.`),this.expirationDateInput.error=!0):(this.isExpirationDateValid=!0,this.expirationDateInput.setCustomValidity(``),this.expirationDateInput.error=!1)}}}),new v(this.cvvInput,{blocks:[4],numericOnly:!0,onValueChanged:e=>{let t=this.cardType===`amex`?4:3;e.target.value.length<t?(this.isCvvValid=!1,this.cvvInput.setCustomValidity(`Please enter a valid ${t}-digit CVV.`),this.cvvInput.error=!0):(this.isCvvValid=!0,this.cvvInput.setCustomValidity(``),this.cvvInput.error=!1)}}),new v(this.cardNameInput,{uppercase:!0,delimiter:` `,onValueChanged:e=>{!e.target.value||e.target.value.length<3?(this.isCardNameValid=!1,this.cardNameInput.setCustomValidity(`Please enter the name as it appears on the card.`),this.cardNameInput.error=!0):(this.isCardNameValid=!0,this.cardNameInput.setCustomValidity(``),this.cardNameInput.error=!1)}})}reportValidity(){return this.form.reportValidity()}checkValidity(){return!!this.form.reportValidity()}emitChange(){this.dispatchEvent(new CustomEvent(`change`,{detail:{...this.value},bubbles:!0}))}render(){let e=this.getCardIcon();return r.html`
|
|
1
|
+
require(`./chunk-BCfY8kxB.cjs`);const e=require(`./decorate-F9CuyeHg.cjs`),t=require(`./litElement.mixin-De5SG5z7.cjs`);require(`./mixins.cjs`);let n=require(`lit/decorators.js`),r=require(`lit`);var i=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},a=function(e,t,n,r,i,o,s,c,l,u){var d=this;d.numeralDecimalMark=e||`.`,d.numeralIntegerScale=t>0?t:0,d.numeralDecimalScale=n>=0?n:2,d.numeralThousandsGroupStyle=r||a.groupStyle.thousand,d.numeralPositiveOnly=!!i,d.stripLeadingZeroes=!1!==o,d.prefix=s||s===``?s:``,d.signBeforePrefix=!!c,d.tailPrefix=!!l,d.delimiter=u||u===``?u:`,`,d.delimiterRE=u?RegExp(`\\`+u,`g`):``};a.groupStyle={thousand:`thousand`,lakh:`lakh`,wan:`wan`,none:`none`},a.prototype={getRawValue:function(e){return e.replace(this.delimiterRE,``).replace(this.numeralDecimalMark,`.`)},format:function(e){var t,n,r,i,o=this,s=``;switch(e=e.replace(/[A-Za-z]/g,``).replace(o.numeralDecimalMark,`M`).replace(/[^\dM-]/g,``).replace(/^\-/,`N`).replace(/\-/g,``).replace(`N`,o.numeralPositiveOnly?``:`-`).replace(`M`,o.numeralDecimalMark),o.stripLeadingZeroes&&(e=e.replace(/^(-)?0+(?=\d)/,`$1`)),n=e.slice(0,1)===`-`?`-`:``,r=o.prefix===void 0?n:o.signBeforePrefix?n+o.prefix:o.prefix+n,i=e,e.indexOf(o.numeralDecimalMark)>=0&&(i=(t=e.split(o.numeralDecimalMark))[0],s=o.numeralDecimalMark+t[1].slice(0,o.numeralDecimalScale)),n===`-`&&(i=i.slice(1)),o.numeralIntegerScale>0&&(i=i.slice(0,o.numeralIntegerScale)),o.numeralThousandsGroupStyle){case a.groupStyle.lakh:i=i.replace(/(\d)(?=(\d\d)+\d$)/g,`$1`+o.delimiter);break;case a.groupStyle.wan:i=i.replace(/(\d)(?=(\d{4})+$)/g,`$1`+o.delimiter);break;case a.groupStyle.thousand:i=i.replace(/(\d)(?=(\d{3})+$)/g,`$1`+o.delimiter)}return o.tailPrefix?n+i.toString()+(o.numeralDecimalScale>0?s.toString():``)+o.prefix:r+i.toString()+(o.numeralDecimalScale>0?s.toString():``)}};var o=a,s=function(e,t,n){var r=this;r.date=[],r.blocks=[],r.datePattern=e,r.dateMin=t.split(`-`).reverse().map(function(e){return parseInt(e,10)}),r.dateMin.length===2&&r.dateMin.unshift(0),r.dateMax=n.split(`-`).reverse().map(function(e){return parseInt(e,10)}),r.dateMax.length===2&&r.dateMax.unshift(0),r.initBlocks()};s.prototype={initBlocks:function(){var e=this;e.datePattern.forEach(function(t){t===`Y`?e.blocks.push(4):e.blocks.push(2)})},getISOFormatDate:function(){var e=this,t=e.date;return t[2]?t[2]+`-`+e.addLeadingZero(t[1])+`-`+e.addLeadingZero(t[0]):``},getBlocks:function(){return this.blocks},getValidatedDate:function(e){var t=this,n=``;return e=e.replace(/[^\d]/g,``),t.blocks.forEach(function(r,i){if(e.length>0){var a=e.slice(0,r),o=a.slice(0,1),s=e.slice(r);switch(t.datePattern[i]){case`d`:a===`00`?a=`01`:parseInt(o,10)>3?a=`0`+o:parseInt(a,10)>31&&(a=`31`);break;case`m`:a===`00`?a=`01`:parseInt(o,10)>1?a=`0`+o:parseInt(a,10)>12&&(a=`12`)}n+=a,e=s}}),this.getFixedDateString(n)},getFixedDateString:function(e){var t,n,r,i=this,a=i.datePattern,o=[],s=0,c=0,l=0,u=0,d=0,f=0,p=!1;return e.length===4&&a[0].toLowerCase()!==`y`&&a[1].toLowerCase()!==`y`&&(d=2-(u=a[0]===`d`?0:2),t=parseInt(e.slice(u,u+2),10),n=parseInt(e.slice(d,d+2),10),o=this.getFixedDate(t,n,0)),e.length===8&&(a.forEach(function(e,t){switch(e){case`d`:s=t;break;case`m`:c=t;break;default:l=t}}),f=2*l,u=s<=l?2*s:2*s+2,d=c<=l?2*c:2*c+2,t=parseInt(e.slice(u,u+2),10),n=parseInt(e.slice(d,d+2),10),r=parseInt(e.slice(f,f+4),10),p=e.slice(f,f+4).length===4,o=this.getFixedDate(t,n,r)),e.length!==4||a[0]!==`y`&&a[1]!==`y`||(f=2-(d=a[0]===`m`?0:2),n=parseInt(e.slice(d,d+2),10),r=parseInt(e.slice(f,f+2),10),p=e.slice(f,f+2).length===2,o=[0,n,r]),e.length!==6||a[0]!==`Y`&&a[1]!==`Y`||(f=2-.5*(d=a[0]===`m`?0:4),n=parseInt(e.slice(d,d+2),10),r=parseInt(e.slice(f,f+4),10),p=e.slice(f,f+4).length===4,o=[0,n,r]),o=i.getRangeFixedDate(o),i.date=o,o.length===0?e:a.reduce(function(e,t){switch(t){case`d`:return e+(o[0]===0?``:i.addLeadingZero(o[0]));case`m`:return e+(o[1]===0?``:i.addLeadingZero(o[1]));case`y`:return e+(p?i.addLeadingZeroForYear(o[2],!1):``);case`Y`:return e+(p?i.addLeadingZeroForYear(o[2],!0):``)}},``)},getRangeFixedDate:function(e){var t=this,n=t.datePattern,r=t.dateMin||[],i=t.dateMax||[];return!e.length||r.length<3&&i.length<3||n.find(function(e){return e.toLowerCase()===`y`})&&e[2]===0?e:i.length&&(i[2]<e[2]||i[2]===e[2]&&(i[1]<e[1]||i[1]===e[1]&&i[0]<e[0]))?i:r.length&&(r[2]>e[2]||r[2]===e[2]&&(r[1]>e[1]||r[1]===e[1]&&r[0]>e[0]))?r:e},getFixedDate:function(e,t,n){return e=Math.min(e,31),t=Math.min(t,12),n=parseInt(n||0,10),(t<7&&t%2==0||t>8&&t%2==1)&&(e=Math.min(e,t===2?this.isLeapYear(n)?29:28:30)),[e,t,n]},isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},addLeadingZero:function(e){return(e<10?`0`:``)+e},addLeadingZeroForYear:function(e,t){return t?(e<10?`000`:e<100?`00`:e<1e3?`0`:``)+e:(e<10?`0`:``)+e}};var c=s,l=function(e,t){var n=this;n.time=[],n.blocks=[],n.timePattern=e,n.timeFormat=t,n.initBlocks()};l.prototype={initBlocks:function(){var e=this;e.timePattern.forEach(function(){e.blocks.push(2)})},getISOFormatTime:function(){var e=this,t=e.time;return t[2]?e.addLeadingZero(t[0])+`:`+e.addLeadingZero(t[1])+`:`+e.addLeadingZero(t[2]):``},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){return String(this.timeFormat)===`12`?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(e){var t=this,n=``;e=e.replace(/[^\d]/g,``);var r=t.getTimeFormatOptions();return t.blocks.forEach(function(i,a){if(e.length>0){var o=e.slice(0,i),s=o.slice(0,1),c=e.slice(i);switch(t.timePattern[a]){case`h`:parseInt(s,10)>r.maxHourFirstDigit?o=`0`+s:parseInt(o,10)>r.maxHours&&(o=r.maxHours+``);break;case`m`:case`s`:parseInt(s,10)>r.maxMinutesFirstDigit?o=`0`+s:parseInt(o,10)>r.maxMinutes&&(o=r.maxMinutes+``)}n+=o,e=c}}),this.getFixedTimeString(n)},getFixedTimeString:function(e){var t,n,r,i=this,a=i.timePattern,o=[],s=0,c=0,l=0,u=0,d=0,f=0;return e.length===6&&(a.forEach(function(e,t){switch(e){case`s`:s=2*t;break;case`m`:c=2*t;break;case`h`:l=2*t}}),f=l,d=c,u=s,t=parseInt(e.slice(u,u+2),10),n=parseInt(e.slice(d,d+2),10),r=parseInt(e.slice(f,f+2),10),o=this.getFixedTime(r,n,t)),e.length===4&&i.timePattern.indexOf(`s`)<0&&(a.forEach(function(e,t){switch(e){case`m`:c=2*t;break;case`h`:l=2*t}}),f=l,d=c,t=0,n=parseInt(e.slice(d,d+2),10),r=parseInt(e.slice(f,f+2),10),o=this.getFixedTime(r,n,t)),i.time=o,o.length===0?e:a.reduce(function(e,t){switch(t){case`s`:return e+i.addLeadingZero(o[2]);case`m`:return e+i.addLeadingZero(o[1]);case`h`:return e+i.addLeadingZero(o[0])}},``)},getFixedTime:function(e,t,n){return n=Math.min(parseInt(n||0,10),60),t=Math.min(t,60),[e=Math.min(e,60),t,n]},addLeadingZero:function(e){return(e<10?`0`:``)+e}};var u=l,d=function(e,t){var n=this;n.delimiter=t||t===``?t:` `,n.delimiterRE=t?RegExp(`\\`+t,`g`):``,n.formatter=e};d.prototype={setFormatter:function(e){this.formatter=e},format:function(e){var t=this;t.formatter.clear();for(var n,r=``,i=!1,a=0,o=(e=(e=(e=e.replace(/[^\d+]/g,``)).replace(/^\+/,`B`).replace(/\+/g,``).replace(`B`,`+`)).replace(t.delimiterRE,``)).length;a<o;a++)n=t.formatter.inputDigit(e.charAt(a)),/[\s()-]/g.test(n)?(r=n,i=!0):i||(r=n);return r=(r=r.replace(/[()]/g,``)).replace(/[\s-]/g,t.delimiter)}};var f=d,p={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(e){var t=e.reduce(function(e,t){return e+t},0);return e.concat(19-t)},getInfo:function(e,t){var n=p.blocks,r=p.re;for(var i in t=!!t,r)if(r[i].test(e)){var a=n[i];return{type:i,blocks:t?this.getStrictBlocks(a):a}}return{type:`unknown`,blocks:t?this.getStrictBlocks(n.general):n.general}}},m=p,h={noop:function(){},strip:function(e,t){return e.replace(t,``)},getPostDelimiter:function(e,t,n){if(n.length===0)return e.slice(-t.length)===t?t:``;var r=``;return n.forEach(function(t){e.slice(-t.length)===t&&(r=t)}),r},getDelimiterREByDelimiter:function(e){return new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,`\\$1`),`g`)},getNextCursorPosition:function(e,t,n,r,i){return t.length===e?n.length:e+this.getPositionOffset(e,t,n,r,i)},getPositionOffset:function(e,t,n,r,i){var a=this.stripDelimiters(t.slice(0,e),r,i),o=this.stripDelimiters(n.slice(0,e),r,i),s=a.length-o.length;return s===0?0:s/Math.abs(s)},stripDelimiters:function(e,t,n){var r=this;if(n.length===0){var i=t?r.getDelimiterREByDelimiter(t):``;return e.replace(i,``)}return n.forEach(function(t){t.split(``).forEach(function(t){e=e.replace(r.getDelimiterREByDelimiter(t),``)})}),e},headStr:function(e,t){return e.slice(0,t)},getMaxLength:function(e){return e.reduce(function(e,t){return e+t},0)},getPrefixStrippedValue:function(e,t,n,r,i,a,o,s,c){if(n===0)return e;if(e===t&&e!==``)return``;if(c&&e.slice(0,1)==`-`){var l=r.slice(0,1)==`-`?r.slice(1):r;return`-`+this.getPrefixStrippedValue(e.slice(1),t,n,l,i,a,o,s,c)}if(r.slice(0,n)!==t&&!s||r.slice(-n)!==t&&s)return o&&!r&&e?e:``;var u=this.stripDelimiters(r,i,a);return e.slice(0,n)===t||s?e.slice(-n)!==t&&s?u.slice(0,-n-1):s?e.slice(0,-n):e.slice(n):u.slice(n)},getFirstDiffIndex:function(e,t){for(var n=0;e.charAt(n)===t.charAt(n);)if(e.charAt(n++)===``)return-1;return n},getFormattedValue:function(e,t,n,r,i,a){var o=``,s=i.length>0,c=``;return n===0?e:(t.forEach(function(t,l){if(e.length>0){var u=e.slice(0,t),d=e.slice(t);c=s?i[a?l-1:l]||c:r,a?(l>0&&(o+=c),o+=u):(o+=u,u.length===t&&l<n-1&&(o+=c)),e=d}}),o)},fixPrefixCursor:function(e,t,n,r){if(e){var i=e.value,a=n||r[0]||` `;if(e.setSelectionRange&&t&&!(t.length+a.length<=i.length)){var o=2*i.length;setTimeout(function(){e.setSelectionRange(o,o)},1)}}},checkFullSelection:function(e){try{return(window.getSelection()||document.getSelection()||{}).toString().length===e.length}catch{}return!1},setSelection:function(e,t,n){if(e===this.getActiveElement(n)&&!(e&&e.value.length<=t))if(e.createTextRange){var r=e.createTextRange();r.move(`character`,t),r.select()}else try{e.setSelectionRange(t,t)}catch{}},getActiveElement:function(e){var t=e.activeElement;return t&&t.shadowRoot?this.getActiveElement(t.shadowRoot):t},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(e,t){return!!(this.isAndroid()&&e&&t)&&t===e.slice(0,-1)}},g={assign:function(e,t){return t||={},(e||={}).creditCard=!!t.creditCard,e.creditCardStrictMode=!!t.creditCardStrictMode,e.creditCardType=``,e.onCreditCardTypeChanged=t.onCreditCardTypeChanged||function(){},e.phone=!!t.phone,e.phoneRegionCode=t.phoneRegionCode||`AU`,e.phoneFormatter={},e.time=!!t.time,e.timePattern=t.timePattern||[`h`,`m`,`s`],e.timeFormat=t.timeFormat||`24`,e.timeFormatter={},e.date=!!t.date,e.datePattern=t.datePattern||[`d`,`m`,`Y`],e.dateMin=t.dateMin||``,e.dateMax=t.dateMax||``,e.dateFormatter={},e.numeral=!!t.numeral,e.numeralIntegerScale=t.numeralIntegerScale>0?t.numeralIntegerScale:0,e.numeralDecimalScale=t.numeralDecimalScale>=0?t.numeralDecimalScale:2,e.numeralDecimalMark=t.numeralDecimalMark||`.`,e.numeralThousandsGroupStyle=t.numeralThousandsGroupStyle||`thousand`,e.numeralPositiveOnly=!!t.numeralPositiveOnly,e.stripLeadingZeroes=!1!==t.stripLeadingZeroes,e.signBeforePrefix=!!t.signBeforePrefix,e.tailPrefix=!!t.tailPrefix,e.swapHiddenInput=!!t.swapHiddenInput,e.numericOnly=e.creditCard||e.date||!!t.numericOnly,e.uppercase=!!t.uppercase,e.lowercase=!!t.lowercase,e.prefix=e.creditCard||e.date?``:t.prefix||``,e.noImmediatePrefix=!!t.noImmediatePrefix,e.prefixLength=e.prefix.length,e.rawValueTrimPrefix=!!t.rawValueTrimPrefix,e.copyDelimiter=!!t.copyDelimiter,e.initValue=t.initValue!==void 0&&t.initValue!==null?t.initValue.toString():``,e.delimiter=t.delimiter||t.delimiter===``?t.delimiter:t.date?`/`:t.time?`:`:t.numeral?`,`:(t.phone,` `),e.delimiterLength=e.delimiter.length,e.delimiterLazyShow=!!t.delimiterLazyShow,e.delimiters=t.delimiters||[],e.blocks=t.blocks||[],e.blocksLength=e.blocks.length,e.root=typeof i==`object`&&i?i:window,e.document=t.document||e.root.document,e.maxLength=0,e.backspace=!1,e.result=``,e.onValueChanged=t.onValueChanged||function(){},e}},_=function(e,t){var n=this;if(typeof e==`string`?(n.element=document.querySelector(e),document.querySelectorAll(e).length):e.length!==void 0&&e.length>0?(n.element=e[0],e.length):n.element=e,!n.element)throw Error(`[cleave.js] Please check the element`);t.initValue=n.element.value,n.properties=_.DefaultProperties.assign({},t),n.init()};_.prototype={init:function(){var e=this,t=e.properties;t.numeral||t.phone||t.creditCard||t.time||t.date||t.blocksLength!==0||t.prefix?(t.maxLength=_.Util.getMaxLength(t.blocks),e.isAndroid=_.Util.isAndroid(),e.lastInputValue=``,e.isBackward=``,e.onChangeListener=e.onChange.bind(e),e.onKeyDownListener=e.onKeyDown.bind(e),e.onFocusListener=e.onFocus.bind(e),e.onCutListener=e.onCut.bind(e),e.onCopyListener=e.onCopy.bind(e),e.initSwapHiddenInput(),e.element.addEventListener(`input`,e.onChangeListener),e.element.addEventListener(`keydown`,e.onKeyDownListener),e.element.addEventListener(`focus`,e.onFocusListener),e.element.addEventListener(`cut`,e.onCutListener),e.element.addEventListener(`copy`,e.onCopyListener),e.initPhoneFormatter(),e.initDateFormatter(),e.initTimeFormatter(),e.initNumeralFormatter(),(t.initValue||t.prefix&&!t.noImmediatePrefix)&&e.onInput(t.initValue)):e.onInput(t.initValue)},initSwapHiddenInput:function(){var e=this;if(e.properties.swapHiddenInput){var t=e.element.cloneNode(!0);e.element.parentNode.insertBefore(t,e.element),e.elementSwapHidden=e.element,e.elementSwapHidden.type=`hidden`,e.element=t,e.element.id=``}},initNumeralFormatter:function(){var e=this.properties;e.numeral&&(e.numeralFormatter=new _.NumeralFormatter(e.numeralDecimalMark,e.numeralIntegerScale,e.numeralDecimalScale,e.numeralThousandsGroupStyle,e.numeralPositiveOnly,e.stripLeadingZeroes,e.prefix,e.signBeforePrefix,e.tailPrefix,e.delimiter))},initTimeFormatter:function(){var e=this.properties;e.time&&(e.timeFormatter=new _.TimeFormatter(e.timePattern,e.timeFormat),e.blocks=e.timeFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=_.Util.getMaxLength(e.blocks))},initDateFormatter:function(){var e=this.properties;e.date&&(e.dateFormatter=new _.DateFormatter(e.datePattern,e.dateMin,e.dateMax),e.blocks=e.dateFormatter.getBlocks(),e.blocksLength=e.blocks.length,e.maxLength=_.Util.getMaxLength(e.blocks))},initPhoneFormatter:function(){var e=this.properties;if(e.phone)try{e.phoneFormatter=new _.PhoneFormatter(new e.root.Cleave.AsYouTypeFormatter(e.phoneRegionCode),e.delimiter)}catch{throw Error(`[cleave.js] Please include phone-type-formatter.{country}.js lib`)}},onKeyDown:function(e){var t=this,n=e.which||e.keyCode;t.lastInputValue=t.element.value,t.isBackward=n===8},onChange:function(e){var t=this,n=t.properties,r=_.Util;t.isBackward=t.isBackward||e.inputType===`deleteContentBackward`;var i=r.getPostDelimiter(t.lastInputValue,n.delimiter,n.delimiters);t.isBackward&&i?n.postDelimiterBackspace=i:n.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var e=this,t=e.properties;e.lastInputValue=e.element.value,t.prefix&&t.noImmediatePrefix&&!e.element.value&&this.onInput(t.prefix),_.Util.fixPrefixCursor(e.element,t.prefix,t.delimiter,t.delimiters)},onCut:function(e){_.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(e),this.onInput(``))},onCopy:function(e){_.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(e)},copyClipboardData:function(e){var t=this.properties,n=_.Util,r=this.element.value,i=``;i=t.copyDelimiter?r:n.stripDelimiters(r,t.delimiter,t.delimiters);try{e.clipboardData?e.clipboardData.setData(`Text`,i):window.clipboardData.setData(`Text`,i),e.preventDefault()}catch{}},onInput:function(e){var t=this,n=t.properties,r=_.Util,i=r.getPostDelimiter(e,n.delimiter,n.delimiters);n.numeral||!n.postDelimiterBackspace||i||(e=r.headStr(e,e.length-n.postDelimiterBackspace.length)),n.phone?(!n.prefix||n.noImmediatePrefix&&!e.length?n.result=n.phoneFormatter.format(e):n.result=n.prefix+n.phoneFormatter.format(e).slice(n.prefix.length),t.updateValueState()):n.numeral?(n.prefix&&n.noImmediatePrefix&&e.length===0?n.result=``:n.result=n.numeralFormatter.format(e),t.updateValueState()):(n.date&&(e=n.dateFormatter.getValidatedDate(e)),n.time&&(e=n.timeFormatter.getValidatedTime(e)),e=r.stripDelimiters(e,n.delimiter,n.delimiters),e=r.getPrefixStrippedValue(e,n.prefix,n.prefixLength,n.result,n.delimiter,n.delimiters,n.noImmediatePrefix,n.tailPrefix,n.signBeforePrefix),e=n.numericOnly?r.strip(e,/[^\d]/g):e,e=n.uppercase?e.toUpperCase():e,e=n.lowercase?e.toLowerCase():e,n.prefix&&(n.tailPrefix?e+=n.prefix:e=n.prefix+e,n.blocksLength===0)?(n.result=e,t.updateValueState()):(n.creditCard&&t.updateCreditCardPropsByValue(e),e=r.headStr(e,n.maxLength),n.result=r.getFormattedValue(e,n.blocks,n.blocksLength,n.delimiter,n.delimiters,n.delimiterLazyShow),t.updateValueState()))},updateCreditCardPropsByValue:function(e){var t,n=this.properties,r=_.Util;r.headStr(n.result,4)!==r.headStr(e,4)&&(t=_.CreditCardDetector.getInfo(e,n.creditCardStrictMode),n.blocks=t.blocks,n.blocksLength=n.blocks.length,n.maxLength=r.getMaxLength(n.blocks),n.creditCardType!==t.type&&(n.creditCardType=t.type,n.onCreditCardTypeChanged.call(this,n.creditCardType)))},updateValueState:function(){var e=this,t=_.Util,n=e.properties;if(e.element){var r=e.element.selectionEnd,i=e.element.value,a=n.result;r=t.getNextCursorPosition(r,i,a,n.delimiter,n.delimiters),e.isAndroid?window.setTimeout(function(){e.element.value=a,t.setSelection(e.element,r,n.document,!1),e.callOnValueChanged()},1):(e.element.value=a,n.swapHiddenInput&&(e.elementSwapHidden.value=e.getRawValue()),t.setSelection(e.element,r,n.document,!1),e.callOnValueChanged())}},callOnValueChanged:function(){var e=this,t=e.properties;t.onValueChanged.call(e,{target:{name:e.element.name,value:t.result,rawValue:e.getRawValue()}})},setPhoneRegionCode:function(e){var t=this;t.properties.phoneRegionCode=e,t.initPhoneFormatter(),t.onChange()},setRawValue:function(e){var t=this,n=t.properties;e=e==null?``:e.toString(),n.numeral&&(e=e.replace(`.`,n.numeralDecimalMark)),n.postDelimiterBackspace=!1,t.element.value=e,t.onInput(e)},getRawValue:function(){var e=this.properties,t=_.Util,n=this.element.value;return e.rawValueTrimPrefix&&(n=t.getPrefixStrippedValue(n,e.prefix,e.prefixLength,e.result,e.delimiter,e.delimiters,e.noImmediatePrefix,e.tailPrefix,e.signBeforePrefix)),n=e.numeral?e.numeralFormatter.getRawValue(n):t.stripDelimiters(n,e.delimiter,e.delimiters)},getISOFormatDate:function(){var e=this.properties;return e.date?e.dateFormatter.getISOFormatDate():``},getISOFormatTime:function(){var e=this.properties;return e.time?e.timeFormatter.getISOFormatTime():``},getFormattedValue:function(){return this.element.value},destroy:function(){var e=this;e.element.removeEventListener(`input`,e.onChangeListener),e.element.removeEventListener(`keydown`,e.onKeyDownListener),e.element.removeEventListener(`focus`,e.onFocusListener),e.element.removeEventListener(`cut`,e.onCutListener),e.element.removeEventListener(`copy`,e.onCopyListener)},toString:function(){return`[Cleave Object]`}},_.NumeralFormatter=o,_.DateFormatter=c,_.TimeFormatter=u,_.PhoneFormatter=f,_.CreditCardDetector=m,_.Util=h,_.DefaultProperties=g,(typeof i==`object`&&i?i:window).Cleave=_;var v=_,y=class extends t.t(){constructor(...e){super(...e),this.value={cardName:``,cardNumber:``,expirationDate:``,cvv:``},this.cardType=``,this.isCardNameValid=!0,this.isCardNumberValid=!0,this.isExpirationDateValid=!0,this.isCvvValid=!0}firstUpdated(){new v(this.cardNumberInput,{creditCard:!0,creditCardStrictMode:!0,onCreditCardTypeChanged:e=>{this.cardType=e,e===`unknown`?(this.isCardNumberValid=!1,this.cardNumberInput.setCustomValidity(`Please enter a valid card number.`),this.cardNumberInput.error=!0):(this.isCardNumberValid=!0,this.cardNumberInput.setCustomValidity(``),this.cardNumberInput.error=!1,this.cvvInput.maxlength=e===`amex`?4:3)}}),new v(this.expirationDateInput,{date:!0,datePattern:[`m`,`y`],onValueChanged:e=>{let t=e.target.value;if(!t||t.length<5)this.isExpirationDateValid=!1,this.expirationDateInput.setCustomValidity(`Please enter a valid expiration date (MM/YY).`),this.expirationDateInput.error=!0;else{let[e,n]=t.split(`/`),r=new Date,i=r.getFullYear()%100,a=r.getMonth()+1,o=parseInt(e,10),s=parseInt(n,10);s<i||s===i&&o<a?(this.isExpirationDateValid=!1,this.expirationDateInput.setCustomValidity(`Card has expired.`),this.expirationDateInput.error=!0):(this.isExpirationDateValid=!0,this.expirationDateInput.setCustomValidity(``),this.expirationDateInput.error=!1)}}}),new v(this.cvvInput,{blocks:[4],numericOnly:!0,onValueChanged:e=>{let t=this.cardType===`amex`?4:3;e.target.value.length<t?(this.isCvvValid=!1,this.cvvInput.setCustomValidity(`Please enter a valid ${t}-digit CVV.`),this.cvvInput.error=!0):(this.isCvvValid=!0,this.cvvInput.setCustomValidity(``),this.cvvInput.error=!1)}}),new v(this.cardNameInput,{uppercase:!0,delimiter:` `,onValueChanged:e=>{!e.target.value||e.target.value.length<3?(this.isCardNameValid=!1,this.cardNameInput.setCustomValidity(`Please enter the name as it appears on the card.`),this.cardNameInput.error=!0):(this.isCardNameValid=!0,this.cardNameInput.setCustomValidity(``),this.cardNameInput.error=!1)}})}reportValidity(){return this.form.reportValidity()}checkValidity(){return!!this.form.reportValidity()}emitChange(){this.dispatchEvent(new CustomEvent(`change`,{detail:{...this.value},bubbles:!0}))}render(){let e=this.getCardIcon();return r.html`
|
|
2
2
|
<schmancy-form
|
|
3
3
|
@change=${e=>{e.stopPropagation(),e.preventDefault()}}
|
|
4
4
|
>
|