@webority/ui-elements 0.149.0 → 0.152.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/WuiCarousel-DthhDxH-.js +1 -0
- package/dist/WuiCodeBlock-DHpmEskS.js +1 -0
- package/dist/WuiCommandPalette-DqHh4lH6.js +2 -0
- package/dist/WuiCommentThread-BmRsl0K1.js +1 -0
- package/dist/WuiConsentBanner-Bm7tT3_5.js +1 -0
- package/dist/WuiContextMenu-sPTmEEVn.js +1 -0
- package/dist/WuiDataTable-B4BYCd_s.js +1 -0
- package/dist/WuiDatePicker-DLEsnzqG.js +31 -0
- package/dist/WuiDateRange-9Xqs5nvv.js +25 -0
- package/dist/WuiDock-d5abaLkL.js +1 -0
- package/dist/WuiDrawer-B3YFmxl2.js +1 -0
- package/dist/WuiHoverCard-CE3dHKaM.js +1 -0
- package/dist/WuiImageCrop-ChvH8GKb.js +17 -0
- package/dist/WuiInlineEdit-BlBuWkHG.js +1 -0
- package/dist/WuiLeadPopup-YN4YCbOe.js +382 -0
- package/dist/WuiLightbox-C2A14vHx.js +1 -0
- package/dist/WuiMarkdown-BXY0QKaO.js +4 -0
- package/dist/WuiMentionInput-8Xjkzdqg.js +1 -0
- package/dist/WuiNavigationMenu-CZ3XhFam.js +1 -0
- package/dist/WuiNotificationCenter-ClkCTUnp.js +1 -0
- package/dist/WuiOnboardingChecklist-Cx-TgpBY.js +1 -0
- package/dist/WuiOrgTree-DzeLFQxy.js +1 -0
- package/dist/{WuiOtp-BqWijfNj.js → WuiOtp-DonxSwVn.js} +2 -2
- package/dist/WuiOverflow-B0wA6aDe.js +1 -0
- package/dist/WuiPhone-BVNVerap.js +16 -0
- package/dist/WuiRating-DLVduJZ_.js +1 -0
- package/dist/WuiRecordPager-7HVGoFlP.js +1 -0
- package/dist/WuiRelativeTime-DyeUQOQ8.js +1 -0
- package/dist/WuiResizable-DQZdQVCz.js +1 -0
- package/dist/WuiRollingNumber-sfgNzaP0.js +1 -0
- package/dist/WuiSavedViews-UaiP6YNG.js +1 -0
- package/dist/WuiSelect-DBPre2oe.js +9 -0
- package/dist/WuiShortcuts-D3rWkaOm.js +1 -0
- package/dist/WuiShowMore-CvdNQXrA.js +1 -0
- package/dist/WuiSlider-D33Y3_t9.js +51 -0
- package/dist/WuiSortable-CBLMNRuZ.js +1 -0
- package/dist/WuiTimePicker-DOodgU2O.js +9 -0
- package/dist/WuiTour-Cx61ijsm.js +1 -0
- package/dist/WuiTree-0Yqu199O.js +1 -0
- package/dist/WuiTruncate-C2WV1-NN.js +1 -0
- package/dist/WuiWhatsNew-dLGyA4g1.js +1 -0
- package/dist/WuiWizardStep-Cencr-mT.js +1 -0
- package/dist/{anchorOverlay-DDrc2k6y.js → anchorOverlay-CXnWfezA.js} +1 -1
- package/dist/buttonClass-GtEi8hAY.js +1 -0
- package/dist/calendarMath-D6UUgYTD.js +1 -0
- package/dist/chips-Dony2fgq.js +2 -0
- package/dist/commentText-BnX7rA2-.js +1 -0
- package/dist/{countries-CvmZ2xpG.js → countries-DQL9nAUt.js} +1 -1
- package/dist/country-x5lqC5Xu.js +1 -0
- package/dist/customRule-Chp7YwFb.js +1 -0
- package/dist/dataTable-B-7oAeii.js +1 -0
- package/dist/dom-Do1pAA12.js +1 -0
- package/dist/drawerDiscard-C0yRSl1I.js +1 -0
- package/dist/elementBase-Cxeyx0tU.js +1 -0
- package/dist/elements/carousel.js +1 -1
- package/dist/elements/code-block.js +1 -1
- package/dist/elements/command-palette.js +1 -1
- package/dist/elements/comment-thread.js +1 -1
- package/dist/elements/consent-banner.js +1 -1
- package/dist/elements/context-menu.js +1 -1
- package/dist/elements/data-table.js +1 -1
- package/dist/elements/date-range.js +1 -1
- package/dist/elements/datepicker.js +1 -1
- package/dist/elements/dock.js +1 -1
- package/dist/elements/drawer.js +1 -1
- package/dist/elements/filter-popover.js +1 -1
- package/dist/elements/hover-card.js +1 -1
- package/dist/elements/image-crop.js +1 -1
- package/dist/elements/inline-edit.js +1 -1
- package/dist/elements/kanban.js +1 -1
- package/dist/elements/lead-popup.js +1 -1
- package/dist/elements/lightbox.js +1 -1
- package/dist/elements/markdown.js +1 -1
- package/dist/elements/mention-input.js +1 -1
- package/dist/elements/navigation-menu.js +1 -1
- package/dist/elements/notification-center.js +1 -1
- package/dist/elements/onboarding-checklist.js +1 -1
- package/dist/elements/org-tree.js +1 -1
- package/dist/elements/otp.js +1 -1
- package/dist/elements/overflow.js +1 -1
- package/dist/elements/phone.js +1 -1
- package/dist/elements/rating.js +1 -1
- package/dist/elements/record-pager.js +1 -1
- package/dist/elements/relative-time.js +1 -1
- package/dist/elements/resizable.js +1 -1
- package/dist/elements/rolling-number.js +1 -1
- package/dist/elements/saved-views.js +1 -1
- package/dist/elements/select.js +1 -1
- package/dist/elements/shortcuts.js +1 -1
- package/dist/elements/show-more.js +1 -1
- package/dist/elements/slider.js +1 -1
- package/dist/elements/sortable.js +1 -1
- package/dist/elements/status-icon.js +1 -1
- package/dist/elements/timepicker.js +1 -1
- package/dist/elements/tour.js +1 -1
- package/dist/elements/tree.js +1 -1
- package/dist/elements/truncate.js +1 -1
- package/dist/elements/whats-new.js +1 -1
- package/dist/elements/wizard.js +1 -1
- package/dist/{fileViewerImage-CLzN49Fd.js → fileViewerImage-Bt1jeArm.js} +2 -2
- package/dist/fileViewerMedia-Bp1uHJvC.js +1 -0
- package/dist/{fileViewerPdf-6MAAzmCM.js → fileViewerPdf-CdaDuaRJ.js} +11 -11
- package/dist/fileViewerUi-ResPjO1o.js +1 -0
- package/dist/filterPopover-D8BOb-Hz.js +1 -0
- package/dist/formMirror-9IpSgeZb.js +1 -0
- package/dist/formatters-ljfITOZ3.js +1 -0
- package/dist/helpers.js +1 -1
- package/dist/iconGlyphs.g-DPqoOoXy.js +1 -0
- package/dist/inlineEditText-CsLCQbcg.js +1 -0
- package/dist/kanban-Dz8m-17x.js +1 -0
- package/dist/kanbanModel-C2IOPJ8L.js +1 -0
- package/dist/listQuery.js +1 -1
- package/dist/listboxKeyNav-4LeEjKq6.js +1 -0
- package/dist/loader-ByHAB1wi.js +1 -0
- package/dist/mentionText-BJsw_opZ.js +1 -0
- package/dist/{notificationDays-dNQZGLlB.js → notificationDays-BIWczft0.js} +1 -1
- package/dist/{optionLabel-CLemms21.js → optionLabel-4xjXWy74.js} +1 -1
- package/dist/recents-CmLLdV8O.js +1 -0
- package/dist/relativeTime-BahImc8F.js +1 -0
- package/dist/search-C8xIzt6h.js +1 -0
- package/dist/server.js +1 -1
- package/dist/shortcutKeys-COVLox98.js +1 -0
- package/dist/{statusIcons-Dt2ZVJyk.js → statusIcons-CRtqA_1C.js} +2 -2
- package/dist/themeTransition-9LQC6fx8.js +1 -0
- package/dist/tourSeenStore-z0Y_Znzx.js +1 -0
- package/dist/ui-calendar.global.js +1 -1
- package/dist/ui-calendar.js +1 -1
- package/dist/ui-chart.global.js +15 -15
- package/dist/ui-chart.js +13 -13
- package/dist/ui-consent-banner.global.js +1 -1
- package/dist/ui-elements/carousel.global.js +1 -1
- package/dist/ui-elements/code-block.global.js +1 -1
- package/dist/ui-elements/command-palette.global.js +2 -2
- package/dist/ui-elements/comment-thread.global.js +1 -1
- package/dist/ui-elements/consent-banner.global.js +1 -1
- package/dist/ui-elements/context-menu.global.js +1 -1
- package/dist/ui-elements/date-range.global.js +4 -4
- package/dist/ui-elements/drawer.global.js +1 -1
- package/dist/ui-elements/glyphs.global.js +1 -0
- package/dist/ui-elements/image-crop.global.js +2 -2
- package/dist/ui-elements/inline-edit.global.js +1 -1
- package/dist/ui-elements/kanban.global.js +1 -1
- package/dist/ui-elements/lead-popup.global.js +3 -3
- package/dist/ui-elements/lightbox.global.js +1 -1
- package/dist/ui-elements/markdown.global.js +2 -2
- package/dist/ui-elements/org-tree.global.js +1 -1
- package/dist/ui-elements/phone.global.js +9 -9
- package/dist/ui-elements/resizable.global.js +1 -1
- package/dist/ui-elements/saved-views.global.js +1 -1
- package/dist/ui-elements/select-chips.global.js +2 -2
- package/dist/ui-elements/select-recents.global.js +1 -1
- package/dist/ui-elements/select-search.global.js +1 -1
- package/dist/ui-elements/slider.global.js +2 -2
- package/dist/ui-elements/sortable.global.js +1 -1
- package/dist/ui-elements/status-icon.global.js +2 -2
- package/dist/ui-elements/timepicker.global.js +2 -2
- package/dist/ui-elements/tour.global.js +1 -1
- package/dist/ui-elements/tree.global.js +1 -1
- package/dist/ui-elements/wizard.global.js +1 -1
- package/dist/ui-elements.global.js +19 -19
- package/dist/ui-elements.js +1 -1
- package/dist/ui-file-viewer.global.js +11 -11
- package/dist/ui-file-viewer.js +1 -1
- package/dist/ui-lead-popup.global.js +1 -1
- package/dist/ui-phone.global.js +8 -8
- package/dist/ui-rich-text.global.js +57 -57
- package/dist/ui-rich-text.js +56 -56
- package/dist/ui-tour.global.js +1 -1
- package/dist/wuiHttp-DGbD7Fra.js +1 -0
- package/dist/{zone-D82f-GU_.js → zone-BR02ZkHF.js} +1 -1
- package/package.json +208 -55
- package/types/WuiCalendar.d.ts +69 -0
- package/types/WuiCarousel.d.ts +64 -0
- package/types/WuiChart.d.ts +77 -0
- package/types/WuiCodeBlock.d.ts +27 -0
- package/types/WuiCommandPalette.d.ts +135 -0
- package/types/WuiCommentThread.d.ts +77 -0
- package/types/WuiConsentBanner.d.ts +73 -0
- package/types/WuiContextMenu.d.ts +90 -0
- package/types/WuiDataTable.d.ts +90 -0
- package/types/WuiDatePicker.d.ts +59 -0
- package/types/WuiDateRange.d.ts +61 -0
- package/types/WuiDock.d.ts +20 -0
- package/types/WuiDrawer.d.ts +65 -0
- package/types/WuiFileViewer.d.ts +111 -0
- package/types/WuiHoverCard.d.ts +29 -0
- package/types/WuiImageCrop.d.ts +119 -0
- package/types/WuiInlineEdit.d.ts +65 -0
- package/types/WuiLeadPopup.d.ts +83 -0
- package/types/WuiLightbox.d.ts +80 -0
- package/types/WuiMarkdown.d.ts +85 -0
- package/types/WuiMentionInput.d.ts +112 -0
- package/types/WuiNavigationMenu.d.ts +29 -0
- package/types/WuiNotificationCenter.d.ts +34 -0
- package/types/WuiOnboardingChecklist.d.ts +34 -0
- package/types/WuiOrgTree.d.ts +50 -0
- package/types/WuiOtp.d.ts +32 -0
- package/types/WuiOverflow.d.ts +29 -0
- package/types/WuiPhone.d.ts +37 -0
- package/types/WuiRating.d.ts +17 -0
- package/types/WuiRecordPager.d.ts +9 -0
- package/types/WuiRelativeTime.d.ts +17 -0
- package/types/WuiResizable.d.ts +79 -0
- package/types/WuiRichText.d.ts +45 -0
- package/types/WuiRollingNumber.d.ts +27 -0
- package/types/WuiSavedViews.d.ts +41 -0
- package/types/WuiSelect.d.ts +147 -0
- package/types/WuiShortcuts.d.ts +31 -0
- package/types/WuiShowMore.d.ts +16 -0
- package/types/WuiSlider.d.ts +126 -0
- package/types/WuiSortable.d.ts +127 -0
- package/types/WuiTimePicker.d.ts +68 -0
- package/types/WuiTour.d.ts +117 -0
- package/types/WuiTree.d.ts +112 -0
- package/types/WuiTruncate.d.ts +19 -0
- package/types/WuiWhatsNew.d.ts +36 -0
- package/types/WuiWizard.d.ts +78 -0
- package/types/WuiWizardStep.d.ts +5 -0
- package/types/anchorOverlay.d.ts +75 -0
- package/types/avatarHtml.d.ts +10 -0
- package/types/avatarPicker.d.ts +47 -0
- package/types/buttonClass.d.ts +8 -0
- package/types/calendar.d.ts +3 -0
- package/types/calendarAdapter.d.ts +68 -0
- package/types/calendarMath.d.ts +40 -0
- package/types/calendarModel.d.ts +78 -0
- package/types/chart.d.ts +4 -0
- package/types/chartAdapter.d.ts +160 -0
- package/types/chartSpec.d.ts +382 -0
- package/types/codeHighlight.d.ts +25 -0
- package/types/collapsibleSearch.d.ts +7 -0
- package/types/commandShortcut.d.ts +12 -0
- package/types/commentText.d.ts +40 -0
- package/types/consentBannerGlobal.d.ts +1 -0
- package/types/consentBannerStandalone.d.ts +2 -0
- package/types/copyText.d.ts +10 -0
- package/types/countries.d.ts +3 -0
- package/types/currency.d.ts +6 -0
- package/types/dataTable.d.ts +159 -0
- package/types/datePresets.d.ts +19 -0
- package/types/defaultCountry.d.ts +3 -0
- package/types/defineElement.d.ts +6 -0
- package/types/devWarn.d.ts +2 -0
- package/types/dom.d.ts +8 -0
- package/types/drawerSnap.d.ts +24 -0
- package/types/elementBase.d.ts +2 -0
- package/types/elementRegistry.d.ts +5 -0
- package/types/elements/carousel.d.ts +2 -0
- package/types/elements/code-block.d.ts +2 -0
- package/types/elements/command-palette.d.ts +2 -0
- package/types/elements/comment-thread.d.ts +4 -0
- package/types/elements/consent-banner.d.ts +2 -0
- package/types/elements/context-menu.d.ts +2 -0
- package/types/elements/data-table.d.ts +3 -0
- package/types/elements/date-range.d.ts +2 -0
- package/types/elements/datepicker.d.ts +2 -0
- package/types/elements/dock.d.ts +2 -0
- package/types/elements/drawer.d.ts +2 -0
- package/types/elements/filter-popover.d.ts +2 -0
- package/types/elements/hover-card.d.ts +2 -0
- package/types/elements/image-crop.d.ts +2 -0
- package/types/elements/inline-edit.d.ts +3 -0
- package/types/elements/kanban.d.ts +2 -0
- package/types/elements/lead-popup.d.ts +2 -0
- package/types/elements/lightbox.d.ts +2 -0
- package/types/elements/markdown.d.ts +2 -0
- package/types/elements/mention-input.d.ts +3 -5
- package/types/elements/navigation-menu.d.ts +2 -0
- package/types/elements/notification-center.d.ts +2 -0
- package/types/elements/onboarding-checklist.d.ts +2 -0
- package/types/elements/org-tree.d.ts +2 -0
- package/types/elements/otp.d.ts +2 -0
- package/types/elements/overflow.d.ts +2 -0
- package/types/elements/phone.d.ts +2 -0
- package/types/elements/rating.d.ts +2 -0
- package/types/elements/record-pager.d.ts +2 -0
- package/types/elements/relative-time.d.ts +3 -0
- package/types/elements/resizable.d.ts +2 -0
- package/types/elements/rolling-number.d.ts +2 -0
- package/types/elements/saved-views.d.ts +2 -0
- package/types/elements/select.d.ts +2 -0
- package/types/elements/shortcuts.d.ts +2 -0
- package/types/elements/show-more.d.ts +2 -0
- package/types/elements/slider.d.ts +2 -0
- package/types/elements/sortable.d.ts +2 -0
- package/types/elements/status-icon.d.ts +1 -0
- package/types/elements/timepicker.d.ts +2 -0
- package/types/elements/tour.d.ts +1 -6
- package/types/elements/tree.d.ts +2 -0
- package/types/elements/truncate.d.ts +2 -0
- package/types/elements/whats-new.d.ts +2 -0
- package/types/elements/wizard.d.ts +3 -0
- package/types/fieldState.d.ts +4 -0
- package/types/fileDrop.d.ts +31 -0
- package/types/fileValidation.d.ts +47 -0
- package/types/fileViewer.d.ts +3 -0
- package/types/fileViewerImage.d.ts +69 -0
- package/types/fileViewerMedia.d.ts +62 -0
- package/types/fileViewerPdf.d.ts +214 -0
- package/types/fileViewerSearch.d.ts +55 -0
- package/types/fileViewerUi.d.ts +33 -0
- package/types/filterPopover.d.ts +55 -0
- package/types/focusOrigin.d.ts +3 -0
- package/types/formMirror.d.ts +22 -0
- package/types/formatters.d.ts +124 -0
- package/types/global/chunks.d.ts +12 -0
- package/types/global/core.d.ts +57 -0
- package/types/global/glyphs.d.ts +10 -0
- package/types/global/loader.d.ts +16 -0
- package/types/global/parts/glyphs.d.ts +1 -0
- package/types/global/parts/select-chips.d.ts +1 -0
- package/types/global/parts/select-country.d.ts +1 -0
- package/types/global/parts/select-recents.d.ts +1 -0
- package/types/global/parts/select-search.d.ts +1 -0
- package/types/global/shared.d.ts +56 -0
- package/types/globals.d.ts +238 -0
- package/types/helpers.d.ts +29 -3
- package/types/iconGlyphs.g.d.ts +7 -0
- package/types/iconGlyphsCore.g.d.ts +1 -0
- package/types/iconGlyphsLazy.g.d.ts +1 -0
- package/types/imageCrop.d.ts +75 -0
- package/types/index.d.ts +54 -0
- package/types/inlineEditText.d.ts +47 -0
- package/types/inputMask.d.ts +70 -0
- package/types/kanban.d.ts +157 -0
- package/types/kanbanModel.d.ts +77 -0
- package/types/leadPopupGlobal.d.ts +1 -0
- package/types/leadPopupStandalone.d.ts +2 -0
- package/types/listQuery.d.ts +87 -0
- package/types/listboxKeyNav.d.ts +63 -0
- package/types/mentionText.d.ts +45 -0
- package/types/navReveal.d.ts +1 -0
- package/types/notificationDays.d.ts +50 -0
- package/types/optionLabel.d.ts +27 -0
- package/types/overlayRelease.d.ts +12 -0
- package/types/pageBarBulk.d.ts +4 -0
- package/types/passwordRules.d.ts +50 -0
- package/types/phoneData.d.ts +1 -0
- package/types/phoneLib.d.ts +15 -0
- package/types/phoneLibGlobal.d.ts +3 -0
- package/types/razor-js/modules/api.d.ts +36 -0
- package/types/razor-js/modules/avatars.d.ts +1 -0
- package/types/razor-js/modules/buttons.d.ts +1 -0
- package/types/razor-js/modules/dropZones.d.ts +2 -0
- package/types/razor-js/modules/fileHelpers.d.ts +16 -0
- package/types/razor-js/modules/filePickers.d.ts +6 -0
- package/types/razor-js/modules/filterBars.d.ts +1 -0
- package/types/razor-js/modules/imagePickers.d.ts +1 -0
- package/types/razor-js/modules/inputs.d.ts +10 -0
- package/types/razor-js/modules/look.d.ts +6 -0
- package/types/razor-js/modules/overlays.d.ts +5 -0
- package/types/razor-js/modules/pageListeners.d.ts +1 -0
- package/types/razor-js/modules/popovers.d.ts +1 -0
- package/types/razor-js/modules/serverBridge.d.ts +13 -0
- package/types/razor-js/modules/shared.d.ts +15 -0
- package/types/razor-js/modules/shell.d.ts +1 -0
- package/types/razor-js/modules/splitView.d.ts +2 -0
- package/types/razor-js/modules/tables.d.ts +9 -0
- package/types/razor-js/modules/tabs.d.ts +1 -0
- package/types/razor-js/modules/themeCopy.d.ts +2 -0
- package/types/razor-js/modules/toast.d.ts +3 -0
- package/types/razor-js/modules/validation.d.ts +11 -0
- package/types/razor-js/modules/widgets.d.ts +10 -0
- package/types/razor-js/webority-ui.d.ts +51 -0
- package/types/relativeTime.d.ts +10 -0
- package/types/richText.d.ts +2 -0
- package/types/richTextAdapter.d.ts +54 -0
- package/types/richTextIcons.d.ts +1 -0
- package/types/rowDrop.d.ts +12 -0
- package/types/scrollEdges.d.ts +10 -0
- package/types/select/chips.d.ts +2 -0
- package/types/select/country.d.ts +2 -0
- package/types/select/customRule.d.ts +3 -0
- package/types/select/list.d.ts +32 -0
- package/types/select/option.d.ts +21 -0
- package/types/select/part.d.ts +103 -0
- package/types/select/partRegistry.d.ts +7 -0
- package/types/select/parts.d.ts +1 -0
- package/types/select/partsGlobal.d.ts +4 -0
- package/types/select/recents.d.ts +2 -0
- package/types/select/remote.d.ts +2 -0
- package/types/select/search.d.ts +5 -0
- package/types/server/drawerDiscard.d.ts +9 -0
- package/types/server/index.d.ts +9 -0
- package/types/server/remoteModal.d.ts +96 -0
- package/types/server/serverActions.d.ts +33 -0
- package/types/server/serverTable.d.ts +48 -0
- package/types/server/shellParts.d.ts +24 -0
- package/types/server/toastAction.d.ts +7 -0
- package/types/server/toastHeader.d.ts +8 -0
- package/types/server/unsavedChanges.d.ts +17 -0
- package/types/server/wuiHttp.d.ts +86 -0
- package/types/shortcutKeys.d.ts +59 -0
- package/types/statusIconImages.d.ts +1 -0
- package/types/statusIcons.d.ts +12 -0
- package/types/stepperHeader.d.ts +31 -0
- package/types/submitOnce.d.ts +3 -0
- package/types/tableSelect.d.ts +34 -0
- package/types/textMatch.d.ts +9 -0
- package/types/themeTransition.d.ts +88 -0
- package/types/toastTypes.d.ts +20 -0
- package/types/tokenCommit.d.ts +13 -0
- package/types/tourAdvance.d.ts +51 -0
- package/types/tourEnd.d.ts +17 -0
- package/types/tourGlobal.d.ts +4 -0
- package/types/tourIsolated.d.ts +2 -0
- package/types/tourMedia.d.ts +19 -0
- package/types/tourMotion.d.ts +20 -0
- package/types/tourOpenMark.d.ts +1 -0
- package/types/tourPlacement.d.ts +24 -0
- package/types/tourProgress.d.ts +29 -0
- package/types/tourSeenStore.d.ts +12 -0
- package/types/zone.d.ts +24 -0
- package/types/zoneCountries.g.d.ts +1 -0
- package/dist/WuiCarousel-C2NWcFxr.js +0 -1
- package/dist/WuiCodeBlock-CCCJwsk5.js +0 -1
- package/dist/WuiCommandPalette-Bfrbocu6.js +0 -2
- package/dist/WuiCommentThread-Dx3vvBWp.js +0 -1
- package/dist/WuiConsentBanner-jkeRiC1_.js +0 -1
- package/dist/WuiContextMenu-KXD8TFfy.js +0 -1
- package/dist/WuiDataTable-DAxAegnG.js +0 -1
- package/dist/WuiDatePicker-kEyyILbM.js +0 -31
- package/dist/WuiDateRange-B05PsdJ3.js +0 -25
- package/dist/WuiDock-Bd2ijOaJ.js +0 -1
- package/dist/WuiDrawer-SkxcDhgf.js +0 -1
- package/dist/WuiHoverCard-Bqapy8Is.js +0 -1
- package/dist/WuiImageCrop-DzzzPagi.js +0 -17
- package/dist/WuiInlineEdit-BqgKfVMy.js +0 -1
- package/dist/WuiLeadPopup-Dwmg7coE.js +0 -382
- package/dist/WuiLightbox-DCTE3ULH.js +0 -1
- package/dist/WuiMarkdown-D5vm4sp4.js +0 -4
- package/dist/WuiMentionInput-Bi3VQoKo.js +0 -1
- package/dist/WuiNavigationMenu-DmH3waKW.js +0 -1
- package/dist/WuiNotificationCenter-DawJRGBc.js +0 -1
- package/dist/WuiOnboardingChecklist-DXUETu1h.js +0 -1
- package/dist/WuiOrgTree-DuaBtFl9.js +0 -1
- package/dist/WuiOverflow-DP3qEbDp.js +0 -1
- package/dist/WuiPhone-CFne_6XG.js +0 -16
- package/dist/WuiRating-DhhqYj5Z.js +0 -1
- package/dist/WuiRecordPager-BOaFcs_W.js +0 -1
- package/dist/WuiRelativeTime-BG6rgUhw.js +0 -1
- package/dist/WuiResizable-mt9EMhjQ.js +0 -1
- package/dist/WuiRollingNumber-CF3H6l7t.js +0 -1
- package/dist/WuiSavedViews-BMBQUv2K.js +0 -1
- package/dist/WuiSelect-oSJPev4N.js +0 -9
- package/dist/WuiShortcuts-BEvFCIu9.js +0 -1
- package/dist/WuiShowMore-D3VHRZJg.js +0 -1
- package/dist/WuiSlider-2kB__6zU.js +0 -51
- package/dist/WuiSortable-r5iZtzM1.js +0 -1
- package/dist/WuiTimePicker-DqqZPv0T.js +0 -9
- package/dist/WuiTour-B-V1PZnw.js +0 -1
- package/dist/WuiTree-B3cnH1PG.js +0 -1
- package/dist/WuiTruncate-DyDQWMBu.js +0 -1
- package/dist/WuiWhatsNew-B5jK2zwZ.js +0 -1
- package/dist/WuiWizardStep-CIYuIp4a.js +0 -1
- package/dist/buttonClass-Yk0Fwgs6.js +0 -1
- package/dist/calendarMath-BC2wGCD-.js +0 -1
- package/dist/chips-DbhCYoAp.js +0 -2
- package/dist/country-3uo7no9r.js +0 -1
- package/dist/customRule-BE7CusA3.js +0 -1
- package/dist/dataTable-BoyxeUL4.js +0 -1
- package/dist/drawerDiscard-D6YgF59q.js +0 -1
- package/dist/elementBase-DV9IZZCu.js +0 -1
- package/dist/fileViewerMedia-BQ0lVXy9.js +0 -1
- package/dist/fileViewerUi-DQH6_B1a.js +0 -1
- package/dist/filterPopover-DniNyLWI.js +0 -1
- package/dist/formMirror-BMQTenSi.js +0 -1
- package/dist/formatters-Ba0CvsTs.js +0 -1
- package/dist/iconGlyphs.g-BlwTSNXS.js +0 -1
- package/dist/kanban-BtgxVDE-.js +0 -1
- package/dist/listboxKeyNav-DMIvs9d6.js +0 -1
- package/dist/loader-Dw3IkGM0.js +0 -1
- package/dist/recents-BzN7j9kV.js +0 -1
- package/dist/search-CdAH8NGK.js +0 -1
- package/dist/shortcutKeys-CvxSh3bV.js +0 -1
- package/dist/themeTransition-rHRVbhHB.js +0 -1
- package/dist/wuiHttp-BuaTcumE.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=globalThis.WeborityUiElementsInternal?.version;if(o!==`0.149.0`)throw Error(`[webority-ui] kanban expects ui-elements 0.149.0 but the page loaded `+o+`.`);var s=Object.freeze([`neutral`,`primary`,`info`,`success`,`warning`,`danger`]),c=Object.freeze([`number`,`currency`,`compact`]),l=`wui-kanban:`,u=`(max-width: 767.98px)`,d=400,f=6,p=Object.freeze({help:`Press Space to pick up the card. Use the Left and Right arrow keys to choose a column, then Space to drop it, or Escape to cancel.`,empty:`Nothing here`,collapse:e=>`Collapse ${e}`,expand:e=>`Expand ${e}`,lifted:(e,t)=>`Picked up ${e} in ${t}. Use the Left and Right arrow keys to choose a column.`,over:(e,t)=>`${e}, ${t===1?`1 card`:`${t} cards`}. Drop allowed.`,overSource:e=>`${e}, where the card started.`,overRefused:(e,t)=>`${e}. ${t}`,dropHere:(e,t)=>`Drop here to move ${e} to ${t}.`,refused:(e,t)=>`Cards in ${e} cannot move to ${t}.`,moved:(e,t)=>`Moved ${e} to ${t}.`,saving:(e,t)=>`Moving ${e} to ${t}.`,cancelled:e=>`${e} was not moved.`,rolledBack:(e,t)=>`${e} went back to ${t}.`,locked:e=>`${e} cannot be moved.`,more:e=>`Show ${e} more`,fewer:`Show fewer`,loadMore:e=>`Show more (${e})`,loading:`Loading…`,loadFailed:`More cards could not be loaded. Try again.`,swipeHint:`Swipe sideways or tap a column`,busy:`This card is still saving. Try again in a moment.`,failed:Object.freeze({forbidden:`You do not have permission to move this card.`,client:`This card could not be moved. Refresh the board and try again.`,validation:`This card could not be moved. Refresh the board and try again.`,server:`Something went wrong on our side, so the card went back. Try again in a moment.`,network:`Could not reach the server, so the card went back. Check your connection and try again.`})}),m=`[data-wui-column]`,h=`[data-wui-body]`,g=`[data-wui-card]`,_=`[data-wui-count]`,v=`[data-wui-summary]`,y=`[data-wui-empty]`,b=`[data-wui-drop-note]`,x=`[data-wui-live]`,S=`[data-wui-help]`,C=`[data-wui-switch]`,w=`[data-wui-scroller]`,T=`[data-wui-collapse]`,E=`[data-wui-more]`,D=`data-wui-visible-limit`,O=`data-wui-overflow`,k=`input, select, textarea, [contenteditable=""], [contenteditable="true"], [data-wui-no-drag]`,A=`[data-wui-load-more]`,j=`data-wui-more-url`,M=`data-wui-total`,N=`data-wui-unloaded`,P=48,F=16,I=160,L=e=>e.getAttribute(`data-wui-column`),R=e=>e.getAttribute(`data-wui-card`),z=e=>e.hidden||e.hasAttribute(`hidden`),B=e=>z(e)||e.hasAttribute(O);function V(e){if(e==null||e===``)return null;let t=typeof e==`number`?e:Number(e);if(!Number.isInteger(t)||t<1)throw TypeError(`Unsupported kanban visible limit "${String(e)}". Use a whole number of 1 or more.`);return t}function H(e,t,n,r){let i=new Set;if(t==null||n)return i;let a=0;for(let n of e)r.has(n)||(a<t?a++:i.add(n));return i}function U(e){let t=(e.getAttribute(`aria-label`)||e.textContent||``).replace(/\s+/g,` `).trim();return t.length>80?`${t.slice(0,79)}…`:t||R(e)||`Card`}function W(e){return e?`${l}${e}`:null}function G(e,t=globalThis.localStorage){let n=W(e);if(!n||!t)return{};try{let e=JSON.parse(t.getItem(n)||`null`);return e&&typeof e.collapsed==`object`&&e.collapsed?e.collapsed:{}}catch{return{}}}function K(e,t,n,r=globalThis.localStorage){let i=W(e);if(!i||!r)return;let a={...G(e,r),[t]:!!n};try{r.setItem(i,JSON.stringify({collapsed:a}))}catch{}}function q(e,t){if(!c.includes(e))throw TypeError(`Unsupported kanban summary format "${String(e)}". Use ${c.join(`, `)}.`);if(t!=null&&t!==``&&!i.MONEY_UNITS.includes(t))throw TypeError(`Unsupported kanban summary unit "${String(t)}". Use ${i.MONEY_UNITS.join(`, `)}.`);return e===`currency`?{style:`currency`,unit:t||`rupees`}:e===`compact`?{style:`compact`,currency:`INR`,unit:t||`rupees`}:{style:`number`,decimals:0}}function J(e){let t=0;for(let n of e){if(n==null||n===``)continue;let e=typeof n==`number`?n:Number(n);Number.isFinite(e)&&(t+=e)}return t}var Y=(e,t)=>{e&&window.WUI?.toast?.(e,{variant:t})},X=class extends r.ElementBase{constructor(){super(),this._wired=!1,this._filter=null,this._expanded=new Set,this._revealed=new Set,this._press=null,this._drag=null,this._kbd=null,this._suppressClick=!1,this._observer=null,this._refreshQueued=!1,this._scrollTimer=0,this._onPointerMove=e=>this._pointerMove(e),this._onPointerUp=e=>this._pointerUp(e),this._onPointerCancel=()=>this._endPointer(!1),this._onDocKeyDown=e=>{e.key===`Escape`&&this._drag&&(e.preventDefault(),this._endPointer(!1))},this._onScroll=()=>{clearTimeout(this._scrollTimer),this._scrollTimer=setTimeout(()=>this._syncSwitcherFromScroll(),80)},this.addEventListener(`pointerdown`,e=>this._pointerDown(e)),this.addEventListener(`keydown`,e=>this._keyDown(e)),this.addEventListener(`click`,e=>this._click(e),!0),this.addEventListener(`scroll`,e=>this._loadOnScroll(e.target),!0),this.addEventListener(`dragstart`,e=>{e.target.closest?.(g)&&e.preventDefault()}),this.addEventListener(`touchmove`,e=>{this._drag&&e.preventDefault()},{passive:!1})}_controlled(){return this.hasAttribute(`controlled`)}connectedCallback(){if(!this._wired){this._wired=!0,this._scroller()?.addEventListener(`scroll`,this._onScroll,{passive:!0}),this._restoreCollapsed();for(let e of this._allCards())this._prepareCard(e);if(typeof MutationObserver==`function`){this._observer=new MutationObserver(e=>{for(let t of e)for(let e of t.addedNodes)e.nodeType===1&&e.matches(g)&&this._prepareCard(e);this._queueRefresh()});for(let e of this.querySelectorAll(h))this._observer.observe(e,{childList:!0})}this.refresh()}}disconnectedCallback(){this._endPointer(!1),this._observer?.disconnect(),this._observer=null,this._scroller()?.removeEventListener(`scroll`,this._onScroll),clearTimeout(this._scrollTimer),this._wired=!1}setFilter(e){if(e!=null&&typeof e!=`function`)throw TypeError(`wui-kanban setFilter: pass a function or null.`);if(this._filter=e,!e)for(let e of this._allCards())e.hidden=!1;this.refresh()}refresh(){if(this._controlled())return;this._refreshQueued=!1;let e=this._summaryFormat();for(let t of this._columns()){let n=L(t),r=V(t.getAttribute(D)),a=[],o=[];for(let e of this._cardsIn(t))this._filter&&(e.hidden=this._filter(e)===!1),z(e)?e.removeAttribute(O):(a.push(e),o.push(e.getAttribute(`data-wui-value`)));let s=this._expanded.has(n),c=H(a.map(R),r,s,this._revealed);for(let e of a)e.toggleAttribute(O,c.has(R(e)));let l=this._unloadedIn(t),u=String(a.length+l);for(let e of this._countsOf(t))e.textContent!==u&&(e.textContent=u);let d=t.querySelector(y);if(d&&(d.hidden=a.length>0),e){let n=t.querySelector(v);n&&(n.textContent=(0,i.formatValue)(J(o),e))}let f=t.querySelector(E);if(f){f.hidden=r==null||(s?a.length<=r:c.size===0),f.setAttribute(`aria-expanded`,s?`true`:`false`);let e=s?p.fewer:p.more(c.size);f.textContent!==e&&(f.textContent=e)}let m=t.querySelector(A);if(m&&(m.hidden=l<=0,!t.hasAttribute(`data-wui-loading`))){m.disabled=!1;let e=p.loadMore(l);m.textContent!==e&&(m.textContent=e)}}}moveCard(e,t,n){let r=this._cardByKey(e);if(!r)throw Error(`wui-kanban moveCard: no card "${String(e)}" on this board.`);if(!this._columnByKey(t))throw Error(`wui-kanban moveCard: no column "${String(t)}" on this board.`);return this._commit(r,t,n)}_columns(){return[...this.querySelectorAll(m)]}_columnByKey(e){return this._columns().find(t=>L(t)===e)||null}_columnOf(e){return e.closest(m)}_titleOf(e){return(e.querySelector(`.wui-kanban-title`)?.textContent||L(e)||``).replace(/\s+/g,` `).trim()}_bodyOf(e){return e.querySelector(h)}_cardsIn(e){let t=this._bodyOf(e);return t?[...t.children].filter(e=>e.matches(g)):[]}_visibleCardsIn(e){return this._cardsIn(e).filter(e=>!B(e))}_allCards(){return[...this.querySelectorAll(`${h} > ${g}`)]}_cardByKey(e){return this._allCards().find(t=>R(t)===e)||null}_countsOf(e){let t=L(e),n=[...this.querySelectorAll(C)].filter(e=>e.getAttribute(`data-wui-switch`)===t);return[...e.querySelectorAll(_),...n.flatMap(e=>[...e.querySelectorAll(_)])]}_scroller(){return this.querySelector(w)}_summaryFormat(){let e=this.getAttribute(`summary-format`);return e?q(e,this.getAttribute(`summary-unit`)):null}_queueRefresh(){this._refreshQueued||(this._refreshQueued=!0,queueMicrotask(()=>{this._refreshQueued&&this.refresh()}))}_prepareCard(e){let t=this.querySelector(S);t?.id&&!e.hasAttribute(`aria-describedby`)&&e.setAttribute(`aria-describedby`,t.id),e.hasAttribute(`tabindex`)||(e.tabIndex=0)}_announce(e){let t=this.querySelector(x);t&&e&&(t.textContent=``,t.textContent=e)}_fire(e,t,n=!1){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:n,detail:t}))}_canLift(e){let t=U(e),n=this.hasAttribute(`readonly`);return n||e.hasAttribute(`data-wui-locked`)?(this._announce(p.locked(t)),this._fire(`wui:kanban:locked`,{key:R(e),card:e,reason:n?`readonly`:`locked`},!0),!1):e.getAttribute(`aria-busy`)!==`true`||(this._announce(p.busy),Y(p.busy,`info`),!1)}_check(e,t,n){if(t===n)return{ok:!1,source:!0,reason:null};let r=this._columnByKey(t),i=this._columnByKey(n),a=p.refused(r?this._titleOf(r):t,i?this._titleOf(i):n),o=i?.getAttribute(`data-accept-from`);if(o!=null&&!o.split(/\s+/).filter(Boolean).includes(t))return{ok:!1,reason:a};if(typeof this.accept==`function`){let r=this.accept(e,t,n);if(r===!1)return{ok:!1,reason:a};if(typeof r==`string`&&r)return{ok:!1,reason:r}}return{ok:!0,reason:null}}_markTargets(e,t){let n=U(e),r=new Map;for(let i of this._columns()){let a=L(i),o=this._check(e,t,a);r.set(a,o),i.setAttribute(`data-wui-drop`,o.source?`source`:o.ok?`ok`:`refused`);let s=i.querySelector(b);s&&!o.source&&(s.textContent=o.ok?p.dropHere(n,this._titleOf(i)):o.reason,s.hidden=!1)}return r}_clearTargets(){for(let e of this._columns()){e.removeAttribute(`data-wui-drop`),e.removeAttribute(`data-wui-over`),e.removeAttribute(`data-wui-target`);let t=e.querySelector(b);t&&(t.hidden=!0,t.textContent=``)}}async _commit(e,t,n){let r=this._columnOf(e),i=L(r),o=this._columnByKey(t),s=U(e);if(i===t||!this._canLift(e))return!1;let c=this._check(e,i,t);if(!c.ok)return this._announce(c.reason),Y(c.reason,`info`),!1;let l=this._cardsIn(o),u=Number.isInteger(n)?Math.max(0,Math.min(n,l.length)):l.length,d={key:R(e),card:e,from:i,to:t,index:u},f=e.contains(document.activeElement);if(this._controlled())return this._fire(`wui:kanban:move`,d),this._announce(p.moved(s,this._titleOf(o))),f&&this._refocusSoon(d.key),!0;if(!this._fire(`wui:kanban:move`,d,!0))return!1;let m=o.hasAttribute(D)&&!this._revealed.has(d.key);m&&this._revealed.add(d.key);let h={parent:e.parentNode,next:e.nextSibling,column:r,revealed:m};this._bodyOf(o).insertBefore(e,l[u]||null),f&&this._focusMoved(e),this.refresh();let g=o.getAttribute(`data-wui-step`);if(g)return this._runStep(e,d,h,g,o.getAttribute(`data-wui-step-size`));let _=this.getAttribute(`move-url`);if(!_)return this._announce(p.moved(s,this._titleOf(o))),this._fire(`wui:kanban:moved`,{...d,result:null}),!0;this._lock(e,!0),this._announce(p.saving(s,this._titleOf(o)));let v=new URLSearchParams({card:d.key,from:i,to:t,index:String(u)}),y=await(0,a.wuiFetch)(_,{method:`POST`,body:v});if(this._lock(e,!1),y.kind===`session`)return!1;if(y.ok){let t=this._applyFragment(y.html)||e;return Y(y.message,`success`),this._announce(p.moved(U(t),this._titleOf(o))),this._fire(`wui:kanban:moved`,{...d,card:t,result:y}),!0}return this._rollback(e,h),y.kind!==`aborted`&&Y(y.message||p.failed[y.kind]||p.failed.server,`danger`),this._fire(`wui:kanban:failed`,{...d,kind:y.kind,status:y.status,message:y.message}),!1}async _runStep(e,t,n,r,i){let o=U(e),s=this._columnByKey(t.to),c=new URLSearchParams({card:t.key,from:t.from,to:t.to}).toString(),l=r+(r.includes(`?`)?`&`:`?`)+c;this._lock(e,!0);let u;try{let t=window.WUI?.modal?.load;if(typeof t!=`function`)throw Error(`<wui-kanban> data-wui-step needs the Razor script webority-ui.js (WUI.modal.load).`);u=await(await t(l,{trigger:e,size:i||void 0})).closed}catch(r){return this._lock(e,!1),this._rollback(e,n),r?.name!==`AbortError`&&Y(p.failed.server,`danger`),this._fire(`wui:kanban:failed`,{...t,kind:`step`,status:0,message:r?.message??null}),!1}if(u?.status!==`success`)return this._lock(e,!1),this._rollback(e,n),this._announce(p.cancelled(o)),this._fire(`wui:kanban:failed`,{...t,kind:`dismissed`,status:0,message:null}),!1;let d=e,f=this.getAttribute(`card-url`);if(f){let n=await(0,a.wuiFetch)(`${f}${f.includes(`?`)?`&`:`?`}${new URLSearchParams({card:t.key})}`);n.ok&&(d=this._applyFragment(n.html)||e)}return this._lock(d,!1),this._announce(p.moved(U(d),this._titleOf(s))),this._fire(`wui:kanban:moved`,{...t,card:d,result:u}),!0}_lock(e,t){t?(e.setAttribute(`aria-busy`,`true`),e.setAttribute(`data-wui-saving`,``)):(e.removeAttribute(`aria-busy`),e.removeAttribute(`data-wui-saving`))}_rollback(e,t){let n=e.contains(document.activeElement),r=t.next&&t.next.parentNode===t.parent?t.next:null;t.revealed&&this._revealed.delete(R(e)),t.parent.insertBefore(e,r),n&&e.focus(),this.refresh(),this._announce(p.rolledBack(U(e),this._titleOf(t.column)))}_applyFragment(e){if(!e)return null;let t=document.createElement(`template`);t.innerHTML=e;for(let e of t.content.querySelectorAll(`script`))(0,n.devWarn)(`[@webority/ui-elements] A kanban fragment carried a script tag; it was removed, not run.`),e.remove();let r=null;for(let e of[...t.content.querySelectorAll(g)]){if(e.closest(`template`))continue;let t=this._cardByKey(R(e));if(!t)continue;let n=t.contains(document.activeElement);t.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0})),t.hidden&&(e.hidden=!0),t.replaceWith(e),this._prepareCard(e),n&&e.focus(),r??=e}for(let e of t.content.querySelectorAll(`template[data-wui-kanban-summary]`))this._columnByKey(e.getAttribute(`data-wui-kanban-summary`))?.querySelector(v)?.replaceChildren(e.content.cloneNode(!0));return this.refresh(),window.WUI?.refresh?.(),r}_refocusSoon(e){let t=()=>{let t=this._cardByKey(e);t&&this._focusMoved(t)};typeof requestAnimationFrame==`function`?requestAnimationFrame(t):setTimeout(t,0)}_focusMoved(e){e.focus({preventScroll:!0}),e.scrollIntoView?.({block:`nearest`})}_pointerDown(e){if(e.button!==0||e.isPrimary===!1||this._drag||this._kbd)return;let t=e.target.closest?.(g);if(!t||!this.contains(t)||e.target.closest(k))return;let n={card:t,id:e.pointerId,x:e.clientX,y:e.clientY,type:e.pointerType,timer:0};this._press=n,e.pointerType===`touch`&&(n.timer=setTimeout(()=>{this._press===n&&this._startDrag(n,n.x,n.y)},400)),window.addEventListener(`pointermove`,this._onPointerMove),window.addEventListener(`pointerup`,this._onPointerUp),window.addEventListener(`pointercancel`,this._onPointerCancel)}_pointerMove(e){let t=this._press;if(t&&e.pointerId===t.id){if(!this._drag){if(!(Math.hypot(e.clientX-t.x,e.clientY-t.y)>6))return;if(t.type===`touch`){this._endPointer(!1);return}if(this._startDrag(t,e.clientX,e.clientY),!this._drag)return}this._dragTo(e.clientX,e.clientY)}}_pointerUp(e){this._press&&e.pointerId===this._press.id&&this._endPointer(!!this._drag)}_startDrag(e,t,n){let r=e.card;if(!this._canLift(r)){this._endPointer(!1);return}let i=L(this._columnOf(r)),a=r.getBoundingClientRect(),o=r.cloneNode(!0);for(let e of[o,...o.querySelectorAll(`[id]`)])e.removeAttribute(`id`);o.removeAttribute(`data-wui-card`),o.removeAttribute(`tabindex`),o.setAttribute(`aria-hidden`,`true`),o.classList.add(`wui-kanban-ghost`),o.style.width=`${a.width}px`,this.appendChild(o),r.setAttribute(`data-wui-dragging`,``),this.setAttribute(`data-wui-dragging`,``),this._drag={card:r,from:i,ghost:o,dx:t-a.left,dy:n-a.top,over:null,verdicts:this._markTargets(r,i)},this._announce(p.lifted(U(r),this._titleOf(this._columnOf(r)))),document.addEventListener(`keydown`,this._onDocKeyDown),this._dragTo(t,n)}_dragTo(e,t){let n=this._drag;n.x=e,n.y=t,n.ghost.style.transform=`translate(${e-n.dx}px, ${t-n.dy}px)`;let r=this._columnAt(e,t);r!==n.over&&(n.over?.removeAttribute(`data-wui-over`),r?.setAttribute(`data-wui-over`,``),n.over=r),this._autoScroll(e,t,r)}_columnAt(e,t){for(let n of this._columns()){let r=n.getBoundingClientRect();if(e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom)return n}return null}_indexAt(e,t){let n=this._visibleCardsIn(e).filter(e=>e!==this._drag?.card).find(e=>{let n=e.getBoundingClientRect();return t<n.top+n.height/2}),r=this._cardsIn(e).filter(e=>e!==this._drag?.card);return n?r.indexOf(n):r.length}_autoScroll(e,t,n){let r=this._scroller();if(r){let t=r.getBoundingClientRect();t.width>0&&(e<t.left+P?r.scrollBy?.({left:-16}):e>t.right-P&&r.scrollBy?.({left:F}))}if(n&&this._scrollColumn(n,t))return;let i=window.innerHeight||0;i>0&&(t<P?window.scrollBy?.({top:-16}):t>i-P&&window.scrollBy?.({top:F}))}_scrollColumn(e,t){let n=this._bodyOf(e);if(!n||e.hasAttribute(`data-collapsed`)||n.scrollHeight<=n.clientHeight)return!1;let r=n.getBoundingClientRect();return t<r.top+P&&n.scrollTop>0?(n.scrollBy?.({top:-16}),!0):t>r.bottom-P&&n.scrollTop+n.clientHeight<n.scrollHeight-1&&(n.scrollBy?.({top:F}),!0)}_endPointer(e){let t=this._press,n=this._drag;if(t&&clearTimeout(t.timer),this._press=null,this._drag=null,window.removeEventListener(`pointermove`,this._onPointerMove),window.removeEventListener(`pointerup`,this._onPointerUp),window.removeEventListener(`pointercancel`,this._onPointerCancel),document.removeEventListener(`keydown`,this._onDocKeyDown),!n)return;n.ghost.remove(),n.card.removeAttribute(`data-wui-dragging`),this.removeAttribute(`data-wui-dragging`),this._suppressClick=!0,setTimeout(()=>{this._suppressClick=!1},0);let r=n.over;if(this._clearTargets(),!e||!r){this._announce(p.cancelled(U(n.card)));return}let i=L(r),a=n.verdicts.get(i);a?.source?this._announce(p.cancelled(U(n.card))):a?.ok?this._commit(n.card,i,this._indexAt(r,n.y)):(this._announce(a?.reason),Y(a?.reason,`info`))}_click(e){if(this._suppressClick&&e.target.closest?.(g)){e.preventDefault(),e.stopPropagation(),this._suppressClick=!1;return}let t=e.target.closest?.(T);if(t&&this.contains(t)){let e=t.closest(m);e&&this._setCollapsed(e,!e.hasAttribute(`data-collapsed`),!0);return}let n=e.target.closest?.(A);if(n&&this.contains(n)){this._controlled()||this._loadMore(n.closest(m));return}let r=e.target.closest?.(E);if(r&&this.contains(r)){this._controlled()||this._toggleMore(r.closest(m));return}let i=e.target.closest?.(C);i&&this.contains(i)&&this._showColumn(i.getAttribute(`data-wui-switch`))}_keyDown(e){if(this._kbd){this._liftedKey(e);return}let t=e.target;if(!t.matches?.(g)||!this.contains(t))return;let n=this._columnOf(t);switch(e.key){case` `:case`Spacebar`:{if(e.preventDefault(),!this._canLift(t))return;let r=L(n),i=this._columns();this._kbd={card:t,from:r,target:i.indexOf(n),verdicts:this._markTargets(t,r)},t.setAttribute(`data-wui-lifted`,``),this.setAttribute(`data-wui-dragging`,``),n.setAttribute(`data-wui-target`,``),this._announce(p.lifted(U(t),this._titleOf(n)));return}case`ArrowDown`:case`ArrowUp`:{let r=this._visibleCardsIn(n),i=r[r.indexOf(t)+(e.key===`ArrowDown`?1:-1)];i&&(e.preventDefault(),i.focus());return}case`ArrowLeft`:case`ArrowRight`:{let t=this._columns(),r=e.key===`ArrowRight`?1:-1;for(let i=t.indexOf(n)+r;i>=0&&i<t.length;i+=r){let n=this._visibleCardsIn(t[i])[0];if(n&&!t[i].hasAttribute(`data-collapsed`)){e.preventDefault(),n.focus();return}}return}}}_liftedKey(e){let t=this._kbd,n=this._columns();switch(e.key){case`ArrowLeft`:case`ArrowRight`:{e.preventDefault();let r=t.target+(e.key===`ArrowRight`?1:-1);if(r<0||r>=n.length)return;n[t.target]?.removeAttribute(`data-wui-target`),t.target=r;let i=n[r];i.setAttribute(`data-wui-target`,``),this._showColumn(L(i),!1);let a=t.verdicts.get(L(i)),o=this._titleOf(i);this._announce(a.source?p.overSource(o):a.ok?p.over(o,this._cardsIn(i).filter(e=>!z(e)).length):p.overRefused(o,a.reason));return}case` `:case`Spacebar`:case`Enter`:{e.preventDefault();let r=n[t.target],i=L(r),a=t.verdicts.get(i);if(!a.source&&!a.ok){this._announce(a.reason);return}this._endKeyboard(),a.source?this._announce(p.cancelled(U(t.card))):this._commit(t.card,i);return}case`Escape`:case`Tab`:e.key===`Escape`&&e.preventDefault(),this._endKeyboard(),this._showColumn(t.from,!1),this._announce(p.cancelled(U(t.card)));return}}_endKeyboard(){let e=this._kbd;this._kbd=null,e&&(e.card.removeAttribute(`data-wui-lifted`),this.removeAttribute(`data-wui-dragging`),this._clearTargets())}_restoreCollapsed(){let e=G(this.getAttribute(`board-id`));for(let t of this._columns()){let n=L(t);t.hasAttribute(`data-collapsible`)&&Object.hasOwn(e,n)&&this._setCollapsed(t,e[n],!1)}}_setCollapsed(e,t,n){let r=L(e);e.toggleAttribute(`data-collapsed`,t);let i=this._titleOf(e);for(let n of e.querySelectorAll(T))n.setAttribute(`aria-expanded`,t?`false`:`true`),n.setAttribute(`aria-label`,t?p.expand(i):p.collapse(i));n&&(K(this.getAttribute(`board-id`),r,t),this._fire(`wui:kanban:collapse`,{column:r,collapsed:t}))}_toggleMore(e){if(!e)return;let t=L(e);if(this._expanded.delete(t))for(let t of this._cardsIn(e))this._revealed.delete(R(t));else this._expanded.add(t);this.refresh()}_unloadedIn(e){return e.hasAttribute(j)?(e.hasAttribute(N)||e.setAttribute(N,String(Math.max(0,Number(e.getAttribute(M))-this._cardsIn(e).length))),Number(e.getAttribute(N))):0}async _loadMore(e){let t=Number(e.getAttribute(N));if(e.hasAttribute(`data-wui-loading`)||!(t>0))return;e.setAttribute(`data-wui-loading`,``);let r=e.querySelector(A);r&&(r.disabled=!0,r.textContent=p.loading);let i=new URL(e.getAttribute(j),document.baseURI);i.searchParams.set(`skip`,String(this._cardsIn(e).length));let o=0,s=!1;try{let n=await(0,a.wuiFetch)(i.toString());if(n.ok){let r=document.createElement(`template`);r.innerHTML=n.html;let i=this._bodyOf(e);for(let e of[...r.content.children])e.matches(g)&&!this._cardByKey(R(e))&&(i.append(e),o++);let a=n.response?.headers.get(`Wui-Kanban-Remaining`)??``;e.setAttribute(N,String(/^\d+$/.test(a)?Number(a):Math.max(0,t-o))),s=!0}}catch(e){(0,n.devError)(`[@webority/ui-elements] A kanban column could not load its next cards.`,e)}e.removeAttribute(`data-wui-loading`),this.refresh(),s?this._fire(`wui:kanban:loaded`,{key:L(e),added:o}):Y(p.loadFailed,`danger`)}_loadOnScroll(e){if(this._controlled()||!e.matches(h))return;let t=e.closest(m);t?.hasAttribute(j)&&e.scrollTop+e.clientHeight>=e.scrollHeight-I&&this._loadMore(t)}_isPhone(){return typeof matchMedia==`function`&&matchMedia(`(max-width: 767.98px)`).matches}_showColumn(e,t=!0){for(let t of this.querySelectorAll(C))t.getAttribute(`data-wui-switch`)===e?t.setAttribute(`aria-current`,`true`):t.removeAttribute(`aria-current`);let n=this._columnByKey(e),r=this._scroller();if(!n||!r||!t&&!this._isPhone())return;let i=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches;r.scrollTo?.({left:n.offsetLeft-r.offsetLeft,behavior:i?`auto`:`smooth`})}_syncSwitcherFromScroll(){let e=this._scroller();if(!e||!this._isPhone())return;let t=e.clientWidth||1,n=this._columns()[Math.round(e.scrollLeft/t)];if(n)for(let e of this.querySelectorAll(C))e.getAttribute(`data-wui-switch`)===L(n)?e.setAttribute(`aria-current`,`true`):e.removeAttribute(`aria-current`)}};(0,t.defineElement)(`wui-kanban`,X),e.KANBAN_DRAG_THRESHOLD_PX=f,e.KANBAN_LONG_PRESS_MS=d,e.KANBAN_PHONE_QUERY=u,e.KANBAN_STORAGE_PREFIX=l,e.KANBAN_SUMMARY_FORMATS=c,e.KANBAN_TEXT=p,e.KANBAN_TONES=s,e.WuiKanban=X,e.kanbanCardLabel=U,e.kanbanOverflow=H,e.kanbanStorageKey=W,e.kanbanSummaryFormat=q,e.kanbanVisibleLimit=V,e.readKanbanCollapsed=G,e.sumKanbanValues=J,e.writeKanbanCollapsed=K})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.devWarn,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.formatters,WeborityUiElementsInternal.modules.wuiHttp);
|
|
1
|
+
(function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=globalThis.WeborityUiElementsInternal?.version;if(o!==`0.152.0`)throw Error(`[webority-ui] kanban expects ui-elements 0.152.0 but the page loaded `+o+`.`);var s=Object.freeze([`neutral`,`primary`,`info`,`success`,`warning`,`danger`]),c=Object.freeze([`number`,`currency`,`compact`]),l=`wui-kanban:`,u=`(max-width: 767.98px)`,d=400,f=6,p=Object.freeze({help:`Press Space to pick up the card. Use the Left and Right arrow keys to choose a column, then Space to drop it, or Escape to cancel.`,empty:`Nothing here`,collapse:e=>`Collapse ${e}`,expand:e=>`Expand ${e}`,lifted:(e,t)=>`Picked up ${e} in ${t}. Use the Left and Right arrow keys to choose a column.`,over:(e,t)=>`${e}, ${t===1?`1 card`:`${t} cards`}. Drop allowed.`,overSource:e=>`${e}, where the card started.`,overRefused:(e,t)=>`${e}. ${t}`,dropHere:(e,t)=>`Drop here to move ${e} to ${t}.`,refused:(e,t)=>`Cards in ${e} cannot move to ${t}.`,moved:(e,t)=>`Moved ${e} to ${t}.`,saving:(e,t)=>`Moving ${e} to ${t}.`,cancelled:e=>`${e} was not moved.`,rolledBack:(e,t)=>`${e} went back to ${t}.`,locked:e=>`${e} cannot be moved.`,more:e=>`Show ${e} more`,fewer:`Show fewer`,loadMore:e=>`Show more (${e})`,loading:`Loading…`,loadFailed:`More cards could not be loaded. Try again.`,swipeHint:`Swipe sideways or tap a column`,busy:`This card is still saving. Try again in a moment.`,failed:Object.freeze({forbidden:`You do not have permission to move this card.`,client:`This card could not be moved. Refresh the board and try again.`,validation:`This card could not be moved. Refresh the board and try again.`,server:`Something went wrong on our side, so the card went back. Try again in a moment.`,network:`Could not reach the server, so the card went back. Check your connection and try again.`})}),m=e=>typeof e==`object`&&!!e,h=e=>{let t=m(e)?e.collapsed:void 0;return m(t)?Object.fromEntries(Object.entries(t).map(([e,t])=>[e,!!t])):{}};function g(e){if(e==null||e===``)return null;let t=typeof e==`number`?e:Number(e);if(!Number.isInteger(t)||t<1)throw TypeError(`Unsupported kanban visible limit "${String(e)}". Use a whole number of 1 or more.`);return t}function _(e,t,n,r){let i=new Set;if(t==null||n)return i;let a=0;for(let n of e)r.has(n)||(a<t?a++:i.add(n));return i}function v(e){let t=(e.getAttribute(`aria-label`)||e.textContent||``).replace(/\s+/g,` `).trim();return t.length>80?`${t.slice(0,79)}…`:t||e.getAttribute(`data-wui-card`)||`Card`}function y(e){return e?`${l}${e}`:null}function b(e,t=globalThis.localStorage){let n=y(e);if(!n||!t)return{};try{return h(JSON.parse(t.getItem(n)||`null`))}catch{return{}}}function x(e,t,n,r=globalThis.localStorage){let i=y(e);if(!i||!r)return;let a={...b(e,r),[String(t)]:!!n};try{r.setItem(i,JSON.stringify({collapsed:a}))}catch{}}function S(e,t){if(!c.includes(e))throw TypeError(`Unsupported kanban summary format "${String(e)}". Use ${c.join(`, `)}.`);if(t!=null&&t!==``&&!(0,i.isMoneyUnit)(t))throw TypeError(`Unsupported kanban summary unit "${String(t)}". Use ${i.MONEY_UNITS.join(`, `)}.`);return e===`currency`?{style:`currency`,unit:t||`rupees`}:e===`compact`?{style:`compact`,currency:`INR`,unit:t||`rupees`}:{style:`number`,decimals:0}}function C(e){let t=0;for(let n of e){if(n==null||n===``)continue;let e=typeof n==`number`?n:Number(n);Number.isFinite(e)&&(t+=e)}return t}var ee=p.failed,w=`[data-wui-column]`,T=`[data-wui-body]`,E=`[data-wui-card]`,D=`[data-wui-count]`,O=`[data-wui-summary]`,k=`[data-wui-empty]`,A=`[data-wui-drop-note]`,j=`[data-wui-live]`,te=`[data-wui-help]`,M=`[data-wui-switch]`,ne=`[data-wui-scroller]`,N=`[data-wui-collapse]`,P=`[data-wui-more]`,F=`data-wui-visible-limit`,I=`data-wui-overflow`,re=`input, select, textarea, [contenteditable=""], [contenteditable="true"], [data-wui-no-drag]`,L=`[data-wui-load-more]`,R=`data-wui-more-url`,z=`data-wui-total`,B=`data-wui-unloaded`,V=48,H=16,U=160,W=e=>e.getAttribute(`data-wui-column`),G=e=>e.getAttribute(`data-wui-card`),K=e=>e instanceof HTMLElement&&!!e.hidden||e.hasAttribute(`hidden`),ie=e=>K(e)||e.hasAttribute(I),q=e=>e instanceof Element?e:null,ae=e=>typeof e==`object`&&e&&`name`in e?e.name:void 0,oe=e=>typeof e==`object`&&e&&`message`in e?e.message:void 0,J=(e,t,n)=>{let r=e.querySelector(t);return r instanceof n?r:null},Y=(e,t,n)=>[...e.querySelectorAll(t)].filter(e=>e instanceof n),X=(e,t,n)=>{let r=e.closest(t);return r instanceof n?r:null},Z=()=>window.WUI??null,Q=(e,t)=>{e&&Z()?.toast(e,{variant:t})},$=class extends r.ElementBase{constructor(){super(),this._wired=!1,this._filter=null,this._expanded=new Set,this._revealed=new Set,this._press=null,this._drag=null,this._kbd=null,this._suppressClick=!1,this._observer=null,this._refreshQueued=!1,this._scrollTimer=0,this._onPointerMove=e=>this._pointerMove(e),this._onPointerUp=e=>this._pointerUp(e),this._onPointerCancel=()=>this._endPointer(!1),this._onDocKeyDown=e=>{e.key===`Escape`&&this._drag&&(e.preventDefault(),this._endPointer(!1))},this._onScroll=()=>{clearTimeout(this._scrollTimer),this._scrollTimer=setTimeout(()=>this._syncSwitcherFromScroll(),80)},this.addEventListener(`pointerdown`,e=>this._pointerDown(e)),this.addEventListener(`keydown`,e=>this._keyDown(e)),this.addEventListener(`click`,e=>this._click(e),!0),this.addEventListener(`scroll`,e=>{e.target instanceof Element&&this._loadOnScroll(e.target)},!0),this.addEventListener(`dragstart`,e=>{q(e.target)?.closest(E)&&e.preventDefault()}),this.addEventListener(`touchmove`,e=>{this._drag&&e.preventDefault()},{passive:!1})}_controlled(){return this.hasAttribute(`controlled`)}connectedCallback(){if(!this._wired){this._wired=!0,this._scroller()?.addEventListener(`scroll`,this._onScroll,{passive:!0}),this._restoreCollapsed();for(let e of this._allCards())this._prepareCard(e);if(typeof MutationObserver==`function`){this._observer=new MutationObserver(e=>{for(let t of e)for(let e of t.addedNodes)e instanceof HTMLElement&&e.matches(E)&&this._prepareCard(e);this._queueRefresh()});for(let e of this.querySelectorAll(T))this._observer.observe(e,{childList:!0})}this.refresh()}}disconnectedCallback(){this._endPointer(!1),this._observer?.disconnect(),this._observer=null,this._scroller()?.removeEventListener(`scroll`,this._onScroll),clearTimeout(this._scrollTimer),this._wired=!1}setFilter(e){if(e!=null&&typeof e!=`function`)throw TypeError(`wui-kanban setFilter: pass a function or null.`);if(this._filter=e,!e)for(let e of this._allCards())e.hidden=!1;this.refresh()}refresh(){if(this._controlled())return;this._refreshQueued=!1;let e=this._summaryFormat();for(let t of this._columns()){let n=W(t),r=g(t.getAttribute(F)),a=[],o=[];for(let e of this._cardsIn(t))this._filter&&(e.hidden=this._filter(e)===!1),K(e)?e.removeAttribute(I):(a.push(e),o.push(e.getAttribute(`data-wui-value`)));let s=this._expanded.has(n),c=_(a.map(G),r,s,this._revealed);for(let e of a)e.toggleAttribute(I,c.has(G(e)));let l=this._unloadedIn(t),u=String(a.length+l);for(let e of this._countsOf(t))e.textContent!==u&&(e.textContent=u);let d=J(t,k,HTMLElement);if(d&&(d.hidden=a.length>0),e){let n=t.querySelector(O);n&&(n.textContent=(0,i.formatValue)(C(o),e))}let f=J(t,P,HTMLElement);if(f){f.hidden=r==null||(s?a.length<=r:c.size===0),f.setAttribute(`aria-expanded`,s?`true`:`false`);let e=s?p.fewer:p.more(c.size);f.textContent!==e&&(f.textContent=e)}let m=J(t,L,HTMLButtonElement);if(m&&(m.hidden=l<=0,!t.hasAttribute(`data-wui-loading`))){m.disabled=!1;let e=p.loadMore(l);m.textContent!==e&&(m.textContent=e)}}}moveCard(e,t,n){let r=this._cardByKey(e);if(!r)throw Error(`wui-kanban moveCard: no card "${String(e)}" on this board.`);if(!this._columnByKey(t))throw Error(`wui-kanban moveCard: no column "${String(t)}" on this board.`);return this._commit(r,t,n)}_columns(){return Y(this,w,HTMLElement)}_columnByKey(e){return this._columns().find(t=>W(t)===e)||null}_columnOf(e){return X(e,w,HTMLElement)}_titleOf(e){return(e.querySelector(`.wui-kanban-title`)?.textContent||W(e)||``).replace(/\s+/g,` `).trim()}_bodyOf(e){return J(e,T,HTMLElement)}_cardsIn(e){let t=this._bodyOf(e);return t?[...t.children].filter(e=>e instanceof HTMLElement&&e.matches(E)):[]}_visibleCardsIn(e){return this._cardsIn(e).filter(e=>!ie(e))}_allCards(){return Y(this,`${T} > ${E}`,HTMLElement)}_cardByKey(e){return this._allCards().find(t=>G(t)===e)||null}_countsOf(e){let t=W(e),n=[...this.querySelectorAll(M)].filter(e=>e.getAttribute(`data-wui-switch`)===t);return[...e.querySelectorAll(D),...n.flatMap(e=>[...e.querySelectorAll(D)])]}_scroller(){return J(this,ne,HTMLElement)}_summaryFormat(){let e=this.getAttribute(`summary-format`);return e?S(e,this.getAttribute(`summary-unit`)):null}_queueRefresh(){this._refreshQueued||(this._refreshQueued=!0,queueMicrotask(()=>{this._refreshQueued&&this.refresh()}))}_prepareCard(e){let t=this.querySelector(te);t?.id&&!e.hasAttribute(`aria-describedby`)&&e.setAttribute(`aria-describedby`,t.id),e.hasAttribute(`tabindex`)||(e.tabIndex=0)}_announce(e){let t=J(this,j,HTMLElement);t&&e&&(t.textContent=``,t.textContent=e)}_fire(e,t,n=!1){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:n,detail:t}))}_canLift(e){let t=v(e),n=this.hasAttribute(`readonly`);return n||e.hasAttribute(`data-wui-locked`)?(this._announce(p.locked(t)),this._fire(`wui:kanban:locked`,{key:G(e),card:e,reason:n?`readonly`:`locked`},!0),!1):e.getAttribute(`aria-busy`)!==`true`||(this._announce(p.busy),Q(p.busy,`info`),!1)}_check(e,t,n){if(t===n)return{ok:!1,source:!0,reason:null};let r=this._columnByKey(t),i=this._columnByKey(n),a=p.refused(r?this._titleOf(r):String(t),i?this._titleOf(i):String(n)),o=i?.getAttribute(`data-accept-from`),s=o?.split(/\s+/).filter(Boolean)??[];if(o!=null&&!s.includes(t))return{ok:!1,reason:a};if(typeof this.accept==`function`){let r=this.accept(e,t,n);if(r===!1)return{ok:!1,reason:a};if(typeof r==`string`&&r)return{ok:!1,reason:r}}return{ok:!0,reason:null}}_markTargets(e,t){let n=v(e),r=new Map;for(let i of this._columns()){let a=W(i),o=this._check(e,t,a);r.set(a,o),i.setAttribute(`data-wui-drop`,o.source?`source`:o.ok?`ok`:`refused`);let s=J(i,A,HTMLElement);s&&!o.source&&(s.textContent=o.ok?p.dropHere(n,this._titleOf(i)):o.reason,s.hidden=!1)}return r}_clearTargets(){for(let e of this._columns()){e.removeAttribute(`data-wui-drop`),e.removeAttribute(`data-wui-over`),e.removeAttribute(`data-wui-target`);let t=J(e,A,HTMLElement);t&&(t.hidden=!0,t.textContent=``)}}async _commit(e,t,n){let r=this._columnOf(e);if(!r)throw Error(`wui-kanban: the card is not inside a column.`);let i=W(r),o=this._columnByKey(t),s=v(e);if(i===t||!this._canLift(e))return!1;let c=this._check(e,i,t);if(!c.ok)return this._announce(c.reason),Q(c.reason,`info`),!1;if(!o)throw Error(`wui-kanban: no column "${String(t)}" on this board.`);let l=this._cardsIn(o),u=Number.isInteger(n)?Math.max(0,Math.min(n??0,l.length)):l.length,d={key:G(e),card:e,from:i,to:t,index:u},f=e.contains(document.activeElement);if(this._controlled())return this._fire(`wui:kanban:move`,d),this._announce(p.moved(s,this._titleOf(o))),f&&this._refocusSoon(d.key),!0;if(!this._fire(`wui:kanban:move`,d,!0))return!1;let m=o.hasAttribute(F)&&!this._revealed.has(d.key);m&&this._revealed.add(d.key);let h={parent:e.parentNode,next:e.nextSibling,column:r,revealed:m},g=this._bodyOf(o);if(!g)throw Error(`wui-kanban: the target column has no body.`);g.insertBefore(e,l[u]||null),f&&this._focusMoved(e),this.refresh();let _=o.getAttribute(`data-wui-step`);if(_)return this._runStep(e,d,h,_,o.getAttribute(`data-wui-step-size`));let y=this.getAttribute(`move-url`);if(!y)return this._announce(p.moved(s,this._titleOf(o))),this._fire(`wui:kanban:moved`,{...d,result:null}),!0;this._lock(e,!0),this._announce(p.saving(s,this._titleOf(o)));let b=new URLSearchParams({card:String(d.key),from:String(i),to:String(t),index:String(u)}),x=await(0,a.wuiFetch)(y,{method:`POST`,body:b});if(this._lock(e,!1),x.kind===`session`)return!1;if(x.ok){let t=this._applyFragment(x.html)||e;return Q(x.message,`success`),this._announce(p.moved(v(t),this._titleOf(o))),this._fire(`wui:kanban:moved`,{...d,card:t,result:x}),!0}return this._rollback(e,h),x.kind!==`aborted`&&Q(x.message||ee[x.kind]||p.failed.server,`danger`),this._fire(`wui:kanban:failed`,{...d,kind:x.kind,status:x.status,message:x.message}),!1}async _runStep(e,t,n,r,i){let o=v(e),s=this._columnByKey(t.to),c=new URLSearchParams({card:String(t.key),from:String(t.from),to:String(t.to)}).toString(),l=r+(r.includes(`?`)?`&`:`?`)+c;this._lock(e,!0);let u;try{let t=window.WUI?.modal?.load;if(typeof t!=`function`)throw Error(`<wui-kanban> data-wui-step needs the Razor script webority-ui.js (WUI.modal.load).`);u=await(await t(l,{trigger:e,size:i||void 0})).closed}catch(r){return this._lock(e,!1),this._rollback(e,n),ae(r)!==`AbortError`&&Q(p.failed.server,`danger`),this._fire(`wui:kanban:failed`,{...t,kind:`step`,status:0,message:oe(r)??null}),!1}if(u?.status!==`success`)return this._lock(e,!1),this._rollback(e,n),this._announce(p.cancelled(o)),this._fire(`wui:kanban:failed`,{...t,kind:`dismissed`,status:0,message:null}),!1;let d=e,f=this.getAttribute(`card-url`);if(f){let n=await(0,a.wuiFetch)(`${f}${f.includes(`?`)?`&`:`?`}${new URLSearchParams({card:String(t.key)})}`);n.ok&&(d=this._applyFragment(n.html)||e)}if(this._lock(d,!1),!s)throw Error(`wui-kanban: no column "${String(t.to)}" on this board.`);return this._announce(p.moved(v(d),this._titleOf(s))),this._fire(`wui:kanban:moved`,{...t,card:d,result:u}),!0}_lock(e,t){t?(e.setAttribute(`aria-busy`,`true`),e.setAttribute(`data-wui-saving`,``)):(e.removeAttribute(`aria-busy`),e.removeAttribute(`data-wui-saving`))}_rollback(e,t){let n=e.contains(document.activeElement),r=t.next&&t.next.parentNode===t.parent?t.next:null;if(t.revealed&&this._revealed.delete(G(e)),!t.parent)throw Error(`wui-kanban: the card had no parent to go back to.`);t.parent.insertBefore(e,r),n&&e.focus(),this.refresh(),this._announce(p.rolledBack(v(e),this._titleOf(t.column)))}_applyFragment(e){if(!e)return null;let t=document.createElement(`template`);t.innerHTML=e;for(let e of t.content.querySelectorAll(`script`))(0,n.devWarn)(`[@webority/ui-elements] A kanban fragment carried a script tag; it was removed, not run.`),e.remove();let r=null;for(let e of Y(t.content,E,HTMLElement)){if(e.closest(`template`))continue;let t=this._cardByKey(G(e));if(!t)continue;let n=t.contains(document.activeElement);t.dispatchEvent(new CustomEvent(`wui:teardown`,{bubbles:!0})),t.hidden&&(e.hidden=!0),t.replaceWith(e),this._prepareCard(e),n&&e.focus(),r??=e}for(let e of Y(t.content,`template[data-wui-kanban-summary]`,HTMLTemplateElement))this._columnByKey(e.getAttribute(`data-wui-kanban-summary`))?.querySelector(O)?.replaceChildren(e.content.cloneNode(!0));return this.refresh(),Z()?.refresh(),r}_refocusSoon(e){let t=()=>{let t=this._cardByKey(e);t&&this._focusMoved(t)};typeof requestAnimationFrame==`function`?requestAnimationFrame(t):setTimeout(t,0)}_focusMoved(e){e.focus({preventScroll:!0}),e.scrollIntoView?.({block:`nearest`})}_pointerDown(e){if(e.button!==0||e.isPrimary===!1||this._drag||this._kbd)return;let t=q(e.target),n=t?X(t,E,HTMLElement):null;if(!n||!this.contains(n)||t?.closest(re))return;let r={card:n,id:e.pointerId,x:e.clientX,y:e.clientY,type:e.pointerType,timer:0};this._press=r,e.pointerType===`touch`&&(r.timer=setTimeout(()=>{this._press===r&&this._startDrag(r,r.x,r.y)},400)),window.addEventListener(`pointermove`,this._onPointerMove),window.addEventListener(`pointerup`,this._onPointerUp),window.addEventListener(`pointercancel`,this._onPointerCancel)}_pointerMove(e){let t=this._press;if(t&&e.pointerId===t.id){if(!this._drag){if(!(Math.hypot(e.clientX-t.x,e.clientY-t.y)>6))return;if(t.type===`touch`){this._endPointer(!1);return}if(this._startDrag(t,e.clientX,e.clientY),!this._drag)return}this._dragTo(e.clientX,e.clientY)}}_pointerUp(e){this._press&&e.pointerId===this._press.id&&this._endPointer(!!this._drag)}_startDrag(e,t,n){let r=e.card;if(!this._canLift(r)){this._endPointer(!1);return}let i=this._columnOf(r);if(!i)throw Error(`wui-kanban: the card is not inside a column.`);let a=W(i),o=r.getBoundingClientRect(),s=r.cloneNode(!0);if(!(s instanceof HTMLElement))return;let c=s;for(let e of[c,...c.querySelectorAll(`[id]`)])e.removeAttribute(`id`);c.removeAttribute(`data-wui-card`),c.removeAttribute(`tabindex`),c.setAttribute(`aria-hidden`,`true`),c.classList.add(`wui-kanban-ghost`),c.style.width=`${o.width}px`,this.appendChild(c),r.setAttribute(`data-wui-dragging`,``),this.setAttribute(`data-wui-dragging`,``),this._drag={card:r,from:a,ghost:c,dx:t-o.left,dy:n-o.top,x:t,y:n,over:null,verdicts:this._markTargets(r,a)},this._announce(p.lifted(v(r),this._titleOf(i))),document.addEventListener(`keydown`,this._onDocKeyDown),this._dragTo(t,n)}_dragTo(e,t){let n=this._drag;if(!n)throw Error(`wui-kanban: no drag in progress.`);n.x=e,n.y=t,n.ghost.style.transform=`translate(${e-n.dx}px, ${t-n.dy}px)`;let r=this._columnAt(e,t);r!==n.over&&(n.over?.removeAttribute(`data-wui-over`),r?.setAttribute(`data-wui-over`,``),n.over=r),this._autoScroll(e,t,r)}_columnAt(e,t){for(let n of this._columns()){let r=n.getBoundingClientRect();if(e>=r.left&&e<=r.right&&t>=r.top&&t<=r.bottom)return n}return null}_indexAt(e,t){let n=this._visibleCardsIn(e).filter(e=>e!==this._drag?.card).find(e=>{let n=e.getBoundingClientRect();return t<n.top+n.height/2}),r=this._cardsIn(e).filter(e=>e!==this._drag?.card);return n?r.indexOf(n):r.length}_autoScroll(e,t,n){let r=this._scroller();if(r){let t=r.getBoundingClientRect();t.width>0&&(e<t.left+V?r.scrollBy?.({left:-16}):e>t.right-V&&r.scrollBy?.({left:H}))}if(n&&this._scrollColumn(n,t))return;let i=window.innerHeight||0;i>0&&(t<V?window.scrollBy?.({top:-16}):t>i-V&&window.scrollBy?.({top:H}))}_scrollColumn(e,t){let n=this._bodyOf(e);if(!n||e.hasAttribute(`data-collapsed`)||n.scrollHeight<=n.clientHeight)return!1;let r=n.getBoundingClientRect();return t<r.top+V&&n.scrollTop>0?(n.scrollBy?.({top:-16}),!0):t>r.bottom-V&&n.scrollTop+n.clientHeight<n.scrollHeight-1&&(n.scrollBy?.({top:H}),!0)}_endPointer(e){let t=this._press,n=this._drag;if(t&&clearTimeout(t.timer||void 0),this._press=null,this._drag=null,window.removeEventListener(`pointermove`,this._onPointerMove),window.removeEventListener(`pointerup`,this._onPointerUp),window.removeEventListener(`pointercancel`,this._onPointerCancel),document.removeEventListener(`keydown`,this._onDocKeyDown),!n)return;n.ghost.remove(),n.card.removeAttribute(`data-wui-dragging`),this.removeAttribute(`data-wui-dragging`),this._suppressClick=!0,setTimeout(()=>{this._suppressClick=!1},0);let r=n.over;if(this._clearTargets(),!e||!r){this._announce(p.cancelled(v(n.card)));return}let i=W(r),a=n.verdicts.get(i);a?.source?this._announce(p.cancelled(v(n.card))):a?.ok?this._commit(n.card,i,this._indexAt(r,n.y)):(this._announce(a?.reason),Q(a?.reason,`info`))}_click(e){let t=q(e.target);if(this._suppressClick&&t?.closest(E)){e.preventDefault(),e.stopPropagation(),this._suppressClick=!1;return}let n=t?.closest(N);if(n&&this.contains(n)){let e=X(n,w,HTMLElement);e&&this._setCollapsed(e,!e.hasAttribute(`data-collapsed`),!0);return}let r=t?.closest(L);if(r&&this.contains(r)){this._controlled()||this._loadMore(X(r,w,HTMLElement));return}let i=t?.closest(P);if(i&&this.contains(i)){this._controlled()||this._toggleMore(X(i,w,HTMLElement));return}let a=t?.closest(M);a&&this.contains(a)&&this._showColumn(a.getAttribute(`data-wui-switch`))}_keyDown(e){let t=this._kbd;if(t){this._liftedKey(e,t);return}let n=e.target instanceof HTMLElement?e.target:null;if(!n?.matches(E)||!this.contains(n))return;let r=this._columnOf(n);switch(e.key){case` `:case`Spacebar`:{if(e.preventDefault(),!this._canLift(n))return;if(!r)throw Error(`wui-kanban: the card is not inside a column.`);let t=W(r),i=this._columns();this._kbd={card:n,from:t,target:i.indexOf(r),verdicts:this._markTargets(n,t)},n.setAttribute(`data-wui-lifted`,``),this.setAttribute(`data-wui-dragging`,``),r.setAttribute(`data-wui-target`,``),this._announce(p.lifted(v(n),this._titleOf(r)));return}case`ArrowDown`:case`ArrowUp`:{if(!r)throw Error(`wui-kanban: the card is not inside a column.`);let t=this._visibleCardsIn(r),i=t[t.indexOf(n)+(e.key===`ArrowDown`?1:-1)];i&&(e.preventDefault(),i.focus());return}case`ArrowLeft`:case`ArrowRight`:{let t=this._columns(),n=e.key===`ArrowRight`?1:-1;for(let i=(r?t.indexOf(r):-1)+n;i>=0&&i<t.length;i+=n){let n=t[i],r=n?this._visibleCardsIn(n)[0]:void 0;if(r&&n&&!n.hasAttribute(`data-collapsed`)){e.preventDefault(),r.focus();return}}return}}}_liftedKey(e,t){let n=this._columns();switch(e.key){case`ArrowLeft`:case`ArrowRight`:{e.preventDefault();let r=t.target+(e.key===`ArrowRight`?1:-1);if(r<0||r>=n.length)return;n[t.target]?.removeAttribute(`data-wui-target`),t.target=r;let i=n[r];if(!i)return;i.setAttribute(`data-wui-target`,``),this._showColumn(W(i),!1);let a=t.verdicts.get(W(i));if(!a)throw Error(`wui-kanban: no verdict for the column.`);let o=this._titleOf(i);this._announce(a.source?p.overSource(o):a.ok?p.over(o,this._cardsIn(i).filter(e=>!K(e)).length):p.overRefused(o,a.reason??``));return}case` `:case`Spacebar`:case`Enter`:{e.preventDefault();let r=n[t.target];if(!r)throw Error(`wui-kanban: the lifted card has no target column.`);let i=W(r),a=t.verdicts.get(i);if(!a)throw Error(`wui-kanban: no verdict for the column.`);if(!a.source&&!a.ok){this._announce(a.reason);return}this._endKeyboard(),a.source?this._announce(p.cancelled(v(t.card))):this._commit(t.card,i);return}case`Escape`:case`Tab`:e.key===`Escape`&&e.preventDefault(),this._endKeyboard(),this._showColumn(t.from,!1),this._announce(p.cancelled(v(t.card)));return}}_endKeyboard(){let e=this._kbd;this._kbd=null,e&&(e.card.removeAttribute(`data-wui-lifted`),this.removeAttribute(`data-wui-dragging`),this._clearTargets())}_restoreCollapsed(){let e=b(this.getAttribute(`board-id`));for(let t of this._columns()){let n=W(t);t.hasAttribute(`data-collapsible`)&&Object.hasOwn(e,String(n))&&this._setCollapsed(t,e[String(n)],!1)}}_setCollapsed(e,t,n){let r=W(e);e.toggleAttribute(`data-collapsed`,t);let i=this._titleOf(e);for(let n of e.querySelectorAll(N))n.setAttribute(`aria-expanded`,t?`false`:`true`),n.setAttribute(`aria-label`,t?p.expand(i):p.collapse(i));n&&(x(this.getAttribute(`board-id`),r,t),this._fire(`wui:kanban:collapse`,{column:r,collapsed:t}))}_toggleMore(e){if(!e)return;let t=W(e);if(this._expanded.delete(t))for(let t of this._cardsIn(e))this._revealed.delete(G(t));else this._expanded.add(t);this.refresh()}_unloadedIn(e){return e.hasAttribute(R)?(e.hasAttribute(B)||e.setAttribute(B,String(Math.max(0,Number(e.getAttribute(z))-this._cardsIn(e).length))),Number(e.getAttribute(B))):0}async _loadMore(e){if(!e)throw Error(`wui-kanban: the load-more button is outside a column.`);let t=Number(e.getAttribute(B));if(e.hasAttribute(`data-wui-loading`)||!(t>0))return;e.setAttribute(`data-wui-loading`,``);let r=J(e,L,HTMLButtonElement);r&&(r.disabled=!0,r.textContent=p.loading);let i=new URL(String(e.getAttribute(R)),document.baseURI);i.searchParams.set(`skip`,String(this._cardsIn(e).length));let o=0,s=!1;try{let n=await(0,a.wuiFetch)(i.toString());if(n.ok){let r=document.createElement(`template`);r.innerHTML=n.html;let i=this._bodyOf(e);for(let e of[...r.content.children])if(e.matches(E)&&!this._cardByKey(G(e))){if(!i)throw Error(`wui-kanban: the column has no body.`);i.append(e),o++}let a=n.response?.headers.get(`Wui-Kanban-Remaining`)??``;e.setAttribute(B,String(/^\d+$/.test(a)?Number(a):Math.max(0,t-o))),s=!0}}catch(e){(0,n.devError)(`[@webority/ui-elements] A kanban column could not load its next cards.`,e)}e.removeAttribute(`data-wui-loading`),this.refresh(),s?this._fire(`wui:kanban:loaded`,{key:W(e),added:o}):Q(p.loadFailed,`danger`)}_loadOnScroll(e){if(this._controlled()||!e.matches(T))return;let t=X(e,w,HTMLElement);t?.hasAttribute(R)&&e.scrollTop+e.clientHeight>=e.scrollHeight-U&&this._loadMore(t)}_isPhone(){return typeof matchMedia==`function`&&matchMedia(`(max-width: 767.98px)`).matches}_showColumn(e,t=!0){for(let t of this.querySelectorAll(M))t.getAttribute(`data-wui-switch`)===e?t.setAttribute(`aria-current`,`true`):t.removeAttribute(`aria-current`);let n=this._columnByKey(e),r=this._scroller();if(!n||!r||!t&&!this._isPhone())return;let i=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches;r.scrollTo?.({left:n.offsetLeft-r.offsetLeft,behavior:i?`auto`:`smooth`})}_syncSwitcherFromScroll(){let e=this._scroller();if(!e||!this._isPhone())return;let t=e.clientWidth||1,n=this._columns()[Math.round(e.scrollLeft/t)];if(n)for(let e of this.querySelectorAll(M))e.getAttribute(`data-wui-switch`)===W(n)?e.setAttribute(`aria-current`,`true`):e.removeAttribute(`aria-current`)}};(0,t.defineElement)(`wui-kanban`,$),e.KANBAN_DRAG_THRESHOLD_PX=f,e.KANBAN_LONG_PRESS_MS=d,e.KANBAN_PHONE_QUERY=u,e.KANBAN_STORAGE_PREFIX=l,e.KANBAN_SUMMARY_FORMATS=c,e.KANBAN_TEXT=p,e.KANBAN_TONES=s,e.WuiKanban=$,e.kanbanCardLabel=v,e.kanbanOverflow=_,e.kanbanStorageKey=y,e.kanbanSummaryFormat=S,e.kanbanVisibleLimit=g,e.readKanbanCollapsed=b,e.sumKanbanValues=C,e.writeKanbanCollapsed=x})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.devWarn,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.formatters,WeborityUiElementsInternal.modules.wuiHttp);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=globalThis.WeborityUiElementsInternal?.version;if(i!==`0.
|
|
1
|
+
(function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=globalThis.WeborityUiElementsInternal?.version;if(i!==`0.152.0`)throw Error(`[webority-ui] lead-popup expects ui-elements 0.152.0 but the page loaded `+i+`.`);var a={"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-soft":`#E0E7FF`,"--color-primary-text":`#4F46E5`,"--color-on-primary":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`,"--color-border-strong":`#C4CADA`,"--color-surface":`#FFFFFF`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-modal":`0px 24px 60px -16px rgba(7, 20, 55, 0.28)`,"--wui-z-modal":`1505`},o=e=>`var(${e}, ${a[e]})`,s=`
|
|
2
2
|
:host {
|
|
3
3
|
all: initial;
|
|
4
4
|
display: contents;
|
|
@@ -342,7 +342,7 @@ textarea.wlp-input {
|
|
|
342
342
|
animation: none;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
`,c=[`name`,`email`,`phone`,`company`,`message`,`consent`],l=[`name`,`email`],u={name:`Name`,email:`Email`,phone:`Phone number`,company:`Company`,message:`Message`,consent:`I agree to be contacted about my enquiry`,consentLink:`Privacy policy`},d={name:100,email:320,phone:40,company:150,message:1e3},f={name:`name`,email:`email`,phone:`tel`,company:`organization`},p=`input:not([type=hidden]), textarea, select, button, a[href]`,m=[`exit`,`delay`,`scroll`,`pages`],h=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,g=864e5,_=`comment_subject`,v=`__RequestVerificationToken`,y=`__FormStamp`,b=`__CaptchaToken`,x=`Something went wrong. Please try again or contact us directly.`,S=`Tick the box to continue`,C=`action.public-form.heading.description.fields.required.field-prefix.field-names.labels.max-lengths.submit-label.success-title.success-text.error-text.close-label.secondary-label.secondary-href.secondary-divider.consent-href.triggers.delay-seconds.scroll-percent.pages-viewed.storage-key.dismiss-days.submitted-days.success-close-seconds.preview`.split(`.`),w=new Set;function T(e,t){w.has(e)||(w.add(e),(0,n.devWarn)(t))}var E=0;function D(e){return(e??``).split(/\s+/).map(e=>e.trim()).filter(Boolean)}function O(e){let t={};for(let n of(e??``).split(`;`)){let e=n.indexOf(`=`);if(e<0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function k(e){return String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var A=null;function j(e){A||(A=new CSSStyleSheet,A.replaceSync(s)),e.adoptedStyleSheets=[A]}function M(e,t){return e instanceof Error&&e.message?e.message:t}var
|
|
345
|
+
`,c=[`name`,`email`,`phone`,`company`,`message`,`consent`],l=[`name`,`email`],u={name:`Name`,email:`Email`,phone:`Phone number`,company:`Company`,message:`Message`,consent:`I agree to be contacted about my enquiry`,consentLink:`Privacy policy`},d={name:100,email:320,phone:40,company:150,message:1e3},f={name:`name`,email:`email`,phone:`tel`,company:`organization`},p=`input:not([type=hidden]), textarea, select, button, a[href]`,m=[`exit`,`delay`,`scroll`,`pages`],h=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,g=864e5,_=`comment_subject`,v=`__RequestVerificationToken`,y=`__FormStamp`,b=`__CaptchaToken`,x=`Something went wrong. Please try again or contact us directly.`,S=`Tick the box to continue`,C=`action.public-form.heading.description.fields.required.field-prefix.field-names.labels.max-lengths.submit-label.success-title.success-text.error-text.close-label.secondary-label.secondary-href.secondary-divider.consent-href.triggers.delay-seconds.scroll-percent.pages-viewed.storage-key.dismiss-days.submitted-days.success-close-seconds.preview`.split(`.`),w=new Set;function T(e,t){w.has(e)||(w.add(e),(0,n.devWarn)(t))}var E=0;function D(e){return(e??``).split(/\s+/).map(e=>e.trim()).filter(Boolean)}function O(e){let t={};for(let n of(e??``).split(`;`)){let e=n.indexOf(`=`);if(e<0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function k(e){return String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var A=null;function j(e){A||(A=new CSSStyleSheet,A.replaceSync(s)),e.adoptedStyleSheets=[A]}function M(e,t){return e instanceof Error&&e.message?e.message:t}function N(e){return c.some(t=>t===e)}function P(e){return m.some(t=>t===e)}function F(e,t,n){if(e instanceof t)return e;throw Error(`${n} missing`)}var I=class extends r.ElementBase{_uid;_rendered;_open;_opened;_posting;_stale;_armed;_session;_returnTo;_prevOverflow;_delayTimer;_closeTimer;_modal;_onMouseLeave;_onVisibility;_onScroll;static get observedAttributes(){return C}constructor(){super(),E+=1,this._uid=`wlp-${E}`,this._rendered=!1,this._open=!1,this._opened=!1,this._posting=!1,this._stale=!1,this._armed=!1,this._session=null,this._returnTo=null,this._prevOverflow=``,this._delayTimer=null,this._closeTimer=null,this._onMouseLeave=e=>{!this._fine()||e.clientY>0||!this._engaged()||this.open(`exit`)},this._onVisibility=()=>{document.visibilityState===`hidden`&&!this._fine()&&this._engaged()&&this.open(`exit`)},this._onScroll=()=>this._trackScroll()}get isOpen(){return this._open}set isOpen(e){e?this.open(`manual`):this.close(`dismiss`)}connectedCallback(){this._rendered||this._render(),this._arm(),this.preview&&!this._open&&this.open(`manual`)}disconnectedCallback(){this._disarm(),this._open&&this._release()}attributeChangedCallback(){this._rendered&&(this._open?this._stale=!0:this._render())}open(e=`manual`){if(!this._open&&!(e!==`manual`&&(this._opened||this._blocked()||document.querySelector(`dialog[open], .modal.show`)))){if(this._rendered||this._render(),this._opened=!0,this._open=!0,clearTimeout(this._delayTimer??void 0),this._showForm(),this._modal=!this.preview,this._modal){let e=document.activeElement;this._returnTo=e instanceof HTMLElement||e instanceof SVGElement?e:null,this._prevOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow=`hidden`;let t=this._dialog();t.showModal();let n=t.querySelector(`[data-wlp-field] [data-wlp-input]`);n instanceof HTMLElement&&n.focus()}else this._dialog().setAttribute(`open`,``);this._remember(`shown`),this._emit(`wui-lead-popup-shown`,{trigger:e})}}close(e=`dismiss`){if(!this._open)return;clearTimeout(this._closeTimer??void 0),this._release();let t=this._returnTo;this._returnTo=null,t?.isConnected&&typeof t.focus==`function`&&t.focus(),this._stale&&this._render(),this._emit(`wui-lead-popup-closed`,{reason:e})}_release(){this._open=!1,this._dialog().close(),this._modal&&(document.documentElement.style.overflow=this._prevOverflow)}_root(){return this.shadowRoot??this.attachShadow({mode:`open`})}_dialog(){return F(this._root().querySelector(`dialog`),HTMLDialogElement,`dialog`)}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}_text(e,t=``){return this.getAttribute(e)||t}_number(e,t){let n=this.getAttribute(e);if(n===null||n.trim()===``)return t;let r=Number(n);return Number.isFinite(r)&&r>=0?r:t}get preview(){return this.hasAttribute(`preview`)}set preview(e){this.toggleAttribute(`preview`,e===!0||e===``||e===`true`)}_fieldKeys(){let e=D(this.getAttribute(`fields`)).filter(e=>N(e)?!0:(T(`field:${e}`,`[@webority/ui-elements] <wui-lead-popup> has no field "${e}". It is ignored.`),!1));return e.length?e:l}_requiredKeys(){let e=this._fieldKeys();return D(this.getAttribute(`required`)).filter(t=>N(t)&&e.includes(t))}_label(e){return O(this.getAttribute(`labels`))[e]||u[e]}_postedName(e){return this._text(`field-prefix`)+(O(this.getAttribute(`field-names`))[e]||e)}_maxLength(e){let t=Number(O(this.getAttribute(`max-lengths`))[e]);return Number.isInteger(t)&&t>0?t:d[e]}_triggers(){if(this.preview)return[];let e=(this.getAttribute(`triggers`)??``).split(/\s+/).filter(P);return e.length?this.getAttribute(`storage-key`)?e:(T(`storage-key`,`[@webority/ui-elements] <wui-lead-popup> has triggers but no storage-key. The triggers are off.`),[]):[]}_render(){let e=this._root();j(e);let t=this._uid,n=this._fieldKeys(),r=new Set(this._requiredKeys()),i=this._text(`heading`),a=this._text(`description`),o=this._text(`secondary-label`),s=this._text(`secondary-href`),c=n.map(e=>this._fieldMarkup(e,r.has(e))).join(``),l=document.createElement(`template`);l.innerHTML=`
|
|
346
346
|
<dialog class="wlp-dialog" aria-labelledby="${t}-h"${a?` aria-describedby="${t}-d"`:``}>
|
|
347
347
|
<div class="wlp-card">
|
|
348
348
|
<button type="button" class="wlp-close" aria-label="${k(this._text(`close-label`,`Close`))}" data-wlp-close>×</button>
|
|
@@ -379,4 +379,4 @@ textarea.wlp-input {
|
|
|
379
379
|
<label class="wlp-label" for="${n}">${k(i)}${o}</label>
|
|
380
380
|
${l}
|
|
381
381
|
<p class="wlp-error" id="${r}" hidden></p>
|
|
382
|
-
</div>`}_wire(){let e=this._dialog();e.addEventListener(`cancel`,e=>{e.preventDefault(),this.close(`escape`)}),e.addEventListener(`click`,t=>{t.target===e&&this.close(`backdrop`)}),e.addEventListener(`keydown`,t=>{if(t.key!==`Tab`||!this._modal)return;let n=Array.from(e.querySelectorAll(p)).filter(e
|
|
382
|
+
</div>`}_wire(){let e=this._dialog();e.addEventListener(`cancel`,e=>{e.preventDefault(),this.close(`escape`)}),e.addEventListener(`click`,t=>{t.target===e&&this.close(`backdrop`)}),e.addEventListener(`keydown`,t=>{if(t.key!==`Tab`||!this._modal)return;let n=Array.from(e.querySelectorAll(p)).filter(e=>e instanceof HTMLElement&&!(`disabled`in e&&e.disabled===!0)&&e.getClientRects().length>0);if(!n.length)return;let r=this._root().activeElement,i=r instanceof HTMLElement?n.indexOf(r):-1;t.preventDefault();let a=n[i===-1?t.shiftKey?n.length-1:0:(i+(t.shiftKey?-1:1)+n.length)%n.length];if(!a)throw Error(`tab stop missing`);a.focus()});for(let t of e.querySelectorAll(`[data-wlp-close]`))t.addEventListener(`click`,()=>this.close(`dismiss`));e.querySelector(`[data-wlp-done]`)?.addEventListener(`click`,()=>this.close(`submitted`)),e.querySelector(`[data-wlp-secondary]`)?.addEventListener(`click`,()=>this.close(`secondary`)),F(e.querySelector(`[data-wlp-form]`),HTMLFormElement,`form`).addEventListener(`submit`,e=>this._onSubmit(e))}_showForm(){let e=this._root();F(e.querySelector(`.wlp-form-view`),HTMLElement,`form view`).hidden=!1,F(e.querySelector(`.wlp-success-view`),HTMLElement,`success view`).hidden=!0}_showSuccess(){let e=this._root();F(e.querySelector(`.wlp-form-view`),HTMLElement,`form view`).hidden=!0;let t=F(e.querySelector(`.wlp-success-view`),HTMLElement,`success view`);t.hidden=!1,F(e.querySelector(`[data-wlp-success-title]`),HTMLElement,`success title`).focus()}_setFieldError(e,t){let n=this._root(),r=F(n.querySelector(`[data-wlp-input="${e}"]`),HTMLElement,`${e} field`),i=F(n.querySelector(`#${this._uid}-e-${e}`),HTMLElement,`${e} error`);return i.textContent=t,i.hidden=!t,t?(r.setAttribute(`aria-invalid`,`true`),r.setAttribute(`aria-describedby`,i.id)):(r.removeAttribute(`aria-invalid`),r.removeAttribute(`aria-describedby`)),r}_validate(){let e=new Set(this._requiredKeys()),t=null,n={};for(let r of this._fieldKeys()){let i=this._root().querySelector(`[data-wlp-input="${r}"]`);if(!(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement))throw Error(`${r} field missing`);let a=r===`consent`&&i instanceof HTMLInputElement?i.checked:i.value.trim();n[r]=a;let o=``;!a&&e.has(r)?o=r===`consent`?S:`Enter your ${this._label(r).toLowerCase()}`:r===`email`&&a&&!h.test(String(a))&&(o=`Enter a valid email address`);let s=this._setFieldError(r,o);o&&!t&&(t=s)}return t?(t.focus(),null):n}_setBusy(e){this._posting=e;let t=F(this._root().querySelector(`[data-wlp-form]`),HTMLElement,`form`);e?t.setAttribute(`aria-busy`,`true`):t.removeAttribute(`aria-busy`),F(this._root().querySelector(`[data-wlp-submit]`),HTMLButtonElement,`submit button`).disabled=e}_fail(e,t){this._setBusy(!1);let n=F(this._root().querySelector(`[data-wlp-form-error]`),HTMLElement,`form error`);n.textContent=t,n.hidden=!t,this._emit(`wui-lead-popup-error`,{message:t,reason:e})}async _onSubmit(e){if(e.preventDefault(),this._posting)return;F(this._root().querySelector(`[data-wlp-form-error]`),HTMLElement,`form error`).hidden=!0;let t=this._validate();t&&!this.preview&&await this._post(t)}async _post(e){let t=globalThis.WeborityPublicForms;if(!t){T(`gate`,`[@webority/ui-elements] <wui-lead-popup> needs window.WeborityPublicForms. Load Webority.Security.Razor's public-form.js.`),this._fail(`gate`,this._text(`error-text`,x));return}let r=this._text(`error-text`,x),i=this._text(`public-form`);this._setBusy(!0);let a,o;try{a=await t.session(),o=await t.mintToken(i)}catch(e){this._fail(`gate`,M(e,r));return}let s=this._root(),c=new FormData;for(let t of this._fieldKeys())c.append(this._postedName(t),String(e[t]));c.set(v,a.token),c.set(y,a.formStamp),c.set(b,o),c.set(_,F(s.querySelector(`[data-wlp-honeypot]`),HTMLInputElement,`honeypot`).value),this._emit(`wui-lead-popup-before-submit`,{formData:c});let l;try{l=await fetch(this._text(`action`),{method:`POST`,body:c,credentials:`same-origin`,headers:{"X-Requested-With":`XMLHttpRequest`}})}catch{this._fail(`network`,r);return}let u;try{u=await this._readJson(l)}catch(e){(0,n.devError)(`<wui-lead-popup> could not read the response body`,e),this._fail(`server`,r);return}if(l.ok)this._succeed(e,u);else{let e=typeof u==`object`&&u&&`detail`in u&&typeof u.detail==`string`?u.detail.trim():``;this._fail(`server`,e||r)}}async _readJson(e){return e.json()}_succeed(e,t){this._setBusy(!1),this._remember(`submitted`),this._emit(`wui-lead-popup-submitted`,{values:e,response:t}),this._showSuccess();let n=this._number(`success-close-seconds`,5);n>0&&(this._closeTimer=setTimeout(()=>this.close(`submitted`),n*1e3))}_arm(){if(this._armed)return;this._armed=!0;let e=this._triggers();if(!e.length)return;this._session=this._loadSession();let t=location.pathname+location.search;if(this._session.pages.includes(t)||this._session.pages.push(t),this._saveSession(),e.includes(`exit`)&&(document.documentElement.addEventListener(`mouseleave`,this._onMouseLeave),document.addEventListener(`visibilitychange`,this._onVisibility)),e.includes(`delay`)){let e=Math.max(0,this._number(`delay-seconds`,30)*1e3-(Date.now()-this._session.start));this._delayTimer=setTimeout(()=>this.open(`delay`),e)}e.includes(`scroll`)&&(window.addEventListener(`scroll`,this._onScroll,{passive:!0}),this._trackScroll()),e.includes(`pages`)&&this._session.pages.length>this._number(`pages-viewed`,2)&&this.open(`pages`)}_disarm(){this._armed=!1,clearTimeout(this._delayTimer??void 0),clearTimeout(this._closeTimer??void 0),document.documentElement.removeEventListener(`mouseleave`,this._onMouseLeave),document.removeEventListener(`visibilitychange`,this._onVisibility),window.removeEventListener(`scroll`,this._onScroll)}_trackScroll(){let e=document.documentElement.scrollHeight;if(this._session&&e>0){let t=(window.scrollY+window.innerHeight)/e*100;t>this._session.maxScroll&&(this._session.maxScroll=t,this._saveSession()),this._session.maxScroll>this._number(`scroll-percent`,50)&&this.open(`scroll`)}}_fine(){return typeof matchMedia!=`function`||matchMedia(`(pointer: fine)`).matches}_engaged(){let e=this._session;return e?Date.now()-e.start>this._number(`delay-seconds`,30)*1e3||e.maxScroll>this._number(`scroll-percent`,50)||e.pages.length>this._number(`pages-viewed`,2):!1}_sessionKey(){return`wui-lead-popup:${this.getAttribute(`storage-key`)}`}_loadSession(){let e={start:Date.now(),maxScroll:0,pages:[]};try{let e=sessionStorage.getItem(this._sessionKey());if(e){let t=JSON.parse(e);if(Number.isFinite(t.start)&&Number.isFinite(t.maxScroll)&&Array.isArray(t.pages))return t}}catch{return e}return e}_saveSession(){try{sessionStorage.setItem(this._sessionKey(),JSON.stringify(this._session))}catch{}}_readMemory(){let e=this.getAttribute(`storage-key`);if(!e)return null;try{let t=JSON.parse(localStorage.getItem(e)??`null`);if((t?.state===`shown`||t?.state===`submitted`)&&Number.isFinite(Date.parse(t.at)))return t}catch{return null}return null}_blocked(){let e=this._readMemory();if(!e)return!1;let t=e.state===`shown`?this._number(`dismiss-days`,30):this._number(`submitted-days`,365);return Date.now()-Date.parse(e.at)<t*g}_remember(e){let t=this.getAttribute(`storage-key`);if(t&&!this.preview)try{localStorage.setItem(t,JSON.stringify({state:e,at:new Date().toISOString()}))}catch{}}};(0,t.defineElement)(`wui-lead-popup`,I),e.WuiLeadPopup=I})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.devWarn,WeborityUiElementsInternal.modules.elementBase);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=globalThis.WeborityUiElementsInternal?.version;if(a!==`0.149.0`)throw Error(`[webority-ui] lightbox expects ui-elements 0.149.0 but the page loaded `+a+`.`);var o=`a.wui-lightbox-item`,s=1,c=4,l=.5,u=2,d=50,f=6,p=300,m=300;function h(e){return Number.isFinite(e)?Math.min(c,Math.max(s,e)):s}function g(e,t,n,r){let i=(e,n)=>Math.max(0,(e*t-n)/2),a=i(r.width,n.width),o=i(r.height,n.height);return{x:Math.min(a,Math.max(-a,e.x)),y:Math.min(o,Math.max(-o,e.y))}}function _(e,t){return Math.abs(e)<d||Math.abs(e)<Math.abs(t)*1.5?0:e<0?1:-1}function v(e){let t=String(e??``).split(/[?#]/)[0].split(`/`).filter(Boolean).pop()??``;try{return decodeURIComponent(t)}catch{return t}}function y(e,t,n={}){let r=document.createElement(e);r.className=t;for(let[e,t]of Object.entries(n))r.setAttribute(e,t);return r}function b(e,t,n){let r=y(`button`,`u-action wui-lightbox-btn ${n}`,{type:`button`,"aria-label":t,title:t});return r.style.setProperty(`--wui-action-size`,`40px`),r.innerHTML=(0,i.glyphSvg)(e,{size:20}),r}var x=class extends n.ElementBase{static get observedAttributes(){return[`open-index`]}constructor(){super(),this._ui=null,this._index=0,this._zoom=s,this._pan={x:0,y:0},this._pointers=new Map,this._gesture=null,this._lastTap=-1/0,this._returnTo=null,this._lockedOverflow=null,this._onClick=e=>{if(e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let t=e.target?.closest?.(o);if(!t||!this.contains(t))return;let n=this._links().indexOf(t);n<0||(e.preventDefault(),this.open(n))}}get download(){return this.hasAttribute(`download`)}set download(e){this.toggleAttribute(`download`,e===!0||e===``||e===`true`)}get label(){return this.getAttribute(`label`)||`Image viewer`}set label(e){this.setAttribute(`label`,String(e??``))}get layout(){return this.getAttribute(`layout`)===`single`?`single`:`gallery`}set layout(e){if(e===`single`)this.setAttribute(`layout`,`single`);else if(e===`gallery`||e===``)this.removeAttribute(`layout`);else throw Error(`<wui-lightbox> layout must be "gallery" or "single", received "${e}".`)}get isOpen(){return this._ui!==null}connectedCallback(){this.addEventListener(`click`,this._onClick),this._syncOpenIndex()}disconnectedCallback(){this.removeEventListener(`click`,this._onClick),this._teardown()}attributeChangedCallback(){this.isConnected&&this._syncOpenIndex()}_syncOpenIndex(){let e=this.getAttribute(`open-index`);e===null?this.close():this.open(Number(e))}_links(){return[...this.querySelectorAll(o)]}_items(){return this._links().map(e=>{let t=e.getAttribute(`href`)??``;return{link:e,src:t,alt:e.querySelector(`img`)?.getAttribute(`alt`)??``,caption:e.dataset.caption??``,name:e.dataset.name||v(t)}})}open(e=0){let t=this._items();return t.length?(this._ui||(this._returnTo=document.activeElement,this._build(),this.dispatchEvent(new CustomEvent(`wui-lightbox:open`,{bubbles:!0,detail:{index:e}}))),this._show(e,t),this._ui.close.focus(),!0):!1}close(){if(!this._ui)return;let e=this._index,t=this._links()[e]??this._returnTo;this._teardown(),t?.isConnected&&t.focus(),this._returnTo=null,this.dispatchEvent(new CustomEvent(`wui-lightbox:close`,{bubbles:!0,detail:{index:e}}))}_teardown(){this._ui&&(this._ui.root.remove(),this._ui=null,this._pointers.clear(),this._gesture=null,this._lockedOverflow!==null&&(document.documentElement.style.overflow=this._lockedOverflow,this._lockedOverflow=null))}_build(){let e=y(`div`,`wui-lightbox-overlay`,{role:`dialog`,"aria-modal":`true`,"aria-label":this.label,tabindex:`-1`}),t=y(`div`,`wui-lightbox-bar`),n=y(`span`,`wui-lightbox-count`,{"aria-live":`polite`}),r=y(`div`,`wui-lightbox-tools`),a=b(`zoom-out`,`Zoom out`,`wui-lightbox-zoom-out`),o=b(`zoom-in`,`Zoom in`,`wui-lightbox-zoom-in`),s=y(`a`,`u-action wui-lightbox-btn wui-lightbox-download`,{"aria-label":`Download`,title:`Download`});s.style.setProperty(`--wui-action-size`,`40px`),s.innerHTML=(0,i.glyphSvg)(`download`,{size:20}),s.hidden=!this.download;let c=b(`x`,`Close`,`wui-lightbox-close`);r.append(a,o,s,c),t.append(n,r);let u=y(`div`,`wui-lightbox-stage`),d=b(`chevron-left`,`Previous image`,`wui-lightbox-nav wui-lightbox-prev`),f=b(`chevron-right`,`Next image`,`wui-lightbox-nav wui-lightbox-next`),p=y(`img`,`wui-lightbox-image`,{decoding:`async`,draggable:`false`,alt:``}),m=y(`p`,`wui-lightbox-status`,{role:`status`});u.append(p,m,d,f);let h=y(`p`,`wui-lightbox-caption`);e.append(t,u,h);let g={root:e,count:n,zoomOut:a,zoomIn:o,download:s,close:c,stage:u,prev:d,next:f,image:p,status:m,caption:h};this._ui=g,c.addEventListener(`click`,()=>this.close()),d.addEventListener(`click`,()=>this.step(-1)),f.addEventListener(`click`,()=>this.step(1)),a.addEventListener(`click`,()=>this._setZoom(this._zoom-l)),o.addEventListener(`click`,()=>this._setZoom(this._zoom+l)),e.addEventListener(`keydown`,e=>this._onKeyDown(e)),u.addEventListener(`pointerdown`,e=>this._onPointerDown(e)),u.addEventListener(`pointermove`,e=>this._onPointerMove(e)),u.addEventListener(`pointerup`,e=>this._onPointerEnd(e,!0)),u.addEventListener(`pointercancel`,e=>this._onPointerEnd(e,!1)),u.addEventListener(`wheel`,e=>this._onWheel(e),{passive:!1}),p.addEventListener(`load`,()=>{this._ui===g&&(m.textContent=``,u.removeAttribute(`aria-busy`),p.hidden=!1,this._applyTransform())}),p.addEventListener(`error`,()=>{this._ui===g&&(u.removeAttribute(`aria-busy`),p.hidden=!0,m.textContent=`This image can't be shown.`)}),this.append(e),this._lockedOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow=`hidden`}step(e){if(!this._ui||!e)return;let t=this._items();t.length<2||this._show((this._index+e+t.length)%t.length,t)}_show(e,t){let n=this._ui,i=Math.min(t.length-1,Math.max(0,Math.trunc(Number(e))||0)),a=t[i],o=i!==this._index||!n.image.getAttribute(`src`);if(this._index=i,this._zoom=s,this._pan={x:0,y:0},n.count.textContent=`${(0,r.formatNumber)(i+1,{decimals:0})} of ${(0,r.formatNumber)(t.length,{decimals:0})}`,n.caption.textContent=a.caption,n.caption.hidden=!a.caption,n.download.href=a.src,n.download.setAttribute(`download`,a.name),n.prev.hidden=n.next.hidden=t.length<2,n.stage.setAttribute(`aria-busy`,`true`),n.status.textContent=``,n.image.hidden=!1,n.image.alt=a.alt||a.caption,n.image.src=a.src,this._applyTransform(),this._syncZoomButtons(),t.length>1)for(let e of[t[(i+1)%t.length],t[(i-1+t.length)%t.length]])new Image().src=e.src;o&&this.dispatchEvent(new CustomEvent(`wui-lightbox:change`,{bubbles:!0,detail:{index:i}}))}_syncZoomButtons(){this._ui.zoomOut.disabled=this._zoom<=s,this._ui.zoomIn.disabled=this._zoom>=c;let e=document.activeElement;(e===this._ui.zoomOut||e===this._ui.zoomIn)&&e.disabled&&this._ui.close.focus()}_setZoom(e){this._ui&&(this._zoom=h(e),this._pan=this._clampedPan(this._pan),this._applyTransform(),this._syncZoomButtons())}_clampedPan(e){let{stage:t,image:n}=this._ui;return g(e,this._zoom,{width:t.clientWidth,height:t.clientHeight},{width:n.offsetWidth,height:n.offsetHeight})}_applyTransform(){let{image:e,stage:t}=this._ui;e.style.transform=`translate(${this._pan.x}px, ${this._pan.y}px) scale(${this._zoom})`,t.classList.toggle(`wui-lightbox-zoomed`,this._zoom>s)}_onKeyDown(e){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this.close();else if(e.key===`Tab`)this._trapTab(e);else if(e.key===`ArrowLeft`||e.key===`ArrowRight`)e.preventDefault(),this.step(e.key===`ArrowRight`?1:-1);else if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=this._items();this._show(e.key===`Home`?0:t.length-1,t)}else e.key===`+`||e.key===`=`?(e.preventDefault(),this._setZoom(this._zoom+l)):e.key===`-`?(e.preventDefault(),this._setZoom(this._zoom-l)):e.key===`0`&&(e.preventDefault(),this._setZoom(s))}_trapTab(e){let t=[...this._ui.root.querySelectorAll(`button, a[href]`)].filter(e=>!e.hidden&&!e.disabled);if(!t.length){e.preventDefault();return}let n=t[0],r=t[t.length-1],i=document.activeElement;e.shiftKey&&(i===n||!this._ui.root.contains(i))?(e.preventDefault(),r.focus()):e.shiftKey||i!==r&&this._ui.root.contains(i)||(e.preventDefault(),n.focus())}_onWheel(e){e.preventDefault(),this._setZoom(this._zoom*(e.deltaY<0?1.15:1/1.15))}_onPointerDown(e){if(!e.target.closest(`.wui-lightbox-nav`)){if(this._ui.stage.setPointerCapture?.(e.pointerId),this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),this._pointers.size===2){let[e,t]=[...this._pointers.values()];this._gesture={kind:`pinch`,distance:Math.hypot(e.x-t.x,e.y-t.y)||1,zoom:this._zoom}}else this._pointers.size===1&&(this._gesture={kind:`drag`,startX:e.clientX,startY:e.clientY,startTime:e.timeStamp,pan:{...this._pan},onImage:e.target===this._ui.image,moved:!1})}}_onPointerMove(e){let t=this._gesture;if(t&&this._pointers.has(e.pointerId)){if(this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),t.kind===`pinch`&&this._pointers.size===2){let[e,n]=[...this._pointers.values()];this._setZoom(t.zoom*Math.hypot(e.x-n.x,e.y-n.y)/t.distance)}else if(t.kind===`drag`){let n=e.clientX-t.startX,r=e.clientY-t.startY;Math.hypot(n,r)>f&&(t.moved=!0),this._zoom>s&&(this._pan=this._clampedPan({x:t.pan.x+n,y:t.pan.y+r}),this._ui.stage.classList.add(`is-dragging`),this._applyTransform())}}}_onPointerEnd(e,t){let n=this._gesture;if(this._pointers.delete(e.pointerId),this._ui?.stage.classList.remove(`is-dragging`),!n)return;if(n.kind===`pinch`){this._pointers.size<2&&(this._gesture=null);return}if(this._gesture=null,!t)return;let r=e.clientX-n.startX,i=e.clientY-n.startY;n.moved?this._zoom===s&&this.step(_(r,i)):e.timeStamp-n.startTime>p||(n.onImage?e.timeStamp-this._lastTap<m?(this._lastTap=-1/0,this._setZoom(this._zoom>s?s:u)):this._lastTap=e.timeStamp:this.close())}};(0,t.defineElement)(`wui-lightbox`,x),e.WuiLightbox=x})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.formatters,WeborityUiElementsInternal.modules.iconGlyphs);
|
|
1
|
+
(function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=globalThis.WeborityUiElementsInternal?.version;if(a!==`0.152.0`)throw Error(`[webority-ui] lightbox expects ui-elements 0.152.0 but the page loaded `+a+`.`);var o=`a.wui-lightbox-item`,s=1,c=4,l=.5,u=2,d=50,f=6,p=300,m=300;function h(e){return Number.isFinite(e)?Math.min(c,Math.max(s,e)):s}function g(e,t,n,r){let i=(e,n)=>Math.max(0,(e*t-n)/2),a=i(r.width,n.width),o=i(r.height,n.height);return{x:Math.min(a,Math.max(-a,e.x)),y:Math.min(o,Math.max(-o,e.y))}}function _(e,t){return Math.abs(e)<d||Math.abs(e)<Math.abs(t)*1.5?0:e<0?1:-1}function v(e){let t=(String(e??``).split(/[?#]/)[0]??``).split(`/`).filter(Boolean).pop()??``;try{return decodeURIComponent(t)}catch{return t}}function y(e,t,n={}){let r=document.createElement(e);r.className=t;for(let[e,t]of Object.entries(n))r.setAttribute(e,t);return r}function b(e,t,n){let r=y(`button`,`u-action wui-lightbox-btn ${n}`,{type:`button`,"aria-label":t,title:t});return r.style.setProperty(`--wui-action-size`,`40px`),r.innerHTML=(0,i.glyphSvg)(e,{size:20}),r}var x=class extends n.ElementBase{_ui;_index;_zoom;_pan;_pointers;_gesture;_lastTap;_returnTo;_lockedOverflow;_onClick;static get observedAttributes(){return[`open-index`]}constructor(){super(),this._ui=null,this._index=0,this._zoom=s,this._pan={x:0,y:0},this._pointers=new Map,this._gesture=null,this._lastTap=-1/0,this._returnTo=null,this._lockedOverflow=null,this._onClick=e=>{if(e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let t=e.target,n=t instanceof Element?t.closest(o):null;if(!(n instanceof HTMLAnchorElement)||!this.contains(n))return;let r=this._links().indexOf(n);r<0||(e.preventDefault(),this.open(r))}}get _view(){if(!this._ui)throw Error(`<wui-lightbox> viewer is not open.`);return this._ui}get download(){return this.hasAttribute(`download`)}set download(e){this.toggleAttribute(`download`,e===!0||e===``||e===`true`)}get label(){return this.getAttribute(`label`)||`Image viewer`}set label(e){this.setAttribute(`label`,String(e??``))}get layout(){return this.getAttribute(`layout`)===`single`?`single`:`gallery`}set layout(e){if(e===`single`)this.setAttribute(`layout`,`single`);else if(e===`gallery`||e===``)this.removeAttribute(`layout`);else throw Error(`<wui-lightbox> layout must be "gallery" or "single", received "${e}".`)}get isOpen(){return this._ui!==null}connectedCallback(){this.addEventListener(`click`,this._onClick),this._syncOpenIndex()}disconnectedCallback(){this.removeEventListener(`click`,this._onClick),this._teardown()}attributeChangedCallback(){this.isConnected&&this._syncOpenIndex()}_syncOpenIndex(){let e=this.getAttribute(`open-index`);e===null?this.close():this.open(Number(e))}_links(){return[...this.querySelectorAll(o)].filter(e=>e instanceof HTMLAnchorElement)}_items(){return this._links().map(e=>{let t=e.getAttribute(`href`)??``;return{link:e,src:t,alt:e.querySelector(`img`)?.getAttribute(`alt`)??``,caption:e.dataset.caption??``,name:e.dataset.name||v(t)}})}open(e=0){let t=this._items();if(!t.length)return!1;if(!this._ui){let t=document.activeElement;this._returnTo=t instanceof HTMLElement||t instanceof SVGElement?t:null,this._build(),this.dispatchEvent(new CustomEvent(`wui-lightbox:open`,{bubbles:!0,detail:{index:e}}))}return this._show(e,t),this._view.close.focus(),!0}close(){if(!this._ui)return;let e=this._index,t=this._links()[e]??this._returnTo;this._teardown(),t?.isConnected&&t.focus(),this._returnTo=null,this.dispatchEvent(new CustomEvent(`wui-lightbox:close`,{bubbles:!0,detail:{index:e}}))}_teardown(){this._ui&&(this._ui.root.remove(),this._ui=null,this._pointers.clear(),this._gesture=null,this._lockedOverflow!==null&&(document.documentElement.style.overflow=this._lockedOverflow,this._lockedOverflow=null))}_build(){let e=y(`div`,`wui-lightbox-overlay`,{role:`dialog`,"aria-modal":`true`,"aria-label":this.label,tabindex:`-1`}),t=y(`div`,`wui-lightbox-bar`),n=y(`span`,`wui-lightbox-count`,{"aria-live":`polite`}),r=y(`div`,`wui-lightbox-tools`),a=b(`zoom-out`,`Zoom out`,`wui-lightbox-zoom-out`),o=b(`zoom-in`,`Zoom in`,`wui-lightbox-zoom-in`),s=y(`a`,`u-action wui-lightbox-btn wui-lightbox-download`,{"aria-label":`Download`,title:`Download`});s.style.setProperty(`--wui-action-size`,`40px`),s.innerHTML=(0,i.glyphSvg)(`download`,{size:20}),s.hidden=!this.download;let c=b(`x`,`Close`,`wui-lightbox-close`);r.append(a,o,s,c),t.append(n,r);let u=y(`div`,`wui-lightbox-stage`),d=b(`chevron-left`,`Previous image`,`wui-lightbox-nav wui-lightbox-prev`),f=b(`chevron-right`,`Next image`,`wui-lightbox-nav wui-lightbox-next`),p=y(`img`,`wui-lightbox-image`,{decoding:`async`,draggable:`false`,alt:``}),m=y(`p`,`wui-lightbox-status`,{role:`status`});u.append(p,m,d,f);let h=y(`p`,`wui-lightbox-caption`);e.append(t,u,h);let g={root:e,count:n,zoomOut:a,zoomIn:o,download:s,close:c,stage:u,prev:d,next:f,image:p,status:m,caption:h};this._ui=g,c.addEventListener(`click`,()=>this.close()),d.addEventListener(`click`,()=>this.step(-1)),f.addEventListener(`click`,()=>this.step(1)),a.addEventListener(`click`,()=>this._setZoom(this._zoom-l)),o.addEventListener(`click`,()=>this._setZoom(this._zoom+l)),e.addEventListener(`keydown`,e=>this._onKeyDown(e)),u.addEventListener(`pointerdown`,e=>this._onPointerDown(e)),u.addEventListener(`pointermove`,e=>this._onPointerMove(e)),u.addEventListener(`pointerup`,e=>this._onPointerEnd(e,!0)),u.addEventListener(`pointercancel`,e=>this._onPointerEnd(e,!1)),u.addEventListener(`wheel`,e=>this._onWheel(e),{passive:!1}),p.addEventListener(`load`,()=>{this._ui===g&&(m.textContent=``,u.removeAttribute(`aria-busy`),p.hidden=!1,this._applyTransform())}),p.addEventListener(`error`,()=>{this._ui===g&&(u.removeAttribute(`aria-busy`),p.hidden=!0,m.textContent=`This image can't be shown.`)}),this.append(e),this._lockedOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow=`hidden`}step(e){if(!this._ui||!e)return;let t=this._items();t.length<2||this._show((this._index+e+t.length)%t.length,t)}_show(e,t){let n=this._view,i=Math.min(t.length-1,Math.max(0,Math.trunc(Number(e))||0)),a=t[i];if(!a)throw Error(`<wui-lightbox> image missing.`);let o=i!==this._index||!n.image.getAttribute(`src`);if(this._index=i,this._zoom=s,this._pan={x:0,y:0},n.count.textContent=`${(0,r.formatNumber)(i+1,{decimals:0})} of ${(0,r.formatNumber)(t.length,{decimals:0})}`,n.caption.textContent=a.caption,n.caption.hidden=!a.caption,n.download.href=a.src,n.download.setAttribute(`download`,a.name),n.prev.hidden=n.next.hidden=t.length<2,n.stage.setAttribute(`aria-busy`,`true`),n.status.textContent=``,n.image.hidden=!1,n.image.alt=a.alt||a.caption,n.image.src=a.src,this._applyTransform(),this._syncZoomButtons(),t.length>1){let e=t[(i+1)%t.length],n=t[(i-1+t.length)%t.length];if(!e||!n)throw Error(`<wui-lightbox> neighbour image missing.`);for(let t of[e,n])new Image().src=t.src}o&&this.dispatchEvent(new CustomEvent(`wui-lightbox:change`,{bubbles:!0,detail:{index:i}}))}_syncZoomButtons(){let e=this._view;e.zoomOut.disabled=this._zoom<=s,e.zoomIn.disabled=this._zoom>=c;let t=document.activeElement;(t===e.zoomOut||t===e.zoomIn)&&t instanceof HTMLButtonElement&&t.disabled&&e.close.focus()}_setZoom(e){this._ui&&(this._zoom=h(e),this._pan=this._clampedPan(this._pan),this._applyTransform(),this._syncZoomButtons())}_clampedPan(e){let{stage:t,image:n}=this._view;return g(e,this._zoom,{width:t.clientWidth,height:t.clientHeight},{width:n.offsetWidth,height:n.offsetHeight})}_applyTransform(){let{image:e,stage:t}=this._view;e.style.transform=`translate(${this._pan.x}px, ${this._pan.y}px) scale(${this._zoom})`,t.classList.toggle(`wui-lightbox-zoomed`,this._zoom>s)}_onKeyDown(e){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this.close();else if(e.key===`Tab`)this._trapTab(e);else if(e.key===`ArrowLeft`||e.key===`ArrowRight`)e.preventDefault(),this.step(e.key===`ArrowRight`?1:-1);else if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=this._items();this._show(e.key===`Home`?0:t.length-1,t)}else e.key===`+`||e.key===`=`?(e.preventDefault(),this._setZoom(this._zoom+l)):e.key===`-`?(e.preventDefault(),this._setZoom(this._zoom-l)):e.key===`0`&&(e.preventDefault(),this._setZoom(s))}_trapTab(e){let t=this._view.root,n=[...t.querySelectorAll(`button, a[href]`)].filter(e=>e instanceof HTMLElement&&!e.hidden&&!(e instanceof HTMLButtonElement&&e.disabled));if(!n.length){e.preventDefault();return}let r=n[0],i=n[n.length-1];if(!r||!i)throw Error(`<wui-lightbox> focus stops missing.`);let a=document.activeElement;e.shiftKey&&(a===r||!t.contains(a))?(e.preventDefault(),i.focus()):e.shiftKey||a!==i&&t.contains(a)||(e.preventDefault(),r.focus())}_onWheel(e){e.preventDefault(),this._setZoom(this._zoom*(e.deltaY<0?1.15:1/1.15))}_onPointerDown(e){let t=e.target;if(t instanceof Element&&t.closest(`.wui-lightbox-nav`))return;let n=this._view;if(n.stage.setPointerCapture?.(e.pointerId),this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),this._pointers.size===2){let e=[...this._pointers.values()],t=e[0],n=e[1];if(!t||!n)throw Error(`<wui-lightbox> pinch needs two pointers.`);this._gesture={kind:`pinch`,distance:Math.hypot(t.x-n.x,t.y-n.y)||1,zoom:this._zoom}}else this._pointers.size===1&&(this._gesture={kind:`drag`,startX:e.clientX,startY:e.clientY,startTime:e.timeStamp,pan:{...this._pan},onImage:e.target===n.image,moved:!1})}_onPointerMove(e){let t=this._gesture;if(t&&this._pointers.has(e.pointerId)){if(this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),t.kind===`pinch`&&this._pointers.size===2){let e=[...this._pointers.values()],n=e[0],r=e[1];if(!n||!r)throw Error(`<wui-lightbox> pinch needs two pointers.`);this._setZoom(t.zoom*Math.hypot(n.x-r.x,n.y-r.y)/t.distance)}else if(t.kind===`drag`){let n=e.clientX-t.startX,r=e.clientY-t.startY;Math.hypot(n,r)>f&&(t.moved=!0),this._zoom>s&&(this._pan=this._clampedPan({x:t.pan.x+n,y:t.pan.y+r}),this._view.stage.classList.add(`is-dragging`),this._applyTransform())}}}_onPointerEnd(e,t){let n=this._gesture;if(this._pointers.delete(e.pointerId),this._ui?.stage.classList.remove(`is-dragging`),!n)return;if(n.kind===`pinch`){this._pointers.size<2&&(this._gesture=null);return}if(this._gesture=null,!t)return;let r=e.clientX-n.startX,i=e.clientY-n.startY;n.moved?this._zoom===s&&this.step(_(r,i)):e.timeStamp-n.startTime>p||(n.onImage?e.timeStamp-this._lastTap<m?(this._lastTap=-1/0,this._setZoom(this._zoom>s?s:u)):this._lastTap=e.timeStamp:this.close())}};(0,t.defineElement)(`wui-lightbox`,x),e.WuiLightbox=x})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.formatters,WeborityUiElementsInternal.modules.iconGlyphs);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var r=globalThis.WeborityUiElementsInternal?.version;if(r!==`0.
|
|
1
|
+
(function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var r=globalThis.WeborityUiElementsInternal?.version;if(r!==`0.152.0`)throw Error(`[webority-ui] markdown expects ui-elements 0.152.0 but the page loaded `+r+`.`);var i=/\[([^[\]\n]+)\](?!\()/g,a=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`),o=/\[([^\]\n]+)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,s=/!\[([^\]\n]*)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,c=new RegExp(i.source,`y`),l=e=>/[\p{L}\p{N}]/u.test(e);function u(e,t){let n=0;for(let r=t-1;r>=0&&e.charAt(r)===`\\`;--r)n+=1;return n%2==1}function d(e,t,n){let r=n.length===1;for(let i=e.indexOf(n,t);i!==-1;i=e.indexOf(n,i+1)){let a=i>t&&!/\s/.test(e.charAt(t))&&!/\s/.test(e.charAt(i-1)),o=r&&(e.charAt(i+1)===n||e.charAt(i-1)===n),s=n===`_`&&l(e.charAt(i+n.length));if(a&&!o&&!s&&!u(e,i))return i}return-1}function f(e,t){let n=t?.isCitation,r=[],i=``,u=()=>{i&&=(r.push({type:`text`,text:i}),``)},p=0;for(;p<e.length;){let m=e.charAt(p),h=e.charAt(p+1);if(m===`\\`&&a.has(h)){i+=h,p+=2;continue}if(m==="`"){let t=e.indexOf("`",p+1);if(t>p+1){u(),r.push({type:`code`,text:e.slice(p+1,t)}),p=t+1;continue}}let g=m+h;if(g===`**`||g===`__`||g===`~~`){let n=d(e,p+2,g);if(n!==-1&&!(g===`__`&&l(e.charAt(p-1)))){u();let i=f(e.slice(p+2,n),t);g===`~~`?r.push({type:`strike`,children:i}):r.push({type:`strong`,children:i}),p=n+2;continue}i+=g,p+=2}else{if(m===`*`||m===`_`){let n=d(e,p+1,m);if(n!==-1&&!(m===`_`&&l(e.charAt(p-1)))){u(),r.push({type:`em`,children:f(e.slice(p+1,n),t)}),p=n+1;continue}}if(m===`[`){o.lastIndex=p;let t=o.exec(e);if(t){let e=t[1],n=t[2];if(e===void 0||n===void 0)throw Error(`The link pattern always captures its label and href`);u(),r.push({type:`link`,href:n,children:f(e)}),p+=t[0].length;continue}if(n){c.lastIndex=p;let t=c.exec(e);if(t){let e=t[1];if(e===void 0)throw Error(`The citation pattern always captures its inner text`);if(n(e)){u(),r.push({type:`citation`,text:e}),p+=t[0].length;continue}}}}if(m===`!`){s.lastIndex=p;let t=s.exec(e);if(t){let e=t[1];if(e===void 0)throw Error(`The image pattern always captures its alt text`);u(),r.push({type:`image`,children:f(e)}),p+=t[0].length;continue}}i+=m,p+=1}}return u(),r.map((e,t)=>({...e,key:t}))}var p=/^[a-z][a-z0-9+.-]*:[a-z0-9_-]+\/[a-z0-9_.~-]+$/i,m=/^https?:/i,h=/^(mailto|tel):/i,g=/^(?:\/(?![/\\])|#|\?|\.{1,2}\/)/,_=/^https:\/\/[^/?#@\\\s]+$/i,v=/^[a-z][a-z0-9+.-]*:/i;function y(e){if(typeof e!=`string`)return null;let t=e.endsWith(`/`)?e.slice(0,-1):e;return _.test(t)?t:null}function ee(e,t,n,r,i){if(n&&(t===`page`||p.test(e))){let t=n(e);if(t!=null)return{kind:`app`,target:t}}if(t===`app`)return null;let a=i==null?null:y(i),o=a===null?e:te(e,a);return o===null?null:g.test(o)?{kind:`page`,href:o}:t===`page`&&!(m.test(o)&&r&&x(o,r))?null:m.test(o)?{kind:r&&x(o,r)?`page`:`web`,href:o}:h.test(o)?{kind:`contact`,href:o}:null}function te(e,t){if(v.test(e))return e;if(e.startsWith(`//`))return`https:${e}`;if(e===``)return null;let n=e.indexOf(`#`),r=n<0?``:e.slice(n),i=n<0?e:e.slice(0,n),a=i.indexOf(`?`),o=a<0?i:i.slice(0,a),s=a<0?``:i.slice(a);return o===``?`${t}${s}${r}`:`${t}${b(o.startsWith(`/`)?o:`/${o}`)}${s}${r}`}function b(e){let t=e.split(`/`),n=[];return t.forEach((e,r)=>{let i=r===t.length-1;e===`.`?i&&n.push(``):e===`..`?(n.length>1&&n.pop(),i&&n.push(``)):n.push(e)}),n.join(`/`)}function x(e,t){if(e.slice(0,t.length).toLowerCase()!==t.toLowerCase())return!1;let n=e[t.length];return n===void 0||n===`/`||n===`?`||n===`#`}function S(e){return typeof e!=`string`||!e.startsWith(`/`)||e[1]===`/`||e[1]===`\\`?null:e}var C=/^\s*```/,w=/^\s*```\s*(\S*)/,T=/^\s{0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,E=/^\s*([-*_])(\s*\1){2,}\s*$/,D=/^(\s*)[-*+]\s+(.*)$/,O=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,k=/^\s*>\s?(.*)$/,ne=/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)*\|?\s*$/,A=[1,2,3,4,5,6],j=e=>e.includes(`|`);function M(e){let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function N(e,t){let n=e[t];if(n===void 0)throw Error(`startsTable was called past the last source line`);let r=e[t+1];return r!==void 0&&j(n)&&r.includes(`|`)&&ne.test(r)}function P(e,t){let n=e[t];if(n===void 0)throw Error(`startsBlock was called past the last source line`);return C.test(n)||k.test(n)||D.test(n)||O.test(n)||T.test(n)||E.test(n)||N(e,t)}function F(e){let t=e.replace(/\t/g,` `).length;return Math.min(Math.floor(t/2),4)}function I(e){let t=O.exec(e);if(t){let e=t[1],n=t[2],r=t[3];if(e===void 0||n===void 0||r===void 0)throw Error(`The ordered list pattern always captures its indent, number and text`);return{text:r,depth:F(e),ordered:!0,number:Number(n)}}let n=D.exec(e);if(n){let e=n[1],t=n[2];if(e===void 0||t===void 0)throw Error(`The bullet list pattern always captures its indent and text`);return{text:t,depth:F(e),ordered:!1,number:0}}return null}function L(e){let t=(e??``).replace(/\r\n?/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),n=[],r=0;for(;r<t.length;){let e=t[r];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()){r+=1;continue}if(C.test(e)){let i=w.exec(e)?.[1]||null,a=[];for(r+=1;r<t.length;){let e=t[r];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(C.test(e))break;a.push(e),r+=1}r+=1,n.push({type:`code`,text:a.join(`
|
|
4
|
-
`),language:i});continue}if(N(t,r)){let i=M(e),a=[];for(r+=2;r<t.length;){let e=t[r];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()||!j(e))break;a.push(M(e)),r+=1}n.push({type:`table`,header:i,rows:a});continue}if(E.test(e)){n.push({type:`rule`}),r+=1;continue}let i=T.exec(e);if(i){let e=i[1],t=i[2];if(e===void 0||t===void 0)throw Error(`The heading pattern always captures its hashes and text`);n.push({type:`heading`,level:
|
|
4
|
+
`),language:i});continue}if(N(t,r)){let i=M(e),a=[];for(r+=2;r<t.length;){let e=t[r];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()||!j(e))break;a.push(M(e)),r+=1}n.push({type:`table`,header:i,rows:a});continue}if(E.test(e)){n.push({type:`rule`}),r+=1;continue}let i=T.exec(e);if(i){let e=i[1],t=i[2];if(e===void 0||t===void 0)throw Error(`The heading pattern always captures its hashes and text`);let a=A[e.length-1];if(a===void 0)throw Error(`The heading pattern always captures one to six hashes`);n.push({type:`heading`,level:a,text:t}),r+=1;continue}if(k.test(e)){let e=[];for(;r<t.length;){let n=t[r];if(n===void 0)throw Error(`parseMarkdown read past the last source line`);let i=k.exec(n);if(!i)break;let a=i[1];if(a===void 0)throw Error(`The quote pattern always captures its text`);e.push(a),r+=1}n.push({type:`quote`,lines:e});continue}let a=I(e);if(a){let e=[];for(;r<t.length;){let n=t[r];if(n===void 0)throw Error(`parseMarkdown read past the last source line`);if(!n.trim())break;let i=I(n);if(i){if(i.depth===0&&i.ordered!==a.ordered)break;e.push(i)}else if(P(t,r))break;else{let t=e[e.length-1];if(t===void 0)throw Error(`A list continuation line follows a list with no item`);t.text+=` ${n.trim()}`}r+=1}n.push({type:`list`,ordered:a.ordered,start:a.ordered?a.number:1,items:e});continue}let o=[e];for(r+=1;r<t.length;){let e=t[r];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()||P(t,r))break;o.push(e),r+=1}n.push({type:`paragraph`,lines:o})}return n.map((e,t)=>({...e,key:t}))}var R=[`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`css`],z=[`app`,`web`,`page`],B=e=>e!==void 0&&z.includes(e);function V(e,t,n,r,i=null){let a=H(e.ownerDocument,n,r).map((e,n)=>{let r=t[n],i=r?.sig===e.sig?r.nodes:null;return{sig:e.sig,nodes:i??e.build()}}),o=new Set(a.flatMap(e=>e.nodes));for(let e of t)for(let t of e.nodes)o.has(t)||t.parentNode?.removeChild(t);let s=i;for(let t of a.flatMap(e=>e.nodes))(t.parentNode!==e||t.previousSibling!==s)&&e.insertBefore(t,s?s.nextSibling:e.firstChild),s=t;return a}function H(e,t,n){let r={doc:e,links:B(n.links)?n.links:`web`,headings:n.headings===`text`?`text`:`outline`,resolveLink:n.resolveLink,isCitation:n.isCitation,figureText:typeof n.figureText==`function`?n.figureText:void 0,base:typeof n.base==`string`?n.base:void 0},i=n.resolverGeneration??0;return L(t).map(e=>({sig:`${JSON.stringify(e)}|${r.links}|${r.headings}|${r.base??``}|${i}`,build:()=>G(r,e)}))}var U=class extends n.ElementBase{_drawn;_blocks;_observer;_connected;_resolveLink;_isCitation;_resolverGeneration;_figureText;static get observedAttributes(){return[`links`,`headings`,`base`]}constructor(){super(),this._drawn=[],this._blocks=[],this._observer=null,this._connected=!1,this._resolveLink=void 0,this._isCitation=void 0,this._resolverGeneration=0,this._figureText=void 0}connectedCallback(){this._connected=!0,this._render(),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(e=>{e.some(e=>!this._drawn.some(t=>t.contains(e.target)))&&this._render()}),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0}))}disconnectedCallback(){this._connected=!1,this._observer?.disconnect(),this._observer=null}get resolveLink(){return this._resolveLink}set resolveLink(e){this._resolveLink=typeof e==`function`?e:void 0,this._resolverGeneration+=1,this._connected&&this._render()}get base(){return this.getAttribute(`base`)??void 0}set base(e){e==null?this.removeAttribute(`base`):this.setAttribute(`base`,String(e))}get isCitation(){return this._isCitation}set isCitation(e){this._isCitation=typeof e==`function`?e:void 0,this._resolverGeneration+=1,this._connected&&this._render()}get figureText(){return this._figureText}set figureText(e){this._figureText=typeof e==`function`?e:void 0,this._resolverGeneration+=1,this._connected&&this._render()}attributeChangedCallback(e,t,n){t!==n&&this._connected&&this._render()}_source(){return Array.from(this.children).find(e=>e instanceof HTMLPreElement&&e.classList.contains(`wui-markdown-source`))}_render(){let e=this._source();e&&(this._blocks=V(this,this._blocks,e.textContent??``,{links:this.getAttribute(`links`)??void 0,headings:this.getAttribute(`headings`)??void 0,base:this.getAttribute(`base`)??void 0,resolveLink:this._resolveLink,isCitation:this._isCitation,figureText:this._figureText,resolverGeneration:this._resolverGeneration},e),this._drawn=this._blocks.flatMap(e=>e.nodes),e.hidden=!0,this._observer?.takeRecords())}};function W(e,t,n=[]){let r=e.createElement(t);return r.append(...n),r}function G(e,t){switch(t.type){case`paragraph`:return[W(e.doc,`p`,K(e,t.lines))];case`heading`:return[q(e,t)];case`list`:return J(e,t.items);case`table`:return[X(e,t)];case`code`:return[re(e.doc,t)];case`quote`:return[W(e.doc,`blockquote`,K(e,t.lines))];case`rule`:return[e.doc.createElement(`hr`)];default:return[]}}function K(e,t){let n=[];return t.forEach((t,r)=>{r>0&&n.push(e.doc.createElement(`br`)),n.push(...Z(e,t))}),n}function q(e,t){let n=Z(e,t.text);if(e.headings===`text`){let t=W(e.doc,`p`,n);return t.className=`fw-semibold`,t}return W(e.doc,`h2`,n)}function J(e,t){let n=[];for(let r=0;r<t.length;){let i=Y(e,t,r);n.push(i.list),r=i.next}return n}function Y(e,t,n){let r=t[n];if(!r)throw Error(`List run starts past its items.`);let{depth:i,ordered:a,number:o}=r,s=e.doc.createElement(a?`ol`:`ul`);a&&o!==1&&s.setAttribute(`start`,String(o));let c=null,l=n,u=t[l];for(;u&&u.depth>=i;){if(u.depth===i)c=W(e.doc,`li`,Z(e,u.text)),s.append(c),l+=1;else{let n=Y(e,t,l);if(!c)throw Error(`Nested list has no item before it.`);c.append(n.list),l=n.next}u=t[l]}return{list:s,next:l}}function X(e,t){let n=t.header.map(t=>{let n=W(e.doc,`th`,Z(e,t));return n.setAttribute(`scope`,`col`),n}),r=t.rows.map(n=>W(e.doc,`tr`,t.header.map((t,r)=>W(e.doc,`td`,Z(e,n[r]??``))))),i=W(e.doc,`table`,[W(e.doc,`thead`,[W(e.doc,`tr`,n)]),W(e.doc,`tbody`,r)]);i.className=`table`;let a=W(e.doc,`div`,[i]);return a.className=`table-responsive`,a}function re(e,t){let n=W(e,`pre`,[W(e,`code`,[e.createTextNode(t.text)])]);n.className=`wui-code-source`;let r=W(e,`wui-code-block`,[n]);return r.className=`wui-code-block`,r.setAttribute(`language`,t.language!==null&&R.includes(t.language)?t.language:`text`),r}function Z(e,t){return Q(e,f(t,{isCitation:e.isCitation}))}function Q(e,t){return t.flatMap(t=>ie(e,t))}function ie(e,t){let{doc:n}=e;switch(t.type){case`code`:return[W(n,`code`,[n.createTextNode(t.text)])];case`strong`:return[W(n,`strong`,Q(e,t.children))];case`em`:return[W(n,`em`,Q(e,t.children))];case`strike`:return[W(n,`del`,Q(e,t.children))];case`image`:return[n.createTextNode(`[`),...Q(e,t.children),n.createTextNode(`]`)];case`link`:return ae(e,t);case`citation`:return[se(n,t.text)];case`text`:return e.figureText?oe(e,e.figureText,t.text):[n.createTextNode(t.text)];default:throw Error(`wui-markdown: unknown inline token ${JSON.stringify(t)}`)}}function ae(e,t){let n=Q(e,t.children),r=ee(t.href,e.links,e.resolveLink,globalThis.location?.origin,e.base);if(!r)return n;if(r.kind===`app`){let t=S(r.target);return t?[$(e.doc,t,n,!1)]:n}return[$(e.doc,r.href,n,r.kind===`web`)]}function oe(e,t,n){return t(n).map(t=>t.kind===`sub`||t.kind===`sup`?W(e.doc,t.kind,[e.doc.createTextNode(t.text)]):e.doc.createTextNode(t.text))}function se(e,t){let n=e.createElement(`span`);n.className=`chip primary chip-outline chip-sm chip-clickable wui-markdown-citation`,n.setAttribute(`data-wui`,`AppChip`);let r=e.createElement(`button`);r.type=`button`,r.className=`chip-body`,r.setAttribute(`aria-label`,t),r.addEventListener(`click`,()=>{r.dispatchEvent(new CustomEvent(`wui-markdown-citation`,{bubbles:!0,detail:{citation:t}}))});let i=e.createElement(`span`);return i.className=`chip-label`,i.textContent=t,r.append(i),n.append(r),n}function $(e,t,n,r){let i=W(e,`span`,n);i.className=`wui-link__label`;let a=W(e,`a`,[i]);return a.className=`wui-link wui-link--static`,a.setAttribute(`data-wui`,`AppLink`),a.setAttribute(`href`,t),r&&(a.setAttribute(`target`,`_blank`),a.setAttribute(`rel`,`noopener noreferrer`)),a}(0,t.defineElement)(`wui-markdown`,U),e.WuiMarkdown=U})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.elementBase);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=globalThis.WeborityUiElementsInternal?.version;if(i!==`0.
|
|
1
|
+
(function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=globalThis.WeborityUiElementsInternal?.version;if(i!==`0.152.0`)throw Error(`[webority-ui] org-tree expects ui-elements 0.152.0 but the page loaded `+i+`.`);var a=`li[data-wui-org-node]`,o=`:scope > .wui-org-tree-node`,s=`:scope > .wui-org-tree-node > .wui-org-tree-text > .wui-org-tree-name`,c=`:scope > .wui-org-tree-children`,l=`:scope > .wui-org-tree-node > [data-wui-org-toggle]`,u=`[data-wui-org-toggle]`,d=`a, button, input, select, textarea`,f=`.wui-org-tree-overlay`,p=`[data-wui-org-search]`,m=`[data-wui-org-canvas]`,h=`[data-wui-org-live]`,g=`--wui-org-tree-print-scale`,_=718,v=1e3,y=150,b=`Show {name}'s team`,x=`Hide {name}'s team`,S=`{count} found`,C=`No one found`,w=e=>[...e.querySelectorAll(a)].filter(e=>e instanceof HTMLElement),T=e=>e.querySelector(s)?.textContent?.trim()??``,E=e=>e.getAttribute(`data-wui-org-node`),D=e=>e.getAttribute(`aria-expanded`)===`true`,O=class extends r.ElementBase{static get observedAttributes(){return[`selected`,`selectable`,`expand-label`,`collapse-label`,`search-results-text`,`search-empty-text`]}constructor(){super(),this._query=``,this._snapshot=null,this._observer=null,this._announceTimer=void 0,this._onKeyDown=e=>this._handleKeyDown(e),this._onClick=e=>this._handleClick(e),this._onFocusIn=e=>this._handleFocusIn(e),this._onInput=e=>this._handleInput(e),this._onBeforePrint=()=>this._scaleForPrint(),this._onAfterPrint=()=>this.style.removeProperty(g)}connectedCallback(){this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`click`,this._onClick),this.addEventListener(`focusin`,this._onFocusIn),this.addEventListener(`input`,this._onInput),window.addEventListener(`beforeprint`,this._onBeforePrint),window.addEventListener(`afterprint`,this._onAfterPrint);let e=this.querySelector(m);e?(this._observer=new MutationObserver(()=>{this._query&&this._applySearch(this._query)}),this._observer.observe(e,{childList:!0,subtree:!0})):(0,n.devError)(`[@webority/ui-elements] <wui-org-tree> has no [data-wui-org-canvas]; render the tree markup inside it.`)}disconnectedCallback(){this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`focusin`,this._onFocusIn),this.removeEventListener(`input`,this._onInput),window.removeEventListener(`beforeprint`,this._onBeforePrint),window.removeEventListener(`afterprint`,this._onAfterPrint),this._observer?.disconnect(),this._observer=null,clearTimeout(this._announceTimer)}attributeChangedCallback(e){e===`selected`||e===`selectable`?this._applySelected():(e===`expand-label`||e===`collapse-label`)&&this._syncToggles()}get selected(){return this.getAttribute(`selected`)}set selected(e){e==null?this.removeAttribute(`selected`):this.setAttribute(`selected`,String(e))}get selectable(){return this.hasAttribute(`selectable`)}set selectable(e){this.toggleAttribute(`selectable`,!!e)}_items(){return w(this)}_hasChildren(e){return!!e.querySelector(c)}_isVisible(e){for(let t=e;t&&t!==this;t=t.parentElement)if(t.hasAttribute(`hidden`))return!1;return!0}_visibleItems(){return this._items().filter(e=>this._isVisible(e))}_parentItem(e){let t=e.parentElement?.closest(a);return t instanceof HTMLElement&&this.contains(t)?t:null}_visibleChildren(e){let t=e.querySelector(c);return t?[...t.children].filter(e=>e.matches(a)&&this._isVisible(e)):[]}_isVisibleItem(e){return e instanceof HTMLElement&&e.matches(a)&&this._isVisible(e)}_siblingItem(e,t){let n=e[t];for(;n&&!this._isVisibleItem(n);)n=n[t];return this._isVisibleItem(n)?n:null}_setRoving(e){for(let t of this._items())t.setAttribute(`tabindex`,t===e?`0`:`-1`)}_focusItem(e){e&&(this._setRoving(e),e.focus())}_toggleLabel(e,t){return(t?this.getAttribute(`collapse-label`)??x:this.getAttribute(`expand-label`)??b).split(`{name}`).join(T(e))}_setExpanded(e,t){let n=e.querySelector(c);n instanceof HTMLElement&&(e.setAttribute(`aria-expanded`,String(t)),n.hidden=!t,e.querySelector(l)?.setAttribute(`aria-label`,this._toggleLabel(e,t)),!t&&n.contains(document.activeElement)&&this._focusItem(e))}_toggle(e){this._setExpanded(e,!D(e))}_syncToggles(){for(let e of this._items())this._hasChildren(e)&&this._setExpanded(e,D(e))}_applySelected(){for(let e of this._items())this.selectable?e.setAttribute(`aria-selected`,String(E(e)===this.selected)):e.removeAttribute(`aria-selected`)}_select(e){this.selectable&&(this.selected=E(e),this.dispatchEvent(new CustomEvent(`wui-org-tree:select`,{detail:{id:this.selected},bubbles:!0,composed:!0})))}_activate(e){this.selectable?this._select(e):this._hasChildren(e)&&this._toggle(e)}_handleFocusIn(e){let t=e.target;if(!(t instanceof Element))return;let n=t.closest(a);n instanceof HTMLElement&&this.contains(n)&&this._setRoving(n)}_handleClick(e){let t=e.target;if(!(t instanceof Element))return;let n=t.closest(a);n instanceof HTMLElement&&this.contains(n)&&(this._setRoving(n),t.closest(u)?this._hasChildren(n)&&this._toggle(n):n.querySelector(o)?.contains(t)&&(t.closest(d)?.closest(f)||this._select(n)))}_handleKeyDown(e){if(e.ctrlKey||e.metaKey||e.altKey)return;let t=e.target;if(t instanceof HTMLElement&&t.matches(a)&&this.contains(t))switch(e.key){case`ArrowDown`:if(e.preventDefault(),!this._hasChildren(t))return;D(t)||this._setExpanded(t,!0),this._focusItem(this._visibleChildren(t)[0]);return;case`ArrowUp`:e.preventDefault(),this._focusItem(this._parentItem(t));return;case`ArrowRight`:e.preventDefault(),this._focusItem(this._siblingItem(t,`nextElementSibling`));return;case`ArrowLeft`:e.preventDefault(),this._focusItem(this._siblingItem(t,`previousElementSibling`));return;case`Home`:e.preventDefault(),this._focusItem(this._visibleItems()[0]);return;case`End`:e.preventDefault(),this._focusItem(this._visibleItems().at(-1));return;case`+`:case`=`:if(!this._hasChildren(t))return;e.preventDefault(),this._setExpanded(t,!0);return;case`-`:if(!this._hasChildren(t))return;e.preventDefault(),this._setExpanded(t,!1);return;case`Enter`:case` `:e.preventDefault(),this._activate(t);return}}_handleInput(e){let t=e.target;t instanceof HTMLInputElement&&t.matches(p)&&this._search(t.value.trim().toLocaleLowerCase())}_search(e){clearTimeout(this._announceTimer),e?(this._snapshot||=this._captureExpanded(),this._query=e,this._applySearch(e),this._announceTimer=window.setTimeout(()=>this._announce(this._resultText()),y)):(this._snapshot&&this._restore(this._snapshot),this._snapshot=null,this._query=``,this._announce(``))}_captureExpanded(){return new Map(this._items().filter(e=>this._hasChildren(e)).map(e=>[E(e),D(e)]))}_restore(e){for(let t of this._items()){t.hidden=!1,t.classList.remove(`wui-org-tree-match`);let n=E(t);e.has(n)&&this._setExpanded(t,e.get(n)??!1)}}_applySearch(e){let t=this._items(),n=new Set(t.filter(t=>T(t).toLocaleLowerCase().includes(e))),r=new Set(n);for(let e of n)for(let t=this._parentItem(e);t;t=this._parentItem(t))r.add(t),D(t)||this._setExpanded(t,!0);for(let e of t)e.classList.toggle(`wui-org-tree-match`,n.has(e)),e.hidden=!r.has(e);let i=t.filter(e=>r.has(e)),a=i[0];a&&!i.some(e=>e.getAttribute(`tabindex`)===`0`)&&this._setRoving(a)}_resultText(){let e=this._items().filter(e=>e.classList.contains(`wui-org-tree-match`)).length;return e===0?this.getAttribute(`search-empty-text`)??C:(this.getAttribute(`search-results-text`)??S).split(`{count}`).join(String(e))}_announce(e){let t=this.querySelector(h);t&&(t.textContent=e)}_scaleForPrint(){let e=this.querySelector(m);if(!(e instanceof HTMLElement))return;let t=Math.min(1,_/e.scrollWidth,v/e.scrollHeight);this.style.setProperty(g,String(t))}};(0,t.defineElement)(`wui-org-tree`,O),e.WuiOrgTree=O})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.devWarn,WeborityUiElementsInternal.modules.elementBase);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
(function(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var u=Object.defineProperty,d=(e,t)=>{let n={};for(var r in e)u(n,r,{get:e[r],enumerable:!0});return t||u(n,Symbol.toStringTag,{value:`Module`}),n},f=globalThis.WeborityUiElementsInternal?.version;if(f!==`0.149.0`)throw Error(`[webority-ui] phone expects ui-elements 0.149.0 but the page loaded `+f+`.`);var p=[[`AF`,`Afghanistan`,`93`],[`AX`,`Åland Islands`,`358`],[`AL`,`Albania`,`355`],[`DZ`,`Algeria`,`213`],[`AS`,`American Samoa`,`1`],[`AD`,`Andorra`,`376`],[`AO`,`Angola`,`244`],[`AI`,`Anguilla`,`1`],[`AG`,`Antigua & Barbuda`,`1`],[`AR`,`Argentina`,`54`],[`AM`,`Armenia`,`374`],[`AW`,`Aruba`,`297`],[`AC`,`Ascension Island`,`247`],[`AU`,`Australia`,`61`],[`AT`,`Austria`,`43`],[`AZ`,`Azerbaijan`,`994`],[`BS`,`Bahamas`,`1`],[`BH`,`Bahrain`,`973`],[`BD`,`Bangladesh`,`880`],[`BB`,`Barbados`,`1`],[`BY`,`Belarus`,`375`],[`BE`,`Belgium`,`32`],[`BZ`,`Belize`,`501`],[`BJ`,`Benin`,`229`],[`BM`,`Bermuda`,`1`],[`BT`,`Bhutan`,`975`],[`BO`,`Bolivia`,`591`],[`BA`,`Bosnia & Herzegovina`,`387`],[`BW`,`Botswana`,`267`],[`BR`,`Brazil`,`55`],[`IO`,`British Indian Ocean Territory`,`246`],[`VG`,`British Virgin Islands`,`1`],[`BN`,`Brunei`,`673`],[`BG`,`Bulgaria`,`359`],[`BF`,`Burkina Faso`,`226`],[`BI`,`Burundi`,`257`],[`KH`,`Cambodia`,`855`],[`CM`,`Cameroon`,`237`],[`CA`,`Canada`,`1`],[`CV`,`Cape Verde`,`238`],[`BQ`,`Caribbean Netherlands`,`599`],[`KY`,`Cayman Islands`,`1`],[`CF`,`Central African Republic`,`236`],[`TD`,`Chad`,`235`],[`CL`,`Chile`,`56`],[`CN`,`China`,`86`],[`CX`,`Christmas Island`,`61`],[`CC`,`Cocos (Keeling) Islands`,`61`],[`CO`,`Colombia`,`57`],[`KM`,`Comoros`,`269`],[`CG`,`Congo - Brazzaville`,`242`],[`CD`,`Congo - Kinshasa`,`243`],[`CK`,`Cook Islands`,`682`],[`CR`,`Costa Rica`,`506`],[`CI`,`Côte d’Ivoire`,`225`],[`HR`,`Croatia`,`385`],[`CU`,`Cuba`,`53`],[`CW`,`Curaçao`,`599`],[`CY`,`Cyprus`,`357`],[`CZ`,`Czechia`,`420`],[`DK`,`Denmark`,`45`],[`DJ`,`Djibouti`,`253`],[`DM`,`Dominica`,`1`],[`DO`,`Dominican Republic`,`1`],[`EC`,`Ecuador`,`593`],[`EG`,`Egypt`,`20`],[`SV`,`El Salvador`,`503`],[`GQ`,`Equatorial Guinea`,`240`],[`ER`,`Eritrea`,`291`],[`EE`,`Estonia`,`372`],[`SZ`,`Eswatini`,`268`],[`ET`,`Ethiopia`,`251`],[`FK`,`Falkland Islands`,`500`],[`FO`,`Faroe Islands`,`298`],[`FJ`,`Fiji`,`679`],[`FI`,`Finland`,`358`],[`FR`,`France`,`33`],[`GF`,`French Guiana`,`594`],[`PF`,`French Polynesia`,`689`],[`GA`,`Gabon`,`241`],[`GM`,`Gambia`,`220`],[`GE`,`Georgia`,`995`],[`DE`,`Germany`,`49`],[`GH`,`Ghana`,`233`],[`GI`,`Gibraltar`,`350`],[`GR`,`Greece`,`30`],[`GL`,`Greenland`,`299`],[`GD`,`Grenada`,`1`],[`GP`,`Guadeloupe`,`590`],[`GU`,`Guam`,`1`],[`GT`,`Guatemala`,`502`],[`GG`,`Guernsey`,`44`],[`GN`,`Guinea`,`224`],[`GW`,`Guinea-Bissau`,`245`],[`GY`,`Guyana`,`592`],[`HT`,`Haiti`,`509`],[`HN`,`Honduras`,`504`],[`HK`,`Hong Kong SAR China`,`852`],[`HU`,`Hungary`,`36`],[`IS`,`Iceland`,`354`],[`IN`,`India`,`91`],[`ID`,`Indonesia`,`62`],[`IR`,`Iran`,`98`],[`IQ`,`Iraq`,`964`],[`IE`,`Ireland`,`353`],[`IM`,`Isle of Man`,`44`],[`IL`,`Israel`,`972`],[`IT`,`Italy`,`39`],[`JM`,`Jamaica`,`1`],[`JP`,`Japan`,`81`],[`JE`,`Jersey`,`44`],[`JO`,`Jordan`,`962`],[`KZ`,`Kazakhstan`,`7`],[`KE`,`Kenya`,`254`],[`KI`,`Kiribati`,`686`],[`XK`,`Kosovo`,`383`],[`KW`,`Kuwait`,`965`],[`KG`,`Kyrgyzstan`,`996`],[`LA`,`Laos`,`856`],[`LV`,`Latvia`,`371`],[`LB`,`Lebanon`,`961`],[`LS`,`Lesotho`,`266`],[`LR`,`Liberia`,`231`],[`LY`,`Libya`,`218`],[`LI`,`Liechtenstein`,`423`],[`LT`,`Lithuania`,`370`],[`LU`,`Luxembourg`,`352`],[`MO`,`Macao SAR China`,`853`],[`MG`,`Madagascar`,`261`],[`MW`,`Malawi`,`265`],[`MY`,`Malaysia`,`60`],[`MV`,`Maldives`,`960`],[`ML`,`Mali`,`223`],[`MT`,`Malta`,`356`],[`MH`,`Marshall Islands`,`692`],[`MQ`,`Martinique`,`596`],[`MR`,`Mauritania`,`222`],[`MU`,`Mauritius`,`230`],[`YT`,`Mayotte`,`262`],[`MX`,`Mexico`,`52`],[`FM`,`Micronesia`,`691`],[`MD`,`Moldova`,`373`],[`MC`,`Monaco`,`377`],[`MN`,`Mongolia`,`976`],[`ME`,`Montenegro`,`382`],[`MS`,`Montserrat`,`1`],[`MA`,`Morocco`,`212`],[`MZ`,`Mozambique`,`258`],[`MM`,`Myanmar (Burma)`,`95`],[`NA`,`Namibia`,`264`],[`NR`,`Nauru`,`674`],[`NP`,`Nepal`,`977`],[`NL`,`Netherlands`,`31`],[`NC`,`New Caledonia`,`687`],[`NZ`,`New Zealand`,`64`],[`NI`,`Nicaragua`,`505`],[`NE`,`Niger`,`227`],[`NG`,`Nigeria`,`234`],[`NU`,`Niue`,`683`],[`NF`,`Norfolk Island`,`672`],[`KP`,`North Korea`,`850`],[`MK`,`North Macedonia`,`389`],[`MP`,`Northern Mariana Islands`,`1`],[`NO`,`Norway`,`47`],[`OM`,`Oman`,`968`],[`PK`,`Pakistan`,`92`],[`PW`,`Palau`,`680`],[`PS`,`Palestinian Territories`,`970`],[`PA`,`Panama`,`507`],[`PG`,`Papua New Guinea`,`675`],[`PY`,`Paraguay`,`595`],[`PE`,`Peru`,`51`],[`PH`,`Philippines`,`63`],[`PL`,`Poland`,`48`],[`PT`,`Portugal`,`351`],[`PR`,`Puerto Rico`,`1`],[`QA`,`Qatar`,`974`],[`RE`,`Réunion`,`262`],[`RO`,`Romania`,`40`],[`RU`,`Russia`,`7`],[`RW`,`Rwanda`,`250`],[`WS`,`Samoa`,`685`],[`SM`,`San Marino`,`378`],[`ST`,`São Tomé & Príncipe`,`239`],[`SA`,`Saudi Arabia`,`966`],[`SN`,`Senegal`,`221`],[`RS`,`Serbia`,`381`],[`SC`,`Seychelles`,`248`],[`SL`,`Sierra Leone`,`232`],[`SG`,`Singapore`,`65`],[`SX`,`Sint Maarten`,`1`],[`SK`,`Slovakia`,`421`],[`SI`,`Slovenia`,`386`],[`SB`,`Solomon Islands`,`677`],[`SO`,`Somalia`,`252`],[`ZA`,`South Africa`,`27`],[`KR`,`South Korea`,`82`],[`SS`,`South Sudan`,`211`],[`ES`,`Spain`,`34`],[`LK`,`Sri Lanka`,`94`],[`BL`,`St. Barthélemy`,`590`],[`SH`,`St. Helena`,`290`],[`KN`,`St. Kitts & Nevis`,`1`],[`LC`,`St. Lucia`,`1`],[`MF`,`St. Martin`,`590`],[`PM`,`St. Pierre & Miquelon`,`508`],[`VC`,`St. Vincent & Grenadines`,`1`],[`SD`,`Sudan`,`249`],[`SR`,`Suriname`,`597`],[`SJ`,`Svalbard & Jan Mayen`,`47`],[`SE`,`Sweden`,`46`],[`CH`,`Switzerland`,`41`],[`SY`,`Syria`,`963`],[`TW`,`Taiwan`,`886`],[`TJ`,`Tajikistan`,`992`],[`TZ`,`Tanzania`,`255`],[`TH`,`Thailand`,`66`],[`TL`,`Timor-Leste`,`670`],[`TG`,`Togo`,`228`],[`TK`,`Tokelau`,`690`],[`TO`,`Tonga`,`676`],[`TT`,`Trinidad & Tobago`,`1`],[`TA`,`Tristan da Cunha`,`290`],[`TN`,`Tunisia`,`216`],[`TR`,`Türkiye`,`90`],[`TM`,`Turkmenistan`,`993`],[`TC`,`Turks & Caicos Islands`,`1`],[`TV`,`Tuvalu`,`688`],[`VI`,`U.S. Virgin Islands`,`1`],[`UG`,`Uganda`,`256`],[`UA`,`Ukraine`,`380`],[`AE`,`United Arab Emirates`,`971`],[`GB`,`United Kingdom`,`44`],[`US`,`United States`,`1`],[`UY`,`Uruguay`,`598`],[`UZ`,`Uzbekistan`,`998`],[`VU`,`Vanuatu`,`678`],[`VA`,`Vatican City`,`39`],[`VE`,`Venezuela`,`58`],[`VN`,`Vietnam`,`84`],[`WF`,`Wallis & Futuna`,`681`],[`EH`,`Western Sahara`,`212`],[`YE`,`Yemen`,`967`],[`ZM`,`Zambia`,`260`],[`ZW`,`Zimbabwe`,`263`]],m=e=>(p.find(t=>t[0]===e)||[``,``,``])[2],h={AD:[`Europe/Andorra`],AE:[`Asia/Dubai`],AF:[`Asia/Kabul`],AG:[`America/Antigua`],AI:[`America/Anguilla`],AL:[`Europe/Tirane`],AM:[`Asia/Yerevan`],AO:[`Africa/Luanda`],AR:[`America/Argentina/Buenos_Aires`,`America/Argentina/Catamarca`,`America/Argentina/ComodRivadavia`,`America/Argentina/Cordoba`,`America/Argentina/Jujuy`,`America/Argentina/La_Rioja`,`America/Argentina/Mendoza`,`America/Argentina/Rio_Gallegos`,`America/Argentina/Salta`,`America/Argentina/San_Juan`,`America/Argentina/San_Luis`,`America/Argentina/Tucuman`,`America/Argentina/Ushuaia`,`America/Buenos_Aires`,`America/Catamarca`,`America/Cordoba`,`America/Jujuy`,`America/Mendoza`,`America/Rosario`],AS:[`Pacific/Pago_Pago`,`Pacific/Samoa`,`US/Samoa`],AT:[`Europe/Vienna`],AU:[`Antarctica/Macquarie`,`Australia/Adelaide`,`Australia/Brisbane`,`Australia/Broken_Hill`,`Australia/Canberra`,`Australia/Currie`,`Australia/Darwin`,`Australia/Eucla`,`Australia/Hobart`,`Australia/LHI`,`Australia/Lindeman`,`Australia/Lord_Howe`,`Australia/Melbourne`,`Australia/NSW`,`Australia/North`,`Australia/Perth`,`Australia/Queensland`,`Australia/South`,`Australia/Sydney`,`Australia/Tasmania`,`Australia/Victoria`,`Australia/West`,`Australia/Yancowinna`],AW:[`America/Aruba`],AX:[`Europe/Mariehamn`],AZ:[`Asia/Baku`],BA:[`Europe/Sarajevo`],BB:[`America/Barbados`],BD:[`Asia/Dacca`,`Asia/Dhaka`],BE:[`Europe/Brussels`],BF:[`Africa/Ouagadougou`],BG:[`Europe/Sofia`],BH:[`Asia/Bahrain`],BI:[`Africa/Bujumbura`],BJ:[`Africa/Porto-Novo`],BL:[`America/St_Barthelemy`],BM:[`Atlantic/Bermuda`],BN:[`Asia/Brunei`],BO:[`America/La_Paz`],BQ:[`America/Kralendijk`],BR:[`America/Araguaina`,`America/Bahia`,`America/Belem`,`America/Boa_Vista`,`America/Campo_Grande`,`America/Cuiaba`,`America/Eirunepe`,`America/Fortaleza`,`America/Maceio`,`America/Manaus`,`America/Noronha`,`America/Porto_Acre`,`America/Porto_Velho`,`America/Recife`,`America/Rio_Branco`,`America/Santarem`,`America/Sao_Paulo`,`Brazil/DeNoronha`,`Brazil/East`,`Brazil/West`],BS:[`America/Nassau`],BT:[`Asia/Thimbu`,`Asia/Thimphu`],BW:[`Africa/Gaborone`],BY:[`Europe/Minsk`],BZ:[`America/Belize`],CA:`America/Atikokan.America/Blanc-Sablon.America/Cambridge_Bay.America/Coral_Harbour.America/Creston.America/Dawson.America/Dawson_Creek.America/Edmonton.America/Fort_Nelson.America/Glace_Bay.America/Goose_Bay.America/Halifax.America/Inuvik.America/Iqaluit.America/Moncton.America/Montreal.America/Nipigon.America/Pangnirtung.America/Rainy_River.America/Rankin_Inlet.America/Regina.America/Resolute.America/St_Johns.America/Swift_Current.America/Thunder_Bay.America/Toronto.America/Vancouver.America/Whitehorse.America/Winnipeg.America/Yellowknife.Canada/Atlantic.Canada/Central.Canada/Eastern.Canada/Mountain.Canada/Newfoundland.Canada/Pacific.Canada/Saskatchewan.Canada/Yukon`.split(`.`),CC:[`Indian/Cocos`],CD:[`Africa/Kinshasa`,`Africa/Lubumbashi`],CF:[`Africa/Bangui`],CG:[`Africa/Brazzaville`],CH:[`Europe/Zurich`],CI:[`Africa/Abidjan`],CK:[`Pacific/Rarotonga`],CL:[`America/Coyhaique`,`America/Punta_Arenas`,`America/Santiago`,`Chile/Continental`,`Chile/EasterIsland`,`Pacific/Easter`],CM:[`Africa/Douala`],CN:[`Asia/Chongqing`,`Asia/Harbin`,`Asia/Kashgar`,`Asia/Shanghai`,`Asia/Urumqi`],CO:[`America/Bogota`],CR:[`America/Costa_Rica`],CU:[`America/Havana`],CV:[`Atlantic/Cape_Verde`],CW:[`America/Curacao`],CX:[`Indian/Christmas`],CY:[`Asia/Famagusta`,`Asia/Nicosia`,`Europe/Nicosia`],CZ:[`Europe/Prague`],DE:[`Europe/Berlin`,`Europe/Busingen`],DJ:[`Africa/Djibouti`],DK:[`Europe/Copenhagen`],DM:[`America/Dominica`],DO:[`America/Santo_Domingo`],DZ:[`Africa/Algiers`],EC:[`America/Guayaquil`,`Pacific/Galapagos`],EE:[`Europe/Tallinn`],EG:[`Africa/Cairo`],EH:[`Africa/El_Aaiun`],ER:[`Africa/Asmara`,`Africa/Asmera`],ES:[`Africa/Ceuta`,`Atlantic/Canary`,`Europe/Madrid`],ET:[`Africa/Addis_Ababa`],FI:[`Europe/Helsinki`],FJ:[`Pacific/Fiji`],FK:[`Atlantic/Stanley`],FM:[`Pacific/Chuuk`,`Pacific/Kosrae`,`Pacific/Pohnpei`,`Pacific/Ponape`,`Pacific/Truk`,`Pacific/Yap`],FO:[`Atlantic/Faeroe`,`Atlantic/Faroe`],FR:[`Europe/Paris`],GA:[`Africa/Libreville`],GB:[`Europe/Belfast`,`Europe/London`],GD:[`America/Grenada`],GE:[`Asia/Tbilisi`],GF:[`America/Cayenne`],GG:[`Europe/Guernsey`],GH:[`Africa/Accra`],GI:[`Europe/Gibraltar`],GL:[`America/Danmarkshavn`,`America/Godthab`,`America/Nuuk`,`America/Scoresbysund`,`America/Thule`],GM:[`Africa/Banjul`],GN:[`Africa/Conakry`],GP:[`America/Guadeloupe`],GQ:[`Africa/Malabo`],GR:[`Europe/Athens`],GT:[`America/Guatemala`],GU:[`Pacific/Guam`],GW:[`Africa/Bissau`],GY:[`America/Guyana`],HK:[`Asia/Hong_Kong`],HN:[`America/Tegucigalpa`],HR:[`Europe/Zagreb`],HT:[`America/Port-au-Prince`],HU:[`Europe/Budapest`],ID:[`Asia/Jakarta`,`Asia/Jayapura`,`Asia/Makassar`,`Asia/Pontianak`,`Asia/Ujung_Pandang`],IE:[`Europe/Dublin`],IL:[`Asia/Jerusalem`,`Asia/Tel_Aviv`],IM:[`Europe/Isle_of_Man`],IN:[`Asia/Calcutta`,`Asia/Kolkata`],IO:[`Indian/Chagos`],IQ:[`Asia/Baghdad`],IR:[`Asia/Tehran`],IS:[`Atlantic/Reykjavik`],IT:[`Europe/Rome`],JE:[`Europe/Jersey`],JM:[`America/Jamaica`],JO:[`Asia/Amman`],JP:[`Asia/Tokyo`],KE:[`Africa/Nairobi`],KG:[`Asia/Bishkek`],KH:[`Asia/Phnom_Penh`],KI:[`Pacific/Enderbury`,`Pacific/Kanton`,`Pacific/Kiritimati`,`Pacific/Tarawa`],KM:[`Indian/Comoro`],KN:[`America/St_Kitts`],KP:[`Asia/Pyongyang`],KR:[`Asia/Seoul`],KW:[`Asia/Kuwait`],KY:[`America/Cayman`],KZ:[`Asia/Almaty`,`Asia/Aqtau`,`Asia/Aqtobe`,`Asia/Atyrau`,`Asia/Oral`,`Asia/Qostanay`,`Asia/Qyzylorda`],LA:[`Asia/Vientiane`],LB:[`Asia/Beirut`],LC:[`America/St_Lucia`],LI:[`Europe/Vaduz`],LK:[`Asia/Colombo`],LR:[`Africa/Monrovia`],LS:[`Africa/Maseru`],LT:[`Europe/Vilnius`],LU:[`Europe/Luxembourg`],LV:[`Europe/Riga`],LY:[`Africa/Tripoli`],MA:[`Africa/Casablanca`],MC:[`Europe/Monaco`],MD:[`Europe/Chisinau`,`Europe/Tiraspol`],ME:[`Europe/Podgorica`],MF:[`America/Marigot`],MG:[`Indian/Antananarivo`],MH:[`Pacific/Kwajalein`,`Pacific/Majuro`],MK:[`Europe/Skopje`],ML:[`Africa/Bamako`,`Africa/Timbuktu`],MM:[`Asia/Rangoon`,`Asia/Yangon`],MN:[`Asia/Choibalsan`,`Asia/Hovd`,`Asia/Ulaanbaatar`,`Asia/Ulan_Bator`],MO:[`Asia/Macao`,`Asia/Macau`],MP:[`Pacific/Saipan`],MQ:[`America/Martinique`],MR:[`Africa/Nouakchott`],MS:[`America/Montserrat`],MT:[`Europe/Malta`],MU:[`Indian/Mauritius`],MV:[`Indian/Maldives`],MW:[`Africa/Blantyre`],MX:[`America/Bahia_Banderas`,`America/Cancun`,`America/Chihuahua`,`America/Ciudad_Juarez`,`America/Ensenada`,`America/Hermosillo`,`America/Matamoros`,`America/Mazatlan`,`America/Merida`,`America/Mexico_City`,`America/Monterrey`,`America/Ojinaga`,`America/Santa_Isabel`,`America/Tijuana`,`Mexico/BajaNorte`,`Mexico/BajaSur`,`Mexico/General`],MY:[`Asia/Kuala_Lumpur`,`Asia/Kuching`],MZ:[`Africa/Maputo`],NA:[`Africa/Windhoek`],NC:[`Pacific/Noumea`],NE:[`Africa/Niamey`],NF:[`Pacific/Norfolk`],NG:[`Africa/Lagos`],NI:[`America/Managua`],NL:[`Europe/Amsterdam`],NO:[`Europe/Oslo`],NP:[`Asia/Kathmandu`,`Asia/Katmandu`],NR:[`Pacific/Nauru`],NU:[`Pacific/Niue`],NZ:[`Pacific/Auckland`,`Pacific/Chatham`],OM:[`Asia/Muscat`],PA:[`America/Panama`],PE:[`America/Lima`],PF:[`Pacific/Gambier`,`Pacific/Marquesas`,`Pacific/Tahiti`],PG:[`Pacific/Bougainville`,`Pacific/Port_Moresby`],PH:[`Asia/Manila`],PK:[`Asia/Karachi`],PL:[`Europe/Warsaw`],PM:[`America/Miquelon`],PR:[`America/Puerto_Rico`],PS:[`Asia/Gaza`,`Asia/Hebron`],PT:[`Atlantic/Azores`,`Atlantic/Madeira`,`Europe/Lisbon`],PW:[`Pacific/Palau`],PY:[`America/Asuncion`],QA:[`Asia/Qatar`],RE:[`Indian/Reunion`],RO:[`Europe/Bucharest`],RS:[`Europe/Belgrade`],RU:`Asia/Anadyr.Asia/Barnaul.Asia/Chita.Asia/Irkutsk.Asia/Kamchatka.Asia/Khandyga.Asia/Krasnoyarsk.Asia/Magadan.Asia/Novokuznetsk.Asia/Novosibirsk.Asia/Omsk.Asia/Sakhalin.Asia/Srednekolymsk.Asia/Tomsk.Asia/Ust-Nera.Asia/Vladivostok.Asia/Yakutsk.Asia/Yekaterinburg.Europe/Astrakhan.Europe/Kaliningrad.Europe/Kirov.Europe/Moscow.Europe/Samara.Europe/Saratov.Europe/Ulyanovsk.Europe/Volgograd`.split(`.`),RW:[`Africa/Kigali`],SA:[`Asia/Riyadh`],SB:[`Pacific/Guadalcanal`],SC:[`Indian/Mahe`],SD:[`Africa/Khartoum`],SE:[`Europe/Stockholm`],SG:[`Asia/Singapore`],SH:[`Atlantic/St_Helena`],SI:[`Europe/Ljubljana`],SJ:[`Arctic/Longyearbyen`,`Atlantic/Jan_Mayen`],SK:[`Europe/Bratislava`],SL:[`Africa/Freetown`],SM:[`Europe/San_Marino`],SN:[`Africa/Dakar`],SO:[`Africa/Mogadishu`],SR:[`America/Paramaribo`],SS:[`Africa/Juba`],ST:[`Africa/Sao_Tome`],SV:[`America/El_Salvador`],SX:[`America/Lower_Princes`],SY:[`Asia/Damascus`],SZ:[`Africa/Mbabane`],TC:[`America/Grand_Turk`],TD:[`Africa/Ndjamena`],TG:[`Africa/Lome`],TH:[`Asia/Bangkok`],TJ:[`Asia/Dushanbe`],TK:[`Pacific/Fakaofo`],TL:[`Asia/Dili`],TM:[`Asia/Ashgabat`,`Asia/Ashkhabad`],TN:[`Africa/Tunis`],TO:[`Pacific/Tongatapu`],TR:[`Asia/Istanbul`,`Europe/Istanbul`],TT:[`America/Port_of_Spain`],TV:[`Pacific/Funafuti`],TW:[`Asia/Taipei`],TZ:[`Africa/Dar_es_Salaam`],UA:[`Europe/Kiev`,`Europe/Kyiv`,`Europe/Simferopol`,`Europe/Uzhgorod`,`Europe/Zaporozhye`],UG:[`Africa/Kampala`],US:`America/Adak.America/Anchorage.America/Atka.America/Boise.America/Chicago.America/Denver.America/Detroit.America/Fort_Wayne.America/Indiana/Indianapolis.America/Indiana/Knox.America/Indiana/Marengo.America/Indiana/Petersburg.America/Indiana/Tell_City.America/Indiana/Vevay.America/Indiana/Vincennes.America/Indiana/Winamac.America/Indianapolis.America/Juneau.America/Kentucky/Louisville.America/Kentucky/Monticello.America/Knox_IN.America/Los_Angeles.America/Louisville.America/Menominee.America/Metlakatla.America/New_York.America/Nome.America/North_Dakota/Beulah.America/North_Dakota/Center.America/North_Dakota/New_Salem.America/Phoenix.America/Shiprock.America/Sitka.America/Yakutat.Pacific/Honolulu.US/Alaska.US/Aleutian.US/Arizona.US/Central.US/East-Indiana.US/Eastern.US/Hawaii.US/Indiana-Starke.US/Michigan.US/Mountain.US/Pacific`.split(`.`),UY:[`America/Montevideo`],UZ:[`Asia/Samarkand`,`Asia/Tashkent`],VA:[`Europe/Vatican`],VC:[`America/St_Vincent`],VE:[`America/Caracas`],VG:[`America/Tortola`],VI:[`America/St_Thomas`,`America/Virgin`],VN:[`Asia/Ho_Chi_Minh`,`Asia/Saigon`],VU:[`Pacific/Efate`],WF:[`Pacific/Wallis`],WS:[`Pacific/Apia`],YE:[`Asia/Aden`],YT:[`Indian/Mayotte`],ZA:[`Africa/Johannesburg`],ZM:[`Africa/Lusaka`],ZW:[`Africa/Harare`]},g=new Set(p.map(([e])=>e)),_=new Map;for(let[e,t]of Object.entries(h))for(let n of t)_.set(n,e);function v(e){let t=_.get(e);return t&&g.has(t)?t:null}function y(e){if(!e)return null;let t;try{t=new Intl.Locale(e).region}catch{return null}return t&&g.has(t)?t:null}function b(){let e;try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{e=void 0}let t=typeof navigator>`u`?void 0:navigator.language;return v(e)||y(t)||null}var x=`ui-phone.global.js`;function S(){return window.WeborityPhone?Promise.resolve(window.WeborityPhone):new Promise((e,t)=>{let n=document.querySelector(`script[src*="${x}"]`);if(!n){n=document.createElement(`script`);try{n.src=(0,c.assetUrl)(x)}catch(e){t(e);return}document.head.append(n)}n.addEventListener(`load`,()=>window.WeborityPhone?e(window.WeborityPhone):t(Error(`The phone metadata script did not load.`))),n.addEventListener(`error`,()=>t(Error(`The phone metadata script failed to load.`)))})}var C=e=>e?`wui-flag wui-flag-${String(e).toLowerCase()}`:`wui-flag`,w=e=>e?`+${m(e)}`:``,T=null,E=null;function D(){return T?Promise.resolve(T):(E||=S().then(e=>(T=e,T)).catch(()=>null),E)}function O(e,t){let n=`+${m(e)}`;return t?.startsWith(n)?t.slice(n.length).trimStart():null}function k(e,t){if(!T||!t||!e)return t;try{return O(e,new T.AsYouType(e).input(`+${m(e)}${t}`))||t}catch{return t}}function A(e,t){if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(/[0-9]/.test(e[r])&&(n+=1,n===t))return r+1;return e.length}function j(e){if(!T||!e)return null;try{return O(e,T.getExampleNumber(e,T.examples)?.formatInternational())||null}catch{return null}}function M(e){let t=j(e);return t?`For example ${t}`:null}function N(e){if(!T||!e)return null;try{if(!T.isValidPhoneNumber(e))return!1;let t=T.parsePhoneNumber(e)?.getType?.();return t===void 0||t===`MOBILE`||t===`FIXED_LINE_OR_MOBILE`}catch{return null}}function P(e){if(!T||!e)return null;try{let t=T.getExampleNumber(e,T.examples);return t?.nationalNumber?t.nationalNumber.length:null}catch{return null}}function F(e,t,n){try{let r=T.parsePhoneNumber(t,e),i=r?.nationalNumber;return!i||r.country!==e||i.length>n||!t.endsWith(i)?null:i}catch{return null}}function I(e){if(!T||!e?.trim().startsWith(`+`))return null;try{let t=new T.AsYouType;t.input(e.trim());let n=t.getCountry();return n?{country:n,national:t.getNationalNumber()||``}:null}catch{return null}}function L(e,t){let n=String(t??``).trim();if(!n.startsWith(`+`))return null;let r=n.replace(/[^0-9]/g,``),i=String(m(e));return{country:e,national:r.startsWith(i)?r.slice(i.length):r}}var R=class extends r.ElementBase{static formAssociated=!0;static get observedAttributes(){return[`value`,`country`,`locked-country`,`placeholder`,`disabled`,`readonly`,`loading`,`required`,`aria-label`,`aria-describedby`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._defaultCountry=b()||``,this._country=this._defaultCountry,this._national=``,this._active=-1,this._committedValue=``,this._validateOnInput=!1}connectedCallback(){this._rendered?this._bindGlobal?.():this.render()}attributeChangedCallback(e,t,n){if(e===`value`)this.value=n;else if(this._rendered){if(e===`aria-label`){let t=this.querySelector(`input[type=tel]`);t&&(n==null?t.removeAttribute(e):t.setAttribute(e,n))}else if(e===`aria-describedby`)this._syncDescribedBy();else if(e===`country`){if(this._locked)return;let e=this.value;if(this._country=n||this._defaultCountry,this._suppressCountryRender)return;this.render(),this.value!==e&&(this._emitInput(),this._emitChange())}else this.render()}}formResetCallback(){this._validateOnInput=!1,this.value=this._defaultValue||``}get _locked(){return(this.getAttribute(`locked-country`)||``).toUpperCase()||null}get value(){return this._national&&this._country?`+${m(this._country)}${this._national}`:``}set value(e){let t=String(e??``).trim();this._locked&&(this._country=this._locked);let n=this._locked?null:I(t);if(n)this._country=n.country,this._national=n.national.replace(/[^0-9]/g,``);else if(t.startsWith(`+`)){let e=t.replace(/[^0-9]/g,``),n=String(m(this._locked||this.getAttribute(`country`)||this._country));n&&e.startsWith(n)&&(e=e.slice(n.length)),this._national=e}else this._national=t.replace(/[^0-9]/g,``);n&&this.getAttribute(`country`)!==this._country?this.setAttribute(`country`,this._country):this._rendered&&this.render(),this._committedValue=this.value,this._syncMirror()}_syncMirror(){(0,a.syncFormMirror)(this,this.value)}_syncDescribedBy(){let e=this.querySelector(`input[type=tel]`);if(!e)return;let t=[this.getAttribute(`aria-describedby`),this.querySelector(`[data-phone-error]`)?.id].filter(Boolean);t.length?e.setAttribute(`aria-describedby`,t.join(` `)):e.removeAttribute(`aria-describedby`)}_emitInput(){this.dispatchEvent(new Event(`input`,{bubbles:!0}))}_emitChange(){this._committedValue=this.value,this.dispatchEvent(new Event(`change`,{bubbles:!0}))}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``),this._country=this._locked||this.getAttribute(`country`)||this._country;let e=this.getAttribute(`placeholder`)||M(this._country)||`Enter phone number`;this.id||=`wui-phone-${Math.random().toString(36).slice(2,9)}`;let t=`${this.id}-listbox`;this._listboxId=t;let n=this._locked?`<div class="phone-country-adornment"><span class="wui-phone-prefix"><span class="${C(this._country)}" data-flag aria-hidden="true"></span><span class="phone-dial" data-dial>${w(this._country)}</span></span></div>`:`<div class="phone-country-adornment">
|
|
2
|
-
<button type="button" class="country-toggle" aria-label="Choose country" aria-haspopup="listbox" aria-expanded="false" aria-controls="${
|
|
3
|
-
<span class="${
|
|
4
|
-
${(0,
|
|
5
|
-
<span class="phone-dial" data-dial>${
|
|
1
|
+
(function(e,t,n,r,i,a,o,s,c,l,u){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var d=Object.defineProperty,f=(e,t)=>{let n={};for(var r in e)d(n,r,{get:e[r],enumerable:!0});return t||d(n,Symbol.toStringTag,{value:`Module`}),n},p=globalThis.WeborityUiElementsInternal?.version;if(p!==`0.152.0`)throw Error(`[webority-ui] phone expects ui-elements 0.152.0 but the page loaded `+p+`.`);var m=[[`AF`,`Afghanistan`,`93`],[`AX`,`Åland Islands`,`358`],[`AL`,`Albania`,`355`],[`DZ`,`Algeria`,`213`],[`AS`,`American Samoa`,`1`],[`AD`,`Andorra`,`376`],[`AO`,`Angola`,`244`],[`AI`,`Anguilla`,`1`],[`AG`,`Antigua & Barbuda`,`1`],[`AR`,`Argentina`,`54`],[`AM`,`Armenia`,`374`],[`AW`,`Aruba`,`297`],[`AC`,`Ascension Island`,`247`],[`AU`,`Australia`,`61`],[`AT`,`Austria`,`43`],[`AZ`,`Azerbaijan`,`994`],[`BS`,`Bahamas`,`1`],[`BH`,`Bahrain`,`973`],[`BD`,`Bangladesh`,`880`],[`BB`,`Barbados`,`1`],[`BY`,`Belarus`,`375`],[`BE`,`Belgium`,`32`],[`BZ`,`Belize`,`501`],[`BJ`,`Benin`,`229`],[`BM`,`Bermuda`,`1`],[`BT`,`Bhutan`,`975`],[`BO`,`Bolivia`,`591`],[`BA`,`Bosnia & Herzegovina`,`387`],[`BW`,`Botswana`,`267`],[`BR`,`Brazil`,`55`],[`IO`,`British Indian Ocean Territory`,`246`],[`VG`,`British Virgin Islands`,`1`],[`BN`,`Brunei`,`673`],[`BG`,`Bulgaria`,`359`],[`BF`,`Burkina Faso`,`226`],[`BI`,`Burundi`,`257`],[`KH`,`Cambodia`,`855`],[`CM`,`Cameroon`,`237`],[`CA`,`Canada`,`1`],[`CV`,`Cape Verde`,`238`],[`BQ`,`Caribbean Netherlands`,`599`],[`KY`,`Cayman Islands`,`1`],[`CF`,`Central African Republic`,`236`],[`TD`,`Chad`,`235`],[`CL`,`Chile`,`56`],[`CN`,`China`,`86`],[`CX`,`Christmas Island`,`61`],[`CC`,`Cocos (Keeling) Islands`,`61`],[`CO`,`Colombia`,`57`],[`KM`,`Comoros`,`269`],[`CG`,`Congo - Brazzaville`,`242`],[`CD`,`Congo - Kinshasa`,`243`],[`CK`,`Cook Islands`,`682`],[`CR`,`Costa Rica`,`506`],[`CI`,`Côte d’Ivoire`,`225`],[`HR`,`Croatia`,`385`],[`CU`,`Cuba`,`53`],[`CW`,`Curaçao`,`599`],[`CY`,`Cyprus`,`357`],[`CZ`,`Czechia`,`420`],[`DK`,`Denmark`,`45`],[`DJ`,`Djibouti`,`253`],[`DM`,`Dominica`,`1`],[`DO`,`Dominican Republic`,`1`],[`EC`,`Ecuador`,`593`],[`EG`,`Egypt`,`20`],[`SV`,`El Salvador`,`503`],[`GQ`,`Equatorial Guinea`,`240`],[`ER`,`Eritrea`,`291`],[`EE`,`Estonia`,`372`],[`SZ`,`Eswatini`,`268`],[`ET`,`Ethiopia`,`251`],[`FK`,`Falkland Islands`,`500`],[`FO`,`Faroe Islands`,`298`],[`FJ`,`Fiji`,`679`],[`FI`,`Finland`,`358`],[`FR`,`France`,`33`],[`GF`,`French Guiana`,`594`],[`PF`,`French Polynesia`,`689`],[`GA`,`Gabon`,`241`],[`GM`,`Gambia`,`220`],[`GE`,`Georgia`,`995`],[`DE`,`Germany`,`49`],[`GH`,`Ghana`,`233`],[`GI`,`Gibraltar`,`350`],[`GR`,`Greece`,`30`],[`GL`,`Greenland`,`299`],[`GD`,`Grenada`,`1`],[`GP`,`Guadeloupe`,`590`],[`GU`,`Guam`,`1`],[`GT`,`Guatemala`,`502`],[`GG`,`Guernsey`,`44`],[`GN`,`Guinea`,`224`],[`GW`,`Guinea-Bissau`,`245`],[`GY`,`Guyana`,`592`],[`HT`,`Haiti`,`509`],[`HN`,`Honduras`,`504`],[`HK`,`Hong Kong SAR China`,`852`],[`HU`,`Hungary`,`36`],[`IS`,`Iceland`,`354`],[`IN`,`India`,`91`],[`ID`,`Indonesia`,`62`],[`IR`,`Iran`,`98`],[`IQ`,`Iraq`,`964`],[`IE`,`Ireland`,`353`],[`IM`,`Isle of Man`,`44`],[`IL`,`Israel`,`972`],[`IT`,`Italy`,`39`],[`JM`,`Jamaica`,`1`],[`JP`,`Japan`,`81`],[`JE`,`Jersey`,`44`],[`JO`,`Jordan`,`962`],[`KZ`,`Kazakhstan`,`7`],[`KE`,`Kenya`,`254`],[`KI`,`Kiribati`,`686`],[`XK`,`Kosovo`,`383`],[`KW`,`Kuwait`,`965`],[`KG`,`Kyrgyzstan`,`996`],[`LA`,`Laos`,`856`],[`LV`,`Latvia`,`371`],[`LB`,`Lebanon`,`961`],[`LS`,`Lesotho`,`266`],[`LR`,`Liberia`,`231`],[`LY`,`Libya`,`218`],[`LI`,`Liechtenstein`,`423`],[`LT`,`Lithuania`,`370`],[`LU`,`Luxembourg`,`352`],[`MO`,`Macao SAR China`,`853`],[`MG`,`Madagascar`,`261`],[`MW`,`Malawi`,`265`],[`MY`,`Malaysia`,`60`],[`MV`,`Maldives`,`960`],[`ML`,`Mali`,`223`],[`MT`,`Malta`,`356`],[`MH`,`Marshall Islands`,`692`],[`MQ`,`Martinique`,`596`],[`MR`,`Mauritania`,`222`],[`MU`,`Mauritius`,`230`],[`YT`,`Mayotte`,`262`],[`MX`,`Mexico`,`52`],[`FM`,`Micronesia`,`691`],[`MD`,`Moldova`,`373`],[`MC`,`Monaco`,`377`],[`MN`,`Mongolia`,`976`],[`ME`,`Montenegro`,`382`],[`MS`,`Montserrat`,`1`],[`MA`,`Morocco`,`212`],[`MZ`,`Mozambique`,`258`],[`MM`,`Myanmar (Burma)`,`95`],[`NA`,`Namibia`,`264`],[`NR`,`Nauru`,`674`],[`NP`,`Nepal`,`977`],[`NL`,`Netherlands`,`31`],[`NC`,`New Caledonia`,`687`],[`NZ`,`New Zealand`,`64`],[`NI`,`Nicaragua`,`505`],[`NE`,`Niger`,`227`],[`NG`,`Nigeria`,`234`],[`NU`,`Niue`,`683`],[`NF`,`Norfolk Island`,`672`],[`KP`,`North Korea`,`850`],[`MK`,`North Macedonia`,`389`],[`MP`,`Northern Mariana Islands`,`1`],[`NO`,`Norway`,`47`],[`OM`,`Oman`,`968`],[`PK`,`Pakistan`,`92`],[`PW`,`Palau`,`680`],[`PS`,`Palestinian Territories`,`970`],[`PA`,`Panama`,`507`],[`PG`,`Papua New Guinea`,`675`],[`PY`,`Paraguay`,`595`],[`PE`,`Peru`,`51`],[`PH`,`Philippines`,`63`],[`PL`,`Poland`,`48`],[`PT`,`Portugal`,`351`],[`PR`,`Puerto Rico`,`1`],[`QA`,`Qatar`,`974`],[`RE`,`Réunion`,`262`],[`RO`,`Romania`,`40`],[`RU`,`Russia`,`7`],[`RW`,`Rwanda`,`250`],[`WS`,`Samoa`,`685`],[`SM`,`San Marino`,`378`],[`ST`,`São Tomé & Príncipe`,`239`],[`SA`,`Saudi Arabia`,`966`],[`SN`,`Senegal`,`221`],[`RS`,`Serbia`,`381`],[`SC`,`Seychelles`,`248`],[`SL`,`Sierra Leone`,`232`],[`SG`,`Singapore`,`65`],[`SX`,`Sint Maarten`,`1`],[`SK`,`Slovakia`,`421`],[`SI`,`Slovenia`,`386`],[`SB`,`Solomon Islands`,`677`],[`SO`,`Somalia`,`252`],[`ZA`,`South Africa`,`27`],[`KR`,`South Korea`,`82`],[`SS`,`South Sudan`,`211`],[`ES`,`Spain`,`34`],[`LK`,`Sri Lanka`,`94`],[`BL`,`St. Barthélemy`,`590`],[`SH`,`St. Helena, Ascension & Tristan da Cunha`,`290`],[`KN`,`St. Kitts & Nevis`,`1`],[`LC`,`St. Lucia`,`1`],[`MF`,`St. Martin`,`590`],[`PM`,`St. Pierre & Miquelon`,`508`],[`VC`,`St. Vincent & Grenadines`,`1`],[`SD`,`Sudan`,`249`],[`SR`,`Suriname`,`597`],[`SJ`,`Svalbard & Jan Mayen`,`47`],[`SE`,`Sweden`,`46`],[`CH`,`Switzerland`,`41`],[`SY`,`Syria`,`963`],[`TW`,`Taiwan`,`886`],[`TJ`,`Tajikistan`,`992`],[`TZ`,`Tanzania`,`255`],[`TH`,`Thailand`,`66`],[`TL`,`Timor-Leste`,`670`],[`TG`,`Togo`,`228`],[`TK`,`Tokelau`,`690`],[`TO`,`Tonga`,`676`],[`TT`,`Trinidad & Tobago`,`1`],[`TA`,`Tristan da Cunha`,`290`],[`TN`,`Tunisia`,`216`],[`TR`,`Türkiye`,`90`],[`TM`,`Turkmenistan`,`993`],[`TC`,`Turks & Caicos Islands`,`1`],[`TV`,`Tuvalu`,`688`],[`VI`,`U.S. Virgin Islands`,`1`],[`UG`,`Uganda`,`256`],[`UA`,`Ukraine`,`380`],[`AE`,`United Arab Emirates`,`971`],[`GB`,`United Kingdom`,`44`],[`US`,`United States`,`1`],[`UY`,`Uruguay`,`598`],[`UZ`,`Uzbekistan`,`998`],[`VU`,`Vanuatu`,`678`],[`VA`,`Vatican City`,`39`],[`VE`,`Venezuela`,`58`],[`VN`,`Vietnam`,`84`],[`WF`,`Wallis & Futuna`,`681`],[`EH`,`Western Sahara`,`212`],[`YE`,`Yemen`,`967`],[`ZM`,`Zambia`,`260`],[`ZW`,`Zimbabwe`,`263`]],h=e=>m.find(t=>t[0]===e)?.[2]??``,g={AD:[`Europe/Andorra`],AE:[`Asia/Dubai`],AF:[`Asia/Kabul`],AG:[`America/Antigua`],AI:[`America/Anguilla`],AL:[`Europe/Tirane`],AM:[`Asia/Yerevan`],AO:[`Africa/Luanda`],AR:[`America/Argentina/Buenos_Aires`,`America/Argentina/Catamarca`,`America/Argentina/ComodRivadavia`,`America/Argentina/Cordoba`,`America/Argentina/Jujuy`,`America/Argentina/La_Rioja`,`America/Argentina/Mendoza`,`America/Argentina/Rio_Gallegos`,`America/Argentina/Salta`,`America/Argentina/San_Juan`,`America/Argentina/San_Luis`,`America/Argentina/Tucuman`,`America/Argentina/Ushuaia`,`America/Buenos_Aires`,`America/Catamarca`,`America/Cordoba`,`America/Jujuy`,`America/Mendoza`,`America/Rosario`],AS:[`Pacific/Pago_Pago`,`Pacific/Samoa`,`US/Samoa`],AT:[`Europe/Vienna`],AU:[`Antarctica/Macquarie`,`Australia/Adelaide`,`Australia/Brisbane`,`Australia/Broken_Hill`,`Australia/Canberra`,`Australia/Currie`,`Australia/Darwin`,`Australia/Eucla`,`Australia/Hobart`,`Australia/LHI`,`Australia/Lindeman`,`Australia/Lord_Howe`,`Australia/Melbourne`,`Australia/NSW`,`Australia/North`,`Australia/Perth`,`Australia/Queensland`,`Australia/South`,`Australia/Sydney`,`Australia/Tasmania`,`Australia/Victoria`,`Australia/West`,`Australia/Yancowinna`],AW:[`America/Aruba`],AX:[`Europe/Mariehamn`],AZ:[`Asia/Baku`],BA:[`Europe/Sarajevo`],BB:[`America/Barbados`],BD:[`Asia/Dacca`,`Asia/Dhaka`],BE:[`Europe/Brussels`],BF:[`Africa/Ouagadougou`],BG:[`Europe/Sofia`],BH:[`Asia/Bahrain`],BI:[`Africa/Bujumbura`],BJ:[`Africa/Porto-Novo`],BL:[`America/St_Barthelemy`],BM:[`Atlantic/Bermuda`],BN:[`Asia/Brunei`],BO:[`America/La_Paz`],BQ:[`America/Kralendijk`],BR:[`America/Araguaina`,`America/Bahia`,`America/Belem`,`America/Boa_Vista`,`America/Campo_Grande`,`America/Cuiaba`,`America/Eirunepe`,`America/Fortaleza`,`America/Maceio`,`America/Manaus`,`America/Noronha`,`America/Porto_Acre`,`America/Porto_Velho`,`America/Recife`,`America/Rio_Branco`,`America/Santarem`,`America/Sao_Paulo`,`Brazil/DeNoronha`,`Brazil/East`,`Brazil/West`],BS:[`America/Nassau`],BT:[`Asia/Thimbu`,`Asia/Thimphu`],BW:[`Africa/Gaborone`],BY:[`Europe/Minsk`],BZ:[`America/Belize`],CA:`America/Atikokan.America/Blanc-Sablon.America/Cambridge_Bay.America/Coral_Harbour.America/Creston.America/Dawson.America/Dawson_Creek.America/Edmonton.America/Fort_Nelson.America/Glace_Bay.America/Goose_Bay.America/Halifax.America/Inuvik.America/Iqaluit.America/Moncton.America/Montreal.America/Nipigon.America/Pangnirtung.America/Rainy_River.America/Rankin_Inlet.America/Regina.America/Resolute.America/St_Johns.America/Swift_Current.America/Thunder_Bay.America/Toronto.America/Vancouver.America/Whitehorse.America/Winnipeg.America/Yellowknife.Canada/Atlantic.Canada/Central.Canada/Eastern.Canada/Mountain.Canada/Newfoundland.Canada/Pacific.Canada/Saskatchewan.Canada/Yukon`.split(`.`),CC:[`Indian/Cocos`],CD:[`Africa/Kinshasa`,`Africa/Lubumbashi`],CF:[`Africa/Bangui`],CG:[`Africa/Brazzaville`],CH:[`Europe/Zurich`],CI:[`Africa/Abidjan`],CK:[`Pacific/Rarotonga`],CL:[`America/Coyhaique`,`America/Punta_Arenas`,`America/Santiago`,`Chile/Continental`,`Chile/EasterIsland`,`Pacific/Easter`],CM:[`Africa/Douala`],CN:[`Asia/Chongqing`,`Asia/Harbin`,`Asia/Kashgar`,`Asia/Shanghai`,`Asia/Urumqi`],CO:[`America/Bogota`],CR:[`America/Costa_Rica`],CU:[`America/Havana`],CV:[`Atlantic/Cape_Verde`],CW:[`America/Curacao`],CX:[`Indian/Christmas`],CY:[`Asia/Famagusta`,`Asia/Nicosia`,`Europe/Nicosia`],CZ:[`Europe/Prague`],DE:[`Europe/Berlin`,`Europe/Busingen`],DJ:[`Africa/Djibouti`],DK:[`Europe/Copenhagen`],DM:[`America/Dominica`],DO:[`America/Santo_Domingo`],DZ:[`Africa/Algiers`],EC:[`America/Guayaquil`,`Pacific/Galapagos`],EE:[`Europe/Tallinn`],EG:[`Africa/Cairo`],EH:[`Africa/El_Aaiun`],ER:[`Africa/Asmara`,`Africa/Asmera`],ES:[`Africa/Ceuta`,`Atlantic/Canary`,`Europe/Madrid`],ET:[`Africa/Addis_Ababa`],FI:[`Europe/Helsinki`],FJ:[`Pacific/Fiji`],FK:[`Atlantic/Stanley`],FM:[`Pacific/Chuuk`,`Pacific/Kosrae`,`Pacific/Pohnpei`,`Pacific/Ponape`,`Pacific/Truk`,`Pacific/Yap`],FO:[`Atlantic/Faeroe`,`Atlantic/Faroe`],FR:[`Europe/Paris`],GA:[`Africa/Libreville`],GB:[`Europe/Belfast`,`Europe/London`],GD:[`America/Grenada`],GE:[`Asia/Tbilisi`],GF:[`America/Cayenne`],GG:[`Europe/Guernsey`],GH:[`Africa/Accra`],GI:[`Europe/Gibraltar`],GL:[`America/Danmarkshavn`,`America/Godthab`,`America/Nuuk`,`America/Scoresbysund`,`America/Thule`],GM:[`Africa/Banjul`],GN:[`Africa/Conakry`],GP:[`America/Guadeloupe`],GQ:[`Africa/Malabo`],GR:[`Europe/Athens`],GT:[`America/Guatemala`],GU:[`Pacific/Guam`],GW:[`Africa/Bissau`],GY:[`America/Guyana`],HK:[`Asia/Hong_Kong`],HN:[`America/Tegucigalpa`],HR:[`Europe/Zagreb`],HT:[`America/Port-au-Prince`],HU:[`Europe/Budapest`],ID:[`Asia/Jakarta`,`Asia/Jayapura`,`Asia/Makassar`,`Asia/Pontianak`,`Asia/Ujung_Pandang`],IE:[`Europe/Dublin`],IL:[`Asia/Jerusalem`,`Asia/Tel_Aviv`],IM:[`Europe/Isle_of_Man`],IN:[`Asia/Calcutta`,`Asia/Kolkata`],IO:[`Indian/Chagos`],IQ:[`Asia/Baghdad`],IR:[`Asia/Tehran`],IS:[`Atlantic/Reykjavik`],IT:[`Europe/Rome`],JE:[`Europe/Jersey`],JM:[`America/Jamaica`],JO:[`Asia/Amman`],JP:[`Asia/Tokyo`],KE:[`Africa/Nairobi`],KG:[`Asia/Bishkek`],KH:[`Asia/Phnom_Penh`],KI:[`Pacific/Enderbury`,`Pacific/Kanton`,`Pacific/Kiritimati`,`Pacific/Tarawa`],KM:[`Indian/Comoro`],KN:[`America/St_Kitts`],KP:[`Asia/Pyongyang`],KR:[`Asia/Seoul`],KW:[`Asia/Kuwait`],KY:[`America/Cayman`],KZ:[`Asia/Almaty`,`Asia/Aqtau`,`Asia/Aqtobe`,`Asia/Atyrau`,`Asia/Oral`,`Asia/Qostanay`,`Asia/Qyzylorda`],LA:[`Asia/Vientiane`],LB:[`Asia/Beirut`],LC:[`America/St_Lucia`],LI:[`Europe/Vaduz`],LK:[`Asia/Colombo`],LR:[`Africa/Monrovia`],LS:[`Africa/Maseru`],LT:[`Europe/Vilnius`],LU:[`Europe/Luxembourg`],LV:[`Europe/Riga`],LY:[`Africa/Tripoli`],MA:[`Africa/Casablanca`],MC:[`Europe/Monaco`],MD:[`Europe/Chisinau`,`Europe/Tiraspol`],ME:[`Europe/Podgorica`],MF:[`America/Marigot`],MG:[`Indian/Antananarivo`],MH:[`Pacific/Kwajalein`,`Pacific/Majuro`],MK:[`Europe/Skopje`],ML:[`Africa/Bamako`,`Africa/Timbuktu`],MM:[`Asia/Rangoon`,`Asia/Yangon`],MN:[`Asia/Choibalsan`,`Asia/Hovd`,`Asia/Ulaanbaatar`,`Asia/Ulan_Bator`],MO:[`Asia/Macao`,`Asia/Macau`],MP:[`Pacific/Saipan`],MQ:[`America/Martinique`],MR:[`Africa/Nouakchott`],MS:[`America/Montserrat`],MT:[`Europe/Malta`],MU:[`Indian/Mauritius`],MV:[`Indian/Maldives`],MW:[`Africa/Blantyre`],MX:[`America/Bahia_Banderas`,`America/Cancun`,`America/Chihuahua`,`America/Ciudad_Juarez`,`America/Ensenada`,`America/Hermosillo`,`America/Matamoros`,`America/Mazatlan`,`America/Merida`,`America/Mexico_City`,`America/Monterrey`,`America/Ojinaga`,`America/Santa_Isabel`,`America/Tijuana`,`Mexico/BajaNorte`,`Mexico/BajaSur`,`Mexico/General`],MY:[`Asia/Kuala_Lumpur`,`Asia/Kuching`],MZ:[`Africa/Maputo`],NA:[`Africa/Windhoek`],NC:[`Pacific/Noumea`],NE:[`Africa/Niamey`],NF:[`Pacific/Norfolk`],NG:[`Africa/Lagos`],NI:[`America/Managua`],NL:[`Europe/Amsterdam`],NO:[`Europe/Oslo`],NP:[`Asia/Kathmandu`,`Asia/Katmandu`],NR:[`Pacific/Nauru`],NU:[`Pacific/Niue`],NZ:[`Pacific/Auckland`,`Pacific/Chatham`],OM:[`Asia/Muscat`],PA:[`America/Panama`],PE:[`America/Lima`],PF:[`Pacific/Gambier`,`Pacific/Marquesas`,`Pacific/Tahiti`],PG:[`Pacific/Bougainville`,`Pacific/Port_Moresby`],PH:[`Asia/Manila`],PK:[`Asia/Karachi`],PL:[`Europe/Warsaw`],PM:[`America/Miquelon`],PR:[`America/Puerto_Rico`],PS:[`Asia/Gaza`,`Asia/Hebron`],PT:[`Atlantic/Azores`,`Atlantic/Madeira`,`Europe/Lisbon`],PW:[`Pacific/Palau`],PY:[`America/Asuncion`],QA:[`Asia/Qatar`],RE:[`Indian/Reunion`],RO:[`Europe/Bucharest`],RS:[`Europe/Belgrade`],RU:`Asia/Anadyr.Asia/Barnaul.Asia/Chita.Asia/Irkutsk.Asia/Kamchatka.Asia/Khandyga.Asia/Krasnoyarsk.Asia/Magadan.Asia/Novokuznetsk.Asia/Novosibirsk.Asia/Omsk.Asia/Sakhalin.Asia/Srednekolymsk.Asia/Tomsk.Asia/Ust-Nera.Asia/Vladivostok.Asia/Yakutsk.Asia/Yekaterinburg.Europe/Astrakhan.Europe/Kaliningrad.Europe/Kirov.Europe/Moscow.Europe/Samara.Europe/Saratov.Europe/Ulyanovsk.Europe/Volgograd`.split(`.`),RW:[`Africa/Kigali`],SA:[`Asia/Riyadh`],SB:[`Pacific/Guadalcanal`],SC:[`Indian/Mahe`],SD:[`Africa/Khartoum`],SE:[`Europe/Stockholm`],SG:[`Asia/Singapore`],SH:[`Atlantic/St_Helena`],SI:[`Europe/Ljubljana`],SJ:[`Arctic/Longyearbyen`,`Atlantic/Jan_Mayen`],SK:[`Europe/Bratislava`],SL:[`Africa/Freetown`],SM:[`Europe/San_Marino`],SN:[`Africa/Dakar`],SO:[`Africa/Mogadishu`],SR:[`America/Paramaribo`],SS:[`Africa/Juba`],ST:[`Africa/Sao_Tome`],SV:[`America/El_Salvador`],SX:[`America/Lower_Princes`],SY:[`Asia/Damascus`],SZ:[`Africa/Mbabane`],TC:[`America/Grand_Turk`],TD:[`Africa/Ndjamena`],TG:[`Africa/Lome`],TH:[`Asia/Bangkok`],TJ:[`Asia/Dushanbe`],TK:[`Pacific/Fakaofo`],TL:[`Asia/Dili`],TM:[`Asia/Ashgabat`,`Asia/Ashkhabad`],TN:[`Africa/Tunis`],TO:[`Pacific/Tongatapu`],TR:[`Asia/Istanbul`,`Europe/Istanbul`],TT:[`America/Port_of_Spain`],TV:[`Pacific/Funafuti`],TW:[`Asia/Taipei`],TZ:[`Africa/Dar_es_Salaam`],UA:[`Europe/Kiev`,`Europe/Kyiv`,`Europe/Simferopol`,`Europe/Uzhgorod`,`Europe/Zaporozhye`],UG:[`Africa/Kampala`],US:`America/Adak.America/Anchorage.America/Atka.America/Boise.America/Chicago.America/Denver.America/Detroit.America/Fort_Wayne.America/Indiana/Indianapolis.America/Indiana/Knox.America/Indiana/Marengo.America/Indiana/Petersburg.America/Indiana/Tell_City.America/Indiana/Vevay.America/Indiana/Vincennes.America/Indiana/Winamac.America/Indianapolis.America/Juneau.America/Kentucky/Louisville.America/Kentucky/Monticello.America/Knox_IN.America/Los_Angeles.America/Louisville.America/Menominee.America/Metlakatla.America/New_York.America/Nome.America/North_Dakota/Beulah.America/North_Dakota/Center.America/North_Dakota/New_Salem.America/Phoenix.America/Shiprock.America/Sitka.America/Yakutat.Pacific/Honolulu.US/Alaska.US/Aleutian.US/Arizona.US/Central.US/East-Indiana.US/Eastern.US/Hawaii.US/Indiana-Starke.US/Michigan.US/Mountain.US/Pacific`.split(`.`),UY:[`America/Montevideo`],UZ:[`Asia/Samarkand`,`Asia/Tashkent`],VA:[`Europe/Vatican`],VC:[`America/St_Vincent`],VE:[`America/Caracas`],VG:[`America/Tortola`],VI:[`America/St_Thomas`,`America/Virgin`],VN:[`Asia/Ho_Chi_Minh`,`Asia/Saigon`],VU:[`Pacific/Efate`],WF:[`Pacific/Wallis`],WS:[`Pacific/Apia`],YE:[`Asia/Aden`],YT:[`Indian/Mayotte`],ZA:[`Africa/Johannesburg`],ZM:[`Africa/Lusaka`],ZW:[`Africa/Harare`]},_=new Set(m.map(([e])=>e)),v=new Map;for(let[e,t]of Object.entries(g))for(let n of t)v.set(n,e);function y(e){let t=e===void 0?void 0:v.get(e);return t&&_.has(t)?t:null}function b(e){if(!e)return null;let t;try{t=new Intl.Locale(e).region}catch{return null}return t&&_.has(t)?t:null}function x(){let e;try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{e=void 0}let t=typeof navigator>`u`?void 0:navigator.language;return y(e)||b(t)||null}var S=`ui-phone.global.js`;function C(){return window.WeborityPhone?Promise.resolve(window.WeborityPhone):new Promise((e,t)=>{let n=document.querySelector(`script[src*="${S}"]`);if(!n){let e=document.createElement(`script`);try{e.src=(0,l.assetUrl)(S)}catch(e){t(e);return}document.head.append(e),n=e}n.addEventListener(`load`,()=>window.WeborityPhone?e(window.WeborityPhone):t(Error(`The phone metadata script did not load.`))),n.addEventListener(`error`,()=>t(Error(`The phone metadata script failed to load.`)))})}function w(e,t){return e.isSupportedCountry(t)}var T=e=>e?`wui-flag wui-flag-${String(e).toLowerCase()}`:`wui-flag`,E=e=>e?`+${h(e)}`:``,D=null,O=null;function k(){return D?Promise.resolve(D):(O||=C().then(e=>(D=e,D)).catch(e=>((0,r.devError)(`[@webority/ui-elements] <wui-phone> could not load its phone number metadata.`,e),null)),O)}function A(e,t){let n=`+${h(e)}`;return t?.startsWith(n)?t.slice(n.length).trimStart():null}function j(e,t){if(!D||!t||!e||!w(D,e))return t;try{return A(e,new D.AsYouType(e).input(`+${h(e)}${t}`))||t}catch{return t}}function M(e,t){if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(/[0-9]/.test(e[r]??``)&&(n+=1,n===t))return r+1;return e.length}function N(e){if(!D||!e||!w(D,e))return null;try{return A(e,D.getExampleNumber(e,D.examples)?.formatInternational())||null}catch{return null}}function P(e){let t=N(e);return t?`For example ${t}`:null}function F(e){if(!D||!e)return null;try{if(!D.isValidPhoneNumber(e))return!1;let t=D.parsePhoneNumber(e)?.getType?.();return t===void 0||t===`MOBILE`||t===`FIXED_LINE_OR_MOBILE`}catch{return null}}function I(e){if(!D||!e||!w(D,e))return null;try{let t=D.getExampleNumber(e,D.examples);return t?.nationalNumber?t.nationalNumber.length:null}catch{return null}}function L(e,t,n){if(!D||!w(D,e))return null;try{let r=D.parsePhoneNumber(t,e),i=r?.nationalNumber;return!i||r.country!==e||i.length>n||!t.endsWith(i)?null:i}catch{return null}}function R(e){if(!D||!e?.trim().startsWith(`+`))return null;try{let t=new D.AsYouType;t.input(e.trim());let n=t.getCountry();return!n||!W(t)?null:{country:n,national:t.getNationalNumber()||``}}catch{return null}}function z(e,t){let n=String(t??``).trim();if(!n.startsWith(`+`))return null;let r=n.replace(/[^0-9]/g,``),i=String(h(e));return{country:e,national:r.startsWith(i)?r.slice(i.length):r}}var B=class extends i.ElementBase{static formAssociated=!0;static get observedAttributes(){return[`value`,`country`,`locked-country`,`placeholder`,`disabled`,`readonly`,`loading`,`required`,`aria-label`,`aria-describedby`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._defaultCountry=x()||``,this._country=this._defaultCountry,this._national=``,this._active=-1,this._committedValue=``,this._validateOnInput=!1}connectedCallback(){this._rendered?this._bindGlobal?.():this.render()}attributeChangedCallback(e,t,n){if(e===`value`)this.value=n;else if(this._rendered){if(e===`aria-label`){let t=this.querySelector(`input[type=tel]`);t&&(n==null?t.removeAttribute(e):t.setAttribute(e,n))}else if(e===`aria-describedby`)this._syncDescribedBy();else if(e===`country`){if(this._locked)return;let e=this.value;if(this._country=n||this._defaultCountry,this._suppressCountryRender)return;this.render(),this.value!==e&&(this._emitInput(),this._emitChange())}else this.render()}}formResetCallback(){this._validateOnInput=!1,this.value=this._defaultValue||``}get _locked(){return(this.getAttribute(`locked-country`)||``).toUpperCase()||null}get value(){return this._national&&this._country?`+${h(this._country)}${this._national}`:``}set value(e){let t=String(e??``).trim();this._locked&&(this._country=this._locked);let n=this._locked?null:R(t);if(n)this._country=n.country,this._national=n.national.replace(/[^0-9]/g,``);else if(t.startsWith(`+`)){let e=t.replace(/[^0-9]/g,``),n=String(h(this._locked||this.getAttribute(`country`)||this._country));n&&e.startsWith(n)&&(e=e.slice(n.length)),this._national=e}else this._national=t.replace(/[^0-9]/g,``);n&&this.getAttribute(`country`)!==this._country?this.setAttribute(`country`,this._country):this._rendered&&this.render(),this._committedValue=this.value,this._syncMirror()}_syncMirror(){(0,o.syncFormMirror)(this,this.value)}_syncDescribedBy(){let e=this.querySelector(`input[type=tel]`);if(!e)return;let t=[this.getAttribute(`aria-describedby`),this.querySelector(`[data-phone-error]`)?.id].filter(Boolean);t.length?e.setAttribute(`aria-describedby`,t.join(` `)):e.removeAttribute(`aria-describedby`)}_emitInput(){this.dispatchEvent(new Event(`input`,{bubbles:!0}))}_emitChange(){this._committedValue=this.value,this.dispatchEvent(new Event(`change`,{bubbles:!0}))}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``),this._country=this._locked||this.getAttribute(`country`)||this._country;let e=this.getAttribute(`placeholder`)||P(this._country)||`Enter phone number`;this.id||=`wui-phone-${Math.random().toString(36).slice(2,9)}`;let t=`${this.id}-listbox`;this._listboxId=t;let n=this._locked?`<div class="phone-country-adornment"><span class="wui-phone-prefix"><span class="${T(this._country)}" data-flag aria-hidden="true"></span><span class="phone-dial" data-dial>${E(this._country)}</span></span></div>`:`<div class="phone-country-adornment">
|
|
2
|
+
<button type="button" class="country-toggle" aria-label="Choose country" aria-haspopup="listbox" aria-expanded="false" aria-controls="${G(t)}"${this.hasAttribute(`disabled`)?` disabled`:``}>
|
|
3
|
+
<span class="${T(this._country)}" data-flag aria-hidden="true"></span>
|
|
4
|
+
${(0,s.glyphSvg)(`chevron-down`,{className:`phone-chevron`})}
|
|
5
|
+
<span class="phone-dial" data-dial>${E(this._country)}</span>
|
|
6
6
|
</button>
|
|
7
7
|
<div class="country-dropdown-menu" hidden>
|
|
8
|
-
<div class="dropdown-search-wrapper"><span class="dropdown-search-icon">${(0,
|
|
9
|
-
<div class="country-list-scroll" role="listbox" id="${
|
|
8
|
+
<div class="dropdown-search-wrapper"><span class="dropdown-search-icon">${(0,s.glyphSvg)(`search`)}</span><input type="text" class="dropdown-search-input" placeholder="Search country or code" aria-label="Search countries" aria-controls="${G(t)}" aria-autocomplete="list" /></div>
|
|
9
|
+
<div class="country-list-scroll" role="listbox" id="${G(t)}" tabindex="-1"></div>
|
|
10
10
|
<div class="country-empty" hidden>No countries found</div>
|
|
11
11
|
</div>
|
|
12
12
|
</div>`;this.innerHTML=`
|
|
13
13
|
<div class="phone-input-wrap">
|
|
14
14
|
${n}
|
|
15
|
-
<input type="tel" class="input" placeholder="${
|
|
16
|
-
</div>`,this._rendered=!0,(0,
|
|
15
|
+
<input type="tel" class="input" placeholder="${G(e)}" value="${G(j(this._country,this._national))}"${this.getAttribute(`aria-label`)?` aria-label="${G(this.getAttribute(`aria-label`))}"`:``}${this.getAttribute(`aria-describedby`)?` aria-describedby="${G(this.getAttribute(`aria-describedby`))}"`:``}${this.hasAttribute(`required`)?` required aria-required="true"`:``}${this.hasAttribute(`disabled`)?` disabled`:``}${(0,a.isInert)(this)?` readonly`:``} />
|
|
16
|
+
</div>`,this._rendered=!0,(0,a.syncFieldState)(this,this.querySelector(`input.input`)),(0,o.syncFormMirror)(this,this.value),this._wire()}_ensureItems(){let e=H(this.querySelector(`.country-list-scroll`),HTMLElement);if(!e||e.querySelector(`.country-dropdown-item`))return;let t=this._listboxId,n=m.map(([e,n,r],i)=>`<button type="button" role="option" id="${G(`${t}-opt-${i}`)}" class="country-dropdown-item${e===this._country?` selected`:``}" data-iso="${e}" aria-selected="${e===this._country}"><span class="${T(e)}" aria-hidden="true"></span><span class="country-name-text">${n}<span class="country-code-text">+${r}</span></span></button>`).join(``);e.insertAdjacentHTML(`afterbegin`,n)}_itemEls(){return[...this.querySelectorAll(`.country-dropdown-item`)].filter(e=>e instanceof HTMLElement)}_visibleItems(){return this._itemEls().filter(e=>!e.hidden)}_wire(){this._teardown();let e=H(this.querySelector(`.country-toggle`),HTMLButtonElement),t=V(H(this.querySelector(`.phone-input-wrap`),HTMLElement),`phone input wrapper`),r=H(this.querySelector(`.country-dropdown-menu`),HTMLElement),i=H(this.querySelector(`.dropdown-search-input`),HTMLInputElement),o=H(this.querySelector(`.country-list-scroll`),HTMLElement),s=H(this.querySelector(`.country-empty`),HTMLElement),l=V(H(this.querySelector(`input[type=tel]`),HTMLInputElement),`phone input`),u=H(this.querySelector(`[data-flag]`),HTMLElement),d=H(this.querySelector(`[data-dial]`),HTMLElement),f=()=>!!r&&!V(r,`country menu`).hidden,p=()=>{(0,n.anchorOverlay)(t||e,r)},m=(e,{reveal:t=!0}={})=>{let n=this._visibleItems();this._active=e,(0,c.moveActiveRow)(V(o,`country list`),e>=0&&n[e]||null);let r=e>=0?n[e]:void 0;r?(t&&r.scrollIntoView({block:`nearest`}),i?.setAttribute(`aria-activedescendant`,r.id)):i?.removeAttribute(`aria-activedescendant`)},g=()=>{f()&&p()},_=()=>{if((0,a.isInert)(this))return;this._ensureItems(),V(r,`country menu`).hidden=!1,V(e,`country toggle`).setAttribute(`aria-expanded`,`true`);let t=V(i,`country search`);t.value=``,y(``),p(),(0,n.bindReanchor)(this,g),t.focus(),m(this._visibleItems().findIndex(e=>e.classList.contains(`selected`)))},v=()=>{V(r,`country menu`).hidden=!0,V(e,`country toggle`).setAttribute(`aria-expanded`,`false`),m(-1),(0,n.unbindReanchor)(this)},y=e=>{let t=e.trim().toLowerCase(),n=0;for(let e of this._itemEls()){let r=!t||(e.textContent??``).toLowerCase().includes(t);e.hidden=!r,r&&(n+=1)}s&&(s.hidden=n>0)},b=e=>{this._country=e,this.getAttribute(`country`)!==e&&(this._suppressCountryRender=!0,this.setAttribute(`country`,e),this._suppressCountryRender=!1),u&&(u.className=T(e)),d&&(d.textContent=`+${h(e)}`);for(let t of this._itemEls()){let n=t.dataset.iso===e;t.classList.toggle(`selected`,n),t.setAttribute(`aria-selected`,String(n))}this.getAttribute(`placeholder`)||(l.placeholder=P(e)||`Enter phone number`),this._national&&(l.value=j(e,this._national)),v(),this._syncMirror(),this._emitChange(),this._validateOnInput&&S(C()),l.focus()},x=t=>{let n=this._visibleItems();if(t.key===`ArrowDown`){if(t.preventDefault(),!f()){_();return}m(Math.min(this._active+1,n.length-1))}else if(t.key===`ArrowUp`){if(t.preventDefault(),!f())return;m(Math.max(this._active-1,0))}else if(t.key===`Enter`){t.preventDefault();let e=n[this._active];f()&&e?.dataset.iso&&b(e.dataset.iso)}else t.key===`Escape`&&f()&&(t.preventDefault(),t.stopPropagation(),v(),V(e,`country toggle`).focus())};e?.addEventListener(`click`,()=>f()?v():_()),e?.addEventListener(`keydown`,e=>{f()?x(e):(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_())}),i&&i.addEventListener(`input`,()=>{y(i.value);let e=this._visibleItems();m(e.length?0:-1)}),o?.addEventListener(`click`,e=>{let t=H(U(e).closest(`.country-dropdown-item`),HTMLElement);t?.dataset.iso&&b(t.dataset.iso)}),o?.addEventListener(`mousemove`,e=>{let t=H(U(e).closest(`.country-dropdown-item`),HTMLElement);t&&!t.classList.contains(`is-active`)&&m(this._visibleItems().indexOf(t),{reveal:!1})}),o?.addEventListener(`mouseleave`,()=>m(-1)),r?.addEventListener(`keydown`,x);let S=e=>{l.classList.toggle(`is-invalid`,e),e?l.setAttribute(`aria-invalid`,`true`):l.removeAttribute(`aria-invalid`);let n=H(this.querySelector(`[data-phone-error]`),HTMLElement);if(e&&!this.hasAttribute(`external-error`)){n||(n=document.createElement(`div`),n.className=`field-error`,n.id=`${this.id}-phone-error`,n.setAttribute(`data-phone-error`,``),t.after(n));let e=N(this._country);n.textContent=this._country?e?`Enter a valid phone number, e.g. ${e}`:`Enter a valid phone number`:`Choose a country`}else n?.remove();this._syncDescribedBy()},C=()=>this._national.length>0&&(!this._country||F(this.value)===!1);l.addEventListener(`input`,e=>{e.stopPropagation();let t=l.selectionStart??l.value.length,n=l.value.slice(0,t).replace(/[^0-9]/g,``).length,r=l.value.replace(/[^0-9]/g,``),i=I(this._country);if(i&&r.length>i){let e=L(this._country,r,i);e?(n=Math.max(0,n-(r.length-e.length)),r=e):r=r.slice(0,i)}this._national=r;let a=j(this._country,this._national);if(l.value!==a){l.value=a;let e=M(a,Math.min(n,r.length));l.setSelectionRange(e,e)}this._syncMirror(),this._emitInput(),this._validateOnInput&&S(C())}),l.addEventListener(`change`,e=>e.stopPropagation()),l.addEventListener(`blur`,()=>{let e=C();S(e),e&&(this._validateOnInput=!0),this.value!==this._committedValue&&this._emitChange()}),l.addEventListener(`paste`,e=>{let t=e.clipboardData?.getData(`text`),n=this._locked?z(this._locked,t):R(t);n&&(e.preventDefault(),this._national=n.national.replace(/[^0-9]/g,``),n.country===this._country?l.value=j(this._country,this._national):(this._country=n.country,this.setAttribute(`country`,n.country)),this._syncMirror(),this._emitInput(),this._emitChange(),this._validateOnInput&&l.isConnected&&S(C()),H(this.querySelector(`input[type=tel]`),HTMLInputElement)?.focus())}),this._bindGlobal=()=>{this._teardownGlobals?.(),this._onDocClick=e=>{f()&&!e.composedPath().includes(this)&&v()},document.addEventListener(`click`,this._onDocClick),f()&&(0,n.bindReanchor)(this,g)},this._teardownGlobals=()=>{this._onDocClick&&=(document.removeEventListener(`click`,this._onDocClick),null),(0,n.unbindReanchor)(this)},this._bindGlobal(),this._validateOnInput&&S(C()),k().then(e=>{if(e&&l.isConnected&&(this._national&&(l.value=j(this._country,this._national)),!this.getAttribute(`placeholder`))){let e=P(this._country);e&&(l.placeholder=e)}}),this._syncMirror()}_teardown(){this._teardownGlobals?.()}disconnectedCallback(){this._teardown()}};function V(e,t){if(e==null)throw Error(`${t} missing`);return e}function H(e,t){return e instanceof t?e:null}function U(e){if(!(e.target instanceof Element))throw Error(`Event target is not an element`);return e.target}function W(e){return`getNationalNumber`in e&&typeof e.getNationalNumber==`function`}var G=e=>String(e??``).replace(/"/g,`"`).replace(/</g,`<`);(0,t.defineElement)(`wui-phone`,B);var K=f({default:()=>Q}),q=/^\+?\d+$/,J=e=>String(e??``).split(`,`).map(e=>e.trim().toUpperCase()).filter(Boolean),Y=e=>{let t=J(e.getAttribute(`countries`)),n=t.length?new Set(t):null,r=m.filter(([e])=>!n||n.has(e)),i=new Map(r.map(e=>[e[0],e])),a=[...new Set(J(e.getAttribute(`suggested`)))].map(e=>i.get(e)).filter(e=>e!==void 0);if(!a.length)return r.map(e=>({tuple:e,group:null}));let o=new Set(a.map(e=>e[0])),s=e.getAttribute(`suggested-label`)||`Suggested`,c=e.getAttribute(`all-countries-label`)||`All countries`;return[...a.map(e=>({tuple:e,group:s})),...r.filter(e=>!o.has(e[0])).map(e=>({tuple:e,group:c}))]},X=({tuple:[e,t,n],group:r})=>({value:e,label:t,flag:e,meta:`+${n}`,...r?{group:r}:{}}),Z=([,e,t],n)=>n?q.test(n)?t.startsWith(n.replace(`+`,``)):e.toLowerCase().includes(n):!0;function Q(){let e,t=[];return{mount(n){e=n,t=Y(n),n.setPartOptions(t.map(X))},onQuery(n){let r=n.trim().toLowerCase();return e.setPartOptions(t.filter(e=>Z(e.tuple,r)).map(X)),!0},teardown(){}}}(0,u.registerSelectPart)(`country`,K),e.WuiPhone=B})(this.WeborityUiElements=this.WeborityUiElements||{},WeborityUiElementsInternal.modules.defineElement,WeborityUiElementsInternal.modules.anchorOverlay,WeborityUiElementsInternal.modules.devWarn,WeborityUiElementsInternal.modules.elementBase,WeborityUiElementsInternal.modules.fieldState,WeborityUiElementsInternal.modules.formMirror,WeborityUiElementsInternal.modules.iconGlyphs,WeborityUiElementsInternal.modules.listboxKeyNav,WeborityUiElementsInternal.modules.loader,WeborityUiElementsInternal.modules.partRegistry);
|