@swisspost/internet-header 10.1.0 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-MGiZpKVI.js → package-2syswPDO.js} +1 -1
- package/dist/cjs/{package-E6EPRPpB.js → package-DQQbs4bt.js} +2 -2
- package/dist/cjs/post-accordion_4.cjs.entry.js +1 -1
- package/dist/cjs/post-autocomplete.cjs.entry.js +11 -2
- package/dist/cjs/post-avatar.cjs.entry.js +1 -1
- package/dist/cjs/post-back-to-top.cjs.entry.js +1 -1
- package/dist/cjs/post-banner.cjs.entry.js +1 -1
- package/dist/cjs/post-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/post-closebutton.cjs.entry.js +1 -1
- package/dist/cjs/post-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/post-footer.cjs.entry.js +31 -13
- package/dist/cjs/post-header.cjs.entry.js +1 -1
- package/dist/cjs/post-icon.cjs.entry.js +1 -1
- package/dist/cjs/post-language-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/post-language-menu.cjs.entry.js +1 -1
- package/dist/cjs/post-linkarea.cjs.entry.js +1 -1
- package/dist/cjs/post-listbox-option.cjs.entry.js +3 -3
- package/dist/cjs/post-listbox.cjs.entry.js +3 -3
- package/dist/cjs/post-logo.cjs.entry.js +2 -2
- package/dist/cjs/post-mainnavigation.cjs.entry.js +2 -2
- package/dist/cjs/post-megadropdown-trigger.cjs.entry.js +2 -2
- package/dist/cjs/post-megadropdown.cjs.entry.js +8 -8
- package/dist/cjs/post-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/post-menu_2.cjs.entry.js +3 -3
- package/dist/cjs/post-number-input.cjs.entry.js +3 -3
- package/dist/cjs/post-pagination.cjs.entry.js +1 -1
- package/dist/cjs/post-popover-trigger.cjs.entry.js +2 -2
- package/dist/cjs/post-popover.cjs.entry.js +3 -3
- package/dist/cjs/post-popovercontainer.cjs.entry.js +3 -3
- package/dist/cjs/post-progressbar.cjs.entry.js +1 -1
- package/dist/cjs/post-rating.cjs.entry.js +2 -2
- package/dist/cjs/post-side-navigation-trigger.cjs.entry.js +2 -2
- package/dist/cjs/post-side-navigation.cjs.entry.js +2 -2
- package/dist/cjs/post-stepper-item.cjs.entry.js +2 -2
- package/dist/cjs/post-stepper.cjs.entry.js +2 -2
- package/dist/cjs/post-tab-item.cjs.entry.js +2 -2
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/post-tabs.cjs.entry.js +4 -4
- package/dist/cjs/post-togglebutton.cjs.entry.js +2 -2
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +2 -2
- package/dist/cjs/post-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/swisspost-internet-footer.cjs.entry.js +1 -1
- package/dist/cjs/swisspost-internet-header.cjs.entry.js +2 -2
- package/dist/cjs/swisspost-internet-header.cjs.js +1 -1
- package/dist/collection/components/internal/Link.js +1 -1
- package/dist/collection/components/post-internet-header/post-internet-header.js +1 -1
- package/dist/components/package.js +1 -1
- package/dist/components/package2.js +1 -1
- package/dist/components/post-autocomplete.js +1 -1
- package/dist/components/post-footer2.js +1 -1
- package/dist/components/post-listbox-option.js +1 -1
- package/dist/components/post-listbox.js +1 -1
- package/dist/components/post-logo2.js +1 -1
- package/dist/components/post-mainnavigation2.js +1 -1
- package/dist/components/post-megadropdown-trigger.js +1 -1
- package/dist/components/post-megadropdown.js +1 -1
- package/dist/components/post-menu-trigger2.js +1 -1
- package/dist/components/post-menu2.js +1 -1
- package/dist/components/post-number-input.js +1 -1
- package/dist/components/post-popover-trigger.js +1 -1
- package/dist/components/post-popover.js +1 -1
- package/dist/components/post-popovercontainer2.js +1 -1
- package/dist/components/post-progressbar.js +1 -1
- package/dist/components/post-rating.js +1 -1
- package/dist/components/post-side-navigation-trigger.js +1 -1
- package/dist/components/post-side-navigation.js +1 -1
- package/dist/components/post-stepper-item.js +1 -1
- package/dist/components/post-stepper.js +1 -1
- package/dist/components/post-tab-item.js +1 -1
- package/dist/components/post-tab-panel.js +1 -1
- package/dist/components/post-tabs.js +1 -1
- package/dist/components/post-togglebutton2.js +1 -1
- package/dist/components/post-tooltip-trigger.js +1 -1
- package/dist/components/post-tooltip.js +1 -1
- package/dist/components/swisspost-internet-header.js +1 -1
- package/dist/docs.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-ClQfdhMK.js → package-BEOiFUNg.js} +2 -2
- package/dist/esm/{package-jK9tFtoG.js → package-YQBh4peU.js} +1 -1
- package/dist/esm/post-accordion_4.entry.js +1 -1
- package/dist/esm/post-autocomplete.entry.js +11 -2
- package/dist/esm/post-avatar.entry.js +1 -1
- package/dist/esm/post-back-to-top.entry.js +1 -1
- package/dist/esm/post-banner.entry.js +1 -1
- package/dist/esm/post-breadcrumb-item.entry.js +1 -1
- package/dist/esm/post-breadcrumbs.entry.js +1 -1
- package/dist/esm/post-closebutton.entry.js +1 -1
- package/dist/esm/post-date-picker.entry.js +1 -1
- package/dist/esm/post-footer.entry.js +31 -13
- package/dist/esm/post-header.entry.js +1 -1
- package/dist/esm/post-icon.entry.js +1 -1
- package/dist/esm/post-language-menu-item.entry.js +1 -1
- package/dist/esm/post-language-menu.entry.js +1 -1
- package/dist/esm/post-linkarea.entry.js +1 -1
- package/dist/esm/post-listbox-option.entry.js +3 -3
- package/dist/esm/post-listbox.entry.js +3 -3
- package/dist/esm/post-logo.entry.js +2 -2
- package/dist/esm/post-mainnavigation.entry.js +2 -2
- package/dist/esm/post-megadropdown-trigger.entry.js +2 -2
- package/dist/esm/post-megadropdown.entry.js +8 -8
- package/dist/esm/post-menu-item.entry.js +1 -1
- package/dist/esm/post-menu_2.entry.js +3 -3
- package/dist/esm/post-number-input.entry.js +3 -3
- package/dist/esm/post-pagination.entry.js +1 -1
- package/dist/esm/post-popover-trigger.entry.js +2 -2
- package/dist/esm/post-popover.entry.js +3 -3
- package/dist/esm/post-popovercontainer.entry.js +3 -3
- package/dist/esm/post-progressbar.entry.js +1 -1
- package/dist/esm/post-rating.entry.js +2 -2
- package/dist/esm/post-side-navigation-trigger.entry.js +2 -2
- package/dist/esm/post-side-navigation.entry.js +2 -2
- package/dist/esm/post-stepper-item.entry.js +2 -2
- package/dist/esm/post-stepper.entry.js +2 -2
- package/dist/esm/post-tab-item.entry.js +2 -2
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/post-tabs.entry.js +4 -4
- package/dist/esm/post-togglebutton.entry.js +2 -2
- package/dist/esm/post-tooltip-trigger.entry.js +2 -2
- package/dist/esm/post-tooltip.entry.js +2 -2
- package/dist/esm/swisspost-internet-footer.entry.js +1 -1
- package/dist/esm/swisspost-internet-header.entry.js +2 -2
- package/dist/esm/swisspost-internet-header.js +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{package-ClQfdhMK.js → package-BEOiFUNg.js} +1 -1
- package/dist/esm-es5/package-YQBh4peU.js +1 -0
- package/dist/esm-es5/post-accordion_4.entry.js +1 -1
- package/dist/esm-es5/post-autocomplete.entry.js +1 -1
- package/dist/esm-es5/post-avatar.entry.js +1 -1
- package/dist/esm-es5/post-back-to-top.entry.js +1 -1
- package/dist/esm-es5/post-banner.entry.js +1 -1
- package/dist/esm-es5/post-breadcrumb-item.entry.js +1 -1
- package/dist/esm-es5/post-breadcrumbs.entry.js +1 -1
- package/dist/esm-es5/post-closebutton.entry.js +1 -1
- package/dist/esm-es5/post-date-picker.entry.js +1 -1
- package/dist/esm-es5/post-footer.entry.js +1 -1
- package/dist/esm-es5/post-header.entry.js +1 -1
- package/dist/esm-es5/post-icon.entry.js +1 -1
- package/dist/esm-es5/post-language-menu-item.entry.js +1 -1
- package/dist/esm-es5/post-language-menu.entry.js +1 -1
- package/dist/esm-es5/post-linkarea.entry.js +1 -1
- package/dist/esm-es5/post-listbox-option.entry.js +1 -1
- package/dist/esm-es5/post-listbox.entry.js +1 -1
- package/dist/esm-es5/post-logo.entry.js +1 -1
- package/dist/esm-es5/post-mainnavigation.entry.js +1 -1
- package/dist/esm-es5/post-megadropdown-trigger.entry.js +1 -1
- package/dist/esm-es5/post-megadropdown.entry.js +1 -1
- package/dist/esm-es5/post-menu-item.entry.js +1 -1
- package/dist/esm-es5/post-menu_2.entry.js +1 -1
- package/dist/esm-es5/post-number-input.entry.js +1 -1
- package/dist/esm-es5/post-pagination.entry.js +1 -1
- package/dist/esm-es5/post-popover-trigger.entry.js +1 -1
- package/dist/esm-es5/post-popover.entry.js +1 -1
- package/dist/esm-es5/post-popovercontainer.entry.js +1 -1
- package/dist/esm-es5/post-progressbar.entry.js +1 -1
- package/dist/esm-es5/post-rating.entry.js +1 -1
- package/dist/esm-es5/post-side-navigation-trigger.entry.js +1 -1
- package/dist/esm-es5/post-side-navigation.entry.js +1 -1
- package/dist/esm-es5/post-stepper-item.entry.js +1 -1
- package/dist/esm-es5/post-stepper.entry.js +1 -1
- package/dist/esm-es5/post-tab-item.entry.js +1 -1
- package/dist/esm-es5/post-tab-panel.entry.js +1 -1
- package/dist/esm-es5/post-tabs.entry.js +1 -1
- package/dist/esm-es5/post-togglebutton.entry.js +1 -1
- package/dist/esm-es5/post-tooltip-trigger.entry.js +1 -1
- package/dist/esm-es5/post-tooltip.entry.js +1 -1
- package/dist/esm-es5/swisspost-internet-footer.entry.js +1 -1
- package/dist/esm-es5/swisspost-internet-header.entry.js +1 -1
- package/dist/esm-es5/swisspost-internet-header.js +1 -1
- package/dist/swisspost-internet-header/index.esm.js +1 -1
- package/dist/swisspost-internet-header/{p-a5705a24.entry.js → p-0018572d.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-806b3bb9.entry.js → p-0432ea2e.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-6b19deb1.system.entry.js → p-04cf59e4.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-e9ae044e.entry.js → p-04d92bd1.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-f606f337.system.entry.js → p-0bffd1b3.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-97eaecab.entry.js → p-0cfd71fd.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-157333c4.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-fe6a6a22.entry.js → p-16f9605f.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-4d49c5ef.system.entry.js → p-17257472.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-fcf9631e.entry.js → p-1aaa2b5b.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-45d5a353.entry.js → p-1b3d12fe.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-1ea8aa7b.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-217899fe.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-2992eede.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-779e1686.entry.js → p-2bd9d12d.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-2d7fbb16.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-4107bc25.system.entry.js → p-2f9015c7.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-f986d587.entry.js → p-2fa843b1.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-23fa3342.entry.js → p-30be319e.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-b5665fc8.system.entry.js → p-311b1a06.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-cd2583f5.entry.js → p-367bb89f.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-fec8e79e.system.entry.js → p-37a651ba.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-67889b8a.system.entry.js → p-388ff4b0.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-dc287805.system.entry.js → p-3a69d97a.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-d4f8cba4.entry.js → p-3c55978f.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-1386d1d4.system.entry.js → p-4ade4bc8.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-ca000634.system.entry.js → p-4e8fbe60.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-0bf25ebc.system.entry.js → p-4ee32cba.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-ea8c458a.entry.js → p-50cd7954.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-aa4ed181.entry.js → p-53ab8bd7.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-d2fa80e5.entry.js → p-5507b066.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-6427c6b0.system.entry.js → p-658cdc8b.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-664cacb4.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-ad77e312.entry.js → p-6902ba81.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-ef183dab.entry.js → p-693be85f.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-6e338cb9.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-ec3c17b7.system.entry.js → p-8035438a.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-9d0b4493.entry.js → p-80860b2a.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-d42d1570.entry.js → p-80c03198.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-18a84bc1.system.entry.js → p-82316b5a.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-faca91f3.system.entry.js → p-8429a0f8.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-72187f34.system.entry.js → p-8499b019.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-f074310f.entry.js → p-8630a05f.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-786e11c5.entry.js → p-8a3118d3.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-5daa12df.entry.js → p-8e1f9fe7.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-c16adcb7.entry.js → p-946e0d66.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-9c5c32af.system.entry.js → p-94b12111.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-a1b94999.entry.js → p-980d6e7d.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-994e894b.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-e655c88c.system.entry.js → p-9b476cbf.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-68dcd52c.system.entry.js → p-9d69f71c.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-9da73a63.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-CDL0cxX6.system.js → p-Bz5HDsjW.system.js} +1 -1
- package/dist/swisspost-internet-header/{p-tBnwOTPV.system.js → p-C-jY5kgj.system.js} +1 -1
- package/dist/swisspost-internet-header/{p-BEtiMUfS.system.js → p-DaXn118n.system.js} +1 -1
- package/dist/swisspost-internet-header/{p-CNZqHwmo.js → p-EbHv-NGg.js} +1 -1
- package/dist/swisspost-internet-header/p-R5BnOD0U.system.js +1 -1
- package/dist/swisspost-internet-header/p-YQBh4peU.js +1 -0
- package/dist/swisspost-internet-header/{p-4f70afb5.system.entry.js → p-a017f91d.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-2a8e1e33.entry.js → p-a0a9f632.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-da88d37e.system.entry.js → p-a4a7d445.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-ad91f6c0.system.entry.js → p-a8d713f0.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-2d1355fa.system.entry.js → p-aebd16d2.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-10bdbca2.entry.js → p-b97832aa.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-d2599e7b.entry.js → p-bb71e55f.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-d558b697.entry.js → p-c98897dc.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-cc32910f.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-bebf0896.entry.js → p-ce4e20c6.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-ce5265e7.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-5329e0b0.system.entry.js → p-d121eed9.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-77199d61.system.entry.js → p-d230f557.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-64428c96.system.entry.js → p-d3e5d8ab.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-15820529.system.entry.js → p-d424deaf.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-e25b4f0b.entry.js → p-d6521b69.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-9776463e.entry.js → p-d763cf81.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-d8c35ad7.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-73d21f06.system.entry.js → p-dfcbf2ae.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-1b9a5275.system.entry.js → p-e0cebd00.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-e6e3e2a1.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-b94bcb65.system.entry.js → p-e83fb5f9.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-bff2014b.entry.js → p-eb2210a4.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-fc6ef72b.system.entry.js → p-ec5c1d1a.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-dfbe1d02.entry.js → p-f18ed6ce.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-cccfd211.entry.js → p-f33c08e6.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-d604cf73.system.entry.js → p-f4ee9401.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-f7b1f331.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-1c40acd2.entry.js → p-f89053da.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-7f0d52e1.entry.js → p-fa3bf2b6.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-c6e57a0c.system.entry.js → p-fb22f9cc.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-20a0a7e7.system.entry.js → p-fbb8f147.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/swisspost-internet-header.esm.js +1 -1
- package/package.json +3 -3
- package/dist/esm-es5/package-jK9tFtoG.js +0 -1
- package/dist/swisspost-internet-header/p-01f39bb3.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-05cab026.entry.js +0 -1
- package/dist/swisspost-internet-header/p-200dc938.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-3028df9f.entry.js +0 -1
- package/dist/swisspost-internet-header/p-45af06c6.entry.js +0 -1
- package/dist/swisspost-internet-header/p-50d3eb3c.entry.js +0 -1
- package/dist/swisspost-internet-header/p-520d3f06.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-5ae377df.entry.js +0 -1
- package/dist/swisspost-internet-header/p-63b15be9.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-7cdf89dc.entry.js +0 -1
- package/dist/swisspost-internet-header/p-8bd09f9e.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-8f06d58d.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-99c19dd2.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-ba63e3e0.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-jK9tFtoG.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-h3opCZqH.js";import{v as version}from"./package-
|
|
1
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-h3opCZqH.js";import{v as version}from"./package-YQBh4peU.js";import{n as nanoid}from"./nanoid-8LXe8Zt_.js";import{R as Required}from"./required-tHxh_hWW.js";import{T as Type}from"./type-Daxpt5v6.js";import"./create-validator-decorator--a-qkYfP.js";var postTabPanelCss=function(){return":host{display:none}"};var __decorate=undefined&&undefined.__decorate||function(e,t,n,a){var o=arguments.length,r=o<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,n):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(e,t,n,a);else for(var i=e.length-1;i>=0;i--)if(s=e[i])r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r;return o>3&&r&&Object.defineProperty(t,n,r),r};var PostTabPanel=function(){function e(e){registerInstance(this,e)}e.prototype.componentWillLoad=function(){this.panelId="panel-".concat(this.host.id||nanoid(6))};e.prototype.render=function(){return h(Host,{key:"07d93ddaa69253a956ed50cd9ecd6ed039fbc6e2","data-version":version,id:this.panelId,role:"tabpanel",slot:"panels",style:undefined},h("slot",{key:"d6887db4e0e4dc22f8f8fdf098d6068ef4bd1a91"}))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();__decorate([Required(),Type("string")],PostTabPanel.prototype,"for",void 0);PostTabPanel.style=postTabPanelCss();export{PostTabPanel as post_tab_panel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,i,r){function s(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function n(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r["throw"](t))}catch(t){o(t)}}function c(t){t.done?i(t.value):s(t.value).then(n,a)}c((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,s,o,n=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return n.next=a(0),n["throw"]=a(1),n["return"]=a(2),typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function a(t){return function(e){return c([t,e])}}function c(a){if(r)throw new TypeError("Generator is already executing.");while(n&&(n=0,a[0]&&(i=0)),i)try{if(r=1,s&&(o=a[0]&2?s["return"]:a[0]?s["throw"]||((o=s["return"])&&o.call(s),0):s.next)&&!(o=o.call(s,a[1])).done)return o;if(s=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;s=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(a[0]===6&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}if(o[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];s=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-h3opCZqH.js";import{v as version}from"./package-jK9tFtoG.js";import{c as componentOnReady}from"./component-on-ready-lpWRZjJp.js";import{f as fade}from"./fade-DsgPYmAa.js";import{O as OneOf}from"./one-of-w2eXPAzD.js";import{T as Type}from"./type-Daxpt5v6.js";import"./utils-CoDiS_Ik.js";import"./create-validator-decorator--a-qkYfP.js";var postTabsCss=function(){return':host{display:block}:host .tabs-wrapper{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .tabs-wrapper button.scroll-btn{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:button;-moz-appearance:button;appearance:button;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:background-color 100ms,border-color 100ms,color 100ms;transition:background-color 100ms,border-color 100ms,color 100ms;cursor:pointer}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn{background-color:ButtonFace !important}:host .tabs-wrapper button.scroll-btn:hover{background-color:Highlight !important}}:host .tabs-wrapper button.scroll-btn post-icon{color:currentColor}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn post-icon{color:Highlight}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:hover post-icon{color:canvas}}:host .tabs-wrapper button.scroll-btn[hidden]{display:none}:host .tabs-wrapper button.scroll-btn{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;outline-offset:calc(var(--post-device-spacing-padding-28) + -1*var(--post-device-border-width-default)) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus){-webkit-transition:none;transition:none}:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus):hover{color:HighlightText;border-color:HighlightText}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;outline-offset:calc(var(--post-device-spacing-padding-28) + -1*var(--post-device-border-width-default)) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus){-webkit-transition:none;transition:none}:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus):hover{color:HighlightText;border-color:HighlightText}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}:host .tabs-wrapper .tabs{overflow-x:hidden;background-color:rgba(0,0,0,0) !important;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:end;align-items:end;overscroll-behavior-x:contain;white-space:nowrap;margin-block:0;-webkit-padding-start:0;padding-inline-start:0;list-style:none}:host(.page-tabs){overflow:visible !important}:host(.page-tabs) .tabs-wrapper{margin-inline:calc(-1*(var(--post-container-offset)))}:host(.page-tabs) .tabs-wrapper button.scroll-btn{color:var(--post-scheme-color-interactive-primary-enabled-fg5);background-color:var(--post-scheme-color-interactive-primary-enabled-bg5);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke);position:absolute;z-index:2;-webkit-box-shadow:var(--post-device-elevation-200);box-shadow:var(--post-device-elevation-200);border-radius:var(--post-device-border-radius-2)}:host(.page-tabs) .tabs-wrapper button.scroll-btn:hover{border-color:var(--post-scheme-color-interactive-primary-hover-stroke) !important;color:var(--post-scheme-color-interactive-primary-hover-fg4);background-color:var(--post-scheme-color-interactive-primary-hover-bg8)}:host(.page-tabs) .tabs-wrapper button.scroll-btn.scroll-btn-left{inset-inline-start:0;-webkit-border-start:none;border-inline-start:none;border-radius:0 var(--post-device-border-radius-2) var(--post-device-border-radius-2) 0}:host(.page-tabs) .tabs-wrapper button.scroll-btn.scroll-btn-right{inset-inline-end:0;-webkit-border-end:none;border-inline-end:none;border-radius:var(--post-device-border-radius-2) 0 0 var(--post-device-border-radius-2)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(.page-tabs) .tabs-wrapper button.scroll-btn.scroll-btn{background-color:Highlight;color:HighlightText}}:host(.page-tabs) .tabs-wrapper::after{content:"";position:absolute;inset-block-end:0;inset-inline-start:0;width:100%;height:var(--post-device-border-width-default);background-color:var(--post-palette-color-nested-tabs-page-stroke)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(.page-tabs) .tabs-wrapper::after{background-color:LinkText}}:host(.page-tabs) .tabs-wrapper .tabs{padding-inline:calc(var(--post-container-offset));gap:var(--post-device-spacing-gap-inline-5);scrollbar-width:none}:host(.page-tabs) .tabs-wrapper .tabs::-webkit-scrollbar{display:none}:host(.page-tabs:not([size=small])) button.scroll-btn{top:var(--post-device-spacing-padding-block-35)}:host(.page-tabs[size=small]) button.scroll-btn{top:var(--post-device-spacing-padding-block-8)}:host(.content-tabs) .tabs-wrapper button.scroll-btn{-ms-flex-negative:0;flex-shrink:0;color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg)}:host(.content-tabs) .tabs-wrapper button.scroll-btn:hover{border-color:var(--post-scheme-color-interactive-primary-hover-stroke) !important;color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(.content-tabs) .tabs-wrapper button.scroll-btn:hover{color:HighlightText}}:host(.page-tabs:not([size=small])) .tabs-wrapper button.scroll-btn{height:var(--post-device-sizing-interactive-button-height-10);width:var(--post-device-sizing-interactive-button-width-1)}:host(.page-tabs:not([size=small])) .tabs-wrapper button.scroll-btn.scroll-btn-left{padding-inline:var(--post-device-spacing-padding-38) var(--post-device-spacing-padding-39)}:host(.page-tabs:not([size=small])) .tabs-wrapper button.scroll-btn.scroll-btn-right{padding-inline:var(--post-device-spacing-padding-39) var(--post-device-spacing-padding-38)}:host([size=small]) .tabs-wrapper button.scroll-btn{height:var(--post-device-sizing-interactive-button-size-1);width:var(--post-device-sizing-interactive-button-size-1)}:host([size=small]) .tabs-wrapper button.scroll-btn.scroll-btn-left{padding-inline:var(--post-device-spacing-padding-41) var(--post-device-spacing-padding-42)}:host([size=small]) .tabs-wrapper button.scroll-btn.scroll-btn-right{padding-inline:var(--post-device-spacing-padding-42) var(--post-device-spacing-padding-41)}:host([size=small]) .tabs-wrapper button.scroll-btn post-icon{height:var(--post-device-sizing-interactive-icon-size4);width:var(--post-device-sizing-interactive-icon-size4)}'};var __decorate=undefined&&undefined.__decorate||function(t,e,i,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,n;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)if(n=t[a])o=(s<3?n(o):s>3?n(e,i,o):n(e,i))||o;return s>3&&o&&Object.defineProperty(e,i,o),o};var PostTabs=function(){function t(t){var e=this;registerInstance(this,t);this.postChange=createEvent(this,"postChange");this.showing=null;this.hiding=null;this.isLoaded=false;this.isPagesVariant=false;this.showLeftScrollButton=false;this.showRightScrollButton=false;this.textPrevTabItems="Previous tab items";this.textNextTabItems="Next tab items";this.size="large";this.updateScrollButtons=function(){if(!e.tabsContainer)return;var t=getComputedStyle(e.tabsContainer);var i=Number.parseFloat(t.paddingInlineStart)||0;var r=Number.parseFloat(t.paddingInlineEnd)||0;var s=e.tabsContainer.clientWidth-i-r;var o=e.tabsContainer.scrollWidth-i-r;e.showLeftScrollButton=e.tabsContainer.scrollLeft>0;e.showRightScrollButton=e.tabsContainer.scrollLeft+s<o}}Object.defineProperty(t.prototype,"tabs",{get:function(){var t=this;return Array.from(this.host.querySelectorAll("post-tab-item")).filter((function(e){return e.closest("post-tabs")===t.host}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"panels",{get:function(){var t=this;return Array.from(this.host.querySelectorAll("post-tab-panel")).filter((function(e){return e.closest("post-tabs")===t.host}))},enumerable:false,configurable:true});t.prototype.validateLabel=function(){if(this.isPagesVariant&&!this.label){console.error("[".concat(this.host.localName,'] Property "label" is required in Pages variant. Received: ').concat(JSON.stringify(this.label),"."),this.host)}};t.prototype.componentWillRender=function(){this.detectVariant()};t.prototype.componentDidLoad=function(){var t;this.leftScrollButton.ariaControlsElements=[this.tabsContainer];this.rightScrollButton.ariaControlsElements=[this.tabsContainer];this.moveMisplacedTabs();this.moveMisplacedPanels();this.enableTabs();this.handleScrollButtons();this.setupContentObserver();this.setupResizeObserver();this.validateLabel();if(this.isPagesVariant){var e=this.findActivePagesTab();if(e){this.activateTab(e);this.scrollTabIntoView(e)}}else{var i=this.activeTab||((t=this.tabs[0])===null||t===void 0?void 0:t.name);if(i){void this.show(i);var e=this.tabs.find((function(t){return t.name===i}));if(e)this.scrollTabIntoView(e)}}this.isLoaded=true};t.prototype.disconnectedCallback=function(){var t,e,i;if(this.showing){this.showing.cancel();this.showing=null}if(this.hiding){this.hiding.cancel();this.hiding=null}if(this.contentObserver){(t=this.contentObserver)===null||t===void 0?void 0:t.disconnect()}(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();(i=this.tabsContainer)===null||i===void 0?void 0:i.removeEventListener("scroll",this.updateScrollButtons)};t.prototype.setupContentObserver=function(){var t;var e={childList:true,subtree:true,attributes:true,attributeFilter:["data-pages-variant","aria-current"]};this.contentObserver=new MutationObserver(this.handleContentChange.bind(this));(t=this.contentObserver)===null||t===void 0?void 0:t.observe(this.host,e)};t.prototype.setupResizeObserver=function(){this.resizeObserver=new ResizeObserver(this.updateScrollButtons);this.resizeObserver.observe(this.tabsContainer)};t.prototype.handleContentChange=function(t){var e=this.shouldRedetectVariant(t);var i=this.hasAriaCurrentChanged(t);if(i&&this.isPagesVariant){this.updateActivePagesTab()}if(e){this.handleVariantChange()}this.updateScrollButtons()};t.prototype.shouldRedetectVariant=function(t){return t.some((function(t){if(t.type==="childList"){return t.addedNodes.length>0||t.removedNodes.length>0}if(t.type==="attributes"&&t.attributeName==="data-pages-variant"){return true}return false}))};t.prototype.hasAriaCurrentChanged=function(t){return t.some((function(t){return t.type==="attributes"&&t.attributeName==="aria-current"}))};t.prototype.updateActivePagesTab=function(){var t=this.findActivePagesTab();if(t&&t!==this.currentActiveTab){this.activateTab(t);this.scrollTabIntoView(t,"smooth")}};t.prototype.handleVariantChange=function(){var t=this.isPagesVariant;this.detectVariant();if(t!==this.isPagesVariant){this.enableTabs();this.initializeActiveTab()}};t.prototype.initializeActiveTab=function(){var t;if(this.isPagesVariant){var e=this.findActivePagesTab();if(e){this.activateTab(e);this.scrollTabIntoView(e)}}else{var i=this.activeTab||((t=this.tabs[0])===null||t===void 0?void 0:t.name);if(i){void this.show(i)}}};t.prototype.detectVariant=function(){var t=this.tabs.some((function(t){var e=t.querySelector("a")!==null;var i=t.dataset.pagesVariant==="true";return e||i}));var e=this.panels.length>0;if(t&&e){throw new Error("PostTabs: Mixed mode detected. Cannot use both Page Tabs (anchor elements) and Content Tabs (post-tab-panel elements) variants at the same time.")}this.isPagesVariant=t;this.host.classList.remove("page-tabs","content-tabs");if(this.isPagesVariant){this.host.classList.add("page-tabs")}else{this.host.classList.add("content-tabs")}};t.prototype.findActivePagesTab=function(){return this.tabs.find((function(t){var e=t.querySelector('a[aria-current="page"]');return e!==null}))||null};t.prototype.show=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;var s;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);if(t===((s=this.currentActiveTab)===null||s===void 0?void 0:s.name)){return[2]}e=this.currentActiveTab;i=this.host.querySelector('post-tab-item[name="'.concat(t,'"]'));if(!i)return[2];this.activateTab(i);this.scrollTabIntoView(i,"smooth");if(this.showing){this.showing.finish();this.showing=null}if(e&&!this.showing&&!this.hiding)this.hidePanel(e.name);return[4,this.awaitAnimation(this.hiding)];case 1:if(o.sent())return[2];this.showSelectedPanel();return[4,this.awaitAnimation(this.showing)];case 2:if(o.sent())return[2];if(this.isLoaded&&this.currentActiveTab)this.postChange.emit(this.currentActiveTab.name);return[3,4];case 3:r=o.sent();if(this.isAbortError(r))return[2];throw r;case 4:return[2]}}))}))};t.prototype.awaitAnimation=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:if(!t)return[2,false];i.label=1;case 1:i.trys.push([1,3,,4]);return[4,t.finished];case 2:i.sent();return[2,false];case 3:e=i.sent();if(this.isAbortError(e))return[2,true];throw e;case 4:return[2]}}))}))};t.prototype.isAbortError=function(t){return(t instanceof DOMException||t instanceof Error)&&t.name==="AbortError"};t.prototype.moveMisplacedTabs=function(){if(!this.tabs)return;this.tabs.forEach((function(t){if(t.getAttribute("slot")){t.removeAttribute("slot")}}))};t.prototype.moveMisplacedPanels=function(){if(!this.panels)return;this.panels.forEach((function(t){if(t.getAttribute("slot")!=="panels"){t.setAttribute("slot","panels")}}))};t.prototype.enableTabs=function(){var t=this;var e;if(!this.tabs)return;this.tabs.forEach((function(e){return __awaiter(t,void 0,void 0,(function(){var t;var i=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,componentOnReady(e)];case 1:r.sent();if(this.isPagesVariant){return[2]}if(e.getAttribute("aria-controls"))return[2];t=this.getPanel(e.name);if(t){e.setAttribute("aria-controls",t.id);t.setAttribute("aria-labelledby",e.id)}e.addEventListener("click",(function(){void i.show(e.name)}));e.addEventListener("keydown",(function(t){if(t.key==="Enter"||t.key===" "){t.preventDefault();void i.show(e.name)}if(t.key!=="Home"&&t.key!=="End")return;t.preventDefault();var r=i.tabs.filter((function(t){return!t.hasAttribute("disabled")}));if(r.length===0)return;var s=t.key==="Home"?r[0]:r.at(-1);if(s){s===null||s===void 0?void 0:s.focus();void i.show(s.name)}}));e.addEventListener("keydown",(function(t){if(t.key==="ArrowRight"||t.key==="ArrowLeft")i.navigateTabs(e,t.key)}));return[2]}}))}))}));if(this.currentActiveTab&&!this.currentActiveTab.isConnected){void this.show((e=this.tabs[0])===null||e===void 0?void 0:e.name)}};t.prototype.activateTab=function(t){if(this.currentActiveTab){if(!this.isPagesVariant){this.currentActiveTab.setAttribute("aria-selected","false");this.currentActiveTab.setAttribute("tabindex","-1")}}if(!this.isPagesVariant){t.setAttribute("aria-selected","true");t.setAttribute("tabindex","0")}this.currentActiveTab=t};t.prototype.hidePanel=function(t){var e=this;var i=this.getPanel(t);if(!i)return;this.hiding=fade(i,"out");this.hiding.onfinish=function(){i.style.display="none";e.hiding=null}};t.prototype.showSelectedPanel=function(){var t=this;if(!this.currentActiveTab)return;var e=this.getPanel(this.currentActiveTab.name);if(!e)return;e.style.display="block";if(!this.isLoaded)return;this.showing=fade(e,"in");this.showing.onfinish=function(){t.showing=null}};t.prototype.getPanel=function(t){return this.host.querySelector("post-tab-panel[for=".concat(t,"]"))};t.prototype.navigateTabs=function(t,e){var i=Array.from(this.tabs).indexOf(t);var r;if(e==="ArrowRight"){r=this.tabs[i+1]||this.tabs[0]}else{r=this.tabs[i-1]||this.tabs.at(-1)}if(!r)return;r.focus();void this.show(r.name)};t.prototype.scrollTabs=function(t){var e=t==="prev"?-1:1;var i=getComputedStyle(this.tabsContainer);var r=Number.parseFloat(i.paddingInlineStart)||0;var s=Number.parseFloat(i.paddingInlineEnd)||0;var o=this.tabsContainer.clientWidth-r-s;this.tabsContainer.scrollBy({left:e*o,behavior:"smooth"})};t.prototype.scrollTabIntoView=function(t,e){if(e===void 0){e="instant"}var i=this.tabsContainer;var r=getComputedStyle(i);var s=Number.parseFloat(r.paddingInlineStart)||0;var o=Number.parseFloat(r.paddingInlineEnd)||0;var n=t.offsetLeft;var a=n+t.offsetWidth;var c=i.scrollLeft+s;var l=c+i.clientWidth-s-o;if(n<c){i.scrollTo({left:n-s,behavior:e})}else if(a>l){i.scrollTo({left:a-i.clientWidth+o,behavior:e})}};t.prototype.handleScrollButtons=function(){this.updateScrollButtons();this.tabsContainer.addEventListener("scroll",this.updateScrollButtons)};t.prototype.render=function(){var t=this;var e=this.isPagesVariant?"nav":"div";var i=undefined;return h(Host,{key:"685ce8af8c27a1a7c3c23c6e5707f0f7e5360125","data-version":version,style:i},h("div",{key:"ddec1765d392d963a9741c83fa54d6a0426c9823",class:"tabs-wrapper",part:"post-tabs"},h("button",{key:"5b7dc5ad5a64d99aa60ab578fc17b5acc0434fa4",ref:function(e){return t.leftScrollButton=e},class:"scroll-btn scroll-btn-left",type:"button","aria-label":this.textPrevTabItems,tabindex:this.showLeftScrollButton?0:-1,hidden:!this.showLeftScrollButton,onClick:function(){return t.scrollTabs("prev")}},h("post-icon",{key:"f3f9ffb11294eb35a77cf2dd59f13e80475c5c16",name:"chevronleft"})),h(e,{key:"1fadf185970129cbc1d7173b9060ceb3fc433e28",ref:function(e){return t.tabsContainer=e},class:"tabs",role:this.isPagesVariant?undefined:"tablist","aria-label":this.isPagesVariant?this.label:undefined},h("slot",{key:"398729181e4d8927cafc7b61fb9a048bbcbfd3d9",onSlotchange:function(){t.moveMisplacedTabs();t.enableTabs()}})),h("button",{key:"d188e222a038215cd13d4f1e60f5b0fbba2a5c7e",ref:function(e){return t.rightScrollButton=e},class:"scroll-btn scroll-btn-right",type:"button","aria-label":this.textNextTabItems,tabindex:this.showRightScrollButton?0:-1,hidden:!this.showRightScrollButton,onClick:function(){return t.scrollTabs("next")}},h("post-icon",{key:"9ab04bf862f7fe65383027102d81be5f82cabe6d",name:"chevronright"}))),!this.isPagesVariant&&h("div",{key:"28e9af0092a31cece1cb7d47f9e32dcfed92517d",class:"tab-content",part:"post-tabs-content"},h("slot",{key:"2ba72280f745ef1d1d36703a5675de1ac7fb1bea",name:"panels",onSlotchange:function(){return t.moveMisplacedPanels()}})))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{label:[{validateLabel:0}]}},enumerable:false,configurable:true});return t}();__decorate([OneOf(["small","large"])],PostTabs.prototype,"size",void 0);__decorate([Type("string")],PostTabs.prototype,"label",void 0);PostTabs.style=postTabsCss();export{PostTabs as post_tabs};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,i,r){function s(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function n(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r["throw"](t))}catch(t){o(t)}}function c(t){t.done?i(t.value):s(t.value).then(n,a)}c((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,s,o,n=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return n.next=a(0),n["throw"]=a(1),n["return"]=a(2),typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function a(t){return function(e){return c([t,e])}}function c(a){if(r)throw new TypeError("Generator is already executing.");while(n&&(n=0,a[0]&&(i=0)),i)try{if(r=1,s&&(o=a[0]&2?s["return"]:a[0]?s["throw"]||((o=s["return"])&&o.call(s),0):s.next)&&!(o=o.call(s,a[1])).done)return o;if(s=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;s=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(a[0]===6&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}if(o[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];s=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-h3opCZqH.js";import{v as version}from"./package-YQBh4peU.js";import{c as componentOnReady}from"./component-on-ready-lpWRZjJp.js";import{f as fade}from"./fade-DsgPYmAa.js";import{O as OneOf}from"./one-of-w2eXPAzD.js";import{T as Type}from"./type-Daxpt5v6.js";import"./utils-CoDiS_Ik.js";import"./create-validator-decorator--a-qkYfP.js";var postTabsCss=function(){return':host{display:block}:host .tabs-wrapper{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .tabs-wrapper button.scroll-btn{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:button;-moz-appearance:button;appearance:button;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:background-color 100ms,border-color 100ms,color 100ms;transition:background-color 100ms,border-color 100ms,color 100ms;cursor:pointer}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn{background-color:ButtonFace !important}:host .tabs-wrapper button.scroll-btn:hover{background-color:Highlight !important}}:host .tabs-wrapper button.scroll-btn post-icon{color:currentColor}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn post-icon{color:Highlight}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:hover post-icon{color:canvas}}:host .tabs-wrapper button.scroll-btn[hidden]{display:none}:host .tabs-wrapper button.scroll-btn{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;outline-offset:calc(var(--post-device-spacing-padding-28) + -1*var(--post-device-border-width-default)) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus){-webkit-transition:none;transition:none}:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus):hover{color:HighlightText;border-color:HighlightText}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;outline-offset:calc(var(--post-device-spacing-padding-28) + -1*var(--post-device-border-width-default)) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus){-webkit-transition:none;transition:none}:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus):hover{color:HighlightText;border-color:HighlightText}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .tabs-wrapper button.scroll-btn:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}:host .tabs-wrapper .tabs{overflow-x:hidden;background-color:rgba(0,0,0,0) !important;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:end;align-items:end;overscroll-behavior-x:contain;white-space:nowrap;margin-block:0;-webkit-padding-start:0;padding-inline-start:0;list-style:none}:host(.page-tabs){overflow:visible !important}:host(.page-tabs) .tabs-wrapper{margin-inline:calc(-1*(var(--post-container-offset)))}:host(.page-tabs) .tabs-wrapper button.scroll-btn{color:var(--post-scheme-color-interactive-primary-enabled-fg5);background-color:var(--post-scheme-color-interactive-primary-enabled-bg5);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke);position:absolute;z-index:2;-webkit-box-shadow:var(--post-device-elevation-200);box-shadow:var(--post-device-elevation-200);border-radius:var(--post-device-border-radius-2)}:host(.page-tabs) .tabs-wrapper button.scroll-btn:hover{border-color:var(--post-scheme-color-interactive-primary-hover-stroke) !important;color:var(--post-scheme-color-interactive-primary-hover-fg4);background-color:var(--post-scheme-color-interactive-primary-hover-bg8)}:host(.page-tabs) .tabs-wrapper button.scroll-btn.scroll-btn-left{inset-inline-start:0;-webkit-border-start:none;border-inline-start:none;border-radius:0 var(--post-device-border-radius-2) var(--post-device-border-radius-2) 0}:host(.page-tabs) .tabs-wrapper button.scroll-btn.scroll-btn-right{inset-inline-end:0;-webkit-border-end:none;border-inline-end:none;border-radius:var(--post-device-border-radius-2) 0 0 var(--post-device-border-radius-2)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(.page-tabs) .tabs-wrapper button.scroll-btn.scroll-btn{background-color:Highlight;color:HighlightText}}:host(.page-tabs) .tabs-wrapper::after{content:"";position:absolute;inset-block-end:0;inset-inline-start:0;width:100%;height:var(--post-device-border-width-default);background-color:var(--post-palette-color-nested-tabs-page-stroke)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(.page-tabs) .tabs-wrapper::after{background-color:LinkText}}:host(.page-tabs) .tabs-wrapper .tabs{padding-inline:calc(var(--post-container-offset));gap:var(--post-device-spacing-gap-inline-5);scrollbar-width:none}:host(.page-tabs) .tabs-wrapper .tabs::-webkit-scrollbar{display:none}:host(.page-tabs:not([size=small])) button.scroll-btn{top:var(--post-device-spacing-padding-block-35)}:host(.page-tabs[size=small]) button.scroll-btn{top:var(--post-device-spacing-padding-block-8)}:host(.content-tabs) .tabs-wrapper button.scroll-btn{-ms-flex-negative:0;flex-shrink:0;color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg)}:host(.content-tabs) .tabs-wrapper button.scroll-btn:hover{border-color:var(--post-scheme-color-interactive-primary-hover-stroke) !important;color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(.content-tabs) .tabs-wrapper button.scroll-btn:hover{color:HighlightText}}:host(post-tabs:not([size=small])) button.scroll-btn{height:var(--post-device-sizing-interactive-button-height-10);width:var(--post-device-sizing-interactive-button-width-1);border-radius:var(--post-device-border-radius-2)}:host(post-tabs:not([size=small])) button.scroll-btn post-icon{height:var(--post-device-sizing-interactive-icon-size5);width:var(--post-device-sizing-interactive-icon-size5)}:host(.page-tabs:not([size=small])) button.scroll-btn-left{padding-inline:var(--post-device-spacing-padding-38) var(--post-device-spacing-padding-39)}:host(.page-tabs:not([size=small])) button.scroll-btn-right{padding-inline:var(--post-device-spacing-padding-39) var(--post-device-spacing-padding-38)}:host([size=small]) button.scroll-btn{height:var(--post-device-sizing-interactive-button-size-1);width:var(--post-device-sizing-interactive-button-size-1);border-radius:var(--post-device-border-radius-2)}:host([size=small]) button.scroll-btn post-icon{height:var(--post-device-sizing-interactive-icon-size4);width:var(--post-device-sizing-interactive-icon-size4)}:host(.page-tabs[size=small]) button.scroll-btn-left{padding-inline:var(--post-device-spacing-padding-41) var(--post-device-spacing-padding-42)}:host(.page-tabs[size=small]) button.scroll-btn-right{padding-inline:var(--post-device-spacing-padding-42) var(--post-device-spacing-padding-41)}'};var __decorate=undefined&&undefined.__decorate||function(t,e,i,r){var s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,n;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)if(n=t[a])o=(s<3?n(o):s>3?n(e,i,o):n(e,i))||o;return s>3&&o&&Object.defineProperty(e,i,o),o};var PostTabs=function(){function t(t){var e=this;registerInstance(this,t);this.postChange=createEvent(this,"postChange");this.showing=null;this.hiding=null;this.isLoaded=false;this.isPagesVariant=false;this.showLeftScrollButton=false;this.showRightScrollButton=false;this.textPrevTabItems="Previous tab items";this.textNextTabItems="Next tab items";this.size="large";this.updateScrollButtons=function(){if(!e.tabsContainer)return;var t=getComputedStyle(e.tabsContainer);var i=Number.parseFloat(t.paddingInlineStart)||0;var r=Number.parseFloat(t.paddingInlineEnd)||0;var s=e.tabsContainer.clientWidth-i-r;var o=e.tabsContainer.scrollWidth-i-r;e.showLeftScrollButton=e.tabsContainer.scrollLeft>0;e.showRightScrollButton=e.tabsContainer.scrollLeft+s<o}}Object.defineProperty(t.prototype,"tabs",{get:function(){var t=this;return Array.from(this.host.querySelectorAll("post-tab-item")).filter((function(e){return e.closest("post-tabs")===t.host}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"panels",{get:function(){var t=this;return Array.from(this.host.querySelectorAll("post-tab-panel")).filter((function(e){return e.closest("post-tabs")===t.host}))},enumerable:false,configurable:true});t.prototype.validateLabel=function(){if(this.isPagesVariant&&!this.label){console.error("[".concat(this.host.localName,'] Property "label" is required in Pages variant. Received: ').concat(JSON.stringify(this.label),"."),this.host)}};t.prototype.componentWillRender=function(){this.detectVariant()};t.prototype.componentDidLoad=function(){var t;this.leftScrollButton.ariaControlsElements=[this.tabsContainer];this.rightScrollButton.ariaControlsElements=[this.tabsContainer];this.moveMisplacedTabs();this.moveMisplacedPanels();this.enableTabs();this.handleScrollButtons();this.setupContentObserver();this.setupResizeObserver();this.validateLabel();if(this.isPagesVariant){var e=this.findActivePagesTab();if(e){this.activateTab(e);this.scrollTabIntoView(e)}}else{var i=this.activeTab||((t=this.tabs[0])===null||t===void 0?void 0:t.name);if(i){void this.show(i);var e=this.tabs.find((function(t){return t.name===i}));if(e)this.scrollTabIntoView(e)}}this.isLoaded=true};t.prototype.disconnectedCallback=function(){var t,e,i;if(this.showing){this.showing.cancel();this.showing=null}if(this.hiding){this.hiding.cancel();this.hiding=null}if(this.contentObserver){(t=this.contentObserver)===null||t===void 0?void 0:t.disconnect()}(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();(i=this.tabsContainer)===null||i===void 0?void 0:i.removeEventListener("scroll",this.updateScrollButtons)};t.prototype.setupContentObserver=function(){var t;var e={childList:true,subtree:true,attributes:true,attributeFilter:["data-pages-variant","aria-current"]};this.contentObserver=new MutationObserver(this.handleContentChange.bind(this));(t=this.contentObserver)===null||t===void 0?void 0:t.observe(this.host,e)};t.prototype.setupResizeObserver=function(){this.resizeObserver=new ResizeObserver(this.updateScrollButtons);this.resizeObserver.observe(this.tabsContainer)};t.prototype.handleContentChange=function(t){var e=this.shouldRedetectVariant(t);var i=this.hasAriaCurrentChanged(t);if(i&&this.isPagesVariant){this.updateActivePagesTab()}if(e){this.handleVariantChange()}this.updateScrollButtons()};t.prototype.shouldRedetectVariant=function(t){return t.some((function(t){if(t.type==="childList"){return t.addedNodes.length>0||t.removedNodes.length>0}if(t.type==="attributes"&&t.attributeName==="data-pages-variant"){return true}return false}))};t.prototype.hasAriaCurrentChanged=function(t){return t.some((function(t){return t.type==="attributes"&&t.attributeName==="aria-current"}))};t.prototype.updateActivePagesTab=function(){var t=this.findActivePagesTab();if(t&&t!==this.currentActiveTab){this.activateTab(t);this.scrollTabIntoView(t,"smooth")}};t.prototype.handleVariantChange=function(){var t=this.isPagesVariant;this.detectVariant();if(t!==this.isPagesVariant){this.enableTabs();this.initializeActiveTab()}};t.prototype.initializeActiveTab=function(){var t;if(this.isPagesVariant){var e=this.findActivePagesTab();if(e){this.activateTab(e);this.scrollTabIntoView(e)}}else{var i=this.activeTab||((t=this.tabs[0])===null||t===void 0?void 0:t.name);if(i){void this.show(i)}}};t.prototype.detectVariant=function(){var t=this.tabs.some((function(t){var e=t.querySelector("a")!==null;var i=t.dataset.pagesVariant==="true";return e||i}));var e=this.panels.length>0;if(t&&e){throw new Error("PostTabs: Mixed mode detected. Cannot use both Page Tabs (anchor elements) and Content Tabs (post-tab-panel elements) variants at the same time.")}this.isPagesVariant=t;this.host.classList.remove("page-tabs","content-tabs");if(this.isPagesVariant){this.host.classList.add("page-tabs")}else{this.host.classList.add("content-tabs")}};t.prototype.findActivePagesTab=function(){return this.tabs.find((function(t){var e=t.querySelector('a[aria-current="page"]');return e!==null}))||null};t.prototype.show=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,r;var s;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);if(t===((s=this.currentActiveTab)===null||s===void 0?void 0:s.name)){return[2]}e=this.currentActiveTab;i=this.host.querySelector('post-tab-item[name="'.concat(t,'"]'));if(!i)return[2];this.activateTab(i);this.scrollTabIntoView(i,"smooth");if(this.showing){this.showing.finish();this.showing=null}if(e&&!this.showing&&!this.hiding)this.hidePanel(e.name);return[4,this.awaitAnimation(this.hiding)];case 1:if(o.sent())return[2];this.showSelectedPanel();return[4,this.awaitAnimation(this.showing)];case 2:if(o.sent())return[2];if(this.isLoaded&&this.currentActiveTab)this.postChange.emit(this.currentActiveTab.name);return[3,4];case 3:r=o.sent();if(this.isAbortError(r))return[2];throw r;case 4:return[2]}}))}))};t.prototype.awaitAnimation=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){switch(i.label){case 0:if(!t)return[2,false];i.label=1;case 1:i.trys.push([1,3,,4]);return[4,t.finished];case 2:i.sent();return[2,false];case 3:e=i.sent();if(this.isAbortError(e))return[2,true];throw e;case 4:return[2]}}))}))};t.prototype.isAbortError=function(t){return(t instanceof DOMException||t instanceof Error)&&t.name==="AbortError"};t.prototype.moveMisplacedTabs=function(){if(!this.tabs)return;this.tabs.forEach((function(t){if(t.getAttribute("slot")){t.removeAttribute("slot")}}))};t.prototype.moveMisplacedPanels=function(){if(!this.panels)return;this.panels.forEach((function(t){if(t.getAttribute("slot")!=="panels"){t.setAttribute("slot","panels")}}))};t.prototype.enableTabs=function(){var t=this;var e;if(!this.tabs)return;this.tabs.forEach((function(e){return __awaiter(t,void 0,void 0,(function(){var t;var i=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,componentOnReady(e)];case 1:r.sent();if(this.isPagesVariant){return[2]}if(e.getAttribute("aria-controls"))return[2];t=this.getPanel(e.name);if(t){e.setAttribute("aria-controls",t.id);t.setAttribute("aria-labelledby",e.id)}e.addEventListener("click",(function(){void i.show(e.name)}));e.addEventListener("keydown",(function(t){if(t.key==="Enter"||t.key===" "){t.preventDefault();void i.show(e.name)}if(t.key!=="Home"&&t.key!=="End")return;t.preventDefault();var r=i.tabs.filter((function(t){return!t.hasAttribute("disabled")}));if(r.length===0)return;var s=t.key==="Home"?r[0]:r.at(-1);if(s){s===null||s===void 0?void 0:s.focus();void i.show(s.name)}}));e.addEventListener("keydown",(function(t){if(t.key==="ArrowRight"||t.key==="ArrowLeft")i.navigateTabs(e,t.key)}));return[2]}}))}))}));if(this.currentActiveTab&&!this.currentActiveTab.isConnected){void this.show((e=this.tabs[0])===null||e===void 0?void 0:e.name)}};t.prototype.activateTab=function(t){if(this.currentActiveTab){if(!this.isPagesVariant){this.currentActiveTab.setAttribute("aria-selected","false");this.currentActiveTab.setAttribute("tabindex","-1")}}if(!this.isPagesVariant){t.setAttribute("aria-selected","true");t.setAttribute("tabindex","0")}this.currentActiveTab=t};t.prototype.hidePanel=function(t){var e=this;var i=this.getPanel(t);if(!i)return;this.hiding=fade(i,"out");this.hiding.onfinish=function(){i.style.display="none";e.hiding=null}};t.prototype.showSelectedPanel=function(){var t=this;if(!this.currentActiveTab)return;var e=this.getPanel(this.currentActiveTab.name);if(!e)return;e.style.display="block";if(!this.isLoaded)return;this.showing=fade(e,"in");this.showing.onfinish=function(){t.showing=null}};t.prototype.getPanel=function(t){return this.host.querySelector("post-tab-panel[for=".concat(t,"]"))};t.prototype.navigateTabs=function(t,e){var i=Array.from(this.tabs).indexOf(t);var r;if(e==="ArrowRight"){r=this.tabs[i+1]||this.tabs[0]}else{r=this.tabs[i-1]||this.tabs.at(-1)}if(!r)return;r.focus();void this.show(r.name)};t.prototype.scrollTabs=function(t){var e=t==="prev"?-1:1;var i=getComputedStyle(this.tabsContainer);var r=Number.parseFloat(i.paddingInlineStart)||0;var s=Number.parseFloat(i.paddingInlineEnd)||0;var o=this.tabsContainer.clientWidth-r-s;this.tabsContainer.scrollBy({left:e*o,behavior:"smooth"})};t.prototype.scrollTabIntoView=function(t,e){if(e===void 0){e="instant"}var i=this.tabsContainer;var r=getComputedStyle(i);var s=Number.parseFloat(r.paddingInlineStart)||0;var o=Number.parseFloat(r.paddingInlineEnd)||0;var n=t.offsetLeft;var a=n+t.offsetWidth;var c=i.scrollLeft+s;var l=c+i.clientWidth-s-o;if(n<c){i.scrollTo({left:n-s,behavior:e})}else if(a>l){i.scrollTo({left:a-i.clientWidth+o,behavior:e})}};t.prototype.handleScrollButtons=function(){this.updateScrollButtons();this.tabsContainer.addEventListener("scroll",this.updateScrollButtons)};t.prototype.render=function(){var t=this;var e=this.isPagesVariant?"nav":"div";var i=undefined;return h(Host,{key:"0520b7aba909495feef9358b2e572f767e42dce2","data-version":version,style:i},h("div",{key:"779d35686ab406d8b60b595aea6ca67eb5b7d82a",class:"tabs-wrapper",part:"post-tabs"},h("button",{key:"2be9734aa1389baf48901e1eafe759f887ed9490",ref:function(e){return t.leftScrollButton=e},class:"scroll-btn scroll-btn-left",type:"button","aria-label":this.textPrevTabItems,tabindex:this.showLeftScrollButton?0:-1,hidden:!this.showLeftScrollButton,onClick:function(){return t.scrollTabs("prev")}},h("post-icon",{key:"ca6b0acaef9179468737d3669acbc61dfb709657",name:"chevronleft"})),h(e,{key:"df8d1f5ca66b86baeb13123459059f1f399f5383",ref:function(e){return t.tabsContainer=e},class:"tabs",role:this.isPagesVariant?undefined:"tablist","aria-label":this.isPagesVariant?this.label:undefined},h("slot",{key:"e9c618d1f018381f37c0b46aea741abe797d7e37",onSlotchange:function(){t.moveMisplacedTabs();t.enableTabs()}})),h("button",{key:"79e0ad08c240f251e5805d71319d6ce32d843367",ref:function(e){return t.rightScrollButton=e},class:"scroll-btn scroll-btn-right",type:"button","aria-label":this.textNextTabItems,tabindex:this.showRightScrollButton?0:-1,hidden:!this.showRightScrollButton,onClick:function(){return t.scrollTabs("next")}},h("post-icon",{key:"491fc9c7746896d9a140fa6cbb97a432ff174ca3",name:"chevronright"}))),!this.isPagesVariant&&h("div",{key:"04839eb63e75923e733ec4eea84cd345ae480e70",class:"tab-content",part:"post-tabs-content"},h("slot",{key:"64483606952f79810e7a24105f5c9f822180b6ca",name:"panels",onSlotchange:function(){return t.moveMisplacedPanels()}})))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{label:[{validateLabel:0}]}},enumerable:false,configurable:true});return t}();__decorate([OneOf(["small","large"])],PostTabs.prototype,"size",void 0);__decorate([Type("string")],PostTabs.prototype,"label",void 0);PostTabs.style=postTabsCss();export{PostTabs as post_tabs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-h3opCZqH.js";import{v as version}from"./package-
|
|
1
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-h3opCZqH.js";import{v as version}from"./package-YQBh4peU.js";var postTogglebuttonCss=function(){return":host{cursor:pointer;outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(:focus-visible){outline-color:Highlight !important}}:host([aria-pressed=true]) ::slotted([data-showwhen=untoggled]){display:none}:host([aria-pressed=false]) ::slotted([data-showwhen=toggled]){display:none}"};var PostTogglebutton=function(){function t(t){var e=this;registerInstance(this,t);this.toggled=false;this.handleClick=function(){e.toggled=!e.toggled};this.handleKeydown=function(t){if(t.key==="Enter"||t.key===" "){t.preventDefault();e.host.click()}}}t.prototype.componentWillLoad=function(){var t=this;this.host.addEventListener("click",(function(){return t.handleClick()}),{capture:true});this.host.addEventListener("keydown",(function(e){return t.handleKeydown(e)}),{capture:true})};t.prototype.render=function(){return h(Host,{key:"6f61a07946f3e67bace0a883b73c424893c4043d","data-version":version,role:"button",tabindex:"0","aria-pressed":this.toggled.toString()},h("slot",{key:"fd9b93e45da499dbb790ad675f3db36e248c1960"}))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();PostTogglebutton.style=postTogglebuttonCss();export{PostTogglebutton as post_togglebutton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-h3opCZqH.js";import{v as version}from"./package-
|
|
1
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-h3opCZqH.js";import{v as version}from"./package-YQBh4peU.js";import{R as Required}from"./required-tHxh_hWW.js";import{T as Type}from"./type-Daxpt5v6.js";import"./create-validator-decorator--a-qkYfP.js";var postTooltipTriggerCss=function(){return"post-tooltip-trigger{vertical-align:top}:host{cursor:pointer}"};var __decorate=undefined&&undefined.__decorate||function(t,i,e,s){var o=arguments.length,n=o<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,e):s,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,i,e,s);else for(var a=t.length-1;a>=0;a--)if(r=t[a])n=(o<3?r(n):o>3?r(i,e,n):r(i,e))||n;return o>3&&n&&Object.defineProperty(i,e,n),n};var TRIGGER_EVENTS=["pointerenter","pointerleave","focusin","focusout"];var isFocusable;var PostTooltipTrigger=function(){function t(t){registerInstance(this,t);this.delay=0;this.trigger=null;this.delayTimeout=null;this.boundTriggerHandler=this.handleTriggerEvent.bind(this);this.boundTooltipHandler=this.handleTooltipEvent.bind(this)}Object.defineProperty(t.prototype,"tooltip",{get:function(){var t=document.getElementById(this.for);return(t===null||t===void 0?void 0:t.localName)==="post-tooltip"?t:null},enumerable:false,configurable:true});t.prototype.componentWillLoad=function(){{import("./focusable-C7afHKmo.js").then((function(t){return t.f})).then((function(t){isFocusable!==null&&isFocusable!==void 0?isFocusable:isFocusable=t.default}))}};t.prototype.componentDidLoad=function(){this.setupTrigger();this.attachListeners();this.attachTooltipListeners()};t.prototype.disconnectedCallback=function(){this.removeListeners();this.removeTooltipListeners();this.cleanupTrigger();if(this.delayTimeout){clearTimeout(this.delayTimeout);this.delayTimeout=null}};t.prototype.handleSlotChange=function(){this.cleanupTrigger();this.setupTrigger()};t.prototype.cleanupTrigger=function(){var t=this;if(this.trigger){var i=this.trigger.getAttribute("aria-describedby")||"";if(i.includes(this.for)){var e=i.split(" ").filter((function(i){return i!==t.for})).join(" ");if(e){this.trigger.setAttribute("aria-describedby",e)}else{this.trigger.removeAttribute("aria-describedby")}}this.trigger=null}};t.prototype.setupTrigger=function(){this.trigger=this.host.querySelector("*");if(this.trigger){if(!(isFocusable===null||isFocusable===void 0?void 0:isFocusable(this.trigger))){this.trigger.setAttribute("tabindex","0")}var t=this.trigger.getAttribute("aria-describedby")||"";if(!t.includes(this.for)){this.trigger.setAttribute("aria-describedby","".concat(t," ").concat(this.for).trim())}}else{console.warn("No content found in the post-tooltip-trigger slot. Please insert a focusable element or content that can receive focus.")}};t.prototype.attachListeners=function(){var t=this;TRIGGER_EVENTS.forEach((function(i){t.host.addEventListener(i,t.boundTriggerHandler)}))};t.prototype.removeListeners=function(){var t=this;TRIGGER_EVENTS.forEach((function(i){t.host.removeEventListener(i,t.boundTriggerHandler)}))};t.prototype.attachTooltipListeners=function(){if(this.tooltip){this.tooltip.addEventListener("pointerenter",this.boundTooltipHandler);this.tooltip.addEventListener("pointerleave",this.boundTooltipHandler)}};t.prototype.removeTooltipListeners=function(){if(this.tooltip){this.tooltip.removeEventListener("pointerenter",this.boundTooltipHandler);this.tooltip.removeEventListener("pointerleave",this.boundTooltipHandler)}};t.prototype.handleTriggerEvent=function(t){switch(t.type){case"pointerenter":case"focusin":case"long-press":this.handleEnter();break;case"pointerleave":case"focusout":this.handleLeave(t);break}};t.prototype.handleTooltipEvent=function(t){switch(t.type){case"pointerenter":this.handleEnter();break;case"pointerleave":this.handleLeave(t);break}};t.prototype.handleEnter=function(){if(this.delayTimeout){clearTimeout(this.delayTimeout);this.delayTimeout=null}this.interestHandler()};t.prototype.handleLeave=function(t){var i=t.relatedTarget;if(this.tooltip&&i&&this.tooltip.contains(i)||i===this.trigger){return}this.interestLostHandler()};t.prototype.interestHandler=function(){var t=this;var i;if(this.trigger){if(this.delay>0){this.delayTimeout=globalThis.setTimeout((function(){var i;(i=t.tooltip)===null||i===void 0?void 0:i.show(t.trigger);t.delayTimeout=null}),this.delay)}else{(i=this.tooltip)===null||i===void 0?void 0:i.show(this.trigger)}}};t.prototype.interestLostHandler=function(){var t;if(this.delayTimeout){clearTimeout(this.delayTimeout);this.delayTimeout=null}(t=this.tooltip)===null||t===void 0?void 0:t.hide()};t.prototype.render=function(){var t=this;return h(Host,{key:"37f835a46c96f1f97019b611da8b6be2d6e1a8d7","data-version":version},h("slot",{key:"c2fc3d9080948fdcfbd8b2866730e76b770b87ba",onSlotchange:function(){return t.handleSlotChange()}}))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();__decorate([Required(),Type("string")],PostTooltipTrigger.prototype,"for",void 0);PostTooltipTrigger.style=postTooltipTriggerCss();export{PostTooltipTrigger as post_tooltip_trigger};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,o,r){function n(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r["throw"](t))}catch(t){i(t)}}function c(t){t.done?o(t.value):n(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,n,i,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=s(0),a["throw"]=s(1),a["return"]=s(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return c([t,e])}}function c(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(r=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;n=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1];i=s;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(s);break}if(i[2])o.ops.pop();o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t];n=0}finally{r=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host,g as getElement}from"./index-h3opCZqH.js";import{P as PLACEMENT_TYPES}from"./placement-DRiVosES.js";import{v as version}from"./package-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,o,r){function n(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r["throw"](t))}catch(t){i(t)}}function c(t){t.done?o(t.value):n(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,n,i,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=s(0),a["throw"]=s(1),a["return"]=s(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return c([t,e])}}function c(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(r=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;n=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1];i=s;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(s);break}if(i[2])o.ops.pop();o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t];n=0}finally{r=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host,g as getElement}from"./index-h3opCZqH.js";import{P as PLACEMENT_TYPES}from"./placement-DRiVosES.js";import{v as version}from"./package-YQBh4peU.js";import{O as OneOf}from"./one-of-w2eXPAzD.js";import"./create-validator-decorator--a-qkYfP.js";var postTooltipCss=function(){return':host{display:none}:host([open]){display:contents}post-popovercontainer[arrow]::after{position:absolute;content:"";inset:-13px;z-index:-1}post-popovercontainer{--post-current-bg:var(--post-scheme-color-surface-accent-bg);--post-current-fg:var(--post-scheme-color-surface-accent-fg);--post-popovercontainer-arrow-border-width:var(--post-device-border-width-alternative1);--post-popovercontainer-arrow-border-color:var(--post-scheme-color-surface-accent-fg)}post-popovercontainer::part(post-popovercontainer-border-mask){display:block;-webkit-box-shadow:inset 0 0 0 var(--post-device-spacing-padding-14) var(--post-scheme-color-surface-accent-bg);box-shadow:inset 0 0 0 var(--post-device-spacing-padding-14) var(--post-scheme-color-surface-accent-bg)}post-popovercontainer::part(post-popovercontainer-content){border:var(--post-device-border-width-alternative1) solid var(--post-scheme-color-surface-accent-fg);border-radius:var(--post-device-border-radius-1);padding:var(--post-device-spacing-padding-14) var(--post-device-spacing-padding-15);font-size:var(--post-device-font-size-9);max-width:var(--post-tooltip-max-width, 280px);width:inherit;word-wrap:break-word;white-space:normal}'};var __decorate=undefined&&undefined.__decorate||function(t,e,o,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,o):r,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(t,e,o,r);else for(var s=t.length-1;s>=0;s--)if(a=t[s])i=(n<3?a(i):n>3?a(e,o,i):a(e,o))||i;return n>3&&i&&Object.defineProperty(e,o,i),i};var PostTooltip=function(){function t(t){registerInstance(this,t);this.placement="top";this.arrow=false;this.open=false}t.prototype.componentDidLoad=function(){if(!this.host.id){console.error("No id set: <post-tooltip> must have an id, linking it to it's target element with a <post-tooltip-trigger> element.")}};t.prototype.show=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(this.open)return[2];return[4,this.popoverRef.show(t)];case 1:e.sent();return[2]}}))}))};t.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.popoverRef.hide();return[2]}))}))};t.prototype.toggle=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){this.popoverRef.toggle(t,e);return[2]}))}))};t.prototype.handleBeforeToggle=function(t){this.open=t.detail.willOpen};t.prototype.render=function(){var t=this;var e="".concat(this.arrow?"has-arrow":"");return h(Host,{key:"d49731becbb7395ec68cfae34d316a6248977b53","data-version":version},h("post-popovercontainer",{key:"12da18a58c2143ef4c2ddff207d081d091e6a40e",safeSpace:"trapezoid",class:e,role:"tooltip",arrow:this.arrow,placement:this.placement,onPostBeforeToggle:function(e){return t.handleBeforeToggle(e)},ref:function(e){return t.popoverRef=e}},h("slot",{key:"5f941c0311eff468be1c6abe7cbcdab8ba272e15"})))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();__decorate([OneOf(PLACEMENT_TYPES)],PostTooltip.prototype,"placement",void 0);PostTooltip.style=postTooltipCss();export{PostTooltip as post_tooltip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++){e=arguments[i];for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o))t[o]=e[o]}return t};return __assign.apply(this,arguments)};import{r as registerInstance,h,H as Host}from"./index-h3opCZqH.js";import{c as createIdFrom,T as Title,L as Link,s as state,g as getText,v as version}from"./package-BEOiFUNg.js";var postInternetFooterCss=function(){return".cookie-settings{min-height:0;border:0 none;font-weight:inherit}"};var PostInternetFooter=function(){function t(t){var e=this;this.liveSupportEnabled=false;this.cookieSettingsEnabled=false;registerInstance(this,t);this.liveSupportEnabled=this.unbluEnabled();this.cookieSettingsEnabled=this.ucUIEnabled();if(!this.liveSupportEnabled){var i=undefined;var n=0;var o=function(){var t=e.unbluEnabled();var o=e.ucUIEnabled();var r=t&&o;if(t){e.liveSupportEnabled=true}if(o){e.cookieSettingsEnabled=true}if(r||n>=5){window.clearInterval(i)}n++};i=window.setInterval(o,1e3)}}t.prototype.unbluEnabled=function(){return typeof window["unbluLSLoad"]==="function"};t.prototype.ucUIEnabled=function(){return typeof window["UC_UI"]==="object"&&typeof window["UC_UI"]["showSecondLayer"]==="function"};t.prototype.handleCookieSettingsClick=function(){window["UC_UI"]["showSecondLayer"]()};t.prototype.renderListWithTitle=function(t,e){if(!t)return undefined;var i=e.titleProps,n=e.listProps,o=e.linkProps;var r=getText(t.title);var s=createIdFrom(r);return[h(Title,__assign(__assign({},i),{config:t.title,id:s})),h("ul",__assign(__assign({},n),{"aria-labelledby":s}),t.items.map((function(t){return h("li",{key:t.text},h(Link,__assign(__assign({},o),{config:t})))})))]};t.prototype.render=function(){var t=this;var e;if(!state.localizedConfig){return null}if(!state.localizedConfig.footer){console.warn('Internet Footer: Current project "'.concat(state.projectId,'" does not include a footer config. The footer will not be rendered. Remove '),document.querySelector("swisspost-internet-footer"),"from your markup or configure the footer in your portal config to stop seeing this warning.");return null}var i=state.localizedConfig.footer;return h(Host,{"data-version":version},h("post-footer",{textFooter:this.textFooter},i.prefooter&&h("div",{slot:"prefooter"},this.renderListWithTitle(i.prefooter,{titleProps:{tag:"h3"}})),(e=i.sections)===null||e===void 0?void 0:e.map((function(e,i){return t.renderListWithTitle(e,{titleProps:{tag:"span",slot:"grid-".concat(i+1,"-title")},listProps:{slot:"grid-".concat(i+1)}})})),i.socialLinks&&h("div",{slot:"socialmedia"},this.renderListWithTitle(i.socialLinks,{titleProps:{tag:"h3"},linkProps:{class:"btn btn-primary btn-icon",hiddenText:true}})),i.appStoreLinks&&h("div",{slot:"app"},this.renderListWithTitle(i.appStoreLinks,{titleProps:{tag:"h3"},linkProps:{class:"app-store-badge",hiddenText:true}})),i.companyLinks&&h("div",{slot:"businesssectors"},this.renderListWithTitle(i.companyLinks,{titleProps:{tag:"h3"}})),i.complianceLinks&&h("div",{slot:"meta"},h("ul",{"aria-label":getText(i.complianceLinks.title)},i.complianceLinks.items.map((function(t){return h("li",{key:t.text},h(Link,{config:t}))})),this.cookieSettingsEnabled&&h("li",null,h("button",{class:"btn btn-link cookie-settings",onClick:this.handleCookieSettingsClick},this.textCookieSettings)))),i.copyright&&h("p",{slot:"copyright"},i.copyright)))};return t}();PostInternetFooter.style=postInternetFooterCss();export{PostInternetFooter as swisspost_internet_footer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++){n=arguments[e];for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i))t[i]=n[i]}return t};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(t,n,e,r){function i(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,a){function o(t){try{s(r.next(t))}catch(t){a(t)}}function u(t){try{s(r["throw"](t))}catch(t){a(t)}}function s(t){t.done?e(t.value):i(t.value).then(o,u)}s((r=r.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=u(0),o["throw"]=u(1),o["return"]=u(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(t){return function(n){return s([t,n])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(e=0)),e)try{if(r=1,i&&(a=u[0]&2?i["return"]:u[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;if(i=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;i=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(a=e.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1];a=u;break}if(a&&e.label<a[2]){e.label=a[2];e.ops.push(u);break}if(a[2])e.ops.pop();e.trys.pop();continue}u=n.call(t,e)}catch(t){u=[6,t];i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,e){if(e||arguments.length===2)for(var r=0,i=n.length,a;r<i;r++){if(a||!(r in n)){if(!a)a=Array.prototype.slice.call(n,0,r);a[r]=n[r]}}return t.concat(a||Array.prototype.slice.call(n))};import{h,r as registerInstance,c as createEvent,H as Host}from"./index-h3opCZqH.js";import{c as createIdFrom,L as Link,g as getText,T as Title,s as state,d as dispose,v as version}from"./package-ClQfdhMK.js";var Avatar=function(t){var n=t.user,e=t.description;return h("post-avatar",{firstname:n.name,lastname:n.surname,email:n.email,description:e,"aria-hidden":e?undefined:"true"})};var MegaDropdown=function(t){var n=t.config,e=t.textClose,r=t.textBack;var i=createIdFrom(n.trigger.text);return[h("post-megadropdown-trigger",{key:"trigger",for:i},n.trigger.text),h("post-megadropdown",{key:"dropdown",id:i,textClose:e,textBack:r},n.overview&&h(Link,{config:n.overview,class:"post-megadropdown-overview",ariaCurrentWhenActive:"page"}),h("div",{class:"row row-cols-1 row-cols-sm-2"},n.sections.map((function(t){return h(MegaDropdownSection,{config:t})}))))]};var MegaDropdownSection=function(t){var n=t.config;var e=getText(n.title);var r=createIdFrom(e);return h("div",{class:"col"},h(Title,{class:"post-megadropdown-list-title",id:r,config:n.title}),h("ul",{class:"post-megadropdown-list","aria-labelledby":r},n.items.map((function(t){return h("li",{key:t.url},h(Link,{config:t,ariaCurrentWhenActive:"page"}))}))))};var withReturnUrl=function(t){var n=new URL(t,window.location.href);n.searchParams.set("returnURL",window.location.href);return n.toString()};var UserMenu=function(t){var n=t.config,e=t.slot,r=t.textCurrentUser,i=t.textUserLinks,a=t.textAccessUserLinks;var o=n.user.userType==="B2C";var u=n.user.userType==="B2B";var s=(o||u)&&n.user.changeUserAndProfile==="userAndProfile";var c=u&&n.user.canChangeCompany&&n.user.company;var f=s||c;var l=[n.user.name,n.user.surname].join(" ");var v=createIdFrom(l);return h("div",{slot:e},h("post-menu-trigger",{for:v},h("button",{class:"btn btn-link",type:"button"},h(Avatar,{user:n.user,description:r.replace("{user}","".concat(l))}),h("span",{class:"visually-hidden"},a))),h("post-menu",{id:v,label:i},h("div",{slot:"header"},h(Avatar,{user:n.user}),n.user.company&&h("p",null,n.user.company),h("p",null,l)),n.accountSwitch&&f&&h("post-menu-item",null,h(Link,{config:{text:n.accountSwitch.text,url:withReturnUrl(n.accountSwitch.url),icon:n.accountSwitch.icon}})),n.companySwitch&&c&&h("post-menu-item",null,h(Link,{config:{text:n.companySwitch.text,url:withReturnUrl(n.companySwitch.url),icon:n.companySwitch.icon}})),n.options.map((function(t){return h("post-menu-item",{key:t.url},h(Link,{config:t}))})),n.logoutLink&&h("post-menu-item",null,h(Link,{config:n.logoutLink}))))};var DEFAULT_LANGUAGE="de";var getUserLang=function(t){var n;var e=new URL(window.location.href);var r=[t,e.searchParams.get("lang"),getPathLanguage(e.pathname),document.documentElement.lang,getPreferredLanguageFromBrowser(),state.currentLanguage].filter((function(t){return t!=null}));return extractLanguage((n=r[0])!==null&&n!==void 0?n:DEFAULT_LANGUAGE)};var getPathLanguage=function(t){var n=t.split("/").filter(Boolean)[0];if(!n)return undefined;try{Intl.getCanonicalLocales(n);return n}catch(t){return undefined}};var getPreferredLanguageFromBrowser=function(){if(navigator.language!=null){return extractLanguage(navigator.language)}if(navigator.languages!=null&&navigator.languages.length>0){return extractLanguage(navigator.languages[0])}return null};var extractLanguage=function(t){return t.substring(0,2).toLowerCase()};var inFlightRequests=new Map;var getPPMConfig=function(){var t=document.querySelector("#PPM_HEADER_DATA");if((t===null||t===void 0?void 0:t.textContent)!=null){return JSON.parse(t.textContent)}return null};var getLocalizedConfig=function(t){return __awaiter(void 0,[t],void 0,(function(t){var n,e,r,i,a,o,u;var s=t.projectId,c=t.environment,f=t.language;return __generator(this,(function(t){switch(t.label){case 0:n=getPPMConfig();if(n){e=document.documentElement.lang;state.currentLanguage=e;return[2,n]}r=getUserLang(f);i="".concat(s,"-").concat(c,"-").concat(r);a=inFlightRequests.get(i);if(a==null){a=fetchConfig(s,c,r).finally((function(){inFlightRequests.delete(i)}));inFlightRequests.set(i,a)}u=[{}];return[4,a];case 1:o=__assign.apply(void 0,u.concat([t.sent()]));state.currentLanguage=r;return[2,o]}}))}))};var fetchConfig=function(t,n,e){return __awaiter(void 0,void 0,void 0,(function(){var r,i,a;return __generator(this,(function(o){switch(o.label){case 0:if(!isValidProjectId(t)){throw new Error('Internet Header: invalid project id "'.concat(t,'"'))}if(t==="test"){n="int01"}r=generateConfigUrl(t,n,e);o.label=1;case 1:o.trys.push([1,4,,5]);return[4,fetch(r)];case 2:i=o.sent();return[4,i.json()];case 3:return[2,o.sent()];case 4:a=o.sent();throw new Error("Internet Header: fetching config failed. ".concat(a.message));case 5:return[2]}}))}))};var generateConfigUrl=function(t,n,e){if(t==="test")return"assets/config/test-configuration.json";var r=n.toUpperCase();var i=e.toLowerCase();var a=r==="PROD";var o="https://".concat(a?"":"int.","preview.post.ch");try{var u=new URLSearchParams({serviceId:t,environment:r,lang:i}).toString();return new URL("".concat(o,"/api/header?").concat(u)).toString()}catch(t){throw new Error("Internet Header: Config URL is invalid.")}};var isValidProjectId=function(t){return t!==""&&t.length>0&&/^[a-zA-Z][\w-]*[a-zA-Z0-9]$/.test(t)};var getActiveLink=function(t){var n;var e=getHeaderLinks((n=state.localizedConfig)===null||n===void 0?void 0:n.header);if(e.length===0||t==="none"){return null}if(t==="auto"||t==="exact"){var r=findActiveLink(e);if(r)return r}var i;if(t==="auto"||t==="exact"){i=new URL(window.location.href)}else{try{i=new URL(t,document.location.origin)}catch(n){console.warn("Active Route: ".concat(t," is not a valid URL. Navigation highlighting has been disabled."));return null}}var a=extractCandidateLinks(e);var o=t==="exact"?"exact":"auto";return findBestMatch(a,i,o)};var findActiveLink=function(t){return t.find((function(t){return t.active}))};var extractCandidateLinks=function(t){return t.filter((function(t){return t.url!==""&&t.url!=="#"&&t.url!=="/"}))};var getHeaderLinks=function(t){var n=[];if(!t){return n}var e=function(t){if(t===null||t===undefined){return}if(Array.isArray(t)){t.forEach(e);return}if(typeof t!=="object"||t===null){return}if("url"in t&&typeof t.url==="string"){n.push(t)}Object.values(t).forEach(e)};e(t);return n};var findBestMatch=function(t,n,e){var r=null;for(var i=0,a=t;i<a.length;i++){var o=a[i];try{var u=new URL(o.url,document.location.origin);var s=compareRoutes(n,u,e);if(s>0){if(!r||s>r.score){r={link:o,score:s}}if(s===Infinity)break}}catch(t){}}return r?r.link:null};var compareRoutes=function(t,n,e){if(t===null||n===null||t.origin!==n.origin){return 0}var r=t.pathname.toLocaleLowerCase();var i=n.pathname.toLocaleLowerCase();if(r===i){return Infinity}if(t.pathname.length<n.pathname.length){return 0}if(e==="auto"){var a=__spreadArray([t.origin.toLocaleLowerCase()],r.split("/").filter((function(t){return t!==null&&t!==""})),true);var o=__spreadArray([n.origin.toLocaleLowerCase()],i.split("/").filter((function(t){return t!==null&&t!==""})),true);var u=getSimilarityScore(a,o);return Math.min(a.length,o.length)===u?u:0}return 0};var getSimilarityScore=function(t,n){if(t==null||n==null||t.length===0||n.length===0){return 0}var e=0;for(;e<Math.min(t.length,n.length);e++){if(t[e]!==n[e]){return 0}}return e};var SESSION_URL="https://n.account.post.ch/v1/session/subscribe";var PostInternetHeader=function(){function t(t){this.activeRoute="auto";this.environment="prod";this.fullWidth=false;registerInstance(this,t);this.headerLoaded=createEvent(this,"headerLoaded");if(this.project===undefined||this.project===""||!isValidProjectId(this.project)){throw new Error('Internet Header project key is "'.concat(this.project,'". Please provide a valid project key.'))}}t.prototype.handleActiveRouteChange=function(){this.updateActiveUrl()};t.prototype.handleLanguageChange=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(e){switch(e.label){case 0:e.trys.push([0,2,,3]);return[4,this.updateConfig(t)];case 1:e.sent();return[3,3];case 2:n=e.sent();console.error(n);return[3,3];case 3:return[2]}}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,Promise.all([this.fetchHeaderConfig(),this.fetchUserData()])];case 1:t.sent();return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;window.requestAnimationFrame((function(){t.headerLoaded.emit()}))};t.prototype.disconnectedCallback=function(){dispose()};t.prototype.handleLanguageChangeEvent=function(t){if(t.target instanceof HTMLElement&&t.target.localName==="post-language-menu-item"&&t.detail!==this.language){void this.handleLanguageChange(t.detail)}};t.prototype.fetchHeaderConfig=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);state.projectId=this.project;state.environment=this.environment.toLocaleLowerCase();if(this.language!==undefined)state.currentLanguage=this.language;return[4,this.updateConfig()];case 1:n.sent();return[3,3];case 2:t=n.sent();console.error(t);return[3,3];case 3:return[2]}}))}))};t.prototype.fetchUserData=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,e;return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,4,,5]);return[4,fetch(SESSION_URL,{credentials:"include"})];case 1:t=r.sent();if(!t.ok)return[3,3];return[4,t.json()];case 2:n=r.sent();state.user=n===null||n===void 0?void 0:n.data;r.label=3;case 3:return[3,5];case 4:e=r.sent();return[3,5];case 5:return[2]}}))}))};t.prototype.updateConfig=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(e){switch(e.label){case 0:n=state;return[4,getLocalizedConfig({projectId:this.project,environment:this.environment,language:t!==null&&t!==void 0?t:this.language})];case 1:n.localizedConfig=e.sent();this.updateActiveUrl();return[2]}}))}))};t.prototype.updateActiveUrl=function(){state.activeLink=getActiveLink(this.activeRoute)};t.prototype.getUserMenuOptions=function(t){var n;return __spreadArray(__spreadArray(__spreadArray([],t.userProfile?[t.userProfile]:[],true),t.settings?[t.settings]:[],true),(n=t.userLinks)!==null&&n!==void 0?n:[],true)};t.prototype.renderNavItem=function(t,n){if(n===void 0){n={}}if("url"in t){return h(Link,__assign(__assign({},n),{config:t}))}return h(UserMenu,{slot:n.slot,config:t,textCurrentUser:this.textCurrentUser,textAccessUserLinks:this.textAccessUserLinks,textUserLinks:this.textUserLinks})};t.prototype.renderNavigation=function(t,n,e){var r=this;if(e===void 0){e={}}if(n.length===0)return null;if(n.length===1){return this.renderNavItem(n[0],__assign(__assign({},e),{slot:t}))}return h("ul",{slot:t},n.map((function(t){return h("li",{key:"url"in t?t.url:t.user.email},r.renderNavItem(t,e))})))};t.prototype.render=function(){var t=this;var n;if(!((n=state.localizedConfig)===null||n===void 0?void 0:n.header)){console.error(new Error("Internet Header: Config cannot be loaded"));return}var e=state.localizedConfig.header,r=e.globalHeader,i=e.localHeader;return h(Host,{"data-version":version},h("post-header",{textMenu:this.textMenu},"image"in r.postLogo?h(Link,{slot:"post-logo",config:r.postLogo}):h("post-logo",{slot:"post-logo",url:r.postLogo.url,"aria-label":r.postLogo.label,"aria-description":r.postLogo.description},r.postLogo.text),r.audience&&this.renderNavigation("audience",r.audience,{ariaCurrentWhenActive:"location"}),r.primaryNavigation&&this.renderNavigation("global-nav-primary",r.primaryNavigation),r.secondaryNavigation&&this.renderNavigation("global-nav-secondary",r.secondaryNavigation,{ariaCurrentWhenActive:"location"}),r.languages&&r.languages.length>0&&h("post-language-menu",{slot:"language-menu",textChangeLanguage:this.textChangeLanguage,textCurrentLanguage:this.textCurrentLanguage},r.languages.map((function(t){return h("post-language-menu-item",{key:t.code,url:t.url,active:t.active,code:t.code,name:t.label,description:t.description},t.text)}))),r.postLogin&&this.renderNavItem(state.user?{user:state.user,options:this.getUserMenuOptions(r.postLogin),accountSwitch:r.postLogin.accountSwitch,companySwitch:r.postLogin.companySwitch,logoutLink:r.postLogin.logoutLink}:r.postLogin.loginLink,{slot:"post-login"}),i.title&&h("p",{slot:"title"},i.title),i.navigation&&this.renderNavigation("local-nav",i.navigation),i.mainNavigation&&h("post-mainnavigation",{slot:"main-nav",textMain:this.textMain},h("ul",null,i.mainNavigation.map((function(n){return h("li",{key:"url"in n?n.url:n.trigger.text},"url"in n?h(Link,{config:n,ariaCurrentWhenActive:"page"}):h(MegaDropdown,{config:n,textBack:t.textBack,textClose:t.textClose}))}))))))};Object.defineProperty(t,"watchers",{get:function(){return{activeRoute:[{handleActiveRouteChange:0}],language:[{handleLanguageChange:0}]}},enumerable:false,configurable:true});return t}();export{PostInternetHeader as swisspost_internet_header};
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++){n=arguments[e];for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i))t[i]=n[i]}return t};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(t,n,e,r){function i(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,a){function o(t){try{s(r.next(t))}catch(t){a(t)}}function u(t){try{s(r["throw"](t))}catch(t){a(t)}}function s(t){t.done?e(t.value):i(t.value).then(o,u)}s((r=r.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=u(0),o["throw"]=u(1),o["return"]=u(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(t){return function(n){return s([t,n])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(e=0)),e)try{if(r=1,i&&(a=u[0]&2?i["return"]:u[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;if(i=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;i=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(a=e.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1];a=u;break}if(a&&e.label<a[2]){e.label=a[2];e.ops.push(u);break}if(a[2])e.ops.pop();e.trys.pop();continue}u=n.call(t,e)}catch(t){u=[6,t];i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,e){if(e||arguments.length===2)for(var r=0,i=n.length,a;r<i;r++){if(a||!(r in n)){if(!a)a=Array.prototype.slice.call(n,0,r);a[r]=n[r]}}return t.concat(a||Array.prototype.slice.call(n))};import{h,r as registerInstance,c as createEvent,H as Host}from"./index-h3opCZqH.js";import{c as createIdFrom,L as Link,g as getText,T as Title,s as state,d as dispose,v as version}from"./package-BEOiFUNg.js";var Avatar=function(t){var n=t.user,e=t.description;return h("post-avatar",{firstname:n.name,lastname:n.surname,email:n.email,description:e,"aria-hidden":e?undefined:"true"})};var MegaDropdown=function(t){var n=t.config,e=t.textClose,r=t.textBack;var i=createIdFrom(n.trigger.text);return[h("post-megadropdown-trigger",{key:"trigger",for:i},n.trigger.text),h("post-megadropdown",{key:"dropdown",id:i,textClose:e,textBack:r},n.overview&&h(Link,{config:n.overview,class:"post-megadropdown-overview",ariaCurrentWhenActive:"page"}),h("div",{class:"row row-cols-1 row-cols-sm-2"},n.sections.map((function(t){return h(MegaDropdownSection,{config:t})}))))]};var MegaDropdownSection=function(t){var n=t.config;var e=getText(n.title);var r=createIdFrom(e);return h("div",{class:"col"},h(Title,{class:"post-megadropdown-list-title",id:r,config:n.title}),h("ul",{class:"post-megadropdown-list","aria-labelledby":r},n.items.map((function(t){return h("li",{key:t.url},h(Link,{config:t,ariaCurrentWhenActive:"page"}))}))))};var withReturnUrl=function(t){var n=new URL(t,window.location.href);n.searchParams.set("returnURL",window.location.href);return n.toString()};var UserMenu=function(t){var n=t.config,e=t.slot,r=t.textCurrentUser,i=t.textUserLinks,a=t.textAccessUserLinks;var o=n.user.userType==="B2C";var u=n.user.userType==="B2B";var s=(o||u)&&n.user.changeUserAndProfile==="userAndProfile";var c=u&&n.user.canChangeCompany&&n.user.company;var f=s||c;var l=[n.user.name,n.user.surname].join(" ");var v=createIdFrom(l);return h("div",{slot:e},h("post-menu-trigger",{for:v},h("button",{class:"btn btn-link",type:"button"},h(Avatar,{user:n.user,description:r.replace("{user}","".concat(l))}),h("span",{class:"visually-hidden"},a))),h("post-menu",{id:v,label:i},h("div",{slot:"header"},h(Avatar,{user:n.user}),n.user.company&&h("p",null,n.user.company),h("p",null,l)),n.accountSwitch&&f&&h("post-menu-item",null,h(Link,{config:{text:n.accountSwitch.text,url:withReturnUrl(n.accountSwitch.url),icon:n.accountSwitch.icon}})),n.companySwitch&&c&&h("post-menu-item",null,h(Link,{config:{text:n.companySwitch.text,url:withReturnUrl(n.companySwitch.url),icon:n.companySwitch.icon}})),n.options.map((function(t){return h("post-menu-item",{key:t.url},h(Link,{config:t}))})),n.logoutLink&&h("post-menu-item",null,h(Link,{config:n.logoutLink}))))};var DEFAULT_LANGUAGE="de";var getUserLang=function(t){var n;var e=new URL(window.location.href);var r=[t,e.searchParams.get("lang"),getPathLanguage(e.pathname),document.documentElement.lang,getPreferredLanguageFromBrowser(),state.currentLanguage].filter((function(t){return t!=null}));return extractLanguage((n=r[0])!==null&&n!==void 0?n:DEFAULT_LANGUAGE)};var getPathLanguage=function(t){var n=t.split("/").filter(Boolean)[0];if(!n)return undefined;try{Intl.getCanonicalLocales(n);return n}catch(t){return undefined}};var getPreferredLanguageFromBrowser=function(){if(navigator.language!=null){return extractLanguage(navigator.language)}if(navigator.languages!=null&&navigator.languages.length>0){return extractLanguage(navigator.languages[0])}return null};var extractLanguage=function(t){return t.substring(0,2).toLowerCase()};var inFlightRequests=new Map;var getPPMConfig=function(){var t=document.querySelector("#PPM_HEADER_DATA");if((t===null||t===void 0?void 0:t.textContent)!=null){return JSON.parse(t.textContent)}return null};var getLocalizedConfig=function(t){return __awaiter(void 0,[t],void 0,(function(t){var n,e,r,i,a,o,u;var s=t.projectId,c=t.environment,f=t.language;return __generator(this,(function(t){switch(t.label){case 0:n=getPPMConfig();if(n){e=document.documentElement.lang;state.currentLanguage=e;return[2,n]}r=getUserLang(f);i="".concat(s,"-").concat(c,"-").concat(r);a=inFlightRequests.get(i);if(a==null){a=fetchConfig(s,c,r).finally((function(){inFlightRequests.delete(i)}));inFlightRequests.set(i,a)}u=[{}];return[4,a];case 1:o=__assign.apply(void 0,u.concat([t.sent()]));state.currentLanguage=r;return[2,o]}}))}))};var fetchConfig=function(t,n,e){return __awaiter(void 0,void 0,void 0,(function(){var r,i,a;return __generator(this,(function(o){switch(o.label){case 0:if(!isValidProjectId(t)){throw new Error('Internet Header: invalid project id "'.concat(t,'"'))}if(t==="test"){n="int01"}r=generateConfigUrl(t,n,e);o.label=1;case 1:o.trys.push([1,4,,5]);return[4,fetch(r)];case 2:i=o.sent();return[4,i.json()];case 3:return[2,o.sent()];case 4:a=o.sent();throw new Error("Internet Header: fetching config failed. ".concat(a.message));case 5:return[2]}}))}))};var generateConfigUrl=function(t,n,e){if(t==="test")return"assets/config/test-configuration.json";var r=n.toUpperCase();var i=e.toLowerCase();var a=r==="PROD";var o="https://".concat(a?"":"int.","preview.post.ch");try{var u=new URLSearchParams({serviceId:t,environment:r,lang:i}).toString();return new URL("".concat(o,"/api/header?").concat(u)).toString()}catch(t){throw new Error("Internet Header: Config URL is invalid.")}};var isValidProjectId=function(t){return t!==""&&t.length>0&&/^[a-zA-Z][\w-]*[a-zA-Z0-9]$/.test(t)};var getActiveLink=function(t){var n;var e=getHeaderLinks((n=state.localizedConfig)===null||n===void 0?void 0:n.header);if(e.length===0||t==="none"){return null}if(t==="auto"||t==="exact"){var r=findActiveLink(e);if(r)return r}var i;if(t==="auto"||t==="exact"){i=new URL(window.location.href)}else{try{i=new URL(t,document.location.origin)}catch(n){console.warn("Active Route: ".concat(t," is not a valid URL. Navigation highlighting has been disabled."));return null}}var a=extractCandidateLinks(e);var o=t==="exact"?"exact":"auto";return findBestMatch(a,i,o)};var findActiveLink=function(t){return t.find((function(t){return t.active}))};var extractCandidateLinks=function(t){return t.filter((function(t){return t.url!==""&&t.url!=="#"&&t.url!=="/"}))};var getHeaderLinks=function(t){var n=[];if(!t){return n}var e=function(t){if(t===null||t===undefined){return}if(Array.isArray(t)){t.forEach(e);return}if(typeof t!=="object"||t===null){return}if("url"in t&&typeof t.url==="string"){n.push(t)}Object.values(t).forEach(e)};e(t);return n};var findBestMatch=function(t,n,e){var r=null;for(var i=0,a=t;i<a.length;i++){var o=a[i];try{var u=new URL(o.url,document.location.origin);var s=compareRoutes(n,u,e);if(s>0){if(!r||s>r.score){r={link:o,score:s}}if(s===Infinity)break}}catch(t){}}return r?r.link:null};var compareRoutes=function(t,n,e){if(t===null||n===null||t.origin!==n.origin){return 0}var r=t.pathname.toLocaleLowerCase();var i=n.pathname.toLocaleLowerCase();if(r===i){return Infinity}if(t.pathname.length<n.pathname.length){return 0}if(e==="auto"){var a=__spreadArray([t.origin.toLocaleLowerCase()],r.split("/").filter((function(t){return t!==null&&t!==""})),true);var o=__spreadArray([n.origin.toLocaleLowerCase()],i.split("/").filter((function(t){return t!==null&&t!==""})),true);var u=getSimilarityScore(a,o);return Math.min(a.length,o.length)===u?u:0}return 0};var getSimilarityScore=function(t,n){if(t==null||n==null||t.length===0||n.length===0){return 0}var e=0;for(;e<Math.min(t.length,n.length);e++){if(t[e]!==n[e]){return 0}}return e};var SESSION_URL="https://n.account.post.ch/v1/session/subscribe";var PostInternetHeader=function(){function t(t){this.activeRoute="auto";this.environment="prod";this.fullWidth=false;registerInstance(this,t);this.headerLoaded=createEvent(this,"headerLoaded");if(this.project===undefined||this.project===""||!isValidProjectId(this.project)){throw new Error('Internet Header project key is "'.concat(this.project,'". Please provide a valid project key.'))}}t.prototype.handleActiveRouteChange=function(){this.updateActiveUrl()};t.prototype.handleLanguageChange=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(e){switch(e.label){case 0:e.trys.push([0,2,,3]);return[4,this.updateConfig(t)];case 1:e.sent();return[3,3];case 2:n=e.sent();console.error(n);return[3,3];case 3:return[2]}}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,Promise.all([this.fetchHeaderConfig(),this.fetchUserData()])];case 1:t.sent();return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;window.requestAnimationFrame((function(){t.headerLoaded.emit()}))};t.prototype.disconnectedCallback=function(){dispose()};t.prototype.handleLanguageChangeEvent=function(t){if(t.target instanceof HTMLElement&&t.target.localName==="post-language-menu-item"&&t.detail!==this.language){void this.handleLanguageChange(t.detail)}};t.prototype.fetchHeaderConfig=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);state.projectId=this.project;state.environment=this.environment.toLocaleLowerCase();if(this.language!==undefined)state.currentLanguage=this.language;return[4,this.updateConfig()];case 1:n.sent();return[3,3];case 2:t=n.sent();console.error(t);return[3,3];case 3:return[2]}}))}))};t.prototype.fetchUserData=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,e;return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,4,,5]);return[4,fetch(SESSION_URL,{credentials:"include"})];case 1:t=r.sent();if(!t.ok)return[3,3];return[4,t.json()];case 2:n=r.sent();state.user=n===null||n===void 0?void 0:n.data;r.label=3;case 3:return[3,5];case 4:e=r.sent();return[3,5];case 5:return[2]}}))}))};t.prototype.updateConfig=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(e){switch(e.label){case 0:n=state;return[4,getLocalizedConfig({projectId:this.project,environment:this.environment,language:t!==null&&t!==void 0?t:this.language})];case 1:n.localizedConfig=e.sent();this.updateActiveUrl();return[2]}}))}))};t.prototype.updateActiveUrl=function(){state.activeLink=getActiveLink(this.activeRoute)};t.prototype.getUserMenuOptions=function(t){var n;return __spreadArray(__spreadArray(__spreadArray([],t.userProfile?[t.userProfile]:[],true),t.settings?[t.settings]:[],true),(n=t.userLinks)!==null&&n!==void 0?n:[],true)};t.prototype.renderNavItem=function(t,n){if(n===void 0){n={}}if("url"in t){return h(Link,__assign(__assign({},n),{config:t}))}return h(UserMenu,{slot:n.slot,config:t,textCurrentUser:this.textCurrentUser,textAccessUserLinks:this.textAccessUserLinks,textUserLinks:this.textUserLinks})};t.prototype.renderNavigation=function(t,n,e){var r=this;if(e===void 0){e={}}if(n.length===0)return null;if(n.length===1){return this.renderNavItem(n[0],__assign(__assign({},e),{slot:t}))}return h("ul",{slot:t},n.map((function(t){return h("li",{key:"url"in t?t.url:t.user.email},r.renderNavItem(t,e))})))};t.prototype.render=function(){var t=this;var n;if(!((n=state.localizedConfig)===null||n===void 0?void 0:n.header)){console.error(new Error("Internet Header: Config cannot be loaded"));return}var e=state.localizedConfig.header,r=e.globalHeader,i=e.localHeader;return h(Host,{"data-version":version},h("post-header",{textMenu:this.textMenu},"image"in r.postLogo?h(Link,{slot:"post-logo",config:r.postLogo}):h("post-logo",{slot:"post-logo",url:r.postLogo.url,"aria-label":r.postLogo.label,"aria-description":r.postLogo.description},r.postLogo.text),r.audience&&this.renderNavigation("audience",r.audience,{ariaCurrentWhenActive:"location"}),r.primaryNavigation&&this.renderNavigation("global-nav-primary",r.primaryNavigation),r.secondaryNavigation&&this.renderNavigation("global-nav-secondary",r.secondaryNavigation,{ariaCurrentWhenActive:"location"}),r.languages&&r.languages.length>0&&h("post-language-menu",{slot:"language-menu",textChangeLanguage:this.textChangeLanguage,textCurrentLanguage:this.textCurrentLanguage},r.languages.map((function(t){return h("post-language-menu-item",{key:t.code,url:t.url,active:t.active,code:t.code,name:t.label,description:t.description},t.text)}))),r.postLogin&&this.renderNavItem(state.user?{user:state.user,options:this.getUserMenuOptions(r.postLogin),accountSwitch:r.postLogin.accountSwitch,companySwitch:r.postLogin.companySwitch,logoutLink:r.postLogin.logoutLink}:r.postLogin.loginLink,{slot:"post-login"}),i.title&&h("p",{slot:"title"},i.title),i.navigation&&this.renderNavigation("local-nav",i.navigation),i.mainNavigation&&i.mainNavigation.length>0&&h("post-mainnavigation",{slot:"main-nav",textMain:this.textMain},h("ul",null,i.mainNavigation.map((function(n){return h("li",{key:"url"in n?n.url:n.trigger.text},"url"in n?h(Link,{config:n,ariaCurrentWhenActive:"page"}):h(MegaDropdown,{config:n,textBack:t.textBack,textClose:t.textClose}))}))))))};Object.defineProperty(t,"watchers",{get:function(){return{activeRoute:[{handleActiveRouteChange:0}],language:[{handleLanguageChange:0}]}},enumerable:false,configurable:true});return t}();export{PostInternetHeader as swisspost_internet_header};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,o,a){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,i){function s(e){try{l(a.next(e))}catch(e){i(e)}}function r(e){try{l(a["throw"](e))}catch(e){i(e)}}function l(e){e.done?o(e.value):n(e.value).then(s,r)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=r(0),s["throw"]=r(1),s["return"]=r(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function r(e){return function(t){return l([e,t])}}function l(r){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,r[0]&&(o=0)),o)try{if(a=1,n&&(i=r[0]&2?n["return"]:r[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,r[1])).done)return i;if(n=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;n=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(r[0]===6&&o.label<i[1]){o.label=i[1];i=r;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(r);break}if(i[2])o.ops.pop();o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e];n=0}finally{a=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{p as promiseResolve,b as bootstrapLazy}from"./index-h3opCZqH.js";export{s as setNonce}from"./index-h3opCZqH.js";import{g as globalScripts}from"./app-globals-DQuL1Twl.js";var patchBrowser=function(){var e=import.meta.url;var t={};if(e!==""){t.resourcesUrl=new URL(".",e).href}return promiseResolve(t)};patchBrowser().then((function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,globalScripts()];case 1:t.sent();return[2,bootstrapLazy([["swisspost-internet-header",[[512,"swisspost-internet-header",{activeRoute:[1,"active-route"],environment:[1],fullWidth:[4,"full-width"],language:[1],project:[1],textBack:[513,"text-back"],textChangeLanguage:[513,"text-change-language"],textClose:[513,"text-close"],textCurrentLanguage:[513,"text-current-language"],textCurrentUser:[513,"text-current-user"],textMain:[513,"text-main"],textMenu:[513,"text-menu"],textAccessUserLinks:[513,"text-access-user-links"],textUserLinks:[513,"text-user-links"]},[[0,"postChange","handleLanguageChangeEvent"]],{activeRoute:[{handleActiveRouteChange:0}],language:[{handleLanguageChange:0}]}]]],["swisspost-internet-footer",[[512,"swisspost-internet-footer",{textFooter:[513,"text-footer"],textCookieSettings:[513,"text-cookie-settings"],liveSupportEnabled:[32],cookieSettingsEnabled:[32]}]]],["post-breadcrumbs",[[257,"post-breadcrumbs",{homeUrl:[513,"home-url"],textHome:[513,"text-home"],textBreadcrumbs:[513,"text-breadcrumbs"],textMoreItems:[513,"text-more-items"],shouldRenderMenu:[32],id:[32]}]]],["post-popover",[[257,"post-popover",{placement:[1],textClose:[513,"text-close"],arrow:[4],edgeGap:[32],show:[64],hide:[64],toggle:[64]}]]],["post-date-picker",[[257,"post-date-picker",{locale:[1],range:[4],min:[1],max:[1],cellConfig:[16],inline:[4],textNextMonth:[513,"text-next-month"],textNextYear:[513,"text-next-year"],textNextDecade:[513,"text-next-decade"],textPreviousMonth:[513,"text-previous-month"],textPreviousYear:[513,"text-previous-year"],textPreviousDecade:[513,"text-previous-decade"],textSwitchYear:[513,"text-switch-year"],textToggleCalendar:[1,"text-toggle-calendar"],inputDisabled:[32],today:[32],startDate:[32],show:[64],hide:[64]},null,{locale:[{validateLocale:0},{updateLocale:0}],range:[{updateRange:0}],min:[{updateMin:0}],max:[{updateMax:0}],inline:[{validateInline:0}]}]]],["post-megadropdown",[[257,"post-megadropdown",{textClose:[513,"text-close"],textBack:[513,"text-back"],device:[32],isVisible:[32],trigger:[32],megadropdownTitle:[32],animationClass:[32],toggle:[64],show:[64],hide:[64],focusFirst:[64]}]]],["post-side-navigation",[[257,"post-side-navigation",{textClose:[513,"text-close"],size:[1],device:[32],toggle:[64],show:[64],hide:[64]}]]],["post-autocomplete",[[257,"post-autocomplete",{filterThreshold:[514,"filter-threshold"],clearable:[516],listbox:[513],textAvailableSuggestions:[513,"text-available-suggestions"],inputValue:[32]}]]],["post-back-to-top",[[1,"post-back-to-top",{textBackToTop:[513,"text-back-to-top"],belowFold:[32]},null,{belowFold:[{watchBelowFold:0}]}]]],["post-breadcrumb-item",[[257,"post-breadcrumb-item",{url:[513],label:[513],description:[513],variant:[513],selected:[516]}]]],["post-listbox",[[257,"post-listbox",{show:[64],hide:[64],filter:[64],clearSelection:[64],navigate:[64],selectActive:[64]},[[0,"postOptionSelected","optionClicked"]]]]],["post-listbox-option",[[257,"post-listbox-option",{value:[513],selected:[516],highlighted:[516]}]]],["post-megadropdown-trigger",[[257,"post-megadropdown-trigger",{active:[516],for:[513],isMegadropdownExpanded:[32],slottedContent:[32]},[[4,"postToggleMegadropdown","onMegadropdownToggled"]]]]],["post-number-input",[[257,"post-number-input",{isDisabled:[32],isIncrementDisabled:[32],isDecrementDisabled:[32],small:[32],input:[32]}]]],["post-pagination",[[1,"post-pagination",{page:[1026],pageSize:[514,"page-size"],collectionSize:[514,"collection-size"],label:[513],textPrevious:[513,"text-previous"],textNext:[513,"text-next"],textPage:[513,"text-page"],textFirst:[513,"text-first"],textLast:[513,"text-last"],paginationId:[32],maxVisiblePages:[32],items:[32]},null,{page:[{handlePropsChange:0}],pageSize:[{handlePropsChange:0}],collectionSize:[{handlePropsChange:0}]}]]],["post-rating",[[1,"post-rating",{label:[513],stars:[2],currentRating:[1026,"current-rating"],readonly:[4],hoveredIndex:[32]}]]],["post-tabs",[[257,"post-tabs",{textPrevTabItems:[513,"text-prev-tab-items"],textNextTabItems:[513,"text-next-tab-items"],activeTab:[513,"active-tab"],size:[513],label:[513],isPagesVariant:[32],showLeftScrollButton:[32],showRightScrollButton:[32],show:[64]},null,{label:[{validateLabel:0}]}]]],["post-tooltip",[[257,"post-tooltip",{placement:[1],arrow:[4],open:[1540],show:[64],hide:[64],toggle:[64]}]]],["post-avatar",[[257,"post-avatar",{firstname:[513],lastname:[1],email:[1],description:[1],slottedImage:[32],avatarType:[32],imageUrl:[32],imageAlt:[32],initials:[32],storageKey:[32]},null,{email:[{updateEmail:0}]}]]],["post-banner",[[257,"post-banner",{type:[513],hasActions:[32],dismiss:[64]},[[0,"click","onCloseButtonClick"]]]]],["post-linkarea",[[257,"post-linkarea"]]],["post-popover-trigger",[[257,"post-popover-trigger",{for:[513],ariaExpanded:[32],popoverOpen:[32]},null,{popoverOpen:[{syncAriaExpanded:0}]}]]],["post-progressbar",[[1,"post-progressbar",{min:[2],max:[2],value:[2]}]]],["post-side-navigation-trigger",[[257,"post-side-navigation-trigger",{for:[513],update:[64]}]]],["post-stepper",[[257,"post-stepper",{textCurrentStep:[513,"text-current-step"],textCompletedStep:[513,"text-completed-step"],textStepNumber:[513,"text-step-number"],currentIndex:[2,"current-index"],selectedIndex:[2,"selected-index"],mobileActiveStepLabel:[32],mobileActiveStepName:[32]},null,{currentIndex:[{validateCurrentIndex:0}],selectedIndex:[{validateSelectedIndex:0}],textStepNumber:[{updateActiveStepNumber:0}]}]]],["post-stepper-item",[[257,"post-stepper-item"]]],["post-tab-item",[[257,"post-tab-item",{name:[513],disabled:[516],tabId:[32],isPagesVariant:[32]}]]],["post-tab-panel",[[257,"post-tab-panel",{for:[513],panelId:[32]}]]],["post-tooltip-trigger",[[257,"post-tooltip-trigger",{for:[513],delay:[2]}]]],["post-popovercontainer",[[257,"post-popovercontainer",{placement:[1],edgeGap:[2,"edge-gap"],offset:[2],arrow:[4],safeSpace:[513,"safe-space"],dynamicPlacement:[32],show:[64],hide:[64],toggle:[64]}]]],["post-icon",[[1,"post-icon",{animation:[513],base:[1],url:[1],flipH:[516,"flip-h"],flipV:[516,"flip-v"],name:[513],rotate:[2],scale:[2]}]]],["post-footer",[[257,"post-footer",{textFooter:[513,"text-footer"],device:[32],gridSlotDisplayed:[32]}]]],["post-language-menu",[[257,"post-language-menu",{textChangeLanguage:[513,"text-change-language"],textCurrentLanguage:[513,"text-current-language"],variant:[513],activeLang:[32]},[[0,"postChange","handlePostChange"],[7,"scroll","hideMenuOnScroll"],[0,"postLanguageMenuItemInitiallyActive","handleInitiallyActive"]],{variant:[{handleVariantChange:0}]}]]],["post-header",[[257,"post-header",{fullWidth:[516,"full-width"],textMenu:[513,"text-menu"],device:[32],hasTitle:[32],hasMainNav:[32],hasLocalNav:[32],burgerMenuExtended:[32],megadropdownOpen:[32],toggleBurgerMenu:[64]},[[0,"focusin","onFocusChange"],[0,"focusout","onFocusChange"]],{device:[{lockBody:0}],burgerMenuExtended:[{lockBody:0}]}]]],["post-language-menu-item",[[260,"post-language-menu-item",{code:[513],active:[1540],variant:[1],name:[1],description:[1],url:[1],select:[64]}]]],["post-mainnavigation",[[257,"post-mainnavigation",{textMain:[513,"text-main"],canScrollLeft:[32],canScrollRight:[32]},[[9,"mouseup","stopScrolling"],[9,"mouseleave","stopScrolling"]]]]],["post-logo",[[257,"post-logo",{url:[1]}]]],["post-togglebutton",[[257,"post-togglebutton",{toggled:[1028]}]]],["post-closebutton",[[321,"post-closebutton",{buttonType:[1,"button-type"],placement:[513],size:[513]}]]],["post-menu-item",[[0,"post-menu-item"]]],["post-menu_2",[[257,"post-menu",{placement:[1],label:[513],isVisible:[32],toggle:[64],show:[64],hide:[64]}],[257,"post-menu-trigger",{for:[513]}]]],["post-accordion_4",[[257,"post-accordion-item",{collapsed:[1540],slottedLogo:[32],toggle:[64]},[[2,"postToggle","onCollapseToggle"]]],[257,"post-accordion",{headingLevel:[514,"heading-level"],multiple:[516],toggle:[64],expandAll:[64],collapseAll:[64]},[[0,"postToggle","collapseToggleHandler"]],{headingLevel:[{syncHeadingLevel:0}]}],[257,"post-collapsible",{collapsed:[1028],toggle:[64]}],[257,"post-collapsible-trigger",{for:[513],update:[64]}]]]],e)]}}))}))}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,o,a){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,i){function s(e){try{l(a.next(e))}catch(e){i(e)}}function r(e){try{l(a["throw"](e))}catch(e){i(e)}}function l(e){e.done?o(e.value):n(e.value).then(s,r)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=r(0),s["throw"]=r(1),s["return"]=r(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function r(e){return function(t){return l([e,t])}}function l(r){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,r[0]&&(o=0)),o)try{if(a=1,n&&(i=r[0]&2?n["return"]:r[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,r[1])).done)return i;if(n=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;n=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(r[0]===6&&o.label<i[1]){o.label=i[1];i=r;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(r);break}if(i[2])o.ops.pop();o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e];n=0}finally{a=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{p as promiseResolve,b as bootstrapLazy}from"./index-h3opCZqH.js";export{s as setNonce}from"./index-h3opCZqH.js";import{g as globalScripts}from"./app-globals-DQuL1Twl.js";var patchBrowser=function(){var e=import.meta.url;var t={};if(e!==""){t.resourcesUrl=new URL(".",e).href}return promiseResolve(t)};patchBrowser().then((function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,globalScripts()];case 1:t.sent();return[2,bootstrapLazy([["swisspost-internet-header",[[512,"swisspost-internet-header",{activeRoute:[1,"active-route"],environment:[1],fullWidth:[4,"full-width"],language:[1],project:[1],textBack:[513,"text-back"],textChangeLanguage:[513,"text-change-language"],textClose:[513,"text-close"],textCurrentLanguage:[513,"text-current-language"],textCurrentUser:[513,"text-current-user"],textMain:[513,"text-main"],textMenu:[513,"text-menu"],textAccessUserLinks:[513,"text-access-user-links"],textUserLinks:[513,"text-user-links"]},[[0,"postChange","handleLanguageChangeEvent"]],{activeRoute:[{handleActiveRouteChange:0}],language:[{handleLanguageChange:0}]}]]],["swisspost-internet-footer",[[512,"swisspost-internet-footer",{textFooter:[513,"text-footer"],textCookieSettings:[513,"text-cookie-settings"],liveSupportEnabled:[32],cookieSettingsEnabled:[32]}]]],["post-breadcrumbs",[[257,"post-breadcrumbs",{homeUrl:[513,"home-url"],textHome:[513,"text-home"],textBreadcrumbs:[513,"text-breadcrumbs"],textMoreItems:[513,"text-more-items"],shouldRenderMenu:[32],id:[32]}]]],["post-popover",[[257,"post-popover",{placement:[1],textClose:[513,"text-close"],arrow:[4],edgeGap:[32],show:[64],hide:[64],toggle:[64]}]]],["post-date-picker",[[257,"post-date-picker",{locale:[1],range:[4],min:[1],max:[1],cellConfig:[16],inline:[4],textNextMonth:[513,"text-next-month"],textNextYear:[513,"text-next-year"],textNextDecade:[513,"text-next-decade"],textPreviousMonth:[513,"text-previous-month"],textPreviousYear:[513,"text-previous-year"],textPreviousDecade:[513,"text-previous-decade"],textSwitchYear:[513,"text-switch-year"],textToggleCalendar:[1,"text-toggle-calendar"],inputDisabled:[32],today:[32],startDate:[32],show:[64],hide:[64]},null,{locale:[{validateLocale:0},{updateLocale:0}],range:[{updateRange:0}],min:[{updateMin:0}],max:[{updateMax:0}],inline:[{validateInline:0}]}]]],["post-megadropdown",[[257,"post-megadropdown",{textClose:[513,"text-close"],textBack:[513,"text-back"],device:[32],isVisible:[32],trigger:[32],megadropdownTitle:[32],animationClass:[32],toggle:[64],show:[64],hide:[64],focusFirst:[64]}]]],["post-side-navigation",[[257,"post-side-navigation",{textClose:[513,"text-close"],size:[1],device:[32],toggle:[64],show:[64],hide:[64]}]]],["post-autocomplete",[[257,"post-autocomplete",{filterThreshold:[514,"filter-threshold"],clearable:[516],listbox:[513],textAvailableSuggestions:[513,"text-available-suggestions"],inputValue:[32]}]]],["post-back-to-top",[[1,"post-back-to-top",{textBackToTop:[513,"text-back-to-top"],belowFold:[32]},null,{belowFold:[{watchBelowFold:0}]}]]],["post-breadcrumb-item",[[257,"post-breadcrumb-item",{url:[513],label:[513],description:[513],variant:[513],selected:[516]}]]],["post-listbox",[[257,"post-listbox",{show:[64],hide:[64],filter:[64],clearSelection:[64],navigate:[64],selectActive:[64]},[[0,"postOptionSelected","optionClicked"]]]]],["post-listbox-option",[[257,"post-listbox-option",{value:[513],selected:[516],highlighted:[516]}]]],["post-megadropdown-trigger",[[257,"post-megadropdown-trigger",{active:[516],for:[513],isMegadropdownExpanded:[32],slottedContent:[32]},[[4,"postToggleMegadropdown","onMegadropdownToggled"]]]]],["post-number-input",[[257,"post-number-input",{isDisabled:[32],isIncrementDisabled:[32],isDecrementDisabled:[32],small:[32],input:[32]}]]],["post-pagination",[[1,"post-pagination",{page:[1026],pageSize:[514,"page-size"],collectionSize:[514,"collection-size"],label:[513],textPrevious:[513,"text-previous"],textNext:[513,"text-next"],textPage:[513,"text-page"],textFirst:[513,"text-first"],textLast:[513,"text-last"],paginationId:[32],maxVisiblePages:[32],items:[32]},null,{page:[{handlePropsChange:0}],pageSize:[{handlePropsChange:0}],collectionSize:[{handlePropsChange:0}]}]]],["post-rating",[[1,"post-rating",{label:[513],stars:[2],currentRating:[1026,"current-rating"],readonly:[4],hoveredIndex:[32]}]]],["post-tabs",[[257,"post-tabs",{textPrevTabItems:[513,"text-prev-tab-items"],textNextTabItems:[513,"text-next-tab-items"],activeTab:[513,"active-tab"],size:[513],label:[513],isPagesVariant:[32],showLeftScrollButton:[32],showRightScrollButton:[32],show:[64]},null,{label:[{validateLabel:0}]}]]],["post-tooltip",[[257,"post-tooltip",{placement:[1],arrow:[4],open:[1540],show:[64],hide:[64],toggle:[64]}]]],["post-avatar",[[257,"post-avatar",{firstname:[513],lastname:[1],email:[1],description:[1],slottedImage:[32],avatarType:[32],imageUrl:[32],imageAlt:[32],initials:[32],storageKey:[32]},null,{email:[{updateEmail:0}]}]]],["post-banner",[[257,"post-banner",{type:[513],hasActions:[32],dismiss:[64]},[[0,"click","onCloseButtonClick"]]]]],["post-linkarea",[[257,"post-linkarea"]]],["post-popover-trigger",[[257,"post-popover-trigger",{for:[513],ariaExpanded:[32],popoverOpen:[32]},null,{popoverOpen:[{syncAriaExpanded:0}]}]]],["post-progressbar",[[1,"post-progressbar",{min:[2],max:[2],value:[2]}]]],["post-side-navigation-trigger",[[257,"post-side-navigation-trigger",{for:[513],update:[64]}]]],["post-stepper",[[257,"post-stepper",{textCurrentStep:[513,"text-current-step"],textCompletedStep:[513,"text-completed-step"],textStepNumber:[513,"text-step-number"],currentIndex:[2,"current-index"],selectedIndex:[2,"selected-index"],mobileActiveStepLabel:[32],mobileActiveStepName:[32]},null,{currentIndex:[{validateCurrentIndex:0}],selectedIndex:[{validateSelectedIndex:0}],textStepNumber:[{updateActiveStepNumber:0}]}]]],["post-stepper-item",[[257,"post-stepper-item"]]],["post-tab-item",[[257,"post-tab-item",{name:[513],disabled:[516],tabId:[32],isPagesVariant:[32]}]]],["post-tab-panel",[[257,"post-tab-panel",{for:[513],panelId:[32]}]]],["post-tooltip-trigger",[[257,"post-tooltip-trigger",{for:[513],delay:[2]}]]],["post-popovercontainer",[[257,"post-popovercontainer",{placement:[1],edgeGap:[2,"edge-gap"],offset:[2],arrow:[4],safeSpace:[513,"safe-space"],dynamicPlacement:[32],show:[64],hide:[64],toggle:[64]}]]],["post-icon",[[1,"post-icon",{animation:[513],base:[1],url:[1],flipH:[516,"flip-h"],flipV:[516,"flip-v"],name:[513],rotate:[2],scale:[2]}]]],["post-footer",[[257,"post-footer",{textFooter:[513,"text-footer"],device:[32],slotDisplayed:[32]}]]],["post-language-menu",[[257,"post-language-menu",{textChangeLanguage:[513,"text-change-language"],textCurrentLanguage:[513,"text-current-language"],variant:[513],activeLang:[32]},[[0,"postChange","handlePostChange"],[7,"scroll","hideMenuOnScroll"],[0,"postLanguageMenuItemInitiallyActive","handleInitiallyActive"]],{variant:[{handleVariantChange:0}]}]]],["post-header",[[257,"post-header",{fullWidth:[516,"full-width"],textMenu:[513,"text-menu"],device:[32],hasTitle:[32],hasMainNav:[32],hasLocalNav:[32],burgerMenuExtended:[32],megadropdownOpen:[32],toggleBurgerMenu:[64]},[[0,"focusin","onFocusChange"],[0,"focusout","onFocusChange"]],{device:[{lockBody:0}],burgerMenuExtended:[{lockBody:0}]}]]],["post-language-menu-item",[[260,"post-language-menu-item",{code:[513],active:[1540],variant:[1],name:[1],description:[1],url:[1],select:[64]}]]],["post-mainnavigation",[[257,"post-mainnavigation",{textMain:[513,"text-main"],canScrollLeft:[32],canScrollRight:[32]},[[9,"mouseup","stopScrolling"],[9,"mouseleave","stopScrolling"]]]]],["post-logo",[[257,"post-logo",{url:[1]}]]],["post-togglebutton",[[257,"post-togglebutton",{toggled:[1028]}]]],["post-closebutton",[[321,"post-closebutton",{buttonType:[1,"button-type"],placement:[513],size:[513]}]]],["post-menu-item",[[0,"post-menu-item"]]],["post-menu_2",[[257,"post-menu",{placement:[1],label:[513],isVisible:[32],toggle:[64],show:[64],hide:[64]}],[257,"post-menu-trigger",{for:[513]}]]],["post-accordion_4",[[257,"post-accordion-item",{collapsed:[1540],slottedLogo:[32],toggle:[64]},[[2,"postToggle","onCollapseToggle"]]],[257,"post-accordion",{headingLevel:[514,"heading-level"],multiple:[516],toggle:[64],expandAll:[64],collapseAll:[64]},[[0,"postToggle","collapseToggleHandler"]],{headingLevel:[{syncHeadingLevel:0}]}],[257,"post-collapsible",{collapsed:[1028],toggle:[64]}],[257,"post-collapsible-trigger",{for:[513],update:[64]}]]]],e)]}}))}))}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{swisspost_internet_footer as PostInternetFooter}from"./swisspost-internet-footer.entry.esm.js";export{swisspost_internet_header as PostInternetHeader}from"./swisspost-internet-header.entry.esm.js";import"./p-h3opCZqH.js";import"./p-
|
|
1
|
+
export{swisspost_internet_footer as PostInternetFooter}from"./swisspost-internet-footer.entry.esm.js";export{swisspost_internet_header as PostInternetHeader}from"./swisspost-internet-header.entry.esm.js";import"./p-h3opCZqH.js";import"./p-EbHv-NGg.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e,H as i,g as s}from"./p-h3opCZqH.js";import{v as o}from"./p-
|
|
1
|
+
import{r as t,h as e,H as i,g as s}from"./p-h3opCZqH.js";import{v as o}from"./p-YQBh4peU.js";import{R as n}from"./p-DvaRK2lz.js";import{T as r}from"./p-DZMUeI8H.js";import"./p-vAzHgwTd.js";const a=class{constructor(e){t(this,e),this.canScrollLeft=!1,this.canScrollRight=!1,this.scrollRight=this.scrollRight.bind(this),this.scrollLeft=this.scrollLeft.bind(this),this.checkScrollability=this.checkScrollability.bind(this),this.resizeObserver=new ResizeObserver(this.checkScrollability),this.mutationObserver=new MutationObserver(this.checkScrollability)}componentDidLoad(){setTimeout((()=>{this.checkScrollability()})),this.resizeObserver.observe(this.navbar),this.mutationObserver.observe(this.navbar,{subtree:!0,childList:!0}),this.navbar?.addEventListener("scrollend",this.checkScrollability)}disconnectedCallback(){this.mutationObserver.disconnect(),this.resizeObserver.disconnect(),this.navbar?.removeEventListener("scrollend",this.checkScrollability)}stopScrolling(){this.scrollRepeatInterval&&clearInterval(this.scrollRepeatInterval)}get navigationItems(){return Array.from(this.host.querySelectorAll("a:not(post-megadropdown *), post-megadropdown-trigger"))}get canScroll(){return this.canScrollLeft||this.canScrollRight}checkScrollability(){const{scrollLeft:t,scrollWidth:e,clientWidth:i}=this.navbar;e===i?this.canScrollLeft=this.canScrollRight=!1:(this.canScrollLeft=Math.floor(t)>0,this.canScrollRight=Math.ceil(i+t)<e)}handleScrollButtonClick(t,e){if(!this.canScroll||0!==t.button)return;this.temporarilyDisableNavbar();const i="right"===e?this.scrollRight:this.scrollLeft;i(),this.scrollRepeatInterval=setInterval((()=>{i()}),100)}scrollRight(){const t=this.host.shadowRoot.querySelector(".scroll-right").getBoundingClientRect().left;for(const e of this.navigationItems){const{right:i,width:s}=e.getBoundingClientRect();if(!(i-.25*s<t))return void this.navbar.scrollBy({left:i-t})}}scrollLeft(){const t=this.host.shadowRoot.querySelector(".scroll-left").getBoundingClientRect().right;for(const e of this.navigationItems.reverse()){const{left:i,width:s}=e.getBoundingClientRect();if(!(i+.25*s>t))return void this.navbar.scrollBy({left:i-t})}}temporarilyDisableNavbar(){this.navbarDisableTimer&&clearTimeout(this.navbarDisableTimer),this.navbar.setAttribute("inert",""),this.navbarDisableTimer=setTimeout((()=>{this.navbar.removeAttribute("inert")}),400)}render(){return e(i,{key:"2e9f2361426298f620411b1d064e166992ba326e",version:o,class:this.canScroll?"scrollable":""},e("div",{key:"10103d153e37fd591c2ce062ef7455228adbf5b9","aria-hidden":"true",class:{"scroll-control scroll-left":!0,"d-none":!this.canScrollLeft},onMouseDown:t=>this.handleScrollButtonClick(t,"left")},e("post-icon",{key:"8bb9b82626d05c1fe8f4fd1bb9f8e6d6be59ad8a","aria-hidden":"true",name:"chevronleft"})),e("nav",{key:"6905afe8c2dfcf0f2411b45237b52d63f187d2c9",ref:t=>this.navbar=t,"aria-label":this.textMain},e("slot",{key:"2db905e52b1604d9c6097734d055100a58625f09"})),e("div",{key:"f8ec4f906f1c99fec2198bb350ac1735c2de8469","aria-hidden":"true",class:{"scroll-control scroll-right":!0,"d-none":!this.canScrollRight},onMouseDown:t=>this.handleScrollButtonClick(t,"right")},e("post-icon",{key:"afed8c1778691ca5b849d78ee20d51a4b8c02fe6","aria-hidden":"true",name:"chevronright"})))}get host(){return s(this)}};(function(t,e,i,s){var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)})([n(),r("string")],a.prototype,"textMain",void 0),a.style=":host{display:-ms-flexbox;display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;max-width:var(--post-header-content-max-width)}@media screen and (min-width: 1024px){:host{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;-webkit-margin-start:calc(-1*var(--post-local-header-padding-inline-start));margin-inline-start:calc(-1*var(--post-local-header-padding-inline-start));-webkit-margin-end:calc(-1*var(--post-local-header-padding-inline-end));margin-inline-end:calc(-1*var(--post-local-header-padding-inline-end));overflow:hidden}}nav{-ms-flex:1 1 auto;flex:1 1 auto}@media screen and (min-width: 1024px){nav{scroll-behavior:smooth;max-width:100vw;overflow:hidden;height:var(--post-main-navigation-height)}}.scroll-control{z-index:1;cursor:pointer;padding:1rem;background:#fff;-webkit-box-shadow:var(--post-device-elevation-500);box-shadow:var(--post-device-elevation-500);line-height:1}.scroll-control.scroll-left{-webkit-margin-end:-3rem;margin-inline-end:-3rem}.scroll-control.scroll-right{-webkit-margin-start:-3rem;margin-inline-start:-3rem}.scroll-control.d-none{display:none}.scroll-control post-icon{font-size:1rem}";export{a as post_mainnavigation}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as o,H as s,g as e}from"./p-h3opCZqH.js";import{v as i}from"./p-
|
|
1
|
+
import{r as t,h as o,H as s,g as e}from"./p-h3opCZqH.js";import{v as i}from"./p-YQBh4peU.js";const r=class{constructor(o){t(this,o),this.toggled=!1,this.handleClick=()=>{this.toggled=!this.toggled},this.handleKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.host.click())}}componentWillLoad(){this.host.addEventListener("click",(()=>this.handleClick()),{capture:!0}),this.host.addEventListener("keydown",(t=>this.handleKeydown(t)),{capture:!0})}render(){return o(s,{key:"6f61a07946f3e67bace0a883b73c424893c4043d","data-version":i,role:"button",tabindex:"0","aria-pressed":this.toggled.toString()},o("slot",{key:"fd9b93e45da499dbb790ad675f3db36e248c1960"}))}get host(){return e(this)}};r.style=":host{cursor:pointer;outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(:focus-visible){outline-color:Highlight !important}}:host([aria-pressed=true]) ::slotted([data-showwhen=untoggled]){display:none}:host([aria-pressed=false]) ::slotted([data-showwhen=toggled]){display:none}";export{r as post_togglebutton}
|
package/dist/swisspost-internet-header/{p-6b19deb1.system.entry.js → p-04cf59e4.system.entry.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-CN_0KCBp.system.js","./p-
|
|
1
|
+
System.register(["./p-CN_0KCBp.system.js","./p-Bz5HDsjW.system.js","./p-CiwQnVr3.system.js","./p-BMZcKRx0.system.js","./p-D4wq7hIE.system.js","./p-DaxAbTyB.system.js"],(function(t){"use strict";var n,i,a,e,r,o,s,f;return{setters:[function(t){n=t.r;i=t.h;a=t.H;e=t.g},function(t){r=t.v},function(t){o=t.O},function(t){s=t.T},function(t){f=t.R},null],execute:function(){var m=["cylon","cylon-vertical","spin","spin-reverse","fade","throb"];var c=function(){return":host{display:inline-block;width:1em;height:1em;vertical-align:-0.15em}span{display:block;width:100%;height:100%;fill:currentColor;forced-color-adjust:preserve-parent-color;background-color:currentColor;-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%}:host([flip-h]:not([flip-h=false])){scale:-1 1}:host([flip-v]:not([flip-v=false])){scale:1 -1}:host([flip-h][flip-v]:not([flip-h=false],[flip-v=false])){scale:-1}:host([animation]){-webkit-transform-origin:center;transform-origin:center}:host([animation=cylon]){-webkit-animation:icon-animation-cylon .75s ease-in-out infinite alternate;animation:icon-animation-cylon .75s ease-in-out infinite alternate}:host([animation=cylon-vertical]){-webkit-animation:icon-animation-cylon-vertical .75s ease-in-out infinite alternate;animation:icon-animation-cylon-vertical .75s ease-in-out infinite alternate}:host([animation=spin]){-webkit-animation:icon-animation-spin 2s linear infinite normal;animation:icon-animation-spin 2s linear infinite normal}:host([animation=spin-reverse]){animation:icon-animation-spin 2s linear infinite reverse}:host([animation=fade]){-webkit-animation:icon-animation-fade .75s ease-in-out infinite alternate;animation:icon-animation-fade .75s ease-in-out infinite alternate}:host([animation=throb]){-webkit-animation:icon-animation-throb .75s ease-in-out infinite alternate;animation:icon-animation-throb .75s ease-in-out infinite alternate}@-webkit-keyframes icon-animation-cylon{from{-webkit-transform:translateX(-25%);transform:translateX(-25%)}to{-webkit-transform:translateX(25%);transform:translateX(25%)}}@keyframes icon-animation-cylon{from{-webkit-transform:translateX(-25%);transform:translateX(-25%)}to{-webkit-transform:translateX(25%);transform:translateX(25%)}}@-webkit-keyframes icon-animation-cylon-vertical{from{-webkit-transform:translateY(25%);transform:translateY(25%)}to{-webkit-transform:translateY(-25%);transform:translateY(-25%)}}@keyframes icon-animation-cylon-vertical{from{-webkit-transform:translateY(25%);transform:translateY(25%)}to{-webkit-transform:translateY(-25%);transform:translateY(-25%)}}@-webkit-keyframes icon-animation-fade{from{opacity:.1}to{opacity:1}}@keyframes icon-animation-fade{from{opacity:.1}to{opacity:1}}@-webkit-keyframes icon-animation-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes icon-animation-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-webkit-keyframes icon-animation-throb{from{opacity:.5;-webkit-transform:scale(0.5);transform:scale(0.5)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes icon-animation-throb{from{opacity:.5;-webkit-transform:scale(0.5);transform:scale(0.5)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}"};var l=undefined&&undefined.__decorate||function(t,n,i,a){var e=arguments.length,r=e<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(t,n,i,a);else for(var s=t.length-1;s>=0;s--)if(o=t[s])r=(e<3?o(r):e>3?o(n,i,r):o(n,i))||r;return e>3&&r&&Object.defineProperty(n,i,r),r};var u="https://unpkg.com/@swisspost/design-system-icons@".concat(r,"/public/post-icons/");var b=t("post_icon",function(){function t(t){n(this,t);this.flipH=false;this.flipV=false}t.prototype.getUrl=function(){var t,n,i;var a=(t=this.name)!==null&&t!==void 0?t:this.host.getAttribute("name");var e="".concat(a,".svg");if((n=this.url)===null||n===void 0?void 0:n.startsWith("data:image/")){return this.url}if(this.url){return this.url}var r=function(t){return/^https?:\/\//.test(t)};var o=function(t){return t&&!t.endsWith("/")?"".concat(t,"/"):t};var s=function(t){return t.replaceAll(/([^:])\/\//g,"$1/")};var f=globalThis.location.origin;var m=((i=document.querySelector("base[href]"))===null||i===void 0?void 0:i.getAttribute("href"))||"";var c="";{var l=document.querySelector('meta[name="design-system-settings"]');c=(l===null||l===void 0?void 0:l.getAttribute("data-post-icon-base"))||""}var b=function(t){var n=o(m);var i=o(t);if(r(n)){return"".concat(n).concat(i)}return"".concat(f).concat(n).concat(i)};var h;if(this.base){h=r(this.base)?"".concat(o(this.base)).concat(e):"".concat(b(this.base)).concat(e);return s(h)}if(c){h=r(c)?"".concat(o(c)).concat(e):"".concat(b(c)).concat(e);return s(h)}return s("".concat(u).concat(e))};t.prototype.getStyles=function(){var t=this.getUrl();return Object.fromEntries(Object.entries({"-webkit-mask-image":"url(".concat(t,")"),"mask-image":"url('".concat(t,"')"),transform:(this.scale&&!Number.isNaN(Number(this.scale))?"scale("+this.scale+")":"")+(this.rotate&&!Number.isNaN(Number(this.rotate))?" rotate("+this.rotate+"deg)":"")}).filter((function(t){var n=t[0],i=t[1];return i!==null})))};t.prototype.render=function(){return i(a,{key:"9d7b98a18fa098702c0fe1bd06544f605801db6a","data-version":r},i("span",{key:"847682d63ce72e26a541f40b29255e81febaf79e",style:this.getStyles()}))};Object.defineProperty(t.prototype,"host",{get:function(){return e(this)},enumerable:false,configurable:true});return t}());l([o(m)],b.prototype,"animation",void 0);l([s("string")],b.prototype,"base",void 0);l([f(),s("string")],b.prototype,"name",void 0);l([s("number")],b.prototype,"rotate",void 0);l([s("number")],b.prototype,"scale",void 0);b.style=c()}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as o,H as i}from"./p-h3opCZqH.js";import{c as e,T as s,L as n,s as r,g as l,v as a}from"./p-
|
|
1
|
+
import{r as t,h as o,H as i}from"./p-h3opCZqH.js";import{c as e,T as s,L as n,s as r,g as l,v as a}from"./p-EbHv-NGg.js";const p=class{textFooter;textCookieSettings;liveSupportEnabled=!1;cookieSettingsEnabled=!1;constructor(o){if(t(this,o),this.liveSupportEnabled=this.unbluEnabled(),this.cookieSettingsEnabled=this.ucUIEnabled(),!this.liveSupportEnabled){let t,o=0;const i=()=>{const i=this.unbluEnabled(),e=this.ucUIEnabled(),s=i&&e;i&&(this.liveSupportEnabled=!0),e&&(this.cookieSettingsEnabled=!0),(s||o>=5)&&window.clearInterval(t),o++};t=window.setInterval(i,1e3)}}unbluEnabled(){return"function"==typeof window.unbluLSLoad}ucUIEnabled(){return"object"==typeof window.UC_UI&&"function"==typeof window.UC_UI.showSecondLayer}handleCookieSettingsClick(){window.UC_UI.showSecondLayer()}renderListWithTitle(t,i){if(!t)return;const{titleProps:r,listProps:a,linkProps:p}=i,h=l(t.title),c=e(h);return[o(s,{...r,config:t.title,id:c}),o("ul",{...a,"aria-labelledby":c},t.items.map((t=>o("li",{key:t.text},o(n,{...p,config:t})))))]}render(){if(!r.localizedConfig)return null;if(!r.localizedConfig.footer)return console.warn(`Internet Footer: Current project "${r.projectId}" does not include a footer config. The footer will not be rendered. Remove `,document.querySelector("swisspost-internet-footer"),"from your markup or configure the footer in your portal config to stop seeing this warning."),null;const t=r.localizedConfig.footer;return o(i,{"data-version":a},o("post-footer",{textFooter:this.textFooter},t.prefooter&&o("div",{slot:"prefooter"},this.renderListWithTitle(t.prefooter,{titleProps:{tag:"h3"}})),t.sections?.map(((t,o)=>this.renderListWithTitle(t,{titleProps:{tag:"span",slot:`grid-${o+1}-title`},listProps:{slot:`grid-${o+1}`}}))),t.socialLinks&&o("div",{slot:"socialmedia"},this.renderListWithTitle(t.socialLinks,{titleProps:{tag:"h3"},linkProps:{class:"btn btn-primary btn-icon",hiddenText:!0}})),t.appStoreLinks&&o("div",{slot:"app"},this.renderListWithTitle(t.appStoreLinks,{titleProps:{tag:"h3"},linkProps:{class:"app-store-badge",hiddenText:!0}})),t.companyLinks&&o("div",{slot:"businesssectors"},this.renderListWithTitle(t.companyLinks,{titleProps:{tag:"h3"}})),t.complianceLinks&&o("div",{slot:"meta"},o("ul",{"aria-label":l(t.complianceLinks.title)},t.complianceLinks.items.map((t=>o("li",{key:t.text},o(n,{config:t})))),this.cookieSettingsEnabled&&o("li",null,o("button",{class:"btn btn-link cookie-settings",onClick:this.handleCookieSettingsClick},this.textCookieSettings)))),t.copyright&&o("p",{slot:"copyright"},t.copyright)))}};p.style=".cookie-settings{min-height:0;border:0 none;font-weight:inherit}";export{p as swisspost_internet_footer}
|
package/dist/swisspost-internet-header/{p-f606f337.system.entry.js → p-0bffd1b3.system.entry.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var i,n=1,o=arguments.length;n<o;n++){i=arguments[n];for(var e in i)if(Object.prototype.hasOwnProperty.call(i,e))t[e]=i[e]}return t};return __assign.apply(this,arguments)};System.register(["./p-CN_0KCBp.system.js","./p-
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var i,n=1,o=arguments.length;n<o;n++){i=arguments[n];for(var e in i)if(Object.prototype.hasOwnProperty.call(i,e))t[e]=i[e]}return t};return __assign.apply(this,arguments)};System.register(["./p-CN_0KCBp.system.js","./p-C-jY5kgj.system.js"],(function(t){"use strict";var i,n,o,e,r,s,a,u,f;return{setters:[function(t){i=t.r;n=t.h;o=t.H},function(t){e=t.c;r=t.T;s=t.L;a=t.s;u=t.g;f=t.v}],execute:function(){var l=function(){return".cookie-settings{min-height:0;border:0 none;font-weight:inherit}"};var c=t("swisspost_internet_footer",function(){function t(t){var n=this;this.liveSupportEnabled=false;this.cookieSettingsEnabled=false;i(this,t);this.liveSupportEnabled=this.unbluEnabled();this.cookieSettingsEnabled=this.ucUIEnabled();if(!this.liveSupportEnabled){var o=undefined;var e=0;var r=function(){var t=n.unbluEnabled();var i=n.ucUIEnabled();var r=t&&i;if(t){n.liveSupportEnabled=true}if(i){n.cookieSettingsEnabled=true}if(r||e>=5){window.clearInterval(o)}e++};o=window.setInterval(r,1e3)}}t.prototype.unbluEnabled=function(){return typeof window["unbluLSLoad"]==="function"};t.prototype.ucUIEnabled=function(){return typeof window["UC_UI"]==="object"&&typeof window["UC_UI"]["showSecondLayer"]==="function"};t.prototype.handleCookieSettingsClick=function(){window["UC_UI"]["showSecondLayer"]()};t.prototype.renderListWithTitle=function(t,i){if(!t)return undefined;var o=i.titleProps,a=i.listProps,f=i.linkProps;var l=u(t.title);var c=e(l);return[n(r,__assign(__assign({},o),{config:t.title,id:c})),n("ul",__assign(__assign({},a),{"aria-labelledby":c}),t.items.map((function(t){return n("li",{key:t.text},n(s,__assign(__assign({},f),{config:t})))})))]};t.prototype.render=function(){var t=this;var i;if(!a.localizedConfig){return null}if(!a.localizedConfig.footer){console.warn('Internet Footer: Current project "'.concat(a.projectId,'" does not include a footer config. The footer will not be rendered. Remove '),document.querySelector("swisspost-internet-footer"),"from your markup or configure the footer in your portal config to stop seeing this warning.");return null}var e=a.localizedConfig.footer;return n(o,{"data-version":f},n("post-footer",{textFooter:this.textFooter},e.prefooter&&n("div",{slot:"prefooter"},this.renderListWithTitle(e.prefooter,{titleProps:{tag:"h3"}})),(i=e.sections)===null||i===void 0?void 0:i.map((function(i,n){return t.renderListWithTitle(i,{titleProps:{tag:"span",slot:"grid-".concat(n+1,"-title")},listProps:{slot:"grid-".concat(n+1)}})})),e.socialLinks&&n("div",{slot:"socialmedia"},this.renderListWithTitle(e.socialLinks,{titleProps:{tag:"h3"},linkProps:{class:"btn btn-primary btn-icon",hiddenText:true}})),e.appStoreLinks&&n("div",{slot:"app"},this.renderListWithTitle(e.appStoreLinks,{titleProps:{tag:"h3"},linkProps:{class:"app-store-badge",hiddenText:true}})),e.companyLinks&&n("div",{slot:"businesssectors"},this.renderListWithTitle(e.companyLinks,{titleProps:{tag:"h3"}})),e.complianceLinks&&n("div",{slot:"meta"},n("ul",{"aria-label":u(e.complianceLinks.title)},e.complianceLinks.items.map((function(t){return n("li",{key:t.text},n(s,{config:t}))})),this.cookieSettingsEnabled&&n("li",null,n("button",{class:"btn btn-link cookie-settings",onClick:this.handleCookieSettingsClick},this.textCookieSettings)))),e.copyright&&n("p",{slot:"copyright"},e.copyright)))};return t}());c.style=l()}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e,H as i,g as o}from"./p-h3opCZqH.js";import{v as s}from"./p-
|
|
1
|
+
import{r as t,h as e,H as i,g as o}from"./p-h3opCZqH.js";import{v as s}from"./p-YQBh4peU.js";import{d as n}from"./p-bR8vy6-s.js";function r(t,e){const i=Number.parseFloat(t[e]);return Number.isNaN(i)?void 0:i}function a(t,e,i){return void 0!==t&&void 0!==e&&i(t,e)}const d=class{constructor(e){t(this,e),this.isDisabled=!1,this.isIncrementDisabled=!1,this.isDecrementDisabled=!1,this.small=!1,this.setupInput=n(50,(()=>{this.input=this.input??function(t,e){const i=t.querySelectorAll(e);return 1===i.length?i[0]:(console.error(`<${t.localName}> expects exactly one element matching "${e}", but found ${i.length}.`,t),null)}(this.host,'input[type="number"]'),this.input&&(this.isDisabled=this.input.disabled,this.small=this.input.classList.contains("form-control-sm"),this.updateStepButtonState(),this.input.addEventListener("input",(()=>this.updateStepButtonState())),this.mutationObserver=new MutationObserver((()=>this.updateStepButtonState())),this.mutationObserver.observe(this.input,{attributes:!0,attributeFilter:["min","max","disabled"]}))}))}get value(){return r(this.input,"value")}get min(){return r(this.input,"min")}get max(){return r(this.input,"max")}get isAtMin(){return a(this.value,this.min,((t,e)=>t===e))}get isAtMax(){return a(this.value,this.max,((t,e)=>t===e))}get isBelowMin(){return a(this.value,this.min,((t,e)=>t<e))}get isAboveMax(){return a(this.value,this.max,((t,e)=>t>e))}disconnectedCallback(){this.mutationObserver&&this.mutationObserver.disconnect()}step(t){const e="up"===t;!function(t,e){const i=function(t,{delayMs:e=300,intervalMs:i=100}={}){let o;t();const s=setTimeout((()=>{o=setInterval(t,i)}),e);return()=>{clearTimeout(s),o&&clearInterval(o)}}(t,e),o=()=>{i(),globalThis.removeEventListener("pointerup",o),globalThis.removeEventListener("pointercancel",o),globalThis.removeEventListener("pointerleave",o)};globalThis.addEventListener("pointerup",o),globalThis.addEventListener("pointercancel",o),globalThis.addEventListener("pointerleave",o)}((()=>{(e?this.isAtMax:this.isAtMin)||((e?this.isBelowMin:this.isAboveMax)?this.input.value=e?this.input.min:this.input.max:(e?this.input.stepUp:this.input.stepDown).call(this.input),this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.updateStepButtonState())}))}updateStepButtonState(){this.input.disabled||this.min&&this.max&&this.min>this.max?this.isIncrementDisabled=this.isDecrementDisabled=!0:(this.isIncrementDisabled=this.isAtMax||this.isAboveMax,this.isDecrementDisabled=this.isAtMin||this.isBelowMin)}render(){const t=!!this.input;return e(i,{key:"59cbe12c66b0eabbff15a3110ee847396df2d261","data-version":s,class:{"number-input-sm":this.small,disabled:this.isDisabled}},t&&e("div",{key:"43fca97c040104786ab528b04f3e0dd576f29025","aria-hidden":"true",onPointerDown:()=>this.step("down"),class:{"step-button":!0,disabled:this.isDecrementDisabled}},e("post-icon",{key:"1b41c236beb802d98f60776827928335d00599c4",name:"minus"})),e("div",{key:"8342d335e0a84f78514edac5052ffea081fb40c7",class:"input-container"},e("slot",{key:"d2f8eae0656faaab31358cd3582c873d4a491e73",onSlotchange:()=>this.setupInput()})),t&&e("div",{key:"0055b317ed6ec64f2451640c436d169bb0b07626","aria-hidden":"true",onPointerDown:()=>this.step("up"),class:{"step-button":!0,disabled:this.isIncrementDisabled}},e("post-icon",{key:"dafe4a65f6d5d6ba4f54229c55506d5cf14fe126",name:"plus"})))}get host(){return o(this)}};d.style=':host{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:end;align-items:end;width:100%}:host ::slotted(input[type=number]),:host .step-button{height:var(--post-device-sizing-interactive-button-height-6) !important}:host ::slotted(input[type=number]){border-radius:0 !important;padding-inline:var(--post-device-spacing-padding-inline-1);-webkit-padding-before:var(--post-device-spacing-padding-block-29);padding-block-start:var(--post-device-spacing-padding-block-29);-webkit-padding-after:var(--post-device-spacing-padding-block-3);padding-block-end:var(--post-device-spacing-padding-block-3)}:host ::slotted(input[type=number]:focus){outline:none !important}:host .step-button.disabled{background-color:var(--post-scheme-color-interactive-button-secondary-disabled-bg);color:var(--post-scheme-color-interactive-button-secondary-disabled-fg);border-color:var(--post-scheme-color-interactive-button-secondary-disabled-stroke);border-style:var(--post-core-border-style-dash)}:host(.number-input-sm) ::slotted(input[type=number]),:host(.number-input-sm) .step-button{height:var(--post-device-sizing-interactive-button-height-8) !important}:host(.number-input-sm) ::slotted(input[type=number]){font-size:var(--post-device-font-size-7) !important;padding-inline:var(--post-device-spacing-padding-inline-1) !important;padding-block:var(--post-device-spacing-padding-29) !important}:host(.number-input-sm) ::slotted(input[type=number].is-valid),:host(.number-input-sm) ::slotted(input[type=number].is-invalid){background-size:var(--post-device-sizing-notification-5) !important;-webkit-padding-end:calc( (var(--post-device-spacing-padding-inline-1)* 2) + var(--post-device-sizing-notification-5) ) !important;padding-inline-end:calc( (var(--post-device-spacing-padding-inline-1)* 2) + var(--post-device-sizing-notification-5) ) !important}:host(.number-input-sm) .step-button{padding-inline:var(--post-device-spacing-padding-32);padding-block:var(--post-device-spacing-padding-2)}:host(.number-input-sm) .step-button post-icon{width:var(--post-device-sizing-interactive-icon-size7);height:var(--post-device-sizing-interactive-icon-size7)}:host(:hover) .step-button:not(.disabled){background-color:var(--post-scheme-color-interactive-button-secondary-hover-bg);border-color:var(--post-scheme-color-interactive-button-secondary-hover-stroke)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(:hover) .step-button:not(.disabled){border-color:Highlight}}:host(:hover) .step-button:not(.disabled),:host(:hover) .step-button:not(.disabled) post-icon{color:var(--post-scheme-color-interactive-button-secondary-hover-fg)}.input-container{position:relative;-ms-flex-positive:1;flex-grow:1}.input-container:focus-within::after{content:"";pointer-events:none;z-index:2;width:calc(100% + (var(--post-device-border-width-default) * 2));height:calc(100% + (var(--post-device-border-width-default) * 2));border:var(--post-device-border-width-focus) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-focus-stroke);position:absolute;border-radius:var(--post-device-border-radius-1);top:calc((var(--post-device-border-width-default) * 2)*-1);left:calc((var(--post-device-border-width-default) * 2)*-1)}.step-button{display:-ms-inline-flexbox;display:inline-flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;max-width:100%;overflow:hidden;-webkit-transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);-webkit-box-shadow:none;box-shadow:none;font-family:inherit;font-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;-webkit-transition:unset;transition:unset;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex:0 0 auto;flex:0 0 auto;border-radius:var(--post-device-border-radius-1);padding-inline:var(--post-device-spacing-padding-23);padding-block:var(--post-device-spacing-padding-22);-webkit-box-shadow:var(--post-device-elevation-100);box-shadow:var(--post-device-elevation-100);border:var(--post-device-border-width-default) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-button-secondary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-secondary-enabled-bg);color:var(--post-scheme-color-interactive-button-secondary-enabled-fg)}.step-button:not(:disabled):hover{text-decoration:none}.step-button:disabled{border-style:var(--post-core-border-style-dash);cursor:unset}.step-button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.step-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.step-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.step-button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.step-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.step-button:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}.step-button:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}.step-button:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}.step-button post-icon{width:var(--post-device-sizing-interactive-icon-size6);height:var(--post-device-sizing-interactive-icon-size6)}.step-button:first-of-type{border-start-end-radius:0;border-end-end-radius:0;border-inline-end-width:0}.step-button:last-of-type{border-start-start-radius:0;border-end-start-radius:0;border-inline-start-width:0}.step-button.disabled{pointer-events:none;cursor:unset}';export{d as post_number_input}
|