@dso-toolkit/core 88.1.1 → 90.0.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/bundle/dso-accordion-section.js +22 -30
- package/dist/bundle/dso-accordion.js +1 -4
- package/dist/bundle/dso-action-list-item.js +2 -5
- package/dist/bundle/dso-action-list.js +2 -5
- package/dist/bundle/dso-advanced-select.js +474 -69
- package/dist/bundle/dso-alert.js +1 -4
- package/dist/bundle/dso-annotation-activiteit.js +12 -15
- package/dist/bundle/dso-annotation-gebiedsaanwijzing.js +11 -14
- package/dist/bundle/dso-annotation-kaart.js +7 -10
- package/dist/bundle/dso-annotation-locatie.js +1 -4
- package/dist/bundle/dso-annotation-omgevingsnormwaarde.js +12 -15
- package/dist/bundle/dso-attachments-counter.js +1 -4
- package/dist/bundle/dso-autosuggest.js +31 -44
- package/dist/bundle/dso-badge.js +1 -4
- package/dist/bundle/dso-banner.js +1 -4
- package/dist/bundle/dso-button-group.js +1 -4
- package/dist/bundle/dso-card-container.js +1 -4
- package/dist/bundle/dso-card.js +4 -8
- package/dist/bundle/dso-contact-information.js +1 -4
- package/dist/bundle/dso-cursor-tooltip.js +2 -5
- package/dist/bundle/dso-date-picker.js +3 -7
- package/dist/bundle/dso-document-card.js +3 -7
- package/dist/bundle/dso-document-component.js +1 -4
- package/dist/bundle/dso-dropdown-menu.js +1 -4
- package/dist/bundle/dso-expandable.js +1 -4
- package/dist/bundle/dso-header.js +17 -19
- package/dist/bundle/dso-highlight-box.js +2 -6
- package/dist/bundle/dso-history-item.js +5 -9
- package/dist/bundle/dso-icon-button.js +1 -4
- package/dist/bundle/dso-icon.js +1 -4
- package/dist/bundle/dso-image-overlay.js +1 -4
- package/dist/bundle/dso-info-button.js +1 -4
- package/dist/bundle/dso-info.js +1 -4
- package/dist/bundle/dso-input-range.js +2 -5
- package/dist/bundle/dso-label.js +1 -4
- package/dist/bundle/dso-legend-group.d.ts +11 -0
- package/dist/bundle/dso-legend-group.js +107 -0
- package/dist/bundle/dso-legend-item.js +62 -34
- package/dist/bundle/dso-legend.js +24 -14
- package/dist/bundle/dso-list-button.js +12 -380
- package/dist/bundle/dso-logo.js +4 -145
- package/dist/bundle/dso-map-base-layers.js +12 -16
- package/dist/bundle/dso-map-controls.js +18 -1187
- package/dist/bundle/dso-map-layer-object.js +3 -6
- package/dist/bundle/dso-map-layer.js +3 -6
- package/dist/bundle/dso-map-overlays.js +12 -16
- package/dist/bundle/dso-mark-bar.js +7 -11
- package/dist/bundle/dso-modal.js +10 -16
- package/dist/bundle/dso-onboarding-tip.js +10 -16
- package/dist/bundle/dso-ozon-content-toggletip.js +1 -4
- package/dist/bundle/dso-ozon-content.js +1 -4
- package/dist/bundle/dso-pagination.js +8 -11
- package/dist/bundle/dso-panel.js +1 -4
- package/dist/bundle/dso-plekinfo-card.js +5 -9
- package/dist/bundle/dso-progress-indicator.js +1 -4
- package/dist/bundle/dso-project-item.js +7 -10
- package/dist/bundle/dso-renvooi.js +1 -4
- package/dist/bundle/dso-responsive-element.js +1 -4
- package/dist/bundle/dso-scrollable.js +1 -4
- package/dist/bundle/dso-segmented-button.d.ts +11 -0
- package/dist/bundle/dso-segmented-button.js +59 -0
- package/dist/bundle/dso-selectable.js +1 -4
- package/dist/bundle/dso-skiplink.js +4 -7
- package/dist/bundle/dso-slide-toggle.js +1 -4
- package/dist/bundle/dso-survey-rating.js +8 -612
- package/dist/bundle/dso-tab.js +3 -7
- package/dist/bundle/dso-table.js +1 -4
- package/dist/bundle/dso-tabs.js +7 -14
- package/dist/bundle/dso-tijdreis-banner.js +4 -7
- package/dist/bundle/dso-toggletip.js +107 -4
- package/dist/bundle/dso-tooltip.js +1 -4
- package/dist/bundle/dso-tree-view.js +15 -26
- package/dist/bundle/dso-viewer-grid.js +30 -617
- package/dist/bundle/dsot-document-component-demo.js +41 -42
- package/dist/bundle/index.d.ts +2 -0
- package/dist/bundle/index.js +6 -5
- package/dist/bundle/{p-CVTNNCuw.js → p-0JNed3EY.js} +15 -23
- package/dist/bundle/p-B6OelUh-.js +172 -0
- package/dist/bundle/{p-VxbAefvg.js → p-BDvMDDCP.js} +5 -8
- package/dist/bundle/p-BNhgCEjt.js +83 -0
- package/dist/bundle/p-BVZJjDvd.js +313 -0
- package/dist/bundle/{p-DVDxAvhs.js → p-BW1PprKl.js} +4 -7
- package/dist/bundle/{p-CodDyi2J.js → p-BWkWD1Z2.js} +1 -5
- package/dist/bundle/{p-kBBh-4zI.js → p-Bbf_KhJ-.js} +2 -5
- package/dist/{esm/floating-ui.dom-C1uSuLE3.js → bundle/p-BgyqGgJ8.js} +79 -76
- package/dist/bundle/{p-Bl7SFp3l.js → p-BrjfgYHu.js} +1 -4
- package/dist/bundle/{p-C0j2UArC.js → p-Bu6cCiCZ.js} +6 -9
- package/dist/bundle/p-ByAqDYup.js +35 -0
- package/dist/bundle/{p-DJ_Iuzp2.js → p-BzrfS3rM.js} +3 -6
- package/dist/bundle/p-C3e8S8uz.js +98 -0
- package/dist/bundle/{p-BFAmNPH7.js → p-CVa_Zw1m.js} +2 -6
- package/dist/bundle/p-CYWYJZS6.js +123 -0
- package/dist/bundle/p-C_akviUd.js +0 -3
- package/dist/bundle/{p-BOYwoGz-.js → p-CdS6sfbr.js} +5 -8
- package/dist/bundle/p-ChV9xqsO.js +0 -3
- package/dist/bundle/{p-DGOjLHXF.js → p-Co2uuask.js} +1 -4
- package/dist/bundle/p-DE7WGgpi.js +825 -0
- package/dist/bundle/p-DHnYupzr.js +7 -0
- package/dist/bundle/{p-dcbs8fsg.js → p-DU9IRZ6t.js} +8 -13
- package/dist/bundle/{p-CkRbdaNs.js → p-DdtY48K7.js} +7 -6
- package/dist/bundle/p-Dgducv6v.js +137 -0
- package/dist/bundle/p-DiyFr3Np.js +1208 -0
- package/dist/bundle/{p-DhBq2NpP.js → p-DkVKF9Hp.js} +3 -6
- package/dist/bundle/{p-DBWrx_3r.js → p-DmmKAUIT.js} +643 -478
- package/dist/bundle/p-DnEMX0HG.js +85 -0
- package/dist/bundle/{p-CBhOl8xD.js → p-DzcBPvon.js} +32 -28
- package/dist/{esm/i18n-pxiVAmq4.js → bundle/p-FXEjFTzg.js} +37 -10
- package/dist/bundle/p-Hgv-pDpy.js +0 -3
- package/dist/bundle/{p-DDSMs62-.js → p-PsHl6ZhV.js} +11 -21
- package/dist/bundle/p-baWVwd8J.js +0 -3
- package/dist/bundle/{p-BgkOiu3z.js → p-cIXis8_E.js} +17 -20
- package/dist/bundle/{p-ecEmdirb.js → p-cvGwDktk.js} +10 -11
- package/dist/bundle/{p-BWiGIQ1w.js → p-srgNz1ix.js} +3 -7
- package/dist/bundle/{p-DrTyWXYp.js → p-uBQHEbAs.js} +41 -45
- package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +0 -3
- package/dist/cjs/{annotation-body-BSApfNFT.js → annotation-body-RMdkmeDi.js} +1 -4
- package/dist/cjs/annotation-list-renvooi-values-yougabBy.js +9 -0
- package/dist/cjs/{annotation-watcher-BEOlrh84.js → annotation-watcher-CRuL5p8N.js} +1 -4
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -3
- package/dist/cjs/clsx-BtxeOLZW.js +0 -3
- package/dist/cjs/dso-accordion-section.cjs.entry.js +14 -20
- package/dist/cjs/dso-accordion.cjs.entry.js +1 -2
- package/dist/cjs/dso-action-list-item.cjs.entry.js +1 -2
- package/dist/cjs/dso-action-list.cjs.entry.js +2 -3
- package/dist/cjs/dso-advanced-select.cjs.entry.js +468 -61
- package/dist/cjs/dso-alert_7.cjs.entry.js +98 -4049
- package/dist/cjs/dso-annotation-activiteit.cjs.entry.js +5 -6
- package/dist/cjs/dso-annotation-gebiedsaanwijzing.cjs.entry.js +4 -5
- package/dist/cjs/dso-annotation-kaart.cjs.entry.js +3 -4
- package/dist/cjs/dso-annotation-locatie_2.cjs.entry.js +20 -1434
- package/dist/cjs/dso-annotation-omgevingsnormwaarde.cjs.entry.js +5 -6
- package/dist/cjs/dso-attachments-counter_2.cjs.entry.js +4 -3
- package/dist/cjs/dso-autosuggest.cjs.entry.js +25 -38
- package/dist/cjs/dso-banner.cjs.entry.js +1 -2
- package/dist/cjs/dso-button-group.cjs.entry.js +2 -4
- package/dist/cjs/dso-card-container.cjs.entry.js +1 -2
- package/dist/cjs/dso-card.cjs.entry.js +3 -5
- package/dist/cjs/dso-contact-information.cjs.entry.js +1 -2
- package/dist/cjs/dso-cursor-tooltip.cjs.entry.js +2 -3
- package/dist/cjs/dso-date-picker.cjs.entry.js +2 -4
- package/dist/cjs/dso-document-card.cjs.entry.js +2 -4
- package/dist/cjs/dso-dropdown-menu.cjs.entry.js +8 -11
- package/dist/cjs/dso-header.cjs.entry.js +12 -14
- package/dist/cjs/dso-highlight-box.cjs.entry.js +2 -4
- package/dist/cjs/dso-history-item.cjs.entry.js +4 -6
- package/dist/cjs/dso-icon_2.cjs.entry.js +431 -868
- package/dist/cjs/dso-info-button.cjs.entry.js +14 -20
- package/dist/cjs/dso-info_2.cjs.entry.js +11 -14
- package/dist/cjs/dso-input-range.cjs.entry.js +1 -2
- package/dist/cjs/dso-label_3.cjs.entry.js +14 -15
- package/dist/cjs/dso-legend-group.cjs.entry.js +71 -0
- package/dist/cjs/dso-legend-item.cjs.entry.js +50 -9
- package/dist/cjs/dso-legend.cjs.entry.js +21 -9
- package/dist/cjs/dso-list-button.cjs.entry.js +6 -372
- package/dist/cjs/dso-logo.cjs.entry.js +3 -142
- package/dist/cjs/dso-map-base-layers.cjs.entry.js +5 -7
- package/dist/cjs/dso-map-controls.cjs.entry.js +11 -1180
- package/dist/cjs/dso-map-layer-object.cjs.entry.js +2 -3
- package/dist/cjs/dso-map-layer.cjs.entry.js +2 -3
- package/dist/cjs/dso-map-overlays.cjs.entry.js +5 -7
- package/dist/cjs/dso-mark-bar.cjs.entry.js +4 -6
- package/dist/cjs/dso-modal.cjs.entry.js +7 -11
- package/dist/cjs/dso-onboarding-tip.cjs.entry.js +9 -13
- package/dist/cjs/dso-pagination.cjs.entry.js +5 -6
- package/dist/cjs/dso-plekinfo-card.cjs.entry.js +4 -6
- package/dist/cjs/dso-progress-indicator.cjs.entry.js +3 -4
- package/dist/cjs/dso-project-item.cjs.entry.js +3 -4
- package/dist/cjs/dso-responsive-element.cjs.entry.js +3 -5
- package/dist/cjs/dso-scrollable.cjs.entry.js +10 -9
- package/dist/cjs/dso-segmented-button.cjs.entry.js +35 -0
- package/dist/cjs/dso-skiplink.cjs.entry.js +2 -3
- package/dist/cjs/dso-survey-rating.cjs.entry.js +4 -606
- package/dist/cjs/dso-tab.cjs.entry.js +3 -5
- package/dist/cjs/dso-tabs.cjs.entry.js +7 -12
- package/dist/cjs/dso-tijdreis-banner.cjs.entry.js +3 -4
- package/dist/cjs/dso-toggletip.cjs.entry.js +3 -5
- package/dist/cjs/dso-toolkit.cjs.js +3 -6
- package/dist/cjs/dso-tooltip.cjs.entry.js +23 -23
- package/dist/cjs/dso-tree-view.cjs.entry.js +12 -21
- package/dist/cjs/dso-viewer-grid.cjs.entry.js +21 -612
- package/dist/cjs/dsot-document-component-demo.cjs.entry.js +18 -21
- package/dist/cjs/{floating-ui.dom-Bp4TaUcL.js → floating-ui.dom-D-ZpkBFm.js} +79 -76
- package/dist/cjs/{get-active-element-DTMk2T2F.js → get-active-element-DutTk1go.js} +1 -5
- package/dist/cjs/{i18n-DLqfPwuf.js → i18n-CBaOSyHy.js} +37 -10
- package/dist/cjs/{index-2aek-b9X.js → index-BKUr3Wdg.js} +643 -478
- package/dist/cjs/index-DMUCyuUA.js +0 -3
- package/dist/cjs/index.cjs.js +0 -3
- package/dist/cjs/{index.esm-jAw0K065.js → index.esm-C3mvhVxy.js} +10 -20
- package/dist/cjs/is-modified-event-Dh9YsHw8.js +0 -3
- package/dist/cjs/loader.cjs.js +2 -5
- package/dist/cjs/{parse-wijzigactie-from-node.function-rda6XbHZ.js → parse-wijzigactie-from-node.function-B_NZh4Us.js} +1 -4
- package/dist/cjs/{position-tooltip.function-CDcvfQQh.js → position-tooltip.function-Bwu_g1_t.js} +1 -4
- package/dist/cjs/{tooltip.functional-component-BEYSPQ3a.js → tooltip.functional-component-CnQn5snY.js} +2 -5
- package/dist/cjs/v4-DVHpSsrI.js +0 -3
- package/dist/collection/collection-manifest.json +4 -2
- package/dist/collection/components/accordion/accordion.interfaces.js +0 -1
- package/dist/collection/components/accordion/accordion.js +4 -3
- package/dist/collection/components/accordion/components/accordion-section.css +2 -2
- package/dist/collection/components/accordion/components/accordion-section.interfaces.js +0 -1
- package/dist/collection/components/accordion/components/accordion-section.js +41 -31
- package/dist/collection/components/action-list/action-list.css +1 -1
- package/dist/collection/components/action-list/action-list.js +0 -1
- package/dist/collection/components/action-list/components/action-list-item.js +0 -1
- package/dist/collection/components/advanced-select/advanced-select.css +7 -7
- package/dist/collection/components/advanced-select/advanced-select.interfaces.js +0 -1
- package/dist/collection/components/advanced-select/advanced-select.js +14 -17
- package/dist/collection/components/alert/alert.css +4 -4
- package/dist/collection/components/alert/alert.i18n.js +0 -1
- package/dist/collection/components/alert/alert.interfaces.js +0 -1
- package/dist/collection/components/alert/alert.js +3 -3
- package/dist/collection/components/annotation/annotation-activiteit/annotation-activiteit.js +10 -6
- package/dist/collection/components/annotation/annotation-body.js +0 -1
- package/dist/collection/components/annotation/annotation-gebiedsaanwijzing/annotation-gebiedsaanwijzing.js +6 -4
- package/dist/collection/components/annotation/annotation-gewijzigde-locatie.js +0 -1
- package/dist/collection/components/annotation/annotation-kaart/annotation-kaart.interfaces.js +0 -1
- package/dist/collection/components/annotation/annotation-kaart/annotation-kaart.js +6 -4
- package/dist/collection/components/annotation/annotation-list-renvooi-values.js +1 -2
- package/dist/collection/components/annotation/annotation-locatie/annotation-locatie.js +6 -4
- package/dist/collection/components/annotation/annotation-omgevingsnormwaarde/annotation-omgevingsnormwaarde.js +10 -6
- package/dist/collection/components/annotation/annotation-symbol-slot.js +0 -1
- package/dist/collection/components/annotation/annotation-watcher.js +0 -1
- package/dist/collection/components/annotation/annotation.css +14 -18
- package/dist/collection/components/annotation/annotation.interfaces.js +0 -1
- package/dist/collection/components/attachments-counter/attachments-counter.js +0 -1
- package/dist/collection/components/autosuggest/autosuggest.i18n.js +0 -1
- package/dist/collection/components/autosuggest/autosuggest.interfaces.js +0 -1
- package/dist/collection/components/autosuggest/autosuggest.js +28 -39
- package/dist/collection/components/badge/badge.css +7 -7
- package/dist/collection/components/badge/badge.interfaces.js +0 -1
- package/dist/collection/components/badge/badge.js +2 -2
- package/dist/collection/components/banner/banner.js +0 -1
- package/dist/collection/components/button-group/button-group.interfaces.js +0 -1
- package/dist/collection/components/button-group/button-group.js +3 -4
- package/dist/collection/components/card/card.css +10 -14
- package/dist/collection/components/card/card.interfaces.js +0 -1
- package/dist/collection/components/card/card.js +3 -4
- package/dist/collection/components/card-container/card-container.interfaces.js +0 -1
- package/dist/collection/components/card-container/card-container.js +2 -2
- package/dist/collection/components/contact-information/contact-information.js +0 -1
- package/dist/collection/components/cursor-tooltip/cursor-tooltip.css +1 -1
- package/dist/collection/components/cursor-tooltip/cursor-tooltip.js +0 -1
- package/dist/collection/components/date-picker/date-picker.interfaces.js +0 -1
- package/dist/collection/components/date-picker/date-picker.js +11 -8
- package/dist/collection/components/date-picker/date-utils.js +0 -1
- package/dist/collection/components/document-card/document-card.interfaces.js +0 -1
- package/dist/collection/components/document-card/document-card.js +3 -4
- package/dist/collection/components/document-component/document-component-heading.js +6 -20
- package/dist/collection/components/document-component/document-component.css +18 -26
- package/dist/collection/components/document-component/document-component.interfaces.js +0 -1
- package/dist/collection/components/document-component/document-component.js +58 -33
- package/dist/collection/components/document-component-demo/document-component.demo.js +21 -23
- package/dist/collection/components/dropdown-menu/dropdown-menu.js +4 -7
- package/dist/collection/components/expandable/expandable.interfaces.js +0 -1
- package/dist/collection/components/expandable/expandable.js +4 -3
- package/dist/collection/components/header/header.css +1 -2
- package/dist/collection/components/header/header.i18n.js +0 -1
- package/dist/collection/components/header/header.interfaces.js +0 -1
- package/dist/collection/components/header/header.js +14 -14
- package/dist/collection/components/header/menu-item.functional-component.js +0 -1
- package/dist/collection/components/highlight-box/highlight-box.js +1 -3
- package/dist/collection/components/history-item/history-item.interfaces.js +0 -1
- package/dist/collection/components/history-item/history-item.js +7 -7
- package/dist/collection/components/icon/icon.interfaces.js +1 -0
- package/dist/collection/components/icon/icon.js +120 -74
- package/dist/collection/components/icon-button/icon-button.css +10 -12
- package/dist/collection/components/icon-button/icon-button.interfaces.js +0 -1
- package/dist/collection/components/icon-button/icon-button.js +24 -17
- package/dist/collection/components/image-overlay/image-overlay.css +8 -8
- package/dist/collection/components/image-overlay/image-overlay.js +13 -20
- package/dist/collection/components/info/info.css +1 -1
- package/dist/collection/components/info/info.js +1 -2
- package/dist/collection/components/info-button/info-button.interfaces.js +0 -1
- package/dist/collection/components/info-button/info-button.js +14 -18
- package/dist/collection/components/input-range/input-range.interfaces.js +0 -1
- package/dist/collection/components/input-range/input-range.js +2 -2
- package/dist/collection/components/label/label.css +48 -50
- package/dist/collection/components/label/label.interfaces.js +0 -1
- package/dist/collection/components/label/label.js +5 -9
- package/dist/collection/components/legend/legend-group/legend-group.css +22 -0
- package/dist/collection/components/legend/legend-group/legend-group.i18n.js +14 -0
- package/dist/collection/components/legend/legend-group/legend-group.js +120 -0
- package/dist/collection/components/legend/legend-item/legend-item.i18n.js +20 -0
- package/dist/collection/components/{legend-item → legend/legend-item}/legend-item.js +87 -15
- package/dist/collection/components/legend/legend.css +3 -0
- package/dist/collection/components/legend/legend.i18n.js +12 -0
- package/dist/collection/components/legend/legend.interfaces.js +0 -1
- package/dist/collection/components/legend/legend.js +13 -10
- package/dist/collection/components/list-button/list-button.css +2 -2
- package/dist/collection/components/list-button/list-button.interfaces.js +0 -1
- package/dist/collection/components/list-button/list-button.js +8 -9
- package/dist/collection/components/logo/logo.interfaces.js +0 -1
- package/dist/collection/components/logo/logo.js +5 -4
- package/dist/collection/components/map-base-layers/map-base-layers.i18n.js +0 -1
- package/dist/collection/components/map-base-layers/map-base-layers.interfaces.js +0 -1
- package/dist/collection/components/map-base-layers/map-base-layers.js +7 -7
- package/dist/collection/components/map-controls/map-controls.css +14 -18
- package/dist/collection/components/map-controls/map-controls.i18n.js +0 -1
- package/dist/collection/components/map-controls/map-controls.interfaces.js +0 -1
- package/dist/collection/components/map-controls/map-controls.js +7 -8
- package/dist/collection/components/map-layer/components/map-layer-object.interfaces.js +0 -1
- package/dist/collection/components/map-layer/components/map-layer-object.js +3 -3
- package/dist/collection/components/map-layer/map-layer.interfaces.js +0 -1
- package/dist/collection/components/map-layer/map-layer.js +3 -3
- package/dist/collection/components/map-overlays/map-overlays.i18n.js +0 -1
- package/dist/collection/components/map-overlays/map-overlays.interfaces.js +0 -1
- package/dist/collection/components/map-overlays/map-overlays.js +7 -7
- package/dist/collection/components/mark-bar/mark-bar.interfaces.js +0 -1
- package/dist/collection/components/mark-bar/mark-bar.js +13 -10
- package/dist/collection/components/modal/modal.i18n.js +0 -1
- package/dist/collection/components/modal/modal.interfaces.js +0 -1
- package/dist/collection/components/modal/modal.js +6 -9
- package/dist/collection/components/onboarding-tip/onboarding-tip.css +1 -4
- package/dist/collection/components/onboarding-tip/onboarding-tip.interfaces.js +0 -1
- package/dist/collection/components/onboarding-tip/onboarding-tip.js +9 -11
- package/dist/collection/components/ozon-content/components/ozon-content-toggletip/ozon-content-toggletip.js +56 -42
- package/dist/collection/components/ozon-content/functional-components/wrap-wijzigactie.functional-component.js +0 -1
- package/dist/collection/components/ozon-content/functions/parse-wijzigactie-from-node.function.js +0 -1
- package/dist/collection/components/ozon-content/functions/wijzigactie-to-class-name.function.js +0 -1
- package/dist/collection/components/ozon-content/get-node-name.function.js +0 -1
- package/dist/collection/components/ozon-content/nodes/abbr.node.js +0 -1
- package/dist/collection/components/ozon-content/nodes/al.node.js +0 -1
- package/dist/collection/components/ozon-content/nodes/begrip.node.js +0 -1
- package/dist/collection/components/ozon-content/nodes/begrippenlijst.node.js +0 -1
- package/dist/collection/components/ozon-content/nodes/bron.node.js +0 -1
- package/dist/collection/components/ozon-content/nodes/document.node.js +0 -1
- package/dist/collection/components/ozon-content/nodes/ext-ref.node.js +1 -2
- package/dist/collection/components/ozon-content/nodes/fallback.node.js +0 -1
- package/dist/collection/components/ozon-content/nodes/figuur.node.js +5 -8
- package/dist/collection/components/ozon-content/nodes/inhoud.node.js +0 -1
- package/dist/collection/components/ozon-content/nodes/inline-tekst-afbeelding.node.js +1 -3
- package/dist/collection/components/ozon-content/nodes/inline.nodes.js +0 -1
- package/dist/collection/components/ozon-content/nodes/int-io-ref.node.js +1 -2
- package/dist/collection/components/ozon-content/nodes/int-ref.node.js +2 -3
- package/dist/collection/components/ozon-content/nodes/kop.node.js +0 -1
- package/dist/collection/components/ozon-content/nodes/lijst.node.js +1 -3
- package/dist/collection/components/ozon-content/nodes/nieuwe-tekst.node.js +0 -1
- package/dist/collection/components/ozon-content/nodes/noot.node.js +2 -4
- package/dist/collection/components/ozon-content/nodes/table.node/colspec/colspec-mapper.js +2 -5
- package/dist/collection/components/ozon-content/nodes/table.node/index.js +0 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table-cell.js +2 -4
- package/dist/collection/components/ozon-content/nodes/table.node/table-colgroup.js +0 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table-rows.js +0 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table.node.js +4 -6
- package/dist/collection/components/ozon-content/nodes/text.node.js +0 -1
- package/dist/collection/components/ozon-content/nodes/verwijderde-tekst.node.js +0 -1
- package/dist/collection/components/ozon-content/ozon-content-context.interface.js +0 -1
- package/dist/collection/components/ozon-content/ozon-content-mapper.js +4 -7
- package/dist/collection/components/ozon-content/ozon-content-node-context.interface.js +0 -1
- package/dist/collection/components/ozon-content/ozon-content-node-state.interface.js +0 -1
- package/dist/collection/components/ozon-content/ozon-content-node.interface.js +0 -1
- package/dist/collection/components/ozon-content/ozon-content.css +44 -52
- package/dist/collection/components/ozon-content/ozon-content.interfaces.js +0 -1
- package/dist/collection/components/ozon-content/ozon-content.js +13 -8
- package/dist/collection/components/pagination/pagination.interfaces.js +0 -1
- package/dist/collection/components/pagination/pagination.js +6 -6
- package/dist/collection/components/panel/panel.css +1 -1
- package/dist/collection/components/panel/panel.i18n.js +0 -1
- package/dist/collection/components/panel/panel.interfaces.js +0 -1
- package/dist/collection/components/panel/panel.js +3 -3
- package/dist/collection/components/plekinfo-card/plekinfo-card.css +4 -4
- package/dist/collection/components/plekinfo-card/plekinfo-card.interfaces.js +0 -1
- package/dist/collection/components/plekinfo-card/plekinfo-card.js +6 -6
- package/dist/collection/components/progress-indicator/progress-indicator.i18n.js +0 -1
- package/dist/collection/components/progress-indicator/progress-indicator.js +1 -2
- package/dist/collection/components/project-item/project-item.css +1 -1
- package/dist/collection/components/project-item/project-item.js +1 -2
- package/dist/collection/components/renvooi/renvooi-render-text.js +0 -1
- package/dist/collection/components/renvooi/renvooi-render.js +0 -1
- package/dist/collection/components/renvooi/renvooi.css +4 -4
- package/dist/collection/components/renvooi/renvooi.interfaces.js +0 -1
- package/dist/collection/components/renvooi/renvooi.js +7 -5
- package/dist/collection/components/responsive-element/responsive-element.interfaces.js +0 -1
- package/dist/collection/components/responsive-element/responsive-element.js +6 -6
- package/dist/collection/components/scrollable/scrollable.css +4 -1
- package/dist/collection/components/scrollable/scrollable.interfaces.js +0 -1
- package/dist/collection/components/scrollable/scrollable.js +10 -8
- package/dist/collection/components/segmented-button/segmented-button.css +59 -0
- package/dist/collection/components/segmented-button/segmented-button.interfaces.js +1 -0
- package/dist/collection/components/segmented-button/segmented-button.js +169 -0
- package/dist/collection/components/selectable/selectable.interfaces.js +0 -1
- package/dist/collection/components/selectable/selectable.js +7 -11
- package/dist/collection/components/skiplink/skiplink.interfaces.js +0 -1
- package/dist/collection/components/skiplink/skiplink.js +3 -3
- package/dist/collection/components/slide-toggle/slide-toggle.interfaces.js +0 -1
- package/dist/collection/components/slide-toggle/slide-toggle.js +3 -3
- package/dist/collection/components/survey-rating/survey-rating.css +11 -12
- package/dist/collection/components/survey-rating/survey-rating.interfaces.js +0 -1
- package/dist/collection/components/survey-rating/survey-rating.js +6 -5
- package/dist/collection/components/table/table.css +14 -18
- package/dist/collection/components/table/table.js +6 -12
- package/dist/collection/components/tabs/components/tab.js +4 -5
- package/dist/collection/components/tabs/tabs.interfaces.js +0 -1
- package/dist/collection/components/tabs/tabs.js +6 -11
- package/dist/collection/components/tijdreis-banner/tijdreis-banner.css +1 -1
- package/dist/collection/components/tijdreis-banner/tijdreis-banner.js +1 -2
- package/dist/collection/components/toggletip/toggletip.js +4 -5
- package/dist/collection/components/tooltip/tooltip.js +15 -20
- package/dist/collection/components/tree-view/tree-item.js +1 -6
- package/dist/collection/components/tree-view/tree-view.css +1 -2
- package/dist/collection/components/tree-view/tree-view.interfaces.js +0 -1
- package/dist/collection/components/tree-view/tree-view.js +19 -19
- package/dist/collection/components/viewer-grid/components/document-panel.js +0 -1
- package/dist/collection/components/viewer-grid/components/filter-panel.js +1 -2
- package/dist/collection/components/viewer-grid/components/index.js +0 -1
- package/dist/collection/components/viewer-grid/components/main-panel.js +0 -1
- package/dist/collection/components/viewer-grid/components/overlay.js +1 -2
- package/dist/collection/components/viewer-grid/components/sizing-buttons.js +0 -1
- package/dist/collection/components/viewer-grid/viewer-grid.css +2 -2
- package/dist/collection/components/viewer-grid/viewer-grid.interfaces.js +0 -1
- package/dist/collection/components/viewer-grid/viewer-grid.js +28 -22
- package/dist/collection/functional-components/mark-text/mark-text.functional-component.js +0 -1
- package/dist/collection/functional-components/mark-text/mark-text.interfaces.js +0 -1
- package/dist/collection/functional-components/tooltip/position-tooltip.function.js +0 -1
- package/dist/collection/functional-components/tooltip/tooltip.functional-component.js +1 -2
- package/dist/collection/functional-components/tooltip/tooltip.interfaces.js +0 -1
- package/dist/collection/index.js +0 -1
- package/dist/collection/utils/create-identifier.js +0 -1
- package/dist/collection/utils/get-active-element.js +1 -3
- package/dist/collection/utils/has-overflow.js +0 -1
- package/dist/collection/utils/i18n.js +0 -1
- package/dist/collection/utils/is-interactive-element.js +0 -1
- package/dist/collection/utils/is-modified-event.js +0 -1
- package/dist/collection/utils/parse-xml.js +0 -1
- package/dist/components/alert.js +1 -86
- package/dist/components/annotation-body.js +1 -8
- package/dist/components/annotation-list-renvooi-values.js +1 -10
- package/dist/components/annotation-locatie.js +1 -88
- package/dist/components/annotation-watcher.js +1 -35
- package/dist/components/attachments-counter.js +1 -43
- package/dist/components/badge.js +1 -38
- package/dist/components/button-group.js +1 -63
- package/dist/components/clsx.js +1 -6
- package/dist/components/document-component.js +1 -1729
- package/dist/components/dropdown-menu.js +1 -210
- package/dist/components/dso-accordion-section.js +1 -289
- package/dist/components/dso-accordion.js +1 -350
- package/dist/components/dso-action-list-item.js +1 -65
- package/dist/components/dso-action-list.js +1 -40
- package/dist/components/dso-advanced-select.js +5 -1146
- package/dist/components/dso-alert.js +1 -9
- package/dist/components/dso-annotation-activiteit.js +1 -95
- package/dist/components/dso-annotation-gebiedsaanwijzing.js +1 -91
- package/dist/components/dso-annotation-kaart.js +1 -74
- package/dist/components/dso-annotation-locatie.js +1 -9
- package/dist/components/dso-annotation-omgevingsnormwaarde.js +1 -95
- package/dist/components/dso-attachments-counter.js +1 -9
- package/dist/components/dso-autosuggest.js +1 -585
- package/dist/components/dso-badge.js +1 -9
- package/dist/components/dso-banner.js +1 -55
- package/dist/components/dso-button-group.js +1 -9
- package/dist/components/dso-card-container.js +1 -44
- package/dist/components/dso-card.js +1 -74
- package/dist/components/dso-contact-information.js +1 -38
- package/dist/components/dso-cursor-tooltip.js +1 -38
- package/dist/components/dso-date-picker.js +1 -189
- package/dist/components/dso-document-card.js +1 -71
- package/dist/components/dso-document-component.js +1 -9
- package/dist/components/dso-dropdown-menu.js +1 -9
- package/dist/components/dso-expandable.js +1 -9
- package/dist/components/dso-header.js +1 -224
- package/dist/components/dso-highlight-box.js +1 -48
- package/dist/components/dso-history-item.js +1 -82
- package/dist/components/dso-icon-button.js +1 -9
- package/dist/components/dso-icon.js +1 -9
- package/dist/components/dso-image-overlay.js +1 -9
- package/dist/components/dso-info-button.js +1 -9
- package/dist/components/dso-info.js +1 -9
- package/dist/components/dso-input-range.js +1 -61
- package/dist/components/dso-label.js +1 -9
- package/dist/components/dso-legend-group.d.ts +11 -0
- package/dist/components/dso-legend-group.js +1 -0
- package/dist/components/dso-legend-item.js +1 -118
- package/dist/components/dso-legend.js +1 -120
- package/dist/components/dso-list-button.js +1 -513
- package/dist/components/dso-logo.js +1 -204
- package/dist/components/dso-map-base-layers.js +1 -115
- package/dist/components/dso-map-controls.js +1 -1327
- package/dist/components/dso-map-layer-object.js +1 -56
- package/dist/components/dso-map-layer.js +1 -61
- package/dist/components/dso-map-overlays.js +1 -116
- package/dist/components/dso-mark-bar.js +1 -99
- package/dist/components/dso-modal.js +1 -141
- package/dist/components/dso-onboarding-tip.js +1 -142
- package/dist/components/dso-ozon-content-toggletip.js +1 -9
- package/dist/components/dso-ozon-content.js +1 -9
- package/dist/components/dso-pagination.js +1 -190
- package/dist/components/dso-panel.js +1 -9
- package/dist/components/dso-plekinfo-card.js +1 -90
- package/dist/components/dso-progress-indicator.js +1 -9
- package/dist/components/dso-project-item.js +1 -64
- package/dist/components/dso-renvooi.js +1 -9
- package/dist/components/dso-responsive-element.js +1 -9
- package/dist/components/dso-scrollable.js +1 -9
- package/dist/components/dso-segmented-button.d.ts +11 -0
- package/dist/components/dso-segmented-button.js +1 -0
- package/dist/components/dso-selectable.js +1 -9
- package/dist/components/dso-skiplink.js +1 -55
- package/dist/components/dso-slide-toggle.js +1 -9
- package/dist/components/dso-survey-rating.js +1 -679
- package/dist/components/dso-tab.js +1 -72
- package/dist/components/dso-table.js +1 -9
- package/dist/components/dso-tabs.js +1 -96
- package/dist/components/dso-tijdreis-banner.js +1 -44
- package/dist/components/dso-toggletip.js +1 -9
- package/dist/components/dso-tooltip.js +1 -9
- package/dist/components/dso-tree-view.js +1 -233
- package/dist/components/dso-viewer-grid.js +1 -853
- package/dist/components/dsot-document-component-demo.js +1 -2004
- package/dist/components/expandable.js +1 -84
- package/dist/components/floating-ui.dom.js +1 -1784
- package/dist/components/get-active-element.js +1 -15
- package/dist/components/i18n.js +1 -2233
- package/dist/components/icon-button.js +1 -657
- package/dist/components/icon.js +1 -733
- package/dist/components/image-overlay.js +1 -146
- package/dist/components/index.d.ts +6 -1
- package/dist/components/index.esm.js +2 -595
- package/dist/components/index.js +1 -74
- package/dist/components/index2.js +1 -109
- package/dist/components/info-button.js +1 -160
- package/dist/components/info.js +1 -51
- package/dist/components/is-modified-event.js +1 -13
- package/dist/components/label.js +1 -171
- package/dist/components/ozon-content-toggletip.js +1 -106
- package/dist/components/ozon-content.js +1 -3781
- package/dist/components/panel.js +1 -72
- package/dist/components/progress-indicator.js +1 -61
- package/dist/components/renvooi.js +1 -78
- package/dist/components/responsive-element.js +1 -78
- package/dist/components/scrollable.js +1 -123
- package/dist/components/selectable.js +1 -149
- package/dist/components/slide-toggle.js +1 -65
- package/dist/components/table.js +1 -1473
- package/dist/components/tooltip.functional-component.js +1 -118
- package/dist/components/tooltip.js +1 -2112
- package/dist/components/v4.js +1 -63
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -2
- package/dist/dso-toolkit/index.esm.js +0 -2
- package/dist/dso-toolkit/p-046a84aa.entry.js +1 -0
- package/dist/dso-toolkit/p-086a3c7e.entry.js +1 -0
- package/dist/dso-toolkit/p-0bb80f9d.entry.js +1 -0
- package/dist/dso-toolkit/p-0f04d059.entry.js +1 -0
- package/dist/dso-toolkit/p-1ec0886c.entry.js +1 -0
- package/dist/dso-toolkit/p-221a2c73.entry.js +1 -0
- package/dist/dso-toolkit/p-295392f6.entry.js +1 -0
- package/dist/dso-toolkit/p-2b380a0b.entry.js +1 -0
- package/dist/dso-toolkit/p-33e1cf5e.entry.js +1 -0
- package/dist/dso-toolkit/p-36812bba.entry.js +1 -0
- package/dist/dso-toolkit/p-38b42e83.entry.js +1 -0
- package/dist/dso-toolkit/p-3dc5a077.entry.js +1 -0
- package/dist/dso-toolkit/p-3fee4537.entry.js +1 -0
- package/dist/dso-toolkit/p-4060fbeb.entry.js +1 -0
- package/dist/dso-toolkit/p-438fcf4b.entry.js +1 -0
- package/dist/dso-toolkit/p-451cc2bb.entry.js +1 -0
- package/dist/dso-toolkit/p-45ccfd50.entry.js +1 -0
- package/dist/dso-toolkit/p-4aacd714.entry.js +1 -0
- package/dist/dso-toolkit/p-4dce7c51.entry.js +1 -0
- package/dist/dso-toolkit/p-532f4245.entry.js +1 -0
- package/dist/dso-toolkit/p-5893f749.entry.js +1 -0
- package/dist/dso-toolkit/p-5a02249b.entry.js +1 -0
- package/dist/dso-toolkit/p-5fb90e0f.entry.js +1 -0
- package/dist/dso-toolkit/p-6256aed0.entry.js +1 -0
- package/dist/dso-toolkit/p-63cbf895.entry.js +1 -0
- package/dist/dso-toolkit/p-6fc38a28.entry.js +1 -0
- package/dist/dso-toolkit/p-780737ad.entry.js +1 -0
- package/dist/dso-toolkit/p-7910ee69.entry.js +1 -0
- package/dist/dso-toolkit/p-7b0408d3.entry.js +1 -0
- package/dist/dso-toolkit/p-851317c7.entry.js +1 -0
- package/dist/dso-toolkit/p-863dde86.entry.js +1 -0
- package/dist/dso-toolkit/p-881da5bc.entry.js +1 -0
- package/dist/dso-toolkit/p-9456a5fe.entry.js +1 -0
- package/dist/dso-toolkit/p-9539245c.entry.js +1 -0
- package/dist/dso-toolkit/p-9c1bbde9.entry.js +1 -0
- package/dist/dso-toolkit/p-BFTU3MAI.js +1 -2
- package/dist/dso-toolkit/p-BWkWD1Z2.js +1 -0
- package/dist/dso-toolkit/p-BgyqGgJ8.js +1 -0
- package/dist/dso-toolkit/p-BlaG0Agw.js +1 -0
- package/dist/dso-toolkit/p-CFP0lFZA.js +1 -0
- package/dist/dso-toolkit/p-C_akviUd.js +1 -2
- package/dist/dso-toolkit/p-Ce5efsIs.js +1 -0
- package/dist/dso-toolkit/p-ChV9xqsO.js +1 -2
- package/dist/dso-toolkit/p-CiFROHm0.js +1 -0
- package/dist/dso-toolkit/p-DMMFbykw.js +1 -0
- package/dist/dso-toolkit/p-DQQwiKx8.js +1 -0
- package/dist/dso-toolkit/p-DQuL1Twl.js +1 -2
- package/dist/dso-toolkit/p-FXEjFTzg.js +1 -0
- package/dist/dso-toolkit/p-Hgv-pDpy.js +1 -2
- package/dist/dso-toolkit/p-PsHl6ZhV.js +5 -0
- package/dist/dso-toolkit/p-a6e1f2ae.entry.js +1 -0
- package/dist/dso-toolkit/p-a7f63c3d.entry.js +1 -0
- package/dist/dso-toolkit/p-ai7aDzJN.js +2 -0
- package/dist/dso-toolkit/p-b0bc4aed.entry.js +1 -0
- package/dist/dso-toolkit/p-b8ca96d8.entry.js +1 -0
- package/dist/dso-toolkit/p-baWVwd8J.js +1 -2
- package/dist/dso-toolkit/p-bb38f836.entry.js +1 -0
- package/dist/dso-toolkit/p-bbf2a5cb.entry.js +1 -0
- package/dist/dso-toolkit/p-be43c839.entry.js +1 -0
- package/dist/dso-toolkit/p-befad06c.entry.js +1 -0
- package/dist/dso-toolkit/p-bf85ab34.entry.js +1 -0
- package/dist/dso-toolkit/p-c01593c7.entry.js +1 -0
- package/dist/dso-toolkit/p-c1df0e1f.entry.js +1 -0
- package/dist/dso-toolkit/p-cc43d3f7.entry.js +1 -0
- package/dist/dso-toolkit/p-d015860d.entry.js +1 -0
- package/dist/dso-toolkit/p-d4d65803.entry.js +1 -0
- package/dist/dso-toolkit/p-d522ee67.entry.js +1 -0
- package/dist/dso-toolkit/p-d8c89791.entry.js +1 -0
- package/dist/dso-toolkit/p-de00a5aa.entry.js +1 -0
- package/dist/dso-toolkit/p-e2890d38.entry.js +1 -0
- package/dist/dso-toolkit/p-e8f4fcd0.entry.js +7 -0
- package/dist/dso-toolkit/p-ef6998eb.entry.js +1 -0
- package/dist/dso-toolkit/p-ef90f4a8.entry.js +1 -0
- package/dist/dso-toolkit/p-f1e746db.entry.js +1 -0
- package/dist/dso-toolkit/p-f43ea451.entry.js +1 -0
- package/dist/dso-toolkit/p-fe4dd620.entry.js +1 -0
- package/dist/dso-toolkit/p-ff1d91b4.entry.js +1 -0
- package/dist/esm/_commonjsHelpers-BFTU3MAI.js +0 -3
- package/dist/esm/{annotation-body-BssUg8-Y.js → annotation-body-Ce5c-0pe.js} +1 -4
- package/dist/esm/annotation-list-renvooi-values-B9Td2jg4.js +7 -0
- package/dist/esm/{annotation-watcher-Rs1ULLIo.js → annotation-watcher-Dk6POxYU.js} +1 -4
- package/dist/esm/app-globals-DQuL1Twl.js +0 -3
- package/dist/esm/clsx-ChV9xqsO.js +0 -3
- package/dist/esm/dso-accordion-section.entry.js +14 -20
- package/dist/esm/dso-accordion.entry.js +1 -2
- package/dist/esm/dso-action-list-item.entry.js +1 -2
- package/dist/esm/dso-action-list.entry.js +2 -3
- package/dist/esm/dso-advanced-select.entry.js +468 -61
- package/dist/esm/dso-alert_7.entry.js +98 -4049
- package/dist/esm/dso-annotation-activiteit.entry.js +5 -6
- package/dist/esm/dso-annotation-gebiedsaanwijzing.entry.js +4 -5
- package/dist/esm/dso-annotation-kaart.entry.js +3 -4
- package/dist/esm/dso-annotation-locatie_2.entry.js +20 -1434
- package/dist/esm/dso-annotation-omgevingsnormwaarde.entry.js +5 -6
- package/dist/esm/dso-attachments-counter_2.entry.js +4 -3
- package/dist/esm/dso-autosuggest.entry.js +25 -38
- package/dist/esm/dso-banner.entry.js +1 -2
- package/dist/esm/dso-button-group.entry.js +2 -4
- package/dist/esm/dso-card-container.entry.js +1 -2
- package/dist/esm/dso-card.entry.js +3 -5
- package/dist/esm/dso-contact-information.entry.js +1 -2
- package/dist/esm/dso-cursor-tooltip.entry.js +2 -3
- package/dist/esm/dso-date-picker.entry.js +2 -4
- package/dist/esm/dso-document-card.entry.js +2 -4
- package/dist/esm/dso-dropdown-menu.entry.js +8 -11
- package/dist/esm/dso-header.entry.js +12 -14
- package/dist/esm/dso-highlight-box.entry.js +2 -4
- package/dist/esm/dso-history-item.entry.js +4 -6
- package/dist/esm/dso-icon_2.entry.js +431 -868
- package/dist/esm/dso-info-button.entry.js +14 -20
- package/dist/esm/dso-info_2.entry.js +11 -14
- package/dist/esm/dso-input-range.entry.js +1 -2
- package/dist/esm/dso-label_3.entry.js +14 -15
- package/dist/esm/dso-legend-group.entry.js +69 -0
- package/dist/esm/dso-legend-item.entry.js +50 -9
- package/dist/esm/dso-legend.entry.js +21 -9
- package/dist/esm/dso-list-button.entry.js +6 -372
- package/dist/esm/dso-logo.entry.js +3 -142
- package/dist/esm/dso-map-base-layers.entry.js +5 -7
- package/dist/esm/dso-map-controls.entry.js +11 -1180
- package/dist/esm/dso-map-layer-object.entry.js +2 -3
- package/dist/esm/dso-map-layer.entry.js +2 -3
- package/dist/esm/dso-map-overlays.entry.js +5 -7
- package/dist/esm/dso-mark-bar.entry.js +4 -6
- package/dist/esm/dso-modal.entry.js +7 -11
- package/dist/esm/dso-onboarding-tip.entry.js +9 -13
- package/dist/esm/dso-pagination.entry.js +5 -6
- package/dist/esm/dso-plekinfo-card.entry.js +4 -6
- package/dist/esm/dso-progress-indicator.entry.js +3 -4
- package/dist/esm/dso-project-item.entry.js +3 -4
- package/dist/esm/dso-responsive-element.entry.js +3 -5
- package/dist/esm/dso-scrollable.entry.js +10 -9
- package/dist/esm/dso-segmented-button.entry.js +33 -0
- package/dist/esm/dso-skiplink.entry.js +2 -3
- package/dist/esm/dso-survey-rating.entry.js +4 -606
- package/dist/esm/dso-tab.entry.js +3 -5
- package/dist/esm/dso-tabs.entry.js +7 -12
- package/dist/esm/dso-tijdreis-banner.entry.js +3 -4
- package/dist/esm/dso-toggletip.entry.js +3 -5
- package/dist/esm/dso-toolkit.js +4 -7
- package/dist/esm/dso-tooltip.entry.js +23 -23
- package/dist/esm/dso-tree-view.entry.js +12 -21
- package/dist/esm/dso-viewer-grid.entry.js +21 -612
- package/dist/esm/dsot-document-component-demo.entry.js +18 -21
- package/dist/{bundle/p-C1uSuLE3.js → esm/floating-ui.dom-BgyqGgJ8.js} +79 -76
- package/dist/esm/get-active-element-BWkWD1Z2.js +11 -0
- package/dist/{bundle/p-pxiVAmq4.js → esm/i18n-FXEjFTzg.js} +37 -10
- package/dist/esm/{index-Dx5skKSq.js → index-ai7aDzJN.js} +643 -478
- package/dist/esm/index-baWVwd8J.js +0 -3
- package/dist/esm/{index.esm-DDSMs62-.js → index.esm-PsHl6ZhV.js} +11 -21
- package/dist/esm/index.js +0 -3
- package/dist/esm/is-modified-event-Hgv-pDpy.js +0 -3
- package/dist/esm/loader.js +3 -6
- package/dist/esm/{parse-wijzigactie-from-node.function-skF9dYbu.js → parse-wijzigactie-from-node.function-DFRwNK3S.js} +1 -4
- package/dist/esm/{position-tooltip.function-gQf7Uoh1.js → position-tooltip.function-Db-YtSLm.js} +1 -4
- package/dist/esm/{tooltip.functional-component-faOeuQGr.js → tooltip.functional-component-JeYQl3eZ.js} +2 -5
- package/dist/esm/v4-C_akviUd.js +0 -3
- package/dist/scripts/readme.js +1 -2
- package/dist/types/components/accordion/components/accordion-section.d.ts +3 -2
- package/dist/types/components/document-component/document-component.d.ts +2 -2
- package/dist/types/components/document-component/document-component.interfaces.d.ts +1 -0
- package/dist/types/components/document-component-demo/document-component.demo.d.ts +2 -2
- package/dist/types/components/icon/icon.d.ts +2 -1
- package/dist/types/components/icon/icon.interfaces.d.ts +1 -0
- package/dist/types/components/icon-button/icon-button.d.ts +2 -1
- package/dist/types/components/legend/legend-group/legend-group.d.ts +27 -0
- package/dist/types/components/legend/legend-group/legend-group.i18n.d.ts +2 -0
- package/dist/types/components/{legend-item → legend/legend-item}/legend-item.d.ts +17 -8
- package/dist/types/components/legend/legend-item/legend-item.i18n.d.ts +2 -0
- package/dist/types/components/legend/legend.d.ts +1 -0
- package/dist/types/components/legend/legend.i18n.d.ts +2 -0
- package/dist/types/components/legend/legend.interfaces.d.ts +22 -0
- package/dist/types/components/ozon-content/components/ozon-content-toggletip/ozon-content-toggletip.d.ts +10 -9
- package/dist/types/components/segmented-button/segmented-button.d.ts +31 -0
- package/dist/types/components/segmented-button/segmented-button.interfaces.d.ts +8 -0
- package/dist/types/components/tree-view/tree-view.interfaces.d.ts +2 -1
- package/dist/types/components.d.ts +655 -151
- package/dist/types/stencil-public-runtime.d.ts +64 -5
- package/package.json +14 -14
- package/dist/bundle/dso-accordion-section.js.map +0 -1
- package/dist/bundle/dso-accordion.js.map +0 -1
- package/dist/bundle/dso-action-list-item.js.map +0 -1
- package/dist/bundle/dso-action-list.js.map +0 -1
- package/dist/bundle/dso-advanced-select.js.map +0 -1
- package/dist/bundle/dso-alert.js.map +0 -1
- package/dist/bundle/dso-annotation-activiteit.js.map +0 -1
- package/dist/bundle/dso-annotation-gebiedsaanwijzing.js.map +0 -1
- package/dist/bundle/dso-annotation-kaart.js.map +0 -1
- package/dist/bundle/dso-annotation-locatie.js.map +0 -1
- package/dist/bundle/dso-annotation-omgevingsnormwaarde.js.map +0 -1
- package/dist/bundle/dso-attachments-counter.js.map +0 -1
- package/dist/bundle/dso-autosuggest.js.map +0 -1
- package/dist/bundle/dso-badge.js.map +0 -1
- package/dist/bundle/dso-banner.js.map +0 -1
- package/dist/bundle/dso-button-group.js.map +0 -1
- package/dist/bundle/dso-card-container.js.map +0 -1
- package/dist/bundle/dso-card.js.map +0 -1
- package/dist/bundle/dso-contact-information.js.map +0 -1
- package/dist/bundle/dso-cursor-tooltip.js.map +0 -1
- package/dist/bundle/dso-date-picker.js.map +0 -1
- package/dist/bundle/dso-document-card.js.map +0 -1
- package/dist/bundle/dso-document-component.js.map +0 -1
- package/dist/bundle/dso-dropdown-menu.js.map +0 -1
- package/dist/bundle/dso-expandable.js.map +0 -1
- package/dist/bundle/dso-header.js.map +0 -1
- package/dist/bundle/dso-highlight-box.js.map +0 -1
- package/dist/bundle/dso-history-item.js.map +0 -1
- package/dist/bundle/dso-icon-button.js.map +0 -1
- package/dist/bundle/dso-icon.js.map +0 -1
- package/dist/bundle/dso-image-overlay.js.map +0 -1
- package/dist/bundle/dso-info-button.js.map +0 -1
- package/dist/bundle/dso-info.js.map +0 -1
- package/dist/bundle/dso-input-range.js.map +0 -1
- package/dist/bundle/dso-label.js.map +0 -1
- package/dist/bundle/dso-legend-item.js.map +0 -1
- package/dist/bundle/dso-legend.js.map +0 -1
- package/dist/bundle/dso-list-button.js.map +0 -1
- package/dist/bundle/dso-logo.js.map +0 -1
- package/dist/bundle/dso-map-base-layers.js.map +0 -1
- package/dist/bundle/dso-map-controls.js.map +0 -1
- package/dist/bundle/dso-map-layer-object.js.map +0 -1
- package/dist/bundle/dso-map-layer.js.map +0 -1
- package/dist/bundle/dso-map-overlays.js.map +0 -1
- package/dist/bundle/dso-mark-bar.js.map +0 -1
- package/dist/bundle/dso-modal.js.map +0 -1
- package/dist/bundle/dso-onboarding-tip.js.map +0 -1
- package/dist/bundle/dso-ozon-content-toggletip.js.map +0 -1
- package/dist/bundle/dso-ozon-content.js.map +0 -1
- package/dist/bundle/dso-pagination.js.map +0 -1
- package/dist/bundle/dso-panel.js.map +0 -1
- package/dist/bundle/dso-plekinfo-card.js.map +0 -1
- package/dist/bundle/dso-progress-indicator.js.map +0 -1
- package/dist/bundle/dso-project-item.js.map +0 -1
- package/dist/bundle/dso-renvooi.js.map +0 -1
- package/dist/bundle/dso-responsive-element.js.map +0 -1
- package/dist/bundle/dso-scrollable.js.map +0 -1
- package/dist/bundle/dso-selectable.js.map +0 -1
- package/dist/bundle/dso-skiplink.js.map +0 -1
- package/dist/bundle/dso-slide-toggle.js.map +0 -1
- package/dist/bundle/dso-survey-rating.js.map +0 -1
- package/dist/bundle/dso-tab.js.map +0 -1
- package/dist/bundle/dso-table.js.map +0 -1
- package/dist/bundle/dso-tabs.js.map +0 -1
- package/dist/bundle/dso-tijdreis-banner.js.map +0 -1
- package/dist/bundle/dso-toggletip.js.map +0 -1
- package/dist/bundle/dso-tooltip.js.map +0 -1
- package/dist/bundle/dso-tree-view.js.map +0 -1
- package/dist/bundle/dso-viewer-grid.js.map +0 -1
- package/dist/bundle/dsot-document-component-demo.js.map +0 -1
- package/dist/bundle/index.js.map +0 -1
- package/dist/bundle/p--_zCrLW5.js +0 -86
- package/dist/bundle/p--_zCrLW5.js.map +0 -1
- package/dist/bundle/p-BFAmNPH7.js.map +0 -1
- package/dist/bundle/p-BJqFBnN6.js +0 -171
- package/dist/bundle/p-BJqFBnN6.js.map +0 -1
- package/dist/bundle/p-BM-R_z20.js +0 -38
- package/dist/bundle/p-BM-R_z20.js.map +0 -1
- package/dist/bundle/p-BOYwoGz-.js.map +0 -1
- package/dist/bundle/p-BWiGIQ1w.js.map +0 -1
- package/dist/bundle/p-BgkOiu3z.js.map +0 -1
- package/dist/bundle/p-Bl7SFp3l.js.map +0 -1
- package/dist/bundle/p-Btk7RWKm.js +0 -733
- package/dist/bundle/p-Btk7RWKm.js.map +0 -1
- package/dist/bundle/p-C0F5ddGm.js +0 -88
- package/dist/bundle/p-C0F5ddGm.js.map +0 -1
- package/dist/bundle/p-C0j2UArC.js.map +0 -1
- package/dist/bundle/p-C1uSuLE3.js.map +0 -1
- package/dist/bundle/p-CBhOl8xD.js.map +0 -1
- package/dist/bundle/p-CVTNNCuw.js.map +0 -1
- package/dist/bundle/p-C_akviUd.js.map +0 -1
- package/dist/bundle/p-ChV9xqsO.js.map +0 -1
- package/dist/bundle/p-ChdQ7Urg.js +0 -1473
- package/dist/bundle/p-ChdQ7Urg.js.map +0 -1
- package/dist/bundle/p-CkRbdaNs.js.map +0 -1
- package/dist/bundle/p-CodDyi2J.js.map +0 -1
- package/dist/bundle/p-CuUjEAKj.js +0 -3781
- package/dist/bundle/p-CuUjEAKj.js.map +0 -1
- package/dist/bundle/p-DBWrx_3r.js.map +0 -1
- package/dist/bundle/p-DDSMs62-.js.map +0 -1
- package/dist/bundle/p-DGOjLHXF.js.map +0 -1
- package/dist/bundle/p-DJ_Iuzp2.js.map +0 -1
- package/dist/bundle/p-DVDxAvhs.js.map +0 -1
- package/dist/bundle/p-DegYTrRA.js +0 -1729
- package/dist/bundle/p-DegYTrRA.js.map +0 -1
- package/dist/bundle/p-DhBq2NpP.js.map +0 -1
- package/dist/bundle/p-DpRZJt_D.js +0 -657
- package/dist/bundle/p-DpRZJt_D.js.map +0 -1
- package/dist/bundle/p-DrTyWXYp.js.map +0 -1
- package/dist/bundle/p-Hgv-pDpy.js.map +0 -1
- package/dist/bundle/p-VxbAefvg.js.map +0 -1
- package/dist/bundle/p-Yu8u8KO1.js +0 -146
- package/dist/bundle/p-Yu8u8KO1.js.map +0 -1
- package/dist/bundle/p-baWVwd8J.js.map +0 -1
- package/dist/bundle/p-dcbs8fsg.js.map +0 -1
- package/dist/bundle/p-ecEmdirb.js.map +0 -1
- package/dist/bundle/p-kBBh-4zI.js.map +0 -1
- package/dist/bundle/p-lZrM2D5q.js +0 -10
- package/dist/bundle/p-lZrM2D5q.js.map +0 -1
- package/dist/bundle/p-pxiVAmq4.js.map +0 -1
- package/dist/bundle/p-zCo78EB0.js +0 -113
- package/dist/bundle/p-zCo78EB0.js.map +0 -1
- package/dist/cjs/_commonjsHelpers-BJu3ubxk.js.map +0 -1
- package/dist/cjs/annotation-body-BSApfNFT.js.map +0 -1
- package/dist/cjs/annotation-list-renvooi-values-CBx225bl.js +0 -12
- package/dist/cjs/annotation-list-renvooi-values-CBx225bl.js.map +0 -1
- package/dist/cjs/annotation-watcher-BEOlrh84.js.map +0 -1
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
- package/dist/cjs/clsx-BtxeOLZW.js.map +0 -1
- package/dist/cjs/dso-toolkit.cjs.js.map +0 -1
- package/dist/cjs/floating-ui.dom-Bp4TaUcL.js.map +0 -1
- package/dist/cjs/get-active-element-DTMk2T2F.js.map +0 -1
- package/dist/cjs/i18n-DLqfPwuf.js.map +0 -1
- package/dist/cjs/index-2aek-b9X.js.map +0 -1
- package/dist/cjs/index-DMUCyuUA.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/index.esm-jAw0K065.js.map +0 -1
- package/dist/cjs/is-modified-event-Dh9YsHw8.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/parse-wijzigactie-from-node.function-rda6XbHZ.js.map +0 -1
- package/dist/cjs/position-tooltip.function-CDcvfQQh.js.map +0 -1
- package/dist/cjs/tooltip.functional-component-BEYSPQ3a.js.map +0 -1
- package/dist/cjs/v4-DVHpSsrI.js.map +0 -1
- package/dist/collection/components/accordion/accordion.interfaces.js.map +0 -1
- package/dist/collection/components/accordion/accordion.js.map +0 -1
- package/dist/collection/components/accordion/components/accordion-section.interfaces.js.map +0 -1
- package/dist/collection/components/accordion/components/accordion-section.js.map +0 -1
- package/dist/collection/components/action-list/action-list.js.map +0 -1
- package/dist/collection/components/action-list/components/action-list-item.js.map +0 -1
- package/dist/collection/components/advanced-select/advanced-select.interfaces.js.map +0 -1
- package/dist/collection/components/advanced-select/advanced-select.js.map +0 -1
- package/dist/collection/components/alert/alert.i18n.js.map +0 -1
- package/dist/collection/components/alert/alert.interfaces.js.map +0 -1
- package/dist/collection/components/alert/alert.js.map +0 -1
- package/dist/collection/components/annotation/annotation-activiteit/annotation-activiteit.js.map +0 -1
- package/dist/collection/components/annotation/annotation-body.js.map +0 -1
- package/dist/collection/components/annotation/annotation-gebiedsaanwijzing/annotation-gebiedsaanwijzing.js.map +0 -1
- package/dist/collection/components/annotation/annotation-gewijzigde-locatie.js.map +0 -1
- package/dist/collection/components/annotation/annotation-kaart/annotation-kaart.interfaces.js.map +0 -1
- package/dist/collection/components/annotation/annotation-kaart/annotation-kaart.js.map +0 -1
- package/dist/collection/components/annotation/annotation-list-renvooi-values.js.map +0 -1
- package/dist/collection/components/annotation/annotation-locatie/annotation-locatie.js.map +0 -1
- package/dist/collection/components/annotation/annotation-omgevingsnormwaarde/annotation-omgevingsnormwaarde.js.map +0 -1
- package/dist/collection/components/annotation/annotation-symbol-slot.js.map +0 -1
- package/dist/collection/components/annotation/annotation-watcher.js.map +0 -1
- package/dist/collection/components/annotation/annotation.interfaces.js.map +0 -1
- package/dist/collection/components/attachments-counter/attachments-counter.js.map +0 -1
- package/dist/collection/components/autosuggest/autosuggest.i18n.js.map +0 -1
- package/dist/collection/components/autosuggest/autosuggest.interfaces.js.map +0 -1
- package/dist/collection/components/autosuggest/autosuggest.js.map +0 -1
- package/dist/collection/components/badge/badge.interfaces.js.map +0 -1
- package/dist/collection/components/badge/badge.js.map +0 -1
- package/dist/collection/components/banner/banner.js.map +0 -1
- package/dist/collection/components/button-group/button-group.interfaces.js.map +0 -1
- package/dist/collection/components/button-group/button-group.js.map +0 -1
- package/dist/collection/components/card/card.interfaces.js.map +0 -1
- package/dist/collection/components/card/card.js.map +0 -1
- package/dist/collection/components/card-container/card-container.interfaces.js.map +0 -1
- package/dist/collection/components/card-container/card-container.js.map +0 -1
- package/dist/collection/components/contact-information/contact-information.js.map +0 -1
- package/dist/collection/components/cursor-tooltip/cursor-tooltip.js.map +0 -1
- package/dist/collection/components/date-picker/date-picker.interfaces.js.map +0 -1
- package/dist/collection/components/date-picker/date-picker.js.map +0 -1
- package/dist/collection/components/date-picker/date-utils.js.map +0 -1
- package/dist/collection/components/document-card/document-card.interfaces.js.map +0 -1
- package/dist/collection/components/document-card/document-card.js.map +0 -1
- package/dist/collection/components/document-component/document-component-heading.js.map +0 -1
- package/dist/collection/components/document-component/document-component.interfaces.js.map +0 -1
- package/dist/collection/components/document-component/document-component.js.map +0 -1
- package/dist/collection/components/document-component-demo/document-component.demo.js.map +0 -1
- package/dist/collection/components/dropdown-menu/dropdown-menu.js.map +0 -1
- package/dist/collection/components/expandable/expandable.interfaces.js.map +0 -1
- package/dist/collection/components/expandable/expandable.js.map +0 -1
- package/dist/collection/components/header/header.i18n.js.map +0 -1
- package/dist/collection/components/header/header.interfaces.js.map +0 -1
- package/dist/collection/components/header/header.js.map +0 -1
- package/dist/collection/components/header/menu-item.functional-component.js.map +0 -1
- package/dist/collection/components/highlight-box/highlight-box.js.map +0 -1
- package/dist/collection/components/history-item/history-item.interfaces.js.map +0 -1
- package/dist/collection/components/history-item/history-item.js.map +0 -1
- package/dist/collection/components/icon/icon.js.map +0 -1
- package/dist/collection/components/icon-button/icon-button.interfaces.js.map +0 -1
- package/dist/collection/components/icon-button/icon-button.js.map +0 -1
- package/dist/collection/components/image-overlay/image-overlay.js.map +0 -1
- package/dist/collection/components/info/info.js.map +0 -1
- package/dist/collection/components/info-button/info-button.interfaces.js.map +0 -1
- package/dist/collection/components/info-button/info-button.js.map +0 -1
- package/dist/collection/components/input-range/input-range.interfaces.js.map +0 -1
- package/dist/collection/components/input-range/input-range.js.map +0 -1
- package/dist/collection/components/label/label.interfaces.js.map +0 -1
- package/dist/collection/components/label/label.js.map +0 -1
- package/dist/collection/components/legend/legend.interfaces.js.map +0 -1
- package/dist/collection/components/legend/legend.js.map +0 -1
- package/dist/collection/components/legend-item/legend-item.interfaces.js +0 -2
- package/dist/collection/components/legend-item/legend-item.interfaces.js.map +0 -1
- package/dist/collection/components/legend-item/legend-item.js.map +0 -1
- package/dist/collection/components/list-button/list-button.interfaces.js.map +0 -1
- package/dist/collection/components/list-button/list-button.js.map +0 -1
- package/dist/collection/components/logo/logo.interfaces.js.map +0 -1
- package/dist/collection/components/logo/logo.js.map +0 -1
- package/dist/collection/components/map-base-layers/map-base-layers.i18n.js.map +0 -1
- package/dist/collection/components/map-base-layers/map-base-layers.interfaces.js.map +0 -1
- package/dist/collection/components/map-base-layers/map-base-layers.js.map +0 -1
- package/dist/collection/components/map-controls/map-controls.i18n.js.map +0 -1
- package/dist/collection/components/map-controls/map-controls.interfaces.js.map +0 -1
- package/dist/collection/components/map-controls/map-controls.js.map +0 -1
- package/dist/collection/components/map-layer/components/map-layer-object.interfaces.js.map +0 -1
- package/dist/collection/components/map-layer/components/map-layer-object.js.map +0 -1
- package/dist/collection/components/map-layer/map-layer.interfaces.js.map +0 -1
- package/dist/collection/components/map-layer/map-layer.js.map +0 -1
- package/dist/collection/components/map-overlays/map-overlays.i18n.js.map +0 -1
- package/dist/collection/components/map-overlays/map-overlays.interfaces.js.map +0 -1
- package/dist/collection/components/map-overlays/map-overlays.js.map +0 -1
- package/dist/collection/components/mark-bar/mark-bar.interfaces.js.map +0 -1
- package/dist/collection/components/mark-bar/mark-bar.js.map +0 -1
- package/dist/collection/components/modal/modal.i18n.js.map +0 -1
- package/dist/collection/components/modal/modal.interfaces.js.map +0 -1
- package/dist/collection/components/modal/modal.js.map +0 -1
- package/dist/collection/components/onboarding-tip/onboarding-tip.interfaces.js.map +0 -1
- package/dist/collection/components/onboarding-tip/onboarding-tip.js.map +0 -1
- package/dist/collection/components/ozon-content/components/ozon-content-toggletip/ozon-content-toggletip.js.map +0 -1
- package/dist/collection/components/ozon-content/functional-components/wrap-wijzigactie.functional-component.js.map +0 -1
- package/dist/collection/components/ozon-content/functions/parse-wijzigactie-from-node.function.js.map +0 -1
- package/dist/collection/components/ozon-content/functions/wijzigactie-to-class-name.function.js.map +0 -1
- package/dist/collection/components/ozon-content/get-node-name.function.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/abbr.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/al.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/begrip.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/begrippenlijst.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/bron.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/document.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/ext-ref.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/fallback.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/figuur.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/inhoud.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/inline-tekst-afbeelding.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/inline.nodes.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/int-io-ref.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/int-ref.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/kop.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/lijst.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/nieuwe-tekst.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/noot.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/table.node/colspec/colspec-mapper.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/table.node/index.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table-cell.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table-colgroup.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table-rows.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/text.node.js.map +0 -1
- package/dist/collection/components/ozon-content/nodes/verwijderde-tekst.node.js.map +0 -1
- package/dist/collection/components/ozon-content/ozon-content-context.interface.js.map +0 -1
- package/dist/collection/components/ozon-content/ozon-content-mapper.js.map +0 -1
- package/dist/collection/components/ozon-content/ozon-content-node-context.interface.js.map +0 -1
- package/dist/collection/components/ozon-content/ozon-content-node-state.interface.js.map +0 -1
- package/dist/collection/components/ozon-content/ozon-content-node.interface.js.map +0 -1
- package/dist/collection/components/ozon-content/ozon-content.interfaces.js.map +0 -1
- package/dist/collection/components/ozon-content/ozon-content.js.map +0 -1
- package/dist/collection/components/pagination/pagination.interfaces.js.map +0 -1
- package/dist/collection/components/pagination/pagination.js.map +0 -1
- package/dist/collection/components/panel/panel.i18n.js.map +0 -1
- package/dist/collection/components/panel/panel.interfaces.js.map +0 -1
- package/dist/collection/components/panel/panel.js.map +0 -1
- package/dist/collection/components/plekinfo-card/plekinfo-card.interfaces.js.map +0 -1
- package/dist/collection/components/plekinfo-card/plekinfo-card.js.map +0 -1
- package/dist/collection/components/progress-indicator/progress-indicator.i18n.js.map +0 -1
- package/dist/collection/components/progress-indicator/progress-indicator.js.map +0 -1
- package/dist/collection/components/project-item/project-item.js.map +0 -1
- package/dist/collection/components/renvooi/renvooi-render-text.js.map +0 -1
- package/dist/collection/components/renvooi/renvooi-render.js.map +0 -1
- package/dist/collection/components/renvooi/renvooi.interfaces.js.map +0 -1
- package/dist/collection/components/renvooi/renvooi.js.map +0 -1
- package/dist/collection/components/responsive-element/responsive-element.interfaces.js.map +0 -1
- package/dist/collection/components/responsive-element/responsive-element.js.map +0 -1
- package/dist/collection/components/scrollable/scrollable.interfaces.js.map +0 -1
- package/dist/collection/components/scrollable/scrollable.js.map +0 -1
- package/dist/collection/components/selectable/selectable.interfaces.js.map +0 -1
- package/dist/collection/components/selectable/selectable.js.map +0 -1
- package/dist/collection/components/skiplink/skiplink.interfaces.js.map +0 -1
- package/dist/collection/components/skiplink/skiplink.js.map +0 -1
- package/dist/collection/components/slide-toggle/slide-toggle.interfaces.js.map +0 -1
- package/dist/collection/components/slide-toggle/slide-toggle.js.map +0 -1
- package/dist/collection/components/survey-rating/survey-rating.interfaces.js.map +0 -1
- package/dist/collection/components/survey-rating/survey-rating.js.map +0 -1
- package/dist/collection/components/table/table.js.map +0 -1
- package/dist/collection/components/tabs/components/tab.js.map +0 -1
- package/dist/collection/components/tabs/tabs.interfaces.js.map +0 -1
- package/dist/collection/components/tabs/tabs.js.map +0 -1
- package/dist/collection/components/tijdreis-banner/tijdreis-banner.js.map +0 -1
- package/dist/collection/components/toggletip/toggletip.js.map +0 -1
- package/dist/collection/components/tooltip/tooltip.js.map +0 -1
- package/dist/collection/components/tree-view/tree-item.js.map +0 -1
- package/dist/collection/components/tree-view/tree-view.interfaces.js.map +0 -1
- package/dist/collection/components/tree-view/tree-view.js.map +0 -1
- package/dist/collection/components/viewer-grid/components/document-panel.js.map +0 -1
- package/dist/collection/components/viewer-grid/components/filter-panel.js.map +0 -1
- package/dist/collection/components/viewer-grid/components/index.js.map +0 -1
- package/dist/collection/components/viewer-grid/components/main-panel.js.map +0 -1
- package/dist/collection/components/viewer-grid/components/overlay.js.map +0 -1
- package/dist/collection/components/viewer-grid/components/sizing-buttons.js.map +0 -1
- package/dist/collection/components/viewer-grid/viewer-grid.interfaces.js.map +0 -1
- package/dist/collection/components/viewer-grid/viewer-grid.js.map +0 -1
- package/dist/collection/functional-components/mark-text/mark-text.functional-component.js.map +0 -1
- package/dist/collection/functional-components/mark-text/mark-text.interfaces.js.map +0 -1
- package/dist/collection/functional-components/tooltip/position-tooltip.function.js.map +0 -1
- package/dist/collection/functional-components/tooltip/tooltip.functional-component.js.map +0 -1
- package/dist/collection/functional-components/tooltip/tooltip.interfaces.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/utils/create-identifier.js.map +0 -1
- package/dist/collection/utils/get-active-element.js.map +0 -1
- package/dist/collection/utils/has-overflow.js.map +0 -1
- package/dist/collection/utils/i18n.js.map +0 -1
- package/dist/collection/utils/is-interactive-element.js.map +0 -1
- package/dist/collection/utils/is-modified-event.js.map +0 -1
- package/dist/collection/utils/parse-xml.js.map +0 -1
- package/dist/components/alert.js.map +0 -1
- package/dist/components/annotation-body.js.map +0 -1
- package/dist/components/annotation-list-renvooi-values.js.map +0 -1
- package/dist/components/annotation-locatie.js.map +0 -1
- package/dist/components/annotation-watcher.js.map +0 -1
- package/dist/components/attachments-counter.js.map +0 -1
- package/dist/components/badge.js.map +0 -1
- package/dist/components/button-group.js.map +0 -1
- package/dist/components/clsx.js.map +0 -1
- package/dist/components/document-component.js.map +0 -1
- package/dist/components/dropdown-menu.js.map +0 -1
- package/dist/components/dso-accordion-section.js.map +0 -1
- package/dist/components/dso-accordion.js.map +0 -1
- package/dist/components/dso-action-list-item.js.map +0 -1
- package/dist/components/dso-action-list.js.map +0 -1
- package/dist/components/dso-advanced-select.js.map +0 -1
- package/dist/components/dso-alert.js.map +0 -1
- package/dist/components/dso-annotation-activiteit.js.map +0 -1
- package/dist/components/dso-annotation-gebiedsaanwijzing.js.map +0 -1
- package/dist/components/dso-annotation-kaart.js.map +0 -1
- package/dist/components/dso-annotation-locatie.js.map +0 -1
- package/dist/components/dso-annotation-omgevingsnormwaarde.js.map +0 -1
- package/dist/components/dso-attachments-counter.js.map +0 -1
- package/dist/components/dso-autosuggest.js.map +0 -1
- package/dist/components/dso-badge.js.map +0 -1
- package/dist/components/dso-banner.js.map +0 -1
- package/dist/components/dso-button-group.js.map +0 -1
- package/dist/components/dso-card-container.js.map +0 -1
- package/dist/components/dso-card.js.map +0 -1
- package/dist/components/dso-contact-information.js.map +0 -1
- package/dist/components/dso-cursor-tooltip.js.map +0 -1
- package/dist/components/dso-date-picker.js.map +0 -1
- package/dist/components/dso-document-card.js.map +0 -1
- package/dist/components/dso-document-component.js.map +0 -1
- package/dist/components/dso-dropdown-menu.js.map +0 -1
- package/dist/components/dso-expandable.js.map +0 -1
- package/dist/components/dso-header.js.map +0 -1
- package/dist/components/dso-highlight-box.js.map +0 -1
- package/dist/components/dso-history-item.js.map +0 -1
- package/dist/components/dso-icon-button.js.map +0 -1
- package/dist/components/dso-icon.js.map +0 -1
- package/dist/components/dso-image-overlay.js.map +0 -1
- package/dist/components/dso-info-button.js.map +0 -1
- package/dist/components/dso-info.js.map +0 -1
- package/dist/components/dso-input-range.js.map +0 -1
- package/dist/components/dso-label.js.map +0 -1
- package/dist/components/dso-legend-item.js.map +0 -1
- package/dist/components/dso-legend.js.map +0 -1
- package/dist/components/dso-list-button.js.map +0 -1
- package/dist/components/dso-logo.js.map +0 -1
- package/dist/components/dso-map-base-layers.js.map +0 -1
- package/dist/components/dso-map-controls.js.map +0 -1
- package/dist/components/dso-map-layer-object.js.map +0 -1
- package/dist/components/dso-map-layer.js.map +0 -1
- package/dist/components/dso-map-overlays.js.map +0 -1
- package/dist/components/dso-mark-bar.js.map +0 -1
- package/dist/components/dso-modal.js.map +0 -1
- package/dist/components/dso-onboarding-tip.js.map +0 -1
- package/dist/components/dso-ozon-content-toggletip.js.map +0 -1
- package/dist/components/dso-ozon-content.js.map +0 -1
- package/dist/components/dso-pagination.js.map +0 -1
- package/dist/components/dso-panel.js.map +0 -1
- package/dist/components/dso-plekinfo-card.js.map +0 -1
- package/dist/components/dso-progress-indicator.js.map +0 -1
- package/dist/components/dso-project-item.js.map +0 -1
- package/dist/components/dso-renvooi.js.map +0 -1
- package/dist/components/dso-responsive-element.js.map +0 -1
- package/dist/components/dso-scrollable.js.map +0 -1
- package/dist/components/dso-selectable.js.map +0 -1
- package/dist/components/dso-skiplink.js.map +0 -1
- package/dist/components/dso-slide-toggle.js.map +0 -1
- package/dist/components/dso-survey-rating.js.map +0 -1
- package/dist/components/dso-tab.js.map +0 -1
- package/dist/components/dso-table.js.map +0 -1
- package/dist/components/dso-tabs.js.map +0 -1
- package/dist/components/dso-tijdreis-banner.js.map +0 -1
- package/dist/components/dso-toggletip.js.map +0 -1
- package/dist/components/dso-tooltip.js.map +0 -1
- package/dist/components/dso-tree-view.js.map +0 -1
- package/dist/components/dso-viewer-grid.js.map +0 -1
- package/dist/components/dsot-document-component-demo.js.map +0 -1
- package/dist/components/expandable.js.map +0 -1
- package/dist/components/floating-ui.dom.js.map +0 -1
- package/dist/components/get-active-element.js.map +0 -1
- package/dist/components/i18n.js.map +0 -1
- package/dist/components/icon-button.js.map +0 -1
- package/dist/components/icon.js.map +0 -1
- package/dist/components/image-overlay.js.map +0 -1
- package/dist/components/index.esm.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/index2.js.map +0 -1
- package/dist/components/info-button.js.map +0 -1
- package/dist/components/info.js.map +0 -1
- package/dist/components/is-modified-event.js.map +0 -1
- package/dist/components/label.js.map +0 -1
- package/dist/components/ozon-content-toggletip.js.map +0 -1
- package/dist/components/ozon-content.js.map +0 -1
- package/dist/components/panel.js.map +0 -1
- package/dist/components/progress-indicator.js.map +0 -1
- package/dist/components/renvooi.js.map +0 -1
- package/dist/components/responsive-element.js.map +0 -1
- package/dist/components/scrollable.js.map +0 -1
- package/dist/components/selectable.js.map +0 -1
- package/dist/components/slide-toggle.js.map +0 -1
- package/dist/components/table.js.map +0 -1
- package/dist/components/toggletip.js +0 -113
- package/dist/components/toggletip.js.map +0 -1
- package/dist/components/tooltip.functional-component.js.map +0 -1
- package/dist/components/tooltip.js.map +0 -1
- package/dist/components/v4.js.map +0 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js.map +0 -1
- package/dist/dso-toolkit/index.esm.js.map +0 -1
- package/dist/dso-toolkit/loader.esm.js.map +0 -1
- package/dist/dso-toolkit/p-0abaf49f.entry.js +0 -2
- package/dist/dso-toolkit/p-0abaf49f.entry.js.map +0 -1
- package/dist/dso-toolkit/p-0fffd169.entry.js +0 -2
- package/dist/dso-toolkit/p-0fffd169.entry.js.map +0 -1
- package/dist/dso-toolkit/p-1c6192d7.entry.js +0 -2
- package/dist/dso-toolkit/p-1c6192d7.entry.js.map +0 -1
- package/dist/dso-toolkit/p-1f11853e.entry.js +0 -2
- package/dist/dso-toolkit/p-1f11853e.entry.js.map +0 -1
- package/dist/dso-toolkit/p-1fb8d4bb.entry.js +0 -2
- package/dist/dso-toolkit/p-1fb8d4bb.entry.js.map +0 -1
- package/dist/dso-toolkit/p-20c9a9be.entry.js +0 -2
- package/dist/dso-toolkit/p-20c9a9be.entry.js.map +0 -1
- package/dist/dso-toolkit/p-25aad37b.entry.js +0 -2
- package/dist/dso-toolkit/p-25aad37b.entry.js.map +0 -1
- package/dist/dso-toolkit/p-2748519c.entry.js +0 -2
- package/dist/dso-toolkit/p-2748519c.entry.js.map +0 -1
- package/dist/dso-toolkit/p-27ecb669.entry.js +0 -2
- package/dist/dso-toolkit/p-27ecb669.entry.js.map +0 -1
- package/dist/dso-toolkit/p-2a3314e5.entry.js +0 -2
- package/dist/dso-toolkit/p-2a3314e5.entry.js.map +0 -1
- package/dist/dso-toolkit/p-2d35b793.entry.js +0 -2
- package/dist/dso-toolkit/p-2d35b793.entry.js.map +0 -1
- package/dist/dso-toolkit/p-3217e47b.entry.js +0 -2
- package/dist/dso-toolkit/p-3217e47b.entry.js.map +0 -1
- package/dist/dso-toolkit/p-37d53ff9.entry.js +0 -2
- package/dist/dso-toolkit/p-37d53ff9.entry.js.map +0 -1
- package/dist/dso-toolkit/p-3a7e5965.entry.js +0 -2
- package/dist/dso-toolkit/p-3a7e5965.entry.js.map +0 -1
- package/dist/dso-toolkit/p-4aee1b2e.entry.js +0 -2
- package/dist/dso-toolkit/p-4aee1b2e.entry.js.map +0 -1
- package/dist/dso-toolkit/p-4d75aeaf.entry.js +0 -2
- package/dist/dso-toolkit/p-4d75aeaf.entry.js.map +0 -1
- package/dist/dso-toolkit/p-50ea7ead.entry.js +0 -2
- package/dist/dso-toolkit/p-50ea7ead.entry.js.map +0 -1
- package/dist/dso-toolkit/p-526ebea7.entry.js +0 -2
- package/dist/dso-toolkit/p-526ebea7.entry.js.map +0 -1
- package/dist/dso-toolkit/p-542c4568.entry.js +0 -6
- package/dist/dso-toolkit/p-542c4568.entry.js.map +0 -1
- package/dist/dso-toolkit/p-5e8291ba.entry.js +0 -2
- package/dist/dso-toolkit/p-5e8291ba.entry.js.map +0 -1
- package/dist/dso-toolkit/p-5f69ed68.entry.js +0 -2
- package/dist/dso-toolkit/p-5f69ed68.entry.js.map +0 -1
- package/dist/dso-toolkit/p-6995bf7c.entry.js +0 -2
- package/dist/dso-toolkit/p-6995bf7c.entry.js.map +0 -1
- package/dist/dso-toolkit/p-6ae428d5.entry.js +0 -2
- package/dist/dso-toolkit/p-6ae428d5.entry.js.map +0 -1
- package/dist/dso-toolkit/p-6e0ba75b.entry.js +0 -2
- package/dist/dso-toolkit/p-6e0ba75b.entry.js.map +0 -1
- package/dist/dso-toolkit/p-7285f1f0.entry.js +0 -2
- package/dist/dso-toolkit/p-7285f1f0.entry.js.map +0 -1
- package/dist/dso-toolkit/p-72fd4bfe.entry.js +0 -2
- package/dist/dso-toolkit/p-72fd4bfe.entry.js.map +0 -1
- package/dist/dso-toolkit/p-7fc764a4.entry.js +0 -2
- package/dist/dso-toolkit/p-7fc764a4.entry.js.map +0 -1
- package/dist/dso-toolkit/p-80e385b3.entry.js +0 -2
- package/dist/dso-toolkit/p-80e385b3.entry.js.map +0 -1
- package/dist/dso-toolkit/p-82ec47c8.entry.js +0 -2
- package/dist/dso-toolkit/p-82ec47c8.entry.js.map +0 -1
- package/dist/dso-toolkit/p-8ba1805d.entry.js +0 -2
- package/dist/dso-toolkit/p-8ba1805d.entry.js.map +0 -1
- package/dist/dso-toolkit/p-8be7df7f.entry.js +0 -2
- package/dist/dso-toolkit/p-8be7df7f.entry.js.map +0 -1
- package/dist/dso-toolkit/p-8c187590.entry.js +0 -2
- package/dist/dso-toolkit/p-8c187590.entry.js.map +0 -1
- package/dist/dso-toolkit/p-8c303909.entry.js +0 -2
- package/dist/dso-toolkit/p-8c303909.entry.js.map +0 -1
- package/dist/dso-toolkit/p-8fb2ba3e.entry.js +0 -2
- package/dist/dso-toolkit/p-8fb2ba3e.entry.js.map +0 -1
- package/dist/dso-toolkit/p-924ef127.entry.js +0 -2
- package/dist/dso-toolkit/p-924ef127.entry.js.map +0 -1
- package/dist/dso-toolkit/p-97700c36.entry.js +0 -2
- package/dist/dso-toolkit/p-97700c36.entry.js.map +0 -1
- package/dist/dso-toolkit/p-BFTU3MAI.js.map +0 -1
- package/dist/dso-toolkit/p-C1uSuLE3.js +0 -2
- package/dist/dso-toolkit/p-C1uSuLE3.js.map +0 -1
- package/dist/dso-toolkit/p-CTkMTWyv.js +0 -2
- package/dist/dso-toolkit/p-CTkMTWyv.js.map +0 -1
- package/dist/dso-toolkit/p-C_akviUd.js.map +0 -1
- package/dist/dso-toolkit/p-ChV9xqsO.js.map +0 -1
- package/dist/dso-toolkit/p-CodDyi2J.js +0 -2
- package/dist/dso-toolkit/p-CodDyi2J.js.map +0 -1
- package/dist/dso-toolkit/p-DDSMs62-.js +0 -6
- package/dist/dso-toolkit/p-DDSMs62-.js.map +0 -1
- package/dist/dso-toolkit/p-DQuL1Twl.js.map +0 -1
- package/dist/dso-toolkit/p-DY6u58-r.js +0 -2
- package/dist/dso-toolkit/p-DY6u58-r.js.map +0 -1
- package/dist/dso-toolkit/p-DhlPEFYa.js +0 -2
- package/dist/dso-toolkit/p-DhlPEFYa.js.map +0 -1
- package/dist/dso-toolkit/p-DsSLzkr9.js +0 -2
- package/dist/dso-toolkit/p-DsSLzkr9.js.map +0 -1
- package/dist/dso-toolkit/p-Dx5skKSq.js +0 -14
- package/dist/dso-toolkit/p-Dx5skKSq.js.map +0 -1
- package/dist/dso-toolkit/p-Hgv-pDpy.js.map +0 -1
- package/dist/dso-toolkit/p-a1b8072a.entry.js +0 -2
- package/dist/dso-toolkit/p-a1b8072a.entry.js.map +0 -1
- package/dist/dso-toolkit/p-a58cc4a7.entry.js +0 -2
- package/dist/dso-toolkit/p-a58cc4a7.entry.js.map +0 -1
- package/dist/dso-toolkit/p-a8e32da8.entry.js +0 -2
- package/dist/dso-toolkit/p-a8e32da8.entry.js.map +0 -1
- package/dist/dso-toolkit/p-b0d6f317.entry.js +0 -2
- package/dist/dso-toolkit/p-b0d6f317.entry.js.map +0 -1
- package/dist/dso-toolkit/p-b1a385c9.entry.js +0 -2
- package/dist/dso-toolkit/p-b1a385c9.entry.js.map +0 -1
- package/dist/dso-toolkit/p-b78d1e0e.entry.js +0 -2
- package/dist/dso-toolkit/p-b78d1e0e.entry.js.map +0 -1
- package/dist/dso-toolkit/p-baWVwd8J.js.map +0 -1
- package/dist/dso-toolkit/p-c1a9a483.entry.js +0 -2
- package/dist/dso-toolkit/p-c1a9a483.entry.js.map +0 -1
- package/dist/dso-toolkit/p-c4499b88.entry.js +0 -2
- package/dist/dso-toolkit/p-c4499b88.entry.js.map +0 -1
- package/dist/dso-toolkit/p-c4e73a45.entry.js +0 -2
- package/dist/dso-toolkit/p-c4e73a45.entry.js.map +0 -1
- package/dist/dso-toolkit/p-c86138aa.entry.js +0 -2
- package/dist/dso-toolkit/p-c86138aa.entry.js.map +0 -1
- package/dist/dso-toolkit/p-d0335c74.entry.js +0 -2
- package/dist/dso-toolkit/p-d0335c74.entry.js.map +0 -1
- package/dist/dso-toolkit/p-d10abd51.entry.js +0 -2
- package/dist/dso-toolkit/p-d10abd51.entry.js.map +0 -1
- package/dist/dso-toolkit/p-dtqgWwPF.js +0 -2
- package/dist/dso-toolkit/p-dtqgWwPF.js.map +0 -1
- package/dist/dso-toolkit/p-eb1f02d0.entry.js +0 -2
- package/dist/dso-toolkit/p-eb1f02d0.entry.js.map +0 -1
- package/dist/dso-toolkit/p-eb280c98.entry.js +0 -2
- package/dist/dso-toolkit/p-eb280c98.entry.js.map +0 -1
- package/dist/dso-toolkit/p-efc6ec01.entry.js +0 -2
- package/dist/dso-toolkit/p-efc6ec01.entry.js.map +0 -1
- package/dist/dso-toolkit/p-f333aebd.entry.js +0 -2
- package/dist/dso-toolkit/p-f333aebd.entry.js.map +0 -1
- package/dist/dso-toolkit/p-f488bdce.entry.js +0 -2
- package/dist/dso-toolkit/p-f488bdce.entry.js.map +0 -1
- package/dist/dso-toolkit/p-f4c12ec1.entry.js +0 -2
- package/dist/dso-toolkit/p-f4c12ec1.entry.js.map +0 -1
- package/dist/dso-toolkit/p-f7837b38.entry.js +0 -2
- package/dist/dso-toolkit/p-f7837b38.entry.js.map +0 -1
- package/dist/dso-toolkit/p-f87553d9.entry.js +0 -2
- package/dist/dso-toolkit/p-f87553d9.entry.js.map +0 -1
- package/dist/dso-toolkit/p-f89f62ea.entry.js +0 -2
- package/dist/dso-toolkit/p-f89f62ea.entry.js.map +0 -1
- package/dist/dso-toolkit/p-fcc4186a.entry.js +0 -2
- package/dist/dso-toolkit/p-fcc4186a.entry.js.map +0 -1
- package/dist/dso-toolkit/p-pxiVAmq4.js +0 -2
- package/dist/dso-toolkit/p-pxiVAmq4.js.map +0 -1
- package/dist/dso-toolkit/p-trJ4oBvK.js +0 -2
- package/dist/dso-toolkit/p-trJ4oBvK.js.map +0 -1
- package/dist/esm/_commonjsHelpers-BFTU3MAI.js.map +0 -1
- package/dist/esm/annotation-body-BssUg8-Y.js.map +0 -1
- package/dist/esm/annotation-list-renvooi-values-BD0DT_sp.js +0 -10
- package/dist/esm/annotation-list-renvooi-values-BD0DT_sp.js.map +0 -1
- package/dist/esm/annotation-watcher-Rs1ULLIo.js.map +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
- package/dist/esm/clsx-ChV9xqsO.js.map +0 -1
- package/dist/esm/dso-accordion-section.entry.js.map +0 -1
- package/dist/esm/dso-accordion.entry.js.map +0 -1
- package/dist/esm/dso-action-list-item.entry.js.map +0 -1
- package/dist/esm/dso-action-list.entry.js.map +0 -1
- package/dist/esm/dso-advanced-select.entry.js.map +0 -1
- package/dist/esm/dso-annotation-activiteit.entry.js.map +0 -1
- package/dist/esm/dso-annotation-gebiedsaanwijzing.entry.js.map +0 -1
- package/dist/esm/dso-annotation-kaart.entry.js.map +0 -1
- package/dist/esm/dso-annotation-omgevingsnormwaarde.entry.js.map +0 -1
- package/dist/esm/dso-autosuggest.entry.js.map +0 -1
- package/dist/esm/dso-banner.entry.js.map +0 -1
- package/dist/esm/dso-button-group.entry.js.map +0 -1
- package/dist/esm/dso-card-container.entry.js.map +0 -1
- package/dist/esm/dso-card.entry.js.map +0 -1
- package/dist/esm/dso-contact-information.entry.js.map +0 -1
- package/dist/esm/dso-cursor-tooltip.entry.js.map +0 -1
- package/dist/esm/dso-date-picker.entry.js.map +0 -1
- package/dist/esm/dso-document-card.entry.js.map +0 -1
- package/dist/esm/dso-dropdown-menu.entry.js.map +0 -1
- package/dist/esm/dso-header.entry.js.map +0 -1
- package/dist/esm/dso-highlight-box.entry.js.map +0 -1
- package/dist/esm/dso-history-item.entry.js.map +0 -1
- package/dist/esm/dso-info-button.entry.js.map +0 -1
- package/dist/esm/dso-input-range.entry.js.map +0 -1
- package/dist/esm/dso-legend-item.entry.js.map +0 -1
- package/dist/esm/dso-legend.entry.js.map +0 -1
- package/dist/esm/dso-list-button.entry.js.map +0 -1
- package/dist/esm/dso-logo.entry.js.map +0 -1
- package/dist/esm/dso-map-base-layers.entry.js.map +0 -1
- package/dist/esm/dso-map-controls.entry.js.map +0 -1
- package/dist/esm/dso-map-layer-object.entry.js.map +0 -1
- package/dist/esm/dso-map-layer.entry.js.map +0 -1
- package/dist/esm/dso-map-overlays.entry.js.map +0 -1
- package/dist/esm/dso-mark-bar.entry.js.map +0 -1
- package/dist/esm/dso-modal.entry.js.map +0 -1
- package/dist/esm/dso-onboarding-tip.entry.js.map +0 -1
- package/dist/esm/dso-pagination.entry.js.map +0 -1
- package/dist/esm/dso-plekinfo-card.entry.js.map +0 -1
- package/dist/esm/dso-progress-indicator.entry.js.map +0 -1
- package/dist/esm/dso-project-item.entry.js.map +0 -1
- package/dist/esm/dso-responsive-element.entry.js.map +0 -1
- package/dist/esm/dso-scrollable.entry.js.map +0 -1
- package/dist/esm/dso-skiplink.entry.js.map +0 -1
- package/dist/esm/dso-survey-rating.entry.js.map +0 -1
- package/dist/esm/dso-tab.entry.js.map +0 -1
- package/dist/esm/dso-tabs.entry.js.map +0 -1
- package/dist/esm/dso-tijdreis-banner.entry.js.map +0 -1
- package/dist/esm/dso-toggletip.entry.js.map +0 -1
- package/dist/esm/dso-toolkit.js.map +0 -1
- package/dist/esm/dso-tooltip.entry.js.map +0 -1
- package/dist/esm/dso-tree-view.entry.js.map +0 -1
- package/dist/esm/dso-viewer-grid.entry.js.map +0 -1
- package/dist/esm/dsot-document-component-demo.entry.js.map +0 -1
- package/dist/esm/floating-ui.dom-C1uSuLE3.js.map +0 -1
- package/dist/esm/get-active-element-CodDyi2J.js +0 -15
- package/dist/esm/get-active-element-CodDyi2J.js.map +0 -1
- package/dist/esm/i18n-pxiVAmq4.js.map +0 -1
- package/dist/esm/index-Dx5skKSq.js.map +0 -1
- package/dist/esm/index-baWVwd8J.js.map +0 -1
- package/dist/esm/index.esm-DDSMs62-.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/is-modified-event-Hgv-pDpy.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/parse-wijzigactie-from-node.function-skF9dYbu.js.map +0 -1
- package/dist/esm/position-tooltip.function-gQf7Uoh1.js.map +0 -1
- package/dist/esm/tooltip.functional-component-faOeuQGr.js.map +0 -1
- package/dist/esm/v4-C_akviUd.js.map +0 -1
- package/dist/scripts/readme.js.map +0 -1
- package/dist/types/components/legend-item/legend-item.interfaces.d.ts +0 -11
- /package/dist/collection/components/{legend-item → legend/legend-item}/legend-item.css +0 -0
package/dist/components/i18n.js
CHANGED
|
@@ -1,2233 +1 @@
|
|
|
1
|
-
const isString = obj => typeof obj === 'string';
|
|
2
|
-
const defer = () => {
|
|
3
|
-
let res;
|
|
4
|
-
let rej;
|
|
5
|
-
const promise = new Promise((resolve, reject) => {
|
|
6
|
-
res = resolve;
|
|
7
|
-
rej = reject;
|
|
8
|
-
});
|
|
9
|
-
promise.resolve = res;
|
|
10
|
-
promise.reject = rej;
|
|
11
|
-
return promise;
|
|
12
|
-
};
|
|
13
|
-
const makeString = object => {
|
|
14
|
-
if (object == null) return '';
|
|
15
|
-
return '' + object;
|
|
16
|
-
};
|
|
17
|
-
const copy = (a, s, t) => {
|
|
18
|
-
a.forEach(m => {
|
|
19
|
-
if (s[m]) t[m] = s[m];
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
const lastOfPathSeparatorRegExp = /###/g;
|
|
23
|
-
const cleanKey = key => key && key.indexOf('###') > -1 ? key.replace(lastOfPathSeparatorRegExp, '.') : key;
|
|
24
|
-
const canNotTraverseDeeper = object => !object || isString(object);
|
|
25
|
-
const getLastOfPath = (object, path, Empty) => {
|
|
26
|
-
const stack = !isString(path) ? path : path.split('.');
|
|
27
|
-
let stackIndex = 0;
|
|
28
|
-
while (stackIndex < stack.length - 1) {
|
|
29
|
-
if (canNotTraverseDeeper(object)) return {};
|
|
30
|
-
const key = cleanKey(stack[stackIndex]);
|
|
31
|
-
if (!object[key] && Empty) object[key] = new Empty();
|
|
32
|
-
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
33
|
-
object = object[key];
|
|
34
|
-
} else {
|
|
35
|
-
object = {};
|
|
36
|
-
}
|
|
37
|
-
++stackIndex;
|
|
38
|
-
}
|
|
39
|
-
if (canNotTraverseDeeper(object)) return {};
|
|
40
|
-
return {
|
|
41
|
-
obj: object,
|
|
42
|
-
k: cleanKey(stack[stackIndex])
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
const setPath = (object, path, newValue) => {
|
|
46
|
-
const {
|
|
47
|
-
obj,
|
|
48
|
-
k
|
|
49
|
-
} = getLastOfPath(object, path, Object);
|
|
50
|
-
if (obj !== undefined || path.length === 1) {
|
|
51
|
-
obj[k] = newValue;
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
let e = path[path.length - 1];
|
|
55
|
-
let p = path.slice(0, path.length - 1);
|
|
56
|
-
let last = getLastOfPath(object, p, Object);
|
|
57
|
-
while (last.obj === undefined && p.length) {
|
|
58
|
-
e = `${p[p.length - 1]}.${e}`;
|
|
59
|
-
p = p.slice(0, p.length - 1);
|
|
60
|
-
last = getLastOfPath(object, p, Object);
|
|
61
|
-
if (last?.obj && typeof last.obj[`${last.k}.${e}`] !== 'undefined') {
|
|
62
|
-
last.obj = undefined;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
last.obj[`${last.k}.${e}`] = newValue;
|
|
66
|
-
};
|
|
67
|
-
const pushPath = (object, path, newValue, concat) => {
|
|
68
|
-
const {
|
|
69
|
-
obj,
|
|
70
|
-
k
|
|
71
|
-
} = getLastOfPath(object, path, Object);
|
|
72
|
-
obj[k] = obj[k] || [];
|
|
73
|
-
obj[k].push(newValue);
|
|
74
|
-
};
|
|
75
|
-
const getPath = (object, path) => {
|
|
76
|
-
const {
|
|
77
|
-
obj,
|
|
78
|
-
k
|
|
79
|
-
} = getLastOfPath(object, path);
|
|
80
|
-
if (!obj) return undefined;
|
|
81
|
-
if (!Object.prototype.hasOwnProperty.call(obj, k)) return undefined;
|
|
82
|
-
return obj[k];
|
|
83
|
-
};
|
|
84
|
-
const getPathWithDefaults = (data, defaultData, key) => {
|
|
85
|
-
const value = getPath(data, key);
|
|
86
|
-
if (value !== undefined) {
|
|
87
|
-
return value;
|
|
88
|
-
}
|
|
89
|
-
return getPath(defaultData, key);
|
|
90
|
-
};
|
|
91
|
-
const deepExtend = (target, source, overwrite) => {
|
|
92
|
-
for (const prop in source) {
|
|
93
|
-
if (prop !== '__proto__' && prop !== 'constructor') {
|
|
94
|
-
if (prop in target) {
|
|
95
|
-
if (isString(target[prop]) || target[prop] instanceof String || isString(source[prop]) || source[prop] instanceof String) {
|
|
96
|
-
if (overwrite) target[prop] = source[prop];
|
|
97
|
-
} else {
|
|
98
|
-
deepExtend(target[prop], source[prop], overwrite);
|
|
99
|
-
}
|
|
100
|
-
} else {
|
|
101
|
-
target[prop] = source[prop];
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return target;
|
|
106
|
-
};
|
|
107
|
-
const regexEscape = str => str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
|
|
108
|
-
var _entityMap = {
|
|
109
|
-
'&': '&',
|
|
110
|
-
'<': '<',
|
|
111
|
-
'>': '>',
|
|
112
|
-
'"': '"',
|
|
113
|
-
"'": ''',
|
|
114
|
-
'/': '/'
|
|
115
|
-
};
|
|
116
|
-
const escape = data => {
|
|
117
|
-
if (isString(data)) {
|
|
118
|
-
return data.replace(/[&<>"'\/]/g, s => _entityMap[s]);
|
|
119
|
-
}
|
|
120
|
-
return data;
|
|
121
|
-
};
|
|
122
|
-
class RegExpCache {
|
|
123
|
-
constructor(capacity) {
|
|
124
|
-
this.capacity = capacity;
|
|
125
|
-
this.regExpMap = new Map();
|
|
126
|
-
this.regExpQueue = [];
|
|
127
|
-
}
|
|
128
|
-
getRegExp(pattern) {
|
|
129
|
-
const regExpFromCache = this.regExpMap.get(pattern);
|
|
130
|
-
if (regExpFromCache !== undefined) {
|
|
131
|
-
return regExpFromCache;
|
|
132
|
-
}
|
|
133
|
-
const regExpNew = new RegExp(pattern);
|
|
134
|
-
if (this.regExpQueue.length === this.capacity) {
|
|
135
|
-
this.regExpMap.delete(this.regExpQueue.shift());
|
|
136
|
-
}
|
|
137
|
-
this.regExpMap.set(pattern, regExpNew);
|
|
138
|
-
this.regExpQueue.push(pattern);
|
|
139
|
-
return regExpNew;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
const chars = [' ', ',', '?', '!', ';'];
|
|
143
|
-
const looksLikeObjectPathRegExpCache = new RegExpCache(20);
|
|
144
|
-
const looksLikeObjectPath = (key, nsSeparator, keySeparator) => {
|
|
145
|
-
nsSeparator = nsSeparator || '';
|
|
146
|
-
keySeparator = keySeparator || '';
|
|
147
|
-
const possibleChars = chars.filter(c => nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0);
|
|
148
|
-
if (possibleChars.length === 0) return true;
|
|
149
|
-
const r = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map(c => c === '?' ? '\\?' : c).join('|')})`);
|
|
150
|
-
let matched = !r.test(key);
|
|
151
|
-
if (!matched) {
|
|
152
|
-
const ki = key.indexOf(keySeparator);
|
|
153
|
-
if (ki > 0 && !r.test(key.substring(0, ki))) {
|
|
154
|
-
matched = true;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return matched;
|
|
158
|
-
};
|
|
159
|
-
const deepFind = (obj, path, keySeparator = '.') => {
|
|
160
|
-
if (!obj) return undefined;
|
|
161
|
-
if (obj[path]) {
|
|
162
|
-
if (!Object.prototype.hasOwnProperty.call(obj, path)) return undefined;
|
|
163
|
-
return obj[path];
|
|
164
|
-
}
|
|
165
|
-
const tokens = path.split(keySeparator);
|
|
166
|
-
let current = obj;
|
|
167
|
-
for (let i = 0; i < tokens.length;) {
|
|
168
|
-
if (!current || typeof current !== 'object') {
|
|
169
|
-
return undefined;
|
|
170
|
-
}
|
|
171
|
-
let next;
|
|
172
|
-
let nextPath = '';
|
|
173
|
-
for (let j = i; j < tokens.length; ++j) {
|
|
174
|
-
if (j !== i) {
|
|
175
|
-
nextPath += keySeparator;
|
|
176
|
-
}
|
|
177
|
-
nextPath += tokens[j];
|
|
178
|
-
next = current[nextPath];
|
|
179
|
-
if (next !== undefined) {
|
|
180
|
-
if (['string', 'number', 'boolean'].indexOf(typeof next) > -1 && j < tokens.length - 1) {
|
|
181
|
-
continue;
|
|
182
|
-
}
|
|
183
|
-
i += j - i + 1;
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
current = next;
|
|
188
|
-
}
|
|
189
|
-
return current;
|
|
190
|
-
};
|
|
191
|
-
const getCleanedCode = code => code?.replace('_', '-');
|
|
192
|
-
|
|
193
|
-
const consoleLogger = {
|
|
194
|
-
type: 'logger',
|
|
195
|
-
log(args) {
|
|
196
|
-
this.output('log', args);
|
|
197
|
-
},
|
|
198
|
-
warn(args) {
|
|
199
|
-
this.output('warn', args);
|
|
200
|
-
},
|
|
201
|
-
error(args) {
|
|
202
|
-
this.output('error', args);
|
|
203
|
-
},
|
|
204
|
-
output(type, args) {
|
|
205
|
-
console?.[type]?.apply?.(console, args);
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
class Logger {
|
|
209
|
-
constructor(concreteLogger, options = {}) {
|
|
210
|
-
this.init(concreteLogger, options);
|
|
211
|
-
}
|
|
212
|
-
init(concreteLogger, options = {}) {
|
|
213
|
-
this.prefix = options.prefix || 'i18next:';
|
|
214
|
-
this.logger = concreteLogger || consoleLogger;
|
|
215
|
-
this.options = options;
|
|
216
|
-
this.debug = options.debug;
|
|
217
|
-
}
|
|
218
|
-
log(...args) {
|
|
219
|
-
return this.forward(args, 'log', '', true);
|
|
220
|
-
}
|
|
221
|
-
warn(...args) {
|
|
222
|
-
return this.forward(args, 'warn', '', true);
|
|
223
|
-
}
|
|
224
|
-
error(...args) {
|
|
225
|
-
return this.forward(args, 'error', '');
|
|
226
|
-
}
|
|
227
|
-
deprecate(...args) {
|
|
228
|
-
return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);
|
|
229
|
-
}
|
|
230
|
-
forward(args, lvl, prefix, debugOnly) {
|
|
231
|
-
if (debugOnly && !this.debug) return null;
|
|
232
|
-
if (isString(args[0])) args[0] = `${prefix}${this.prefix} ${args[0]}`;
|
|
233
|
-
return this.logger[lvl](args);
|
|
234
|
-
}
|
|
235
|
-
create(moduleName) {
|
|
236
|
-
return new Logger(this.logger, {
|
|
237
|
-
...{
|
|
238
|
-
prefix: `${this.prefix}:${moduleName}:`
|
|
239
|
-
},
|
|
240
|
-
...this.options
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
clone(options) {
|
|
244
|
-
options = options || this.options;
|
|
245
|
-
options.prefix = options.prefix || this.prefix;
|
|
246
|
-
return new Logger(this.logger, options);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
var baseLogger = new Logger();
|
|
250
|
-
|
|
251
|
-
class EventEmitter {
|
|
252
|
-
constructor() {
|
|
253
|
-
this.observers = {};
|
|
254
|
-
}
|
|
255
|
-
on(events, listener) {
|
|
256
|
-
events.split(' ').forEach(event => {
|
|
257
|
-
if (!this.observers[event]) this.observers[event] = new Map();
|
|
258
|
-
const numListeners = this.observers[event].get(listener) || 0;
|
|
259
|
-
this.observers[event].set(listener, numListeners + 1);
|
|
260
|
-
});
|
|
261
|
-
return this;
|
|
262
|
-
}
|
|
263
|
-
off(event, listener) {
|
|
264
|
-
if (!this.observers[event]) return;
|
|
265
|
-
if (!listener) {
|
|
266
|
-
delete this.observers[event];
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
this.observers[event].delete(listener);
|
|
270
|
-
}
|
|
271
|
-
emit(event, ...args) {
|
|
272
|
-
if (this.observers[event]) {
|
|
273
|
-
const cloned = Array.from(this.observers[event].entries());
|
|
274
|
-
cloned.forEach(([observer, numTimesAdded]) => {
|
|
275
|
-
for (let i = 0; i < numTimesAdded; i++) {
|
|
276
|
-
observer(...args);
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
if (this.observers['*']) {
|
|
281
|
-
const cloned = Array.from(this.observers['*'].entries());
|
|
282
|
-
cloned.forEach(([observer, numTimesAdded]) => {
|
|
283
|
-
for (let i = 0; i < numTimesAdded; i++) {
|
|
284
|
-
observer.apply(observer, [event, ...args]);
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
class ResourceStore extends EventEmitter {
|
|
292
|
-
constructor(data, options = {
|
|
293
|
-
ns: ['translation'],
|
|
294
|
-
defaultNS: 'translation'
|
|
295
|
-
}) {
|
|
296
|
-
super();
|
|
297
|
-
this.data = data || {};
|
|
298
|
-
this.options = options;
|
|
299
|
-
if (this.options.keySeparator === undefined) {
|
|
300
|
-
this.options.keySeparator = '.';
|
|
301
|
-
}
|
|
302
|
-
if (this.options.ignoreJSONStructure === undefined) {
|
|
303
|
-
this.options.ignoreJSONStructure = true;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
addNamespaces(ns) {
|
|
307
|
-
if (this.options.ns.indexOf(ns) < 0) {
|
|
308
|
-
this.options.ns.push(ns);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
removeNamespaces(ns) {
|
|
312
|
-
const index = this.options.ns.indexOf(ns);
|
|
313
|
-
if (index > -1) {
|
|
314
|
-
this.options.ns.splice(index, 1);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
getResource(lng, ns, key, options = {}) {
|
|
318
|
-
const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
319
|
-
const ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
320
|
-
let path;
|
|
321
|
-
if (lng.indexOf('.') > -1) {
|
|
322
|
-
path = lng.split('.');
|
|
323
|
-
} else {
|
|
324
|
-
path = [lng, ns];
|
|
325
|
-
if (key) {
|
|
326
|
-
if (Array.isArray(key)) {
|
|
327
|
-
path.push(...key);
|
|
328
|
-
} else if (isString(key) && keySeparator) {
|
|
329
|
-
path.push(...key.split(keySeparator));
|
|
330
|
-
} else {
|
|
331
|
-
path.push(key);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
const result = getPath(this.data, path);
|
|
336
|
-
if (!result && !ns && !key && lng.indexOf('.') > -1) {
|
|
337
|
-
lng = path[0];
|
|
338
|
-
ns = path[1];
|
|
339
|
-
key = path.slice(2).join('.');
|
|
340
|
-
}
|
|
341
|
-
if (result || !ignoreJSONStructure || !isString(key)) return result;
|
|
342
|
-
return deepFind(this.data?.[lng]?.[ns], key, keySeparator);
|
|
343
|
-
}
|
|
344
|
-
addResource(lng, ns, key, value, options = {
|
|
345
|
-
silent: false
|
|
346
|
-
}) {
|
|
347
|
-
const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
348
|
-
let path = [lng, ns];
|
|
349
|
-
if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
|
|
350
|
-
if (lng.indexOf('.') > -1) {
|
|
351
|
-
path = lng.split('.');
|
|
352
|
-
value = ns;
|
|
353
|
-
ns = path[1];
|
|
354
|
-
}
|
|
355
|
-
this.addNamespaces(ns);
|
|
356
|
-
setPath(this.data, path, value);
|
|
357
|
-
if (!options.silent) this.emit('added', lng, ns, key, value);
|
|
358
|
-
}
|
|
359
|
-
addResources(lng, ns, resources, options = {
|
|
360
|
-
silent: false
|
|
361
|
-
}) {
|
|
362
|
-
for (const m in resources) {
|
|
363
|
-
if (isString(resources[m]) || Array.isArray(resources[m])) this.addResource(lng, ns, m, resources[m], {
|
|
364
|
-
silent: true
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
if (!options.silent) this.emit('added', lng, ns, resources);
|
|
368
|
-
}
|
|
369
|
-
addResourceBundle(lng, ns, resources, deep, overwrite, options = {
|
|
370
|
-
silent: false,
|
|
371
|
-
skipCopy: false
|
|
372
|
-
}) {
|
|
373
|
-
let path = [lng, ns];
|
|
374
|
-
if (lng.indexOf('.') > -1) {
|
|
375
|
-
path = lng.split('.');
|
|
376
|
-
deep = resources;
|
|
377
|
-
resources = ns;
|
|
378
|
-
ns = path[1];
|
|
379
|
-
}
|
|
380
|
-
this.addNamespaces(ns);
|
|
381
|
-
let pack = getPath(this.data, path) || {};
|
|
382
|
-
if (!options.skipCopy) resources = JSON.parse(JSON.stringify(resources));
|
|
383
|
-
if (deep) {
|
|
384
|
-
deepExtend(pack, resources, overwrite);
|
|
385
|
-
} else {
|
|
386
|
-
pack = {
|
|
387
|
-
...pack,
|
|
388
|
-
...resources
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
setPath(this.data, path, pack);
|
|
392
|
-
if (!options.silent) this.emit('added', lng, ns, resources);
|
|
393
|
-
}
|
|
394
|
-
removeResourceBundle(lng, ns) {
|
|
395
|
-
if (this.hasResourceBundle(lng, ns)) {
|
|
396
|
-
delete this.data[lng][ns];
|
|
397
|
-
}
|
|
398
|
-
this.removeNamespaces(ns);
|
|
399
|
-
this.emit('removed', lng, ns);
|
|
400
|
-
}
|
|
401
|
-
hasResourceBundle(lng, ns) {
|
|
402
|
-
return this.getResource(lng, ns) !== undefined;
|
|
403
|
-
}
|
|
404
|
-
getResourceBundle(lng, ns) {
|
|
405
|
-
if (!ns) ns = this.options.defaultNS;
|
|
406
|
-
return this.getResource(lng, ns);
|
|
407
|
-
}
|
|
408
|
-
getDataByLanguage(lng) {
|
|
409
|
-
return this.data[lng];
|
|
410
|
-
}
|
|
411
|
-
hasLanguageSomeTranslations(lng) {
|
|
412
|
-
const data = this.getDataByLanguage(lng);
|
|
413
|
-
const n = data && Object.keys(data) || [];
|
|
414
|
-
return !!n.find(v => data[v] && Object.keys(data[v]).length > 0);
|
|
415
|
-
}
|
|
416
|
-
toJSON() {
|
|
417
|
-
return this.data;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
var postProcessor = {
|
|
422
|
-
processors: {},
|
|
423
|
-
addPostProcessor(module) {
|
|
424
|
-
this.processors[module.name] = module;
|
|
425
|
-
},
|
|
426
|
-
handle(processors, value, key, options, translator) {
|
|
427
|
-
processors.forEach(processor => {
|
|
428
|
-
value = this.processors[processor]?.process(value, key, options, translator) ?? value;
|
|
429
|
-
});
|
|
430
|
-
return value;
|
|
431
|
-
}
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
const PATH_KEY = Symbol('i18next/PATH_KEY');
|
|
435
|
-
function createProxy() {
|
|
436
|
-
const state = [];
|
|
437
|
-
const handler = Object.create(null);
|
|
438
|
-
let proxy;
|
|
439
|
-
handler.get = (target, key) => {
|
|
440
|
-
proxy?.revoke?.();
|
|
441
|
-
if (key === PATH_KEY) return state;
|
|
442
|
-
state.push(key);
|
|
443
|
-
proxy = Proxy.revocable(target, handler);
|
|
444
|
-
return proxy.proxy;
|
|
445
|
-
};
|
|
446
|
-
return Proxy.revocable(Object.create(null), handler).proxy;
|
|
447
|
-
}
|
|
448
|
-
function keysFromSelector(selector, opts) {
|
|
449
|
-
const {
|
|
450
|
-
[PATH_KEY]: path
|
|
451
|
-
} = selector(createProxy());
|
|
452
|
-
return path.join(opts?.keySeparator ?? '.');
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
const checkedLoadedFor = {};
|
|
456
|
-
const shouldHandleAsObject = res => !isString(res) && typeof res !== 'boolean' && typeof res !== 'number';
|
|
457
|
-
class Translator extends EventEmitter {
|
|
458
|
-
constructor(services, options = {}) {
|
|
459
|
-
super();
|
|
460
|
-
copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, this);
|
|
461
|
-
this.options = options;
|
|
462
|
-
if (this.options.keySeparator === undefined) {
|
|
463
|
-
this.options.keySeparator = '.';
|
|
464
|
-
}
|
|
465
|
-
this.logger = baseLogger.create('translator');
|
|
466
|
-
}
|
|
467
|
-
changeLanguage(lng) {
|
|
468
|
-
if (lng) this.language = lng;
|
|
469
|
-
}
|
|
470
|
-
exists(key, o = {
|
|
471
|
-
interpolation: {}
|
|
472
|
-
}) {
|
|
473
|
-
const opt = {
|
|
474
|
-
...o
|
|
475
|
-
};
|
|
476
|
-
if (key == null) return false;
|
|
477
|
-
const resolved = this.resolve(key, opt);
|
|
478
|
-
if (resolved?.res === undefined) return false;
|
|
479
|
-
const isObject = shouldHandleAsObject(resolved.res);
|
|
480
|
-
if (opt.returnObjects === false && isObject) {
|
|
481
|
-
return false;
|
|
482
|
-
}
|
|
483
|
-
return true;
|
|
484
|
-
}
|
|
485
|
-
extractFromKey(key, opt) {
|
|
486
|
-
let nsSeparator = opt.nsSeparator !== undefined ? opt.nsSeparator : this.options.nsSeparator;
|
|
487
|
-
if (nsSeparator === undefined) nsSeparator = ':';
|
|
488
|
-
const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
|
|
489
|
-
let namespaces = opt.ns || this.options.defaultNS || [];
|
|
490
|
-
const wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;
|
|
491
|
-
const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !opt.keySeparator && !this.options.userDefinedNsSeparator && !opt.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);
|
|
492
|
-
if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
|
|
493
|
-
const m = key.match(this.interpolator.nestingRegexp);
|
|
494
|
-
if (m && m.length > 0) {
|
|
495
|
-
return {
|
|
496
|
-
key,
|
|
497
|
-
namespaces: isString(namespaces) ? [namespaces] : namespaces
|
|
498
|
-
};
|
|
499
|
-
}
|
|
500
|
-
const parts = key.split(nsSeparator);
|
|
501
|
-
if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();
|
|
502
|
-
key = parts.join(keySeparator);
|
|
503
|
-
}
|
|
504
|
-
return {
|
|
505
|
-
key,
|
|
506
|
-
namespaces: isString(namespaces) ? [namespaces] : namespaces
|
|
507
|
-
};
|
|
508
|
-
}
|
|
509
|
-
translate(keys, o, lastKey) {
|
|
510
|
-
let opt = typeof o === 'object' ? {
|
|
511
|
-
...o
|
|
512
|
-
} : o;
|
|
513
|
-
if (typeof opt !== 'object' && this.options.overloadTranslationOptionHandler) {
|
|
514
|
-
opt = this.options.overloadTranslationOptionHandler(arguments);
|
|
515
|
-
}
|
|
516
|
-
if (typeof opt === 'object') opt = {
|
|
517
|
-
...opt
|
|
518
|
-
};
|
|
519
|
-
if (!opt) opt = {};
|
|
520
|
-
if (keys == null) return '';
|
|
521
|
-
if (typeof keys === 'function') keys = keysFromSelector(keys, {
|
|
522
|
-
...this.options,
|
|
523
|
-
...opt
|
|
524
|
-
});
|
|
525
|
-
if (!Array.isArray(keys)) keys = [String(keys)];
|
|
526
|
-
const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails;
|
|
527
|
-
const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
|
|
528
|
-
const {
|
|
529
|
-
key,
|
|
530
|
-
namespaces
|
|
531
|
-
} = this.extractFromKey(keys[keys.length - 1], opt);
|
|
532
|
-
const namespace = namespaces[namespaces.length - 1];
|
|
533
|
-
let nsSeparator = opt.nsSeparator !== undefined ? opt.nsSeparator : this.options.nsSeparator;
|
|
534
|
-
if (nsSeparator === undefined) nsSeparator = ':';
|
|
535
|
-
const lng = opt.lng || this.language;
|
|
536
|
-
const appendNamespaceToCIMode = opt.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
537
|
-
if (lng?.toLowerCase() === 'cimode') {
|
|
538
|
-
if (appendNamespaceToCIMode) {
|
|
539
|
-
if (returnDetails) {
|
|
540
|
-
return {
|
|
541
|
-
res: `${namespace}${nsSeparator}${key}`,
|
|
542
|
-
usedKey: key,
|
|
543
|
-
exactUsedKey: key,
|
|
544
|
-
usedLng: lng,
|
|
545
|
-
usedNS: namespace,
|
|
546
|
-
usedParams: this.getUsedParamsDetails(opt)
|
|
547
|
-
};
|
|
548
|
-
}
|
|
549
|
-
return `${namespace}${nsSeparator}${key}`;
|
|
550
|
-
}
|
|
551
|
-
if (returnDetails) {
|
|
552
|
-
return {
|
|
553
|
-
res: key,
|
|
554
|
-
usedKey: key,
|
|
555
|
-
exactUsedKey: key,
|
|
556
|
-
usedLng: lng,
|
|
557
|
-
usedNS: namespace,
|
|
558
|
-
usedParams: this.getUsedParamsDetails(opt)
|
|
559
|
-
};
|
|
560
|
-
}
|
|
561
|
-
return key;
|
|
562
|
-
}
|
|
563
|
-
const resolved = this.resolve(keys, opt);
|
|
564
|
-
let res = resolved?.res;
|
|
565
|
-
const resUsedKey = resolved?.usedKey || key;
|
|
566
|
-
const resExactUsedKey = resolved?.exactUsedKey || key;
|
|
567
|
-
const noObject = ['[object Number]', '[object Function]', '[object RegExp]'];
|
|
568
|
-
const joinArrays = opt.joinArrays !== undefined ? opt.joinArrays : this.options.joinArrays;
|
|
569
|
-
const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
|
|
570
|
-
const needsPluralHandling = opt.count !== undefined && !isString(opt.count);
|
|
571
|
-
const hasDefaultValue = Translator.hasDefaultValue(opt);
|
|
572
|
-
const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, opt) : '';
|
|
573
|
-
const defaultValueSuffixOrdinalFallback = opt.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, {
|
|
574
|
-
ordinal: false
|
|
575
|
-
}) : '';
|
|
576
|
-
const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;
|
|
577
|
-
const defaultValue = needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] || opt[`defaultValue${defaultValueSuffix}`] || opt[`defaultValue${defaultValueSuffixOrdinalFallback}`] || opt.defaultValue;
|
|
578
|
-
let resForObjHndl = res;
|
|
579
|
-
if (handleAsObjectInI18nFormat && !res && hasDefaultValue) {
|
|
580
|
-
resForObjHndl = defaultValue;
|
|
581
|
-
}
|
|
582
|
-
const handleAsObject = shouldHandleAsObject(resForObjHndl);
|
|
583
|
-
const resType = Object.prototype.toString.apply(resForObjHndl);
|
|
584
|
-
if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.indexOf(resType) < 0 && !(isString(joinArrays) && Array.isArray(resForObjHndl))) {
|
|
585
|
-
if (!opt.returnObjects && !this.options.returnObjects) {
|
|
586
|
-
if (!this.options.returnedObjectHandler) {
|
|
587
|
-
this.logger.warn('accessing an object - but returnObjects options is not enabled!');
|
|
588
|
-
}
|
|
589
|
-
const r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, resForObjHndl, {
|
|
590
|
-
...opt,
|
|
591
|
-
ns: namespaces
|
|
592
|
-
}) : `key '${key} (${this.language})' returned an object instead of string.`;
|
|
593
|
-
if (returnDetails) {
|
|
594
|
-
resolved.res = r;
|
|
595
|
-
resolved.usedParams = this.getUsedParamsDetails(opt);
|
|
596
|
-
return resolved;
|
|
597
|
-
}
|
|
598
|
-
return r;
|
|
599
|
-
}
|
|
600
|
-
if (keySeparator) {
|
|
601
|
-
const resTypeIsArray = Array.isArray(resForObjHndl);
|
|
602
|
-
const copy = resTypeIsArray ? [] : {};
|
|
603
|
-
const newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;
|
|
604
|
-
for (const m in resForObjHndl) {
|
|
605
|
-
if (Object.prototype.hasOwnProperty.call(resForObjHndl, m)) {
|
|
606
|
-
const deepKey = `${newKeyToUse}${keySeparator}${m}`;
|
|
607
|
-
if (hasDefaultValue && !res) {
|
|
608
|
-
copy[m] = this.translate(deepKey, {
|
|
609
|
-
...opt,
|
|
610
|
-
defaultValue: shouldHandleAsObject(defaultValue) ? defaultValue[m] : undefined,
|
|
611
|
-
...{
|
|
612
|
-
joinArrays: false,
|
|
613
|
-
ns: namespaces
|
|
614
|
-
}
|
|
615
|
-
});
|
|
616
|
-
} else {
|
|
617
|
-
copy[m] = this.translate(deepKey, {
|
|
618
|
-
...opt,
|
|
619
|
-
...{
|
|
620
|
-
joinArrays: false,
|
|
621
|
-
ns: namespaces
|
|
622
|
-
}
|
|
623
|
-
});
|
|
624
|
-
}
|
|
625
|
-
if (copy[m] === deepKey) copy[m] = resForObjHndl[m];
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
res = copy;
|
|
629
|
-
}
|
|
630
|
-
} else if (handleAsObjectInI18nFormat && isString(joinArrays) && Array.isArray(res)) {
|
|
631
|
-
res = res.join(joinArrays);
|
|
632
|
-
if (res) res = this.extendTranslation(res, keys, opt, lastKey);
|
|
633
|
-
} else {
|
|
634
|
-
let usedDefault = false;
|
|
635
|
-
let usedKey = false;
|
|
636
|
-
if (!this.isValidLookup(res) && hasDefaultValue) {
|
|
637
|
-
usedDefault = true;
|
|
638
|
-
res = defaultValue;
|
|
639
|
-
}
|
|
640
|
-
if (!this.isValidLookup(res)) {
|
|
641
|
-
usedKey = true;
|
|
642
|
-
res = key;
|
|
643
|
-
}
|
|
644
|
-
const missingKeyNoValueFallbackToKey = opt.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;
|
|
645
|
-
const resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res;
|
|
646
|
-
const updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;
|
|
647
|
-
if (usedKey || usedDefault || updateMissing) {
|
|
648
|
-
this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? defaultValue : res);
|
|
649
|
-
if (keySeparator) {
|
|
650
|
-
const fk = this.resolve(key, {
|
|
651
|
-
...opt,
|
|
652
|
-
keySeparator: false
|
|
653
|
-
});
|
|
654
|
-
if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.');
|
|
655
|
-
}
|
|
656
|
-
let lngs = [];
|
|
657
|
-
const fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, opt.lng || this.language);
|
|
658
|
-
if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {
|
|
659
|
-
for (let i = 0; i < fallbackLngs.length; i++) {
|
|
660
|
-
lngs.push(fallbackLngs[i]);
|
|
661
|
-
}
|
|
662
|
-
} else if (this.options.saveMissingTo === 'all') {
|
|
663
|
-
lngs = this.languageUtils.toResolveHierarchy(opt.lng || this.language);
|
|
664
|
-
} else {
|
|
665
|
-
lngs.push(opt.lng || this.language);
|
|
666
|
-
}
|
|
667
|
-
const send = (l, k, specificDefaultValue) => {
|
|
668
|
-
const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
|
|
669
|
-
if (this.options.missingKeyHandler) {
|
|
670
|
-
this.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, opt);
|
|
671
|
-
} else if (this.backendConnector?.saveMissing) {
|
|
672
|
-
this.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, opt);
|
|
673
|
-
}
|
|
674
|
-
this.emit('missingKey', l, namespace, k, res);
|
|
675
|
-
};
|
|
676
|
-
if (this.options.saveMissing) {
|
|
677
|
-
if (this.options.saveMissingPlurals && needsPluralHandling) {
|
|
678
|
-
lngs.forEach(language => {
|
|
679
|
-
const suffixes = this.pluralResolver.getSuffixes(language, opt);
|
|
680
|
-
if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && suffixes.indexOf(`${this.options.pluralSeparator}zero`) < 0) {
|
|
681
|
-
suffixes.push(`${this.options.pluralSeparator}zero`);
|
|
682
|
-
}
|
|
683
|
-
suffixes.forEach(suffix => {
|
|
684
|
-
send([language], key + suffix, opt[`defaultValue${suffix}`] || defaultValue);
|
|
685
|
-
});
|
|
686
|
-
});
|
|
687
|
-
} else {
|
|
688
|
-
send(lngs, key, defaultValue);
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
res = this.extendTranslation(res, keys, opt, resolved, lastKey);
|
|
693
|
-
if (usedKey && res === key && this.options.appendNamespaceToMissingKey) {
|
|
694
|
-
res = `${namespace}${nsSeparator}${key}`;
|
|
695
|
-
}
|
|
696
|
-
if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
|
|
697
|
-
res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}${nsSeparator}${key}` : key, usedDefault ? res : undefined, opt);
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
if (returnDetails) {
|
|
701
|
-
resolved.res = res;
|
|
702
|
-
resolved.usedParams = this.getUsedParamsDetails(opt);
|
|
703
|
-
return resolved;
|
|
704
|
-
}
|
|
705
|
-
return res;
|
|
706
|
-
}
|
|
707
|
-
extendTranslation(res, key, opt, resolved, lastKey) {
|
|
708
|
-
if (this.i18nFormat?.parse) {
|
|
709
|
-
res = this.i18nFormat.parse(res, {
|
|
710
|
-
...this.options.interpolation.defaultVariables,
|
|
711
|
-
...opt
|
|
712
|
-
}, opt.lng || this.language || resolved.usedLng, resolved.usedNS, resolved.usedKey, {
|
|
713
|
-
resolved
|
|
714
|
-
});
|
|
715
|
-
} else if (!opt.skipInterpolation) {
|
|
716
|
-
if (opt.interpolation) this.interpolator.init({
|
|
717
|
-
...opt,
|
|
718
|
-
...{
|
|
719
|
-
interpolation: {
|
|
720
|
-
...this.options.interpolation,
|
|
721
|
-
...opt.interpolation
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
});
|
|
725
|
-
const skipOnVariables = isString(res) && (opt?.interpolation?.skipOnVariables !== undefined ? opt.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
726
|
-
let nestBef;
|
|
727
|
-
if (skipOnVariables) {
|
|
728
|
-
const nb = res.match(this.interpolator.nestingRegexp);
|
|
729
|
-
nestBef = nb && nb.length;
|
|
730
|
-
}
|
|
731
|
-
let data = opt.replace && !isString(opt.replace) ? opt.replace : opt;
|
|
732
|
-
if (this.options.interpolation.defaultVariables) data = {
|
|
733
|
-
...this.options.interpolation.defaultVariables,
|
|
734
|
-
...data
|
|
735
|
-
};
|
|
736
|
-
res = this.interpolator.interpolate(res, data, opt.lng || this.language || resolved.usedLng, opt);
|
|
737
|
-
if (skipOnVariables) {
|
|
738
|
-
const na = res.match(this.interpolator.nestingRegexp);
|
|
739
|
-
const nestAft = na && na.length;
|
|
740
|
-
if (nestBef < nestAft) opt.nest = false;
|
|
741
|
-
}
|
|
742
|
-
if (!opt.lng && resolved && resolved.res) opt.lng = this.language || resolved.usedLng;
|
|
743
|
-
if (opt.nest !== false) res = this.interpolator.nest(res, (...args) => {
|
|
744
|
-
if (lastKey?.[0] === args[0] && !opt.context) {
|
|
745
|
-
this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);
|
|
746
|
-
return null;
|
|
747
|
-
}
|
|
748
|
-
return this.translate(...args, key);
|
|
749
|
-
}, opt);
|
|
750
|
-
if (opt.interpolation) this.interpolator.reset();
|
|
751
|
-
}
|
|
752
|
-
const postProcess = opt.postProcess || this.options.postProcess;
|
|
753
|
-
const postProcessorNames = isString(postProcess) ? [postProcess] : postProcess;
|
|
754
|
-
if (res != null && postProcessorNames?.length && opt.applyPostProcessor !== false) {
|
|
755
|
-
res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {
|
|
756
|
-
i18nResolved: {
|
|
757
|
-
...resolved,
|
|
758
|
-
usedParams: this.getUsedParamsDetails(opt)
|
|
759
|
-
},
|
|
760
|
-
...opt
|
|
761
|
-
} : opt, this);
|
|
762
|
-
}
|
|
763
|
-
return res;
|
|
764
|
-
}
|
|
765
|
-
resolve(keys, opt = {}) {
|
|
766
|
-
let found;
|
|
767
|
-
let usedKey;
|
|
768
|
-
let exactUsedKey;
|
|
769
|
-
let usedLng;
|
|
770
|
-
let usedNS;
|
|
771
|
-
if (isString(keys)) keys = [keys];
|
|
772
|
-
keys.forEach(k => {
|
|
773
|
-
if (this.isValidLookup(found)) return;
|
|
774
|
-
const extracted = this.extractFromKey(k, opt);
|
|
775
|
-
const key = extracted.key;
|
|
776
|
-
usedKey = key;
|
|
777
|
-
let namespaces = extracted.namespaces;
|
|
778
|
-
if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);
|
|
779
|
-
const needsPluralHandling = opt.count !== undefined && !isString(opt.count);
|
|
780
|
-
const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;
|
|
781
|
-
const needsContextHandling = opt.context !== undefined && (isString(opt.context) || typeof opt.context === 'number') && opt.context !== '';
|
|
782
|
-
const codes = opt.lngs ? opt.lngs : this.languageUtils.toResolveHierarchy(opt.lng || this.language, opt.fallbackLng);
|
|
783
|
-
namespaces.forEach(ns => {
|
|
784
|
-
if (this.isValidLookup(found)) return;
|
|
785
|
-
usedNS = ns;
|
|
786
|
-
if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {
|
|
787
|
-
checkedLoadedFor[`${codes[0]}-${ns}`] = true;
|
|
788
|
-
this.logger.warn(`key "${usedKey}" for languages "${codes.join(', ')}" won't get resolved as namespace "${usedNS}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
|
|
789
|
-
}
|
|
790
|
-
codes.forEach(code => {
|
|
791
|
-
if (this.isValidLookup(found)) return;
|
|
792
|
-
usedLng = code;
|
|
793
|
-
const finalKeys = [key];
|
|
794
|
-
if (this.i18nFormat?.addLookupKeys) {
|
|
795
|
-
this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, opt);
|
|
796
|
-
} else {
|
|
797
|
-
let pluralSuffix;
|
|
798
|
-
if (needsPluralHandling) pluralSuffix = this.pluralResolver.getSuffix(code, opt.count, opt);
|
|
799
|
-
const zeroSuffix = `${this.options.pluralSeparator}zero`;
|
|
800
|
-
const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
801
|
-
if (needsPluralHandling) {
|
|
802
|
-
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
|
|
803
|
-
finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
|
|
804
|
-
}
|
|
805
|
-
finalKeys.push(key + pluralSuffix);
|
|
806
|
-
if (needsZeroSuffixLookup) {
|
|
807
|
-
finalKeys.push(key + zeroSuffix);
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
if (needsContextHandling) {
|
|
811
|
-
const contextKey = `${key}${this.options.contextSeparator || '_'}${opt.context}`;
|
|
812
|
-
finalKeys.push(contextKey);
|
|
813
|
-
if (needsPluralHandling) {
|
|
814
|
-
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
|
|
815
|
-
finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
|
|
816
|
-
}
|
|
817
|
-
finalKeys.push(contextKey + pluralSuffix);
|
|
818
|
-
if (needsZeroSuffixLookup) {
|
|
819
|
-
finalKeys.push(contextKey + zeroSuffix);
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
let possibleKey;
|
|
825
|
-
while (possibleKey = finalKeys.pop()) {
|
|
826
|
-
if (!this.isValidLookup(found)) {
|
|
827
|
-
exactUsedKey = possibleKey;
|
|
828
|
-
found = this.getResource(code, ns, possibleKey, opt);
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
});
|
|
832
|
-
});
|
|
833
|
-
});
|
|
834
|
-
return {
|
|
835
|
-
res: found,
|
|
836
|
-
usedKey,
|
|
837
|
-
exactUsedKey,
|
|
838
|
-
usedLng,
|
|
839
|
-
usedNS
|
|
840
|
-
};
|
|
841
|
-
}
|
|
842
|
-
isValidLookup(res) {
|
|
843
|
-
return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');
|
|
844
|
-
}
|
|
845
|
-
getResource(code, ns, key, options = {}) {
|
|
846
|
-
if (this.i18nFormat?.getResource) return this.i18nFormat.getResource(code, ns, key, options);
|
|
847
|
-
return this.resourceStore.getResource(code, ns, key, options);
|
|
848
|
-
}
|
|
849
|
-
getUsedParamsDetails(options = {}) {
|
|
850
|
-
const optionsKeys = ['defaultValue', 'ordinal', 'context', 'replace', 'lng', 'lngs', 'fallbackLng', 'ns', 'keySeparator', 'nsSeparator', 'returnObjects', 'returnDetails', 'joinArrays', 'postProcess', 'interpolation'];
|
|
851
|
-
const useOptionsReplaceForData = options.replace && !isString(options.replace);
|
|
852
|
-
let data = useOptionsReplaceForData ? options.replace : options;
|
|
853
|
-
if (useOptionsReplaceForData && typeof options.count !== 'undefined') {
|
|
854
|
-
data.count = options.count;
|
|
855
|
-
}
|
|
856
|
-
if (this.options.interpolation.defaultVariables) {
|
|
857
|
-
data = {
|
|
858
|
-
...this.options.interpolation.defaultVariables,
|
|
859
|
-
...data
|
|
860
|
-
};
|
|
861
|
-
}
|
|
862
|
-
if (!useOptionsReplaceForData) {
|
|
863
|
-
data = {
|
|
864
|
-
...data
|
|
865
|
-
};
|
|
866
|
-
for (const key of optionsKeys) {
|
|
867
|
-
delete data[key];
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
return data;
|
|
871
|
-
}
|
|
872
|
-
static hasDefaultValue(options) {
|
|
873
|
-
const prefix = 'defaultValue';
|
|
874
|
-
for (const option in options) {
|
|
875
|
-
if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && undefined !== options[option]) {
|
|
876
|
-
return true;
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
return false;
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
class LanguageUtil {
|
|
884
|
-
constructor(options) {
|
|
885
|
-
this.options = options;
|
|
886
|
-
this.supportedLngs = this.options.supportedLngs || false;
|
|
887
|
-
this.logger = baseLogger.create('languageUtils');
|
|
888
|
-
}
|
|
889
|
-
getScriptPartFromCode(code) {
|
|
890
|
-
code = getCleanedCode(code);
|
|
891
|
-
if (!code || code.indexOf('-') < 0) return null;
|
|
892
|
-
const p = code.split('-');
|
|
893
|
-
if (p.length === 2) return null;
|
|
894
|
-
p.pop();
|
|
895
|
-
if (p[p.length - 1].toLowerCase() === 'x') return null;
|
|
896
|
-
return this.formatLanguageCode(p.join('-'));
|
|
897
|
-
}
|
|
898
|
-
getLanguagePartFromCode(code) {
|
|
899
|
-
code = getCleanedCode(code);
|
|
900
|
-
if (!code || code.indexOf('-') < 0) return code;
|
|
901
|
-
const p = code.split('-');
|
|
902
|
-
return this.formatLanguageCode(p[0]);
|
|
903
|
-
}
|
|
904
|
-
formatLanguageCode(code) {
|
|
905
|
-
if (isString(code) && code.indexOf('-') > -1) {
|
|
906
|
-
let formattedCode;
|
|
907
|
-
try {
|
|
908
|
-
formattedCode = Intl.getCanonicalLocales(code)[0];
|
|
909
|
-
} catch (e) {}
|
|
910
|
-
if (formattedCode && this.options.lowerCaseLng) {
|
|
911
|
-
formattedCode = formattedCode.toLowerCase();
|
|
912
|
-
}
|
|
913
|
-
if (formattedCode) return formattedCode;
|
|
914
|
-
if (this.options.lowerCaseLng) {
|
|
915
|
-
return code.toLowerCase();
|
|
916
|
-
}
|
|
917
|
-
return code;
|
|
918
|
-
}
|
|
919
|
-
return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
|
|
920
|
-
}
|
|
921
|
-
isSupportedCode(code) {
|
|
922
|
-
if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {
|
|
923
|
-
code = this.getLanguagePartFromCode(code);
|
|
924
|
-
}
|
|
925
|
-
return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;
|
|
926
|
-
}
|
|
927
|
-
getBestMatchFromCodes(codes) {
|
|
928
|
-
if (!codes) return null;
|
|
929
|
-
let found;
|
|
930
|
-
codes.forEach(code => {
|
|
931
|
-
if (found) return;
|
|
932
|
-
const cleanedLng = this.formatLanguageCode(code);
|
|
933
|
-
if (!this.options.supportedLngs || this.isSupportedCode(cleanedLng)) found = cleanedLng;
|
|
934
|
-
});
|
|
935
|
-
if (!found && this.options.supportedLngs) {
|
|
936
|
-
codes.forEach(code => {
|
|
937
|
-
if (found) return;
|
|
938
|
-
const lngScOnly = this.getScriptPartFromCode(code);
|
|
939
|
-
if (this.isSupportedCode(lngScOnly)) return found = lngScOnly;
|
|
940
|
-
const lngOnly = this.getLanguagePartFromCode(code);
|
|
941
|
-
if (this.isSupportedCode(lngOnly)) return found = lngOnly;
|
|
942
|
-
found = this.options.supportedLngs.find(supportedLng => {
|
|
943
|
-
if (supportedLng === lngOnly) return supportedLng;
|
|
944
|
-
if (supportedLng.indexOf('-') < 0 && lngOnly.indexOf('-') < 0) return;
|
|
945
|
-
if (supportedLng.indexOf('-') > 0 && lngOnly.indexOf('-') < 0 && supportedLng.substring(0, supportedLng.indexOf('-')) === lngOnly) return supportedLng;
|
|
946
|
-
if (supportedLng.indexOf(lngOnly) === 0 && lngOnly.length > 1) return supportedLng;
|
|
947
|
-
});
|
|
948
|
-
});
|
|
949
|
-
}
|
|
950
|
-
if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];
|
|
951
|
-
return found;
|
|
952
|
-
}
|
|
953
|
-
getFallbackCodes(fallbacks, code) {
|
|
954
|
-
if (!fallbacks) return [];
|
|
955
|
-
if (typeof fallbacks === 'function') fallbacks = fallbacks(code);
|
|
956
|
-
if (isString(fallbacks)) fallbacks = [fallbacks];
|
|
957
|
-
if (Array.isArray(fallbacks)) return fallbacks;
|
|
958
|
-
if (!code) return fallbacks.default || [];
|
|
959
|
-
let found = fallbacks[code];
|
|
960
|
-
if (!found) found = fallbacks[this.getScriptPartFromCode(code)];
|
|
961
|
-
if (!found) found = fallbacks[this.formatLanguageCode(code)];
|
|
962
|
-
if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];
|
|
963
|
-
if (!found) found = fallbacks.default;
|
|
964
|
-
return found || [];
|
|
965
|
-
}
|
|
966
|
-
toResolveHierarchy(code, fallbackCode) {
|
|
967
|
-
const fallbackCodes = this.getFallbackCodes((fallbackCode === false ? [] : fallbackCode) || this.options.fallbackLng || [], code);
|
|
968
|
-
const codes = [];
|
|
969
|
-
const addCode = c => {
|
|
970
|
-
if (!c) return;
|
|
971
|
-
if (this.isSupportedCode(c)) {
|
|
972
|
-
codes.push(c);
|
|
973
|
-
} else {
|
|
974
|
-
this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`);
|
|
975
|
-
}
|
|
976
|
-
};
|
|
977
|
-
if (isString(code) && (code.indexOf('-') > -1 || code.indexOf('_') > -1)) {
|
|
978
|
-
if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));
|
|
979
|
-
if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));
|
|
980
|
-
if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));
|
|
981
|
-
} else if (isString(code)) {
|
|
982
|
-
addCode(this.formatLanguageCode(code));
|
|
983
|
-
}
|
|
984
|
-
fallbackCodes.forEach(fc => {
|
|
985
|
-
if (codes.indexOf(fc) < 0) addCode(this.formatLanguageCode(fc));
|
|
986
|
-
});
|
|
987
|
-
return codes;
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
const suffixesOrder = {
|
|
992
|
-
zero: 0,
|
|
993
|
-
one: 1,
|
|
994
|
-
two: 2,
|
|
995
|
-
few: 3,
|
|
996
|
-
many: 4,
|
|
997
|
-
other: 5
|
|
998
|
-
};
|
|
999
|
-
const dummyRule = {
|
|
1000
|
-
select: count => count === 1 ? 'one' : 'other',
|
|
1001
|
-
resolvedOptions: () => ({
|
|
1002
|
-
pluralCategories: ['one', 'other']
|
|
1003
|
-
})
|
|
1004
|
-
};
|
|
1005
|
-
class PluralResolver {
|
|
1006
|
-
constructor(languageUtils, options = {}) {
|
|
1007
|
-
this.languageUtils = languageUtils;
|
|
1008
|
-
this.options = options;
|
|
1009
|
-
this.logger = baseLogger.create('pluralResolver');
|
|
1010
|
-
this.pluralRulesCache = {};
|
|
1011
|
-
}
|
|
1012
|
-
addRule(lng, obj) {
|
|
1013
|
-
this.rules[lng] = obj;
|
|
1014
|
-
}
|
|
1015
|
-
clearCache() {
|
|
1016
|
-
this.pluralRulesCache = {};
|
|
1017
|
-
}
|
|
1018
|
-
getRule(code, options = {}) {
|
|
1019
|
-
const cleanedCode = getCleanedCode(code === 'dev' ? 'en' : code);
|
|
1020
|
-
const type = options.ordinal ? 'ordinal' : 'cardinal';
|
|
1021
|
-
const cacheKey = JSON.stringify({
|
|
1022
|
-
cleanedCode,
|
|
1023
|
-
type
|
|
1024
|
-
});
|
|
1025
|
-
if (cacheKey in this.pluralRulesCache) {
|
|
1026
|
-
return this.pluralRulesCache[cacheKey];
|
|
1027
|
-
}
|
|
1028
|
-
let rule;
|
|
1029
|
-
try {
|
|
1030
|
-
rule = new Intl.PluralRules(cleanedCode, {
|
|
1031
|
-
type
|
|
1032
|
-
});
|
|
1033
|
-
} catch (err) {
|
|
1034
|
-
if (!Intl) {
|
|
1035
|
-
this.logger.error('No Intl support, please use an Intl polyfill!');
|
|
1036
|
-
return dummyRule;
|
|
1037
|
-
}
|
|
1038
|
-
if (!code.match(/-|_/)) return dummyRule;
|
|
1039
|
-
const lngPart = this.languageUtils.getLanguagePartFromCode(code);
|
|
1040
|
-
rule = this.getRule(lngPart, options);
|
|
1041
|
-
}
|
|
1042
|
-
this.pluralRulesCache[cacheKey] = rule;
|
|
1043
|
-
return rule;
|
|
1044
|
-
}
|
|
1045
|
-
needsPlural(code, options = {}) {
|
|
1046
|
-
let rule = this.getRule(code, options);
|
|
1047
|
-
if (!rule) rule = this.getRule('dev', options);
|
|
1048
|
-
return rule?.resolvedOptions().pluralCategories.length > 1;
|
|
1049
|
-
}
|
|
1050
|
-
getPluralFormsOfKey(code, key, options = {}) {
|
|
1051
|
-
return this.getSuffixes(code, options).map(suffix => `${key}${suffix}`);
|
|
1052
|
-
}
|
|
1053
|
-
getSuffixes(code, options = {}) {
|
|
1054
|
-
let rule = this.getRule(code, options);
|
|
1055
|
-
if (!rule) rule = this.getRule('dev', options);
|
|
1056
|
-
if (!rule) return [];
|
|
1057
|
-
return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map(pluralCategory => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${pluralCategory}`);
|
|
1058
|
-
}
|
|
1059
|
-
getSuffix(code, count, options = {}) {
|
|
1060
|
-
const rule = this.getRule(code, options);
|
|
1061
|
-
if (rule) {
|
|
1062
|
-
return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${rule.select(count)}`;
|
|
1063
|
-
}
|
|
1064
|
-
this.logger.warn(`no plural rule found for: ${code}`);
|
|
1065
|
-
return this.getSuffix('dev', count, options);
|
|
1066
|
-
}
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
const deepFindWithDefaults = (data, defaultData, key, keySeparator = '.', ignoreJSONStructure = true) => {
|
|
1070
|
-
let path = getPathWithDefaults(data, defaultData, key);
|
|
1071
|
-
if (!path && ignoreJSONStructure && isString(key)) {
|
|
1072
|
-
path = deepFind(data, key, keySeparator);
|
|
1073
|
-
if (path === undefined) path = deepFind(defaultData, key, keySeparator);
|
|
1074
|
-
}
|
|
1075
|
-
return path;
|
|
1076
|
-
};
|
|
1077
|
-
const regexSafe = val => val.replace(/\$/g, '$$$$');
|
|
1078
|
-
class Interpolator {
|
|
1079
|
-
constructor(options = {}) {
|
|
1080
|
-
this.logger = baseLogger.create('interpolator');
|
|
1081
|
-
this.options = options;
|
|
1082
|
-
this.format = options?.interpolation?.format || (value => value);
|
|
1083
|
-
this.init(options);
|
|
1084
|
-
}
|
|
1085
|
-
init(options = {}) {
|
|
1086
|
-
if (!options.interpolation) options.interpolation = {
|
|
1087
|
-
escapeValue: true
|
|
1088
|
-
};
|
|
1089
|
-
const {
|
|
1090
|
-
escape: escape$1,
|
|
1091
|
-
escapeValue,
|
|
1092
|
-
useRawValueToEscape,
|
|
1093
|
-
prefix,
|
|
1094
|
-
prefixEscaped,
|
|
1095
|
-
suffix,
|
|
1096
|
-
suffixEscaped,
|
|
1097
|
-
formatSeparator,
|
|
1098
|
-
unescapeSuffix,
|
|
1099
|
-
unescapePrefix,
|
|
1100
|
-
nestingPrefix,
|
|
1101
|
-
nestingPrefixEscaped,
|
|
1102
|
-
nestingSuffix,
|
|
1103
|
-
nestingSuffixEscaped,
|
|
1104
|
-
nestingOptionsSeparator,
|
|
1105
|
-
maxReplaces,
|
|
1106
|
-
alwaysFormat
|
|
1107
|
-
} = options.interpolation;
|
|
1108
|
-
this.escape = escape$1 !== undefined ? escape$1 : escape;
|
|
1109
|
-
this.escapeValue = escapeValue !== undefined ? escapeValue : true;
|
|
1110
|
-
this.useRawValueToEscape = useRawValueToEscape !== undefined ? useRawValueToEscape : false;
|
|
1111
|
-
this.prefix = prefix ? regexEscape(prefix) : prefixEscaped || '{{';
|
|
1112
|
-
this.suffix = suffix ? regexEscape(suffix) : suffixEscaped || '}}';
|
|
1113
|
-
this.formatSeparator = formatSeparator || ',';
|
|
1114
|
-
this.unescapePrefix = unescapeSuffix ? '' : unescapePrefix || '-';
|
|
1115
|
-
this.unescapeSuffix = this.unescapePrefix ? '' : unescapeSuffix || '';
|
|
1116
|
-
this.nestingPrefix = nestingPrefix ? regexEscape(nestingPrefix) : nestingPrefixEscaped || regexEscape('$t(');
|
|
1117
|
-
this.nestingSuffix = nestingSuffix ? regexEscape(nestingSuffix) : nestingSuffixEscaped || regexEscape(')');
|
|
1118
|
-
this.nestingOptionsSeparator = nestingOptionsSeparator || ',';
|
|
1119
|
-
this.maxReplaces = maxReplaces || 1000;
|
|
1120
|
-
this.alwaysFormat = alwaysFormat !== undefined ? alwaysFormat : false;
|
|
1121
|
-
this.resetRegExp();
|
|
1122
|
-
}
|
|
1123
|
-
reset() {
|
|
1124
|
-
if (this.options) this.init(this.options);
|
|
1125
|
-
}
|
|
1126
|
-
resetRegExp() {
|
|
1127
|
-
const getOrResetRegExp = (existingRegExp, pattern) => {
|
|
1128
|
-
if (existingRegExp?.source === pattern) {
|
|
1129
|
-
existingRegExp.lastIndex = 0;
|
|
1130
|
-
return existingRegExp;
|
|
1131
|
-
}
|
|
1132
|
-
return new RegExp(pattern, 'g');
|
|
1133
|
-
};
|
|
1134
|
-
this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);
|
|
1135
|
-
this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);
|
|
1136
|
-
this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
|
|
1137
|
-
}
|
|
1138
|
-
interpolate(str, data, lng, options) {
|
|
1139
|
-
let match;
|
|
1140
|
-
let value;
|
|
1141
|
-
let replaces;
|
|
1142
|
-
const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
|
|
1143
|
-
const handleFormat = key => {
|
|
1144
|
-
if (key.indexOf(this.formatSeparator) < 0) {
|
|
1145
|
-
const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
1146
|
-
return this.alwaysFormat ? this.format(path, undefined, lng, {
|
|
1147
|
-
...options,
|
|
1148
|
-
...data,
|
|
1149
|
-
interpolationkey: key
|
|
1150
|
-
}) : path;
|
|
1151
|
-
}
|
|
1152
|
-
const p = key.split(this.formatSeparator);
|
|
1153
|
-
const k = p.shift().trim();
|
|
1154
|
-
const f = p.join(this.formatSeparator).trim();
|
|
1155
|
-
return this.format(deepFindWithDefaults(data, defaultData, k, this.options.keySeparator, this.options.ignoreJSONStructure), f, lng, {
|
|
1156
|
-
...options,
|
|
1157
|
-
...data,
|
|
1158
|
-
interpolationkey: k
|
|
1159
|
-
});
|
|
1160
|
-
};
|
|
1161
|
-
this.resetRegExp();
|
|
1162
|
-
const missingInterpolationHandler = options?.missingInterpolationHandler || this.options.missingInterpolationHandler;
|
|
1163
|
-
const skipOnVariables = options?.interpolation?.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
1164
|
-
const todos = [{
|
|
1165
|
-
regex: this.regexpUnescape,
|
|
1166
|
-
safeValue: val => regexSafe(val)
|
|
1167
|
-
}, {
|
|
1168
|
-
regex: this.regexp,
|
|
1169
|
-
safeValue: val => this.escapeValue ? regexSafe(this.escape(val)) : regexSafe(val)
|
|
1170
|
-
}];
|
|
1171
|
-
todos.forEach(todo => {
|
|
1172
|
-
replaces = 0;
|
|
1173
|
-
while (match = todo.regex.exec(str)) {
|
|
1174
|
-
const matchedVar = match[1].trim();
|
|
1175
|
-
value = handleFormat(matchedVar);
|
|
1176
|
-
if (value === undefined) {
|
|
1177
|
-
if (typeof missingInterpolationHandler === 'function') {
|
|
1178
|
-
const temp = missingInterpolationHandler(str, match, options);
|
|
1179
|
-
value = isString(temp) ? temp : '';
|
|
1180
|
-
} else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {
|
|
1181
|
-
value = '';
|
|
1182
|
-
} else if (skipOnVariables) {
|
|
1183
|
-
value = match[0];
|
|
1184
|
-
continue;
|
|
1185
|
-
} else {
|
|
1186
|
-
this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`);
|
|
1187
|
-
value = '';
|
|
1188
|
-
}
|
|
1189
|
-
} else if (!isString(value) && !this.useRawValueToEscape) {
|
|
1190
|
-
value = makeString(value);
|
|
1191
|
-
}
|
|
1192
|
-
const safeValue = todo.safeValue(value);
|
|
1193
|
-
str = str.replace(match[0], safeValue);
|
|
1194
|
-
if (skipOnVariables) {
|
|
1195
|
-
todo.regex.lastIndex += value.length;
|
|
1196
|
-
todo.regex.lastIndex -= match[0].length;
|
|
1197
|
-
} else {
|
|
1198
|
-
todo.regex.lastIndex = 0;
|
|
1199
|
-
}
|
|
1200
|
-
replaces++;
|
|
1201
|
-
if (replaces >= this.maxReplaces) {
|
|
1202
|
-
break;
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
});
|
|
1206
|
-
return str;
|
|
1207
|
-
}
|
|
1208
|
-
nest(str, fc, options = {}) {
|
|
1209
|
-
let match;
|
|
1210
|
-
let value;
|
|
1211
|
-
let clonedOptions;
|
|
1212
|
-
const handleHasOptions = (key, inheritedOptions) => {
|
|
1213
|
-
const sep = this.nestingOptionsSeparator;
|
|
1214
|
-
if (key.indexOf(sep) < 0) return key;
|
|
1215
|
-
const c = key.split(new RegExp(`${sep}[ ]*{`));
|
|
1216
|
-
let optionsString = `{${c[1]}`;
|
|
1217
|
-
key = c[0];
|
|
1218
|
-
optionsString = this.interpolate(optionsString, clonedOptions);
|
|
1219
|
-
const matchedSingleQuotes = optionsString.match(/'/g);
|
|
1220
|
-
const matchedDoubleQuotes = optionsString.match(/"/g);
|
|
1221
|
-
if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
|
|
1222
|
-
optionsString = optionsString.replace(/'/g, '"');
|
|
1223
|
-
}
|
|
1224
|
-
try {
|
|
1225
|
-
clonedOptions = JSON.parse(optionsString);
|
|
1226
|
-
if (inheritedOptions) clonedOptions = {
|
|
1227
|
-
...inheritedOptions,
|
|
1228
|
-
...clonedOptions
|
|
1229
|
-
};
|
|
1230
|
-
} catch (e) {
|
|
1231
|
-
this.logger.warn(`failed parsing options string in nesting for key ${key}`, e);
|
|
1232
|
-
return `${key}${sep}${optionsString}`;
|
|
1233
|
-
}
|
|
1234
|
-
if (clonedOptions.defaultValue && clonedOptions.defaultValue.indexOf(this.prefix) > -1) delete clonedOptions.defaultValue;
|
|
1235
|
-
return key;
|
|
1236
|
-
};
|
|
1237
|
-
while (match = this.nestingRegexp.exec(str)) {
|
|
1238
|
-
let formatters = [];
|
|
1239
|
-
clonedOptions = {
|
|
1240
|
-
...options
|
|
1241
|
-
};
|
|
1242
|
-
clonedOptions = clonedOptions.replace && !isString(clonedOptions.replace) ? clonedOptions.replace : clonedOptions;
|
|
1243
|
-
clonedOptions.applyPostProcessor = false;
|
|
1244
|
-
delete clonedOptions.defaultValue;
|
|
1245
|
-
const keyEndIndex = /{.*}/.test(match[1]) ? match[1].lastIndexOf('}') + 1 : match[1].indexOf(this.formatSeparator);
|
|
1246
|
-
if (keyEndIndex !== -1) {
|
|
1247
|
-
formatters = match[1].slice(keyEndIndex).split(this.formatSeparator).map(elem => elem.trim()).filter(Boolean);
|
|
1248
|
-
match[1] = match[1].slice(0, keyEndIndex);
|
|
1249
|
-
}
|
|
1250
|
-
value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);
|
|
1251
|
-
if (value && match[0] === str && !isString(value)) return value;
|
|
1252
|
-
if (!isString(value)) value = makeString(value);
|
|
1253
|
-
if (!value) {
|
|
1254
|
-
this.logger.warn(`missed to resolve ${match[1]} for nesting ${str}`);
|
|
1255
|
-
value = '';
|
|
1256
|
-
}
|
|
1257
|
-
if (formatters.length) {
|
|
1258
|
-
value = formatters.reduce((v, f) => this.format(v, f, options.lng, {
|
|
1259
|
-
...options,
|
|
1260
|
-
interpolationkey: match[1].trim()
|
|
1261
|
-
}), value.trim());
|
|
1262
|
-
}
|
|
1263
|
-
str = str.replace(match[0], value);
|
|
1264
|
-
this.regexp.lastIndex = 0;
|
|
1265
|
-
}
|
|
1266
|
-
return str;
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
const parseFormatStr = formatStr => {
|
|
1271
|
-
let formatName = formatStr.toLowerCase().trim();
|
|
1272
|
-
const formatOptions = {};
|
|
1273
|
-
if (formatStr.indexOf('(') > -1) {
|
|
1274
|
-
const p = formatStr.split('(');
|
|
1275
|
-
formatName = p[0].toLowerCase().trim();
|
|
1276
|
-
const optStr = p[1].substring(0, p[1].length - 1);
|
|
1277
|
-
if (formatName === 'currency' && optStr.indexOf(':') < 0) {
|
|
1278
|
-
if (!formatOptions.currency) formatOptions.currency = optStr.trim();
|
|
1279
|
-
} else if (formatName === 'relativetime' && optStr.indexOf(':') < 0) {
|
|
1280
|
-
if (!formatOptions.range) formatOptions.range = optStr.trim();
|
|
1281
|
-
} else {
|
|
1282
|
-
const opts = optStr.split(';');
|
|
1283
|
-
opts.forEach(opt => {
|
|
1284
|
-
if (opt) {
|
|
1285
|
-
const [key, ...rest] = opt.split(':');
|
|
1286
|
-
const val = rest.join(':').trim().replace(/^'+|'+$/g, '');
|
|
1287
|
-
const trimmedKey = key.trim();
|
|
1288
|
-
if (!formatOptions[trimmedKey]) formatOptions[trimmedKey] = val;
|
|
1289
|
-
if (val === 'false') formatOptions[trimmedKey] = false;
|
|
1290
|
-
if (val === 'true') formatOptions[trimmedKey] = true;
|
|
1291
|
-
if (!isNaN(val)) formatOptions[trimmedKey] = parseInt(val, 10);
|
|
1292
|
-
}
|
|
1293
|
-
});
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
return {
|
|
1297
|
-
formatName,
|
|
1298
|
-
formatOptions
|
|
1299
|
-
};
|
|
1300
|
-
};
|
|
1301
|
-
const createCachedFormatter = fn => {
|
|
1302
|
-
const cache = {};
|
|
1303
|
-
return (v, l, o) => {
|
|
1304
|
-
let optForCache = o;
|
|
1305
|
-
if (o && o.interpolationkey && o.formatParams && o.formatParams[o.interpolationkey] && o[o.interpolationkey]) {
|
|
1306
|
-
optForCache = {
|
|
1307
|
-
...optForCache,
|
|
1308
|
-
[o.interpolationkey]: undefined
|
|
1309
|
-
};
|
|
1310
|
-
}
|
|
1311
|
-
const key = l + JSON.stringify(optForCache);
|
|
1312
|
-
let frm = cache[key];
|
|
1313
|
-
if (!frm) {
|
|
1314
|
-
frm = fn(getCleanedCode(l), o);
|
|
1315
|
-
cache[key] = frm;
|
|
1316
|
-
}
|
|
1317
|
-
return frm(v);
|
|
1318
|
-
};
|
|
1319
|
-
};
|
|
1320
|
-
const createNonCachedFormatter = fn => (v, l, o) => fn(getCleanedCode(l), o)(v);
|
|
1321
|
-
class Formatter {
|
|
1322
|
-
constructor(options = {}) {
|
|
1323
|
-
this.logger = baseLogger.create('formatter');
|
|
1324
|
-
this.options = options;
|
|
1325
|
-
this.init(options);
|
|
1326
|
-
}
|
|
1327
|
-
init(services, options = {
|
|
1328
|
-
interpolation: {}
|
|
1329
|
-
}) {
|
|
1330
|
-
this.formatSeparator = options.interpolation.formatSeparator || ',';
|
|
1331
|
-
const cf = options.cacheInBuiltFormats ? createCachedFormatter : createNonCachedFormatter;
|
|
1332
|
-
this.formats = {
|
|
1333
|
-
number: cf((lng, opt) => {
|
|
1334
|
-
const formatter = new Intl.NumberFormat(lng, {
|
|
1335
|
-
...opt
|
|
1336
|
-
});
|
|
1337
|
-
return val => formatter.format(val);
|
|
1338
|
-
}),
|
|
1339
|
-
currency: cf((lng, opt) => {
|
|
1340
|
-
const formatter = new Intl.NumberFormat(lng, {
|
|
1341
|
-
...opt,
|
|
1342
|
-
style: 'currency'
|
|
1343
|
-
});
|
|
1344
|
-
return val => formatter.format(val);
|
|
1345
|
-
}),
|
|
1346
|
-
datetime: cf((lng, opt) => {
|
|
1347
|
-
const formatter = new Intl.DateTimeFormat(lng, {
|
|
1348
|
-
...opt
|
|
1349
|
-
});
|
|
1350
|
-
return val => formatter.format(val);
|
|
1351
|
-
}),
|
|
1352
|
-
relativetime: cf((lng, opt) => {
|
|
1353
|
-
const formatter = new Intl.RelativeTimeFormat(lng, {
|
|
1354
|
-
...opt
|
|
1355
|
-
});
|
|
1356
|
-
return val => formatter.format(val, opt.range || 'day');
|
|
1357
|
-
}),
|
|
1358
|
-
list: cf((lng, opt) => {
|
|
1359
|
-
const formatter = new Intl.ListFormat(lng, {
|
|
1360
|
-
...opt
|
|
1361
|
-
});
|
|
1362
|
-
return val => formatter.format(val);
|
|
1363
|
-
})
|
|
1364
|
-
};
|
|
1365
|
-
}
|
|
1366
|
-
add(name, fc) {
|
|
1367
|
-
this.formats[name.toLowerCase().trim()] = fc;
|
|
1368
|
-
}
|
|
1369
|
-
addCached(name, fc) {
|
|
1370
|
-
this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);
|
|
1371
|
-
}
|
|
1372
|
-
format(value, format, lng, options = {}) {
|
|
1373
|
-
const formats = format.split(this.formatSeparator);
|
|
1374
|
-
if (formats.length > 1 && formats[0].indexOf('(') > 1 && formats[0].indexOf(')') < 0 && formats.find(f => f.indexOf(')') > -1)) {
|
|
1375
|
-
const lastIndex = formats.findIndex(f => f.indexOf(')') > -1);
|
|
1376
|
-
formats[0] = [formats[0], ...formats.splice(1, lastIndex)].join(this.formatSeparator);
|
|
1377
|
-
}
|
|
1378
|
-
const result = formats.reduce((mem, f) => {
|
|
1379
|
-
const {
|
|
1380
|
-
formatName,
|
|
1381
|
-
formatOptions
|
|
1382
|
-
} = parseFormatStr(f);
|
|
1383
|
-
if (this.formats[formatName]) {
|
|
1384
|
-
let formatted = mem;
|
|
1385
|
-
try {
|
|
1386
|
-
const valOptions = options?.formatParams?.[options.interpolationkey] || {};
|
|
1387
|
-
const l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
|
|
1388
|
-
formatted = this.formats[formatName](mem, l, {
|
|
1389
|
-
...formatOptions,
|
|
1390
|
-
...options,
|
|
1391
|
-
...valOptions
|
|
1392
|
-
});
|
|
1393
|
-
} catch (error) {
|
|
1394
|
-
this.logger.warn(error);
|
|
1395
|
-
}
|
|
1396
|
-
return formatted;
|
|
1397
|
-
} else {
|
|
1398
|
-
this.logger.warn(`there was no format function for ${formatName}`);
|
|
1399
|
-
}
|
|
1400
|
-
return mem;
|
|
1401
|
-
}, value);
|
|
1402
|
-
return result;
|
|
1403
|
-
}
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
const removePending = (q, name) => {
|
|
1407
|
-
if (q.pending[name] !== undefined) {
|
|
1408
|
-
delete q.pending[name];
|
|
1409
|
-
q.pendingCount--;
|
|
1410
|
-
}
|
|
1411
|
-
};
|
|
1412
|
-
class Connector extends EventEmitter {
|
|
1413
|
-
constructor(backend, store, services, options = {}) {
|
|
1414
|
-
super();
|
|
1415
|
-
this.backend = backend;
|
|
1416
|
-
this.store = store;
|
|
1417
|
-
this.services = services;
|
|
1418
|
-
this.languageUtils = services.languageUtils;
|
|
1419
|
-
this.options = options;
|
|
1420
|
-
this.logger = baseLogger.create('backendConnector');
|
|
1421
|
-
this.waitingReads = [];
|
|
1422
|
-
this.maxParallelReads = options.maxParallelReads || 10;
|
|
1423
|
-
this.readingCalls = 0;
|
|
1424
|
-
this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5;
|
|
1425
|
-
this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;
|
|
1426
|
-
this.state = {};
|
|
1427
|
-
this.queue = [];
|
|
1428
|
-
this.backend?.init?.(services, options.backend, options);
|
|
1429
|
-
}
|
|
1430
|
-
queueLoad(languages, namespaces, options, callback) {
|
|
1431
|
-
const toLoad = {};
|
|
1432
|
-
const pending = {};
|
|
1433
|
-
const toLoadLanguages = {};
|
|
1434
|
-
const toLoadNamespaces = {};
|
|
1435
|
-
languages.forEach(lng => {
|
|
1436
|
-
let hasAllNamespaces = true;
|
|
1437
|
-
namespaces.forEach(ns => {
|
|
1438
|
-
const name = `${lng}|${ns}`;
|
|
1439
|
-
if (!options.reload && this.store.hasResourceBundle(lng, ns)) {
|
|
1440
|
-
this.state[name] = 2;
|
|
1441
|
-
} else if (this.state[name] < 0) ; else if (this.state[name] === 1) {
|
|
1442
|
-
if (pending[name] === undefined) pending[name] = true;
|
|
1443
|
-
} else {
|
|
1444
|
-
this.state[name] = 1;
|
|
1445
|
-
hasAllNamespaces = false;
|
|
1446
|
-
if (pending[name] === undefined) pending[name] = true;
|
|
1447
|
-
if (toLoad[name] === undefined) toLoad[name] = true;
|
|
1448
|
-
if (toLoadNamespaces[ns] === undefined) toLoadNamespaces[ns] = true;
|
|
1449
|
-
}
|
|
1450
|
-
});
|
|
1451
|
-
if (!hasAllNamespaces) toLoadLanguages[lng] = true;
|
|
1452
|
-
});
|
|
1453
|
-
if (Object.keys(toLoad).length || Object.keys(pending).length) {
|
|
1454
|
-
this.queue.push({
|
|
1455
|
-
pending,
|
|
1456
|
-
pendingCount: Object.keys(pending).length,
|
|
1457
|
-
loaded: {},
|
|
1458
|
-
errors: [],
|
|
1459
|
-
callback
|
|
1460
|
-
});
|
|
1461
|
-
}
|
|
1462
|
-
return {
|
|
1463
|
-
toLoad: Object.keys(toLoad),
|
|
1464
|
-
pending: Object.keys(pending),
|
|
1465
|
-
toLoadLanguages: Object.keys(toLoadLanguages),
|
|
1466
|
-
toLoadNamespaces: Object.keys(toLoadNamespaces)
|
|
1467
|
-
};
|
|
1468
|
-
}
|
|
1469
|
-
loaded(name, err, data) {
|
|
1470
|
-
const s = name.split('|');
|
|
1471
|
-
const lng = s[0];
|
|
1472
|
-
const ns = s[1];
|
|
1473
|
-
if (err) this.emit('failedLoading', lng, ns, err);
|
|
1474
|
-
if (!err && data) {
|
|
1475
|
-
this.store.addResourceBundle(lng, ns, data, undefined, undefined, {
|
|
1476
|
-
skipCopy: true
|
|
1477
|
-
});
|
|
1478
|
-
}
|
|
1479
|
-
this.state[name] = err ? -1 : 2;
|
|
1480
|
-
if (err && data) this.state[name] = 0;
|
|
1481
|
-
const loaded = {};
|
|
1482
|
-
this.queue.forEach(q => {
|
|
1483
|
-
pushPath(q.loaded, [lng], ns);
|
|
1484
|
-
removePending(q, name);
|
|
1485
|
-
if (err) q.errors.push(err);
|
|
1486
|
-
if (q.pendingCount === 0 && !q.done) {
|
|
1487
|
-
Object.keys(q.loaded).forEach(l => {
|
|
1488
|
-
if (!loaded[l]) loaded[l] = {};
|
|
1489
|
-
const loadedKeys = q.loaded[l];
|
|
1490
|
-
if (loadedKeys.length) {
|
|
1491
|
-
loadedKeys.forEach(n => {
|
|
1492
|
-
if (loaded[l][n] === undefined) loaded[l][n] = true;
|
|
1493
|
-
});
|
|
1494
|
-
}
|
|
1495
|
-
});
|
|
1496
|
-
q.done = true;
|
|
1497
|
-
if (q.errors.length) {
|
|
1498
|
-
q.callback(q.errors);
|
|
1499
|
-
} else {
|
|
1500
|
-
q.callback();
|
|
1501
|
-
}
|
|
1502
|
-
}
|
|
1503
|
-
});
|
|
1504
|
-
this.emit('loaded', loaded);
|
|
1505
|
-
this.queue = this.queue.filter(q => !q.done);
|
|
1506
|
-
}
|
|
1507
|
-
read(lng, ns, fcName, tried = 0, wait = this.retryTimeout, callback) {
|
|
1508
|
-
if (!lng.length) return callback(null, {});
|
|
1509
|
-
if (this.readingCalls >= this.maxParallelReads) {
|
|
1510
|
-
this.waitingReads.push({
|
|
1511
|
-
lng,
|
|
1512
|
-
ns,
|
|
1513
|
-
fcName,
|
|
1514
|
-
tried,
|
|
1515
|
-
wait,
|
|
1516
|
-
callback
|
|
1517
|
-
});
|
|
1518
|
-
return;
|
|
1519
|
-
}
|
|
1520
|
-
this.readingCalls++;
|
|
1521
|
-
const resolver = (err, data) => {
|
|
1522
|
-
this.readingCalls--;
|
|
1523
|
-
if (this.waitingReads.length > 0) {
|
|
1524
|
-
const next = this.waitingReads.shift();
|
|
1525
|
-
this.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);
|
|
1526
|
-
}
|
|
1527
|
-
if (err && data && tried < this.maxRetries) {
|
|
1528
|
-
setTimeout(() => {
|
|
1529
|
-
this.read.call(this, lng, ns, fcName, tried + 1, wait * 2, callback);
|
|
1530
|
-
}, wait);
|
|
1531
|
-
return;
|
|
1532
|
-
}
|
|
1533
|
-
callback(err, data);
|
|
1534
|
-
};
|
|
1535
|
-
const fc = this.backend[fcName].bind(this.backend);
|
|
1536
|
-
if (fc.length === 2) {
|
|
1537
|
-
try {
|
|
1538
|
-
const r = fc(lng, ns);
|
|
1539
|
-
if (r && typeof r.then === 'function') {
|
|
1540
|
-
r.then(data => resolver(null, data)).catch(resolver);
|
|
1541
|
-
} else {
|
|
1542
|
-
resolver(null, r);
|
|
1543
|
-
}
|
|
1544
|
-
} catch (err) {
|
|
1545
|
-
resolver(err);
|
|
1546
|
-
}
|
|
1547
|
-
return;
|
|
1548
|
-
}
|
|
1549
|
-
return fc(lng, ns, resolver);
|
|
1550
|
-
}
|
|
1551
|
-
prepareLoading(languages, namespaces, options = {}, callback) {
|
|
1552
|
-
if (!this.backend) {
|
|
1553
|
-
this.logger.warn('No backend was added via i18next.use. Will not load resources.');
|
|
1554
|
-
return callback && callback();
|
|
1555
|
-
}
|
|
1556
|
-
if (isString(languages)) languages = this.languageUtils.toResolveHierarchy(languages);
|
|
1557
|
-
if (isString(namespaces)) namespaces = [namespaces];
|
|
1558
|
-
const toLoad = this.queueLoad(languages, namespaces, options, callback);
|
|
1559
|
-
if (!toLoad.toLoad.length) {
|
|
1560
|
-
if (!toLoad.pending.length) callback();
|
|
1561
|
-
return null;
|
|
1562
|
-
}
|
|
1563
|
-
toLoad.toLoad.forEach(name => {
|
|
1564
|
-
this.loadOne(name);
|
|
1565
|
-
});
|
|
1566
|
-
}
|
|
1567
|
-
load(languages, namespaces, callback) {
|
|
1568
|
-
this.prepareLoading(languages, namespaces, {}, callback);
|
|
1569
|
-
}
|
|
1570
|
-
reload(languages, namespaces, callback) {
|
|
1571
|
-
this.prepareLoading(languages, namespaces, {
|
|
1572
|
-
reload: true
|
|
1573
|
-
}, callback);
|
|
1574
|
-
}
|
|
1575
|
-
loadOne(name, prefix = '') {
|
|
1576
|
-
const s = name.split('|');
|
|
1577
|
-
const lng = s[0];
|
|
1578
|
-
const ns = s[1];
|
|
1579
|
-
this.read(lng, ns, 'read', undefined, undefined, (err, data) => {
|
|
1580
|
-
if (err) this.logger.warn(`${prefix}loading namespace ${ns} for language ${lng} failed`, err);
|
|
1581
|
-
if (!err && data) this.logger.log(`${prefix}loaded namespace ${ns} for language ${lng}`, data);
|
|
1582
|
-
this.loaded(name, err, data);
|
|
1583
|
-
});
|
|
1584
|
-
}
|
|
1585
|
-
saveMissing(languages, namespace, key, fallbackValue, isUpdate, options = {}, clb = () => {}) {
|
|
1586
|
-
if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(namespace)) {
|
|
1587
|
-
this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
|
|
1588
|
-
return;
|
|
1589
|
-
}
|
|
1590
|
-
if (key === undefined || key === null || key === '') return;
|
|
1591
|
-
if (this.backend?.create) {
|
|
1592
|
-
const opts = {
|
|
1593
|
-
...options,
|
|
1594
|
-
isUpdate
|
|
1595
|
-
};
|
|
1596
|
-
const fc = this.backend.create.bind(this.backend);
|
|
1597
|
-
if (fc.length < 6) {
|
|
1598
|
-
try {
|
|
1599
|
-
let r;
|
|
1600
|
-
if (fc.length === 5) {
|
|
1601
|
-
r = fc(languages, namespace, key, fallbackValue, opts);
|
|
1602
|
-
} else {
|
|
1603
|
-
r = fc(languages, namespace, key, fallbackValue);
|
|
1604
|
-
}
|
|
1605
|
-
if (r && typeof r.then === 'function') {
|
|
1606
|
-
r.then(data => clb(null, data)).catch(clb);
|
|
1607
|
-
} else {
|
|
1608
|
-
clb(null, r);
|
|
1609
|
-
}
|
|
1610
|
-
} catch (err) {
|
|
1611
|
-
clb(err);
|
|
1612
|
-
}
|
|
1613
|
-
} else {
|
|
1614
|
-
fc(languages, namespace, key, fallbackValue, clb, opts);
|
|
1615
|
-
}
|
|
1616
|
-
}
|
|
1617
|
-
if (!languages || !languages[0]) return;
|
|
1618
|
-
this.store.addResource(languages[0], namespace, key, fallbackValue);
|
|
1619
|
-
}
|
|
1620
|
-
}
|
|
1621
|
-
|
|
1622
|
-
const get = () => ({
|
|
1623
|
-
debug: false,
|
|
1624
|
-
initAsync: true,
|
|
1625
|
-
ns: ['translation'],
|
|
1626
|
-
defaultNS: ['translation'],
|
|
1627
|
-
fallbackLng: ['dev'],
|
|
1628
|
-
fallbackNS: false,
|
|
1629
|
-
supportedLngs: false,
|
|
1630
|
-
nonExplicitSupportedLngs: false,
|
|
1631
|
-
load: 'all',
|
|
1632
|
-
preload: false,
|
|
1633
|
-
simplifyPluralSuffix: true,
|
|
1634
|
-
keySeparator: '.',
|
|
1635
|
-
nsSeparator: ':',
|
|
1636
|
-
pluralSeparator: '_',
|
|
1637
|
-
contextSeparator: '_',
|
|
1638
|
-
partialBundledLanguages: false,
|
|
1639
|
-
saveMissing: false,
|
|
1640
|
-
updateMissing: false,
|
|
1641
|
-
saveMissingTo: 'fallback',
|
|
1642
|
-
saveMissingPlurals: true,
|
|
1643
|
-
missingKeyHandler: false,
|
|
1644
|
-
missingInterpolationHandler: false,
|
|
1645
|
-
postProcess: false,
|
|
1646
|
-
postProcessPassResolved: false,
|
|
1647
|
-
returnNull: false,
|
|
1648
|
-
returnEmptyString: true,
|
|
1649
|
-
returnObjects: false,
|
|
1650
|
-
joinArrays: false,
|
|
1651
|
-
returnedObjectHandler: false,
|
|
1652
|
-
parseMissingKeyHandler: false,
|
|
1653
|
-
appendNamespaceToMissingKey: false,
|
|
1654
|
-
appendNamespaceToCIMode: false,
|
|
1655
|
-
overloadTranslationOptionHandler: args => {
|
|
1656
|
-
let ret = {};
|
|
1657
|
-
if (typeof args[1] === 'object') ret = args[1];
|
|
1658
|
-
if (isString(args[1])) ret.defaultValue = args[1];
|
|
1659
|
-
if (isString(args[2])) ret.tDescription = args[2];
|
|
1660
|
-
if (typeof args[2] === 'object' || typeof args[3] === 'object') {
|
|
1661
|
-
const options = args[3] || args[2];
|
|
1662
|
-
Object.keys(options).forEach(key => {
|
|
1663
|
-
ret[key] = options[key];
|
|
1664
|
-
});
|
|
1665
|
-
}
|
|
1666
|
-
return ret;
|
|
1667
|
-
},
|
|
1668
|
-
interpolation: {
|
|
1669
|
-
escapeValue: true,
|
|
1670
|
-
format: value => value,
|
|
1671
|
-
prefix: '{{',
|
|
1672
|
-
suffix: '}}',
|
|
1673
|
-
formatSeparator: ',',
|
|
1674
|
-
unescapePrefix: '-',
|
|
1675
|
-
nestingPrefix: '$t(',
|
|
1676
|
-
nestingSuffix: ')',
|
|
1677
|
-
nestingOptionsSeparator: ',',
|
|
1678
|
-
maxReplaces: 1000,
|
|
1679
|
-
skipOnVariables: true
|
|
1680
|
-
},
|
|
1681
|
-
cacheInBuiltFormats: true
|
|
1682
|
-
});
|
|
1683
|
-
const transformOptions = options => {
|
|
1684
|
-
if (isString(options.ns)) options.ns = [options.ns];
|
|
1685
|
-
if (isString(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
|
|
1686
|
-
if (isString(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
|
|
1687
|
-
if (options.supportedLngs?.indexOf?.('cimode') < 0) {
|
|
1688
|
-
options.supportedLngs = options.supportedLngs.concat(['cimode']);
|
|
1689
|
-
}
|
|
1690
|
-
if (typeof options.initImmediate === 'boolean') options.initAsync = options.initImmediate;
|
|
1691
|
-
return options;
|
|
1692
|
-
};
|
|
1693
|
-
|
|
1694
|
-
const noop = () => {};
|
|
1695
|
-
const bindMemberFunctions = inst => {
|
|
1696
|
-
const mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));
|
|
1697
|
-
mems.forEach(mem => {
|
|
1698
|
-
if (typeof inst[mem] === 'function') {
|
|
1699
|
-
inst[mem] = inst[mem].bind(inst);
|
|
1700
|
-
}
|
|
1701
|
-
});
|
|
1702
|
-
};
|
|
1703
|
-
class I18n extends EventEmitter {
|
|
1704
|
-
constructor(options = {}, callback) {
|
|
1705
|
-
super();
|
|
1706
|
-
this.options = transformOptions(options);
|
|
1707
|
-
this.services = {};
|
|
1708
|
-
this.logger = baseLogger;
|
|
1709
|
-
this.modules = {
|
|
1710
|
-
external: []
|
|
1711
|
-
};
|
|
1712
|
-
bindMemberFunctions(this);
|
|
1713
|
-
if (callback && !this.isInitialized && !options.isClone) {
|
|
1714
|
-
if (!this.options.initAsync) {
|
|
1715
|
-
this.init(options, callback);
|
|
1716
|
-
return this;
|
|
1717
|
-
}
|
|
1718
|
-
setTimeout(() => {
|
|
1719
|
-
this.init(options, callback);
|
|
1720
|
-
}, 0);
|
|
1721
|
-
}
|
|
1722
|
-
}
|
|
1723
|
-
init(options = {}, callback) {
|
|
1724
|
-
this.isInitializing = true;
|
|
1725
|
-
if (typeof options === 'function') {
|
|
1726
|
-
callback = options;
|
|
1727
|
-
options = {};
|
|
1728
|
-
}
|
|
1729
|
-
if (options.defaultNS == null && options.ns) {
|
|
1730
|
-
if (isString(options.ns)) {
|
|
1731
|
-
options.defaultNS = options.ns;
|
|
1732
|
-
} else if (options.ns.indexOf('translation') < 0) {
|
|
1733
|
-
options.defaultNS = options.ns[0];
|
|
1734
|
-
}
|
|
1735
|
-
}
|
|
1736
|
-
const defOpts = get();
|
|
1737
|
-
this.options = {
|
|
1738
|
-
...defOpts,
|
|
1739
|
-
...this.options,
|
|
1740
|
-
...transformOptions(options)
|
|
1741
|
-
};
|
|
1742
|
-
this.options.interpolation = {
|
|
1743
|
-
...defOpts.interpolation,
|
|
1744
|
-
...this.options.interpolation
|
|
1745
|
-
};
|
|
1746
|
-
if (options.keySeparator !== undefined) {
|
|
1747
|
-
this.options.userDefinedKeySeparator = options.keySeparator;
|
|
1748
|
-
}
|
|
1749
|
-
if (options.nsSeparator !== undefined) {
|
|
1750
|
-
this.options.userDefinedNsSeparator = options.nsSeparator;
|
|
1751
|
-
}
|
|
1752
|
-
if (typeof this.options.overloadTranslationOptionHandler !== 'function') {
|
|
1753
|
-
this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler;
|
|
1754
|
-
}
|
|
1755
|
-
const createClassOnDemand = ClassOrObject => {
|
|
1756
|
-
if (!ClassOrObject) return null;
|
|
1757
|
-
if (typeof ClassOrObject === 'function') return new ClassOrObject();
|
|
1758
|
-
return ClassOrObject;
|
|
1759
|
-
};
|
|
1760
|
-
if (!this.options.isClone) {
|
|
1761
|
-
if (this.modules.logger) {
|
|
1762
|
-
baseLogger.init(createClassOnDemand(this.modules.logger), this.options);
|
|
1763
|
-
} else {
|
|
1764
|
-
baseLogger.init(null, this.options);
|
|
1765
|
-
}
|
|
1766
|
-
let formatter;
|
|
1767
|
-
if (this.modules.formatter) {
|
|
1768
|
-
formatter = this.modules.formatter;
|
|
1769
|
-
} else {
|
|
1770
|
-
formatter = Formatter;
|
|
1771
|
-
}
|
|
1772
|
-
const lu = new LanguageUtil(this.options);
|
|
1773
|
-
this.store = new ResourceStore(this.options.resources, this.options);
|
|
1774
|
-
const s = this.services;
|
|
1775
|
-
s.logger = baseLogger;
|
|
1776
|
-
s.resourceStore = this.store;
|
|
1777
|
-
s.languageUtils = lu;
|
|
1778
|
-
s.pluralResolver = new PluralResolver(lu, {
|
|
1779
|
-
prepend: this.options.pluralSeparator,
|
|
1780
|
-
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1781
|
-
});
|
|
1782
|
-
const usingLegacyFormatFunction = this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format;
|
|
1783
|
-
if (usingLegacyFormatFunction) {
|
|
1784
|
-
this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
|
|
1785
|
-
}
|
|
1786
|
-
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
|
|
1787
|
-
s.formatter = createClassOnDemand(formatter);
|
|
1788
|
-
if (s.formatter.init) s.formatter.init(s, this.options);
|
|
1789
|
-
this.options.interpolation.format = s.formatter.format.bind(s.formatter);
|
|
1790
|
-
}
|
|
1791
|
-
s.interpolator = new Interpolator(this.options);
|
|
1792
|
-
s.utils = {
|
|
1793
|
-
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1794
|
-
};
|
|
1795
|
-
s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);
|
|
1796
|
-
s.backendConnector.on('*', (event, ...args) => {
|
|
1797
|
-
this.emit(event, ...args);
|
|
1798
|
-
});
|
|
1799
|
-
if (this.modules.languageDetector) {
|
|
1800
|
-
s.languageDetector = createClassOnDemand(this.modules.languageDetector);
|
|
1801
|
-
if (s.languageDetector.init) s.languageDetector.init(s, this.options.detection, this.options);
|
|
1802
|
-
}
|
|
1803
|
-
if (this.modules.i18nFormat) {
|
|
1804
|
-
s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
|
|
1805
|
-
if (s.i18nFormat.init) s.i18nFormat.init(this);
|
|
1806
|
-
}
|
|
1807
|
-
this.translator = new Translator(this.services, this.options);
|
|
1808
|
-
this.translator.on('*', (event, ...args) => {
|
|
1809
|
-
this.emit(event, ...args);
|
|
1810
|
-
});
|
|
1811
|
-
this.modules.external.forEach(m => {
|
|
1812
|
-
if (m.init) m.init(this);
|
|
1813
|
-
});
|
|
1814
|
-
}
|
|
1815
|
-
this.format = this.options.interpolation.format;
|
|
1816
|
-
if (!callback) callback = noop;
|
|
1817
|
-
if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
1818
|
-
const codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1819
|
-
if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];
|
|
1820
|
-
}
|
|
1821
|
-
if (!this.services.languageDetector && !this.options.lng) {
|
|
1822
|
-
this.logger.warn('init: no languageDetector is used and no lng is defined');
|
|
1823
|
-
}
|
|
1824
|
-
const storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
|
|
1825
|
-
storeApi.forEach(fcName => {
|
|
1826
|
-
this[fcName] = (...args) => this.store[fcName](...args);
|
|
1827
|
-
});
|
|
1828
|
-
const storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];
|
|
1829
|
-
storeApiChained.forEach(fcName => {
|
|
1830
|
-
this[fcName] = (...args) => {
|
|
1831
|
-
this.store[fcName](...args);
|
|
1832
|
-
return this;
|
|
1833
|
-
};
|
|
1834
|
-
});
|
|
1835
|
-
const deferred = defer();
|
|
1836
|
-
const load = () => {
|
|
1837
|
-
const finish = (err, t) => {
|
|
1838
|
-
this.isInitializing = false;
|
|
1839
|
-
if (this.isInitialized && !this.initializedStoreOnce) this.logger.warn('init: i18next is already initialized. You should call init just once!');
|
|
1840
|
-
this.isInitialized = true;
|
|
1841
|
-
if (!this.options.isClone) this.logger.log('initialized', this.options);
|
|
1842
|
-
this.emit('initialized', this.options);
|
|
1843
|
-
deferred.resolve(t);
|
|
1844
|
-
callback(err, t);
|
|
1845
|
-
};
|
|
1846
|
-
if (this.languages && !this.isInitialized) return finish(null, this.t.bind(this));
|
|
1847
|
-
this.changeLanguage(this.options.lng, finish);
|
|
1848
|
-
};
|
|
1849
|
-
if (this.options.resources || !this.options.initAsync) {
|
|
1850
|
-
load();
|
|
1851
|
-
} else {
|
|
1852
|
-
setTimeout(load, 0);
|
|
1853
|
-
}
|
|
1854
|
-
return deferred;
|
|
1855
|
-
}
|
|
1856
|
-
loadResources(language, callback = noop) {
|
|
1857
|
-
let usedCallback = callback;
|
|
1858
|
-
const usedLng = isString(language) ? language : this.language;
|
|
1859
|
-
if (typeof language === 'function') usedCallback = language;
|
|
1860
|
-
if (!this.options.resources || this.options.partialBundledLanguages) {
|
|
1861
|
-
if (usedLng?.toLowerCase() === 'cimode' && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
|
|
1862
|
-
const toLoad = [];
|
|
1863
|
-
const append = lng => {
|
|
1864
|
-
if (!lng) return;
|
|
1865
|
-
if (lng === 'cimode') return;
|
|
1866
|
-
const lngs = this.services.languageUtils.toResolveHierarchy(lng);
|
|
1867
|
-
lngs.forEach(l => {
|
|
1868
|
-
if (l === 'cimode') return;
|
|
1869
|
-
if (toLoad.indexOf(l) < 0) toLoad.push(l);
|
|
1870
|
-
});
|
|
1871
|
-
};
|
|
1872
|
-
if (!usedLng) {
|
|
1873
|
-
const fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1874
|
-
fallbacks.forEach(l => append(l));
|
|
1875
|
-
} else {
|
|
1876
|
-
append(usedLng);
|
|
1877
|
-
}
|
|
1878
|
-
this.options.preload?.forEach?.(l => append(l));
|
|
1879
|
-
this.services.backendConnector.load(toLoad, this.options.ns, e => {
|
|
1880
|
-
if (!e && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language);
|
|
1881
|
-
usedCallback(e);
|
|
1882
|
-
});
|
|
1883
|
-
} else {
|
|
1884
|
-
usedCallback(null);
|
|
1885
|
-
}
|
|
1886
|
-
}
|
|
1887
|
-
reloadResources(lngs, ns, callback) {
|
|
1888
|
-
const deferred = defer();
|
|
1889
|
-
if (typeof lngs === 'function') {
|
|
1890
|
-
callback = lngs;
|
|
1891
|
-
lngs = undefined;
|
|
1892
|
-
}
|
|
1893
|
-
if (typeof ns === 'function') {
|
|
1894
|
-
callback = ns;
|
|
1895
|
-
ns = undefined;
|
|
1896
|
-
}
|
|
1897
|
-
if (!lngs) lngs = this.languages;
|
|
1898
|
-
if (!ns) ns = this.options.ns;
|
|
1899
|
-
if (!callback) callback = noop;
|
|
1900
|
-
this.services.backendConnector.reload(lngs, ns, err => {
|
|
1901
|
-
deferred.resolve();
|
|
1902
|
-
callback(err);
|
|
1903
|
-
});
|
|
1904
|
-
return deferred;
|
|
1905
|
-
}
|
|
1906
|
-
use(module) {
|
|
1907
|
-
if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');
|
|
1908
|
-
if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');
|
|
1909
|
-
if (module.type === 'backend') {
|
|
1910
|
-
this.modules.backend = module;
|
|
1911
|
-
}
|
|
1912
|
-
if (module.type === 'logger' || module.log && module.warn && module.error) {
|
|
1913
|
-
this.modules.logger = module;
|
|
1914
|
-
}
|
|
1915
|
-
if (module.type === 'languageDetector') {
|
|
1916
|
-
this.modules.languageDetector = module;
|
|
1917
|
-
}
|
|
1918
|
-
if (module.type === 'i18nFormat') {
|
|
1919
|
-
this.modules.i18nFormat = module;
|
|
1920
|
-
}
|
|
1921
|
-
if (module.type === 'postProcessor') {
|
|
1922
|
-
postProcessor.addPostProcessor(module);
|
|
1923
|
-
}
|
|
1924
|
-
if (module.type === 'formatter') {
|
|
1925
|
-
this.modules.formatter = module;
|
|
1926
|
-
}
|
|
1927
|
-
if (module.type === '3rdParty') {
|
|
1928
|
-
this.modules.external.push(module);
|
|
1929
|
-
}
|
|
1930
|
-
return this;
|
|
1931
|
-
}
|
|
1932
|
-
setResolvedLanguage(l) {
|
|
1933
|
-
if (!l || !this.languages) return;
|
|
1934
|
-
if (['cimode', 'dev'].indexOf(l) > -1) return;
|
|
1935
|
-
for (let li = 0; li < this.languages.length; li++) {
|
|
1936
|
-
const lngInLngs = this.languages[li];
|
|
1937
|
-
if (['cimode', 'dev'].indexOf(lngInLngs) > -1) continue;
|
|
1938
|
-
if (this.store.hasLanguageSomeTranslations(lngInLngs)) {
|
|
1939
|
-
this.resolvedLanguage = lngInLngs;
|
|
1940
|
-
break;
|
|
1941
|
-
}
|
|
1942
|
-
}
|
|
1943
|
-
if (!this.resolvedLanguage && this.languages.indexOf(l) < 0 && this.store.hasLanguageSomeTranslations(l)) {
|
|
1944
|
-
this.resolvedLanguage = l;
|
|
1945
|
-
this.languages.unshift(l);
|
|
1946
|
-
}
|
|
1947
|
-
}
|
|
1948
|
-
changeLanguage(lng, callback) {
|
|
1949
|
-
this.isLanguageChangingTo = lng;
|
|
1950
|
-
const deferred = defer();
|
|
1951
|
-
this.emit('languageChanging', lng);
|
|
1952
|
-
const setLngProps = l => {
|
|
1953
|
-
this.language = l;
|
|
1954
|
-
this.languages = this.services.languageUtils.toResolveHierarchy(l);
|
|
1955
|
-
this.resolvedLanguage = undefined;
|
|
1956
|
-
this.setResolvedLanguage(l);
|
|
1957
|
-
};
|
|
1958
|
-
const done = (err, l) => {
|
|
1959
|
-
if (l) {
|
|
1960
|
-
if (this.isLanguageChangingTo === lng) {
|
|
1961
|
-
setLngProps(l);
|
|
1962
|
-
this.translator.changeLanguage(l);
|
|
1963
|
-
this.isLanguageChangingTo = undefined;
|
|
1964
|
-
this.emit('languageChanged', l);
|
|
1965
|
-
this.logger.log('languageChanged', l);
|
|
1966
|
-
}
|
|
1967
|
-
} else {
|
|
1968
|
-
this.isLanguageChangingTo = undefined;
|
|
1969
|
-
}
|
|
1970
|
-
deferred.resolve((...args) => this.t(...args));
|
|
1971
|
-
if (callback) callback(err, (...args) => this.t(...args));
|
|
1972
|
-
};
|
|
1973
|
-
const setLng = lngs => {
|
|
1974
|
-
if (!lng && !lngs && this.services.languageDetector) lngs = [];
|
|
1975
|
-
const fl = isString(lngs) ? lngs : lngs && lngs[0];
|
|
1976
|
-
const l = this.store.hasLanguageSomeTranslations(fl) ? fl : this.services.languageUtils.getBestMatchFromCodes(isString(lngs) ? [lngs] : lngs);
|
|
1977
|
-
if (l) {
|
|
1978
|
-
if (!this.language) {
|
|
1979
|
-
setLngProps(l);
|
|
1980
|
-
}
|
|
1981
|
-
if (!this.translator.language) this.translator.changeLanguage(l);
|
|
1982
|
-
this.services.languageDetector?.cacheUserLanguage?.(l);
|
|
1983
|
-
}
|
|
1984
|
-
this.loadResources(l, err => {
|
|
1985
|
-
done(err, l);
|
|
1986
|
-
});
|
|
1987
|
-
};
|
|
1988
|
-
if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {
|
|
1989
|
-
setLng(this.services.languageDetector.detect());
|
|
1990
|
-
} else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {
|
|
1991
|
-
if (this.services.languageDetector.detect.length === 0) {
|
|
1992
|
-
this.services.languageDetector.detect().then(setLng);
|
|
1993
|
-
} else {
|
|
1994
|
-
this.services.languageDetector.detect(setLng);
|
|
1995
|
-
}
|
|
1996
|
-
} else {
|
|
1997
|
-
setLng(lng);
|
|
1998
|
-
}
|
|
1999
|
-
return deferred;
|
|
2000
|
-
}
|
|
2001
|
-
getFixedT(lng, ns, keyPrefix) {
|
|
2002
|
-
const fixedT = (key, opts, ...rest) => {
|
|
2003
|
-
let o;
|
|
2004
|
-
if (typeof opts !== 'object') {
|
|
2005
|
-
o = this.options.overloadTranslationOptionHandler([key, opts].concat(rest));
|
|
2006
|
-
} else {
|
|
2007
|
-
o = {
|
|
2008
|
-
...opts
|
|
2009
|
-
};
|
|
2010
|
-
}
|
|
2011
|
-
o.lng = o.lng || fixedT.lng;
|
|
2012
|
-
o.lngs = o.lngs || fixedT.lngs;
|
|
2013
|
-
o.ns = o.ns || fixedT.ns;
|
|
2014
|
-
if (o.keyPrefix !== '') o.keyPrefix = o.keyPrefix || keyPrefix || fixedT.keyPrefix;
|
|
2015
|
-
const keySeparator = this.options.keySeparator || '.';
|
|
2016
|
-
let resultKey;
|
|
2017
|
-
if (o.keyPrefix && Array.isArray(key)) {
|
|
2018
|
-
resultKey = key.map(k => {
|
|
2019
|
-
if (typeof k === 'function') k = keysFromSelector(k, {
|
|
2020
|
-
...this.options,
|
|
2021
|
-
...opts
|
|
2022
|
-
});
|
|
2023
|
-
return `${o.keyPrefix}${keySeparator}${k}`;
|
|
2024
|
-
});
|
|
2025
|
-
} else {
|
|
2026
|
-
if (typeof key === 'function') key = keysFromSelector(key, {
|
|
2027
|
-
...this.options,
|
|
2028
|
-
...opts
|
|
2029
|
-
});
|
|
2030
|
-
resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
|
|
2031
|
-
}
|
|
2032
|
-
return this.t(resultKey, o);
|
|
2033
|
-
};
|
|
2034
|
-
if (isString(lng)) {
|
|
2035
|
-
fixedT.lng = lng;
|
|
2036
|
-
} else {
|
|
2037
|
-
fixedT.lngs = lng;
|
|
2038
|
-
}
|
|
2039
|
-
fixedT.ns = ns;
|
|
2040
|
-
fixedT.keyPrefix = keyPrefix;
|
|
2041
|
-
return fixedT;
|
|
2042
|
-
}
|
|
2043
|
-
t(...args) {
|
|
2044
|
-
return this.translator?.translate(...args);
|
|
2045
|
-
}
|
|
2046
|
-
exists(...args) {
|
|
2047
|
-
return this.translator?.exists(...args);
|
|
2048
|
-
}
|
|
2049
|
-
setDefaultNamespace(ns) {
|
|
2050
|
-
this.options.defaultNS = ns;
|
|
2051
|
-
}
|
|
2052
|
-
hasLoadedNamespace(ns, options = {}) {
|
|
2053
|
-
if (!this.isInitialized) {
|
|
2054
|
-
this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);
|
|
2055
|
-
return false;
|
|
2056
|
-
}
|
|
2057
|
-
if (!this.languages || !this.languages.length) {
|
|
2058
|
-
this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);
|
|
2059
|
-
return false;
|
|
2060
|
-
}
|
|
2061
|
-
const lng = options.lng || this.resolvedLanguage || this.languages[0];
|
|
2062
|
-
const fallbackLng = this.options ? this.options.fallbackLng : false;
|
|
2063
|
-
const lastLng = this.languages[this.languages.length - 1];
|
|
2064
|
-
if (lng.toLowerCase() === 'cimode') return true;
|
|
2065
|
-
const loadNotPending = (l, n) => {
|
|
2066
|
-
const loadState = this.services.backendConnector.state[`${l}|${n}`];
|
|
2067
|
-
return loadState === -1 || loadState === 0 || loadState === 2;
|
|
2068
|
-
};
|
|
2069
|
-
if (options.precheck) {
|
|
2070
|
-
const preResult = options.precheck(this, loadNotPending);
|
|
2071
|
-
if (preResult !== undefined) return preResult;
|
|
2072
|
-
}
|
|
2073
|
-
if (this.hasResourceBundle(lng, ns)) return true;
|
|
2074
|
-
if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;
|
|
2075
|
-
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
|
|
2076
|
-
return false;
|
|
2077
|
-
}
|
|
2078
|
-
loadNamespaces(ns, callback) {
|
|
2079
|
-
const deferred = defer();
|
|
2080
|
-
if (!this.options.ns) {
|
|
2081
|
-
if (callback) callback();
|
|
2082
|
-
return Promise.resolve();
|
|
2083
|
-
}
|
|
2084
|
-
if (isString(ns)) ns = [ns];
|
|
2085
|
-
ns.forEach(n => {
|
|
2086
|
-
if (this.options.ns.indexOf(n) < 0) this.options.ns.push(n);
|
|
2087
|
-
});
|
|
2088
|
-
this.loadResources(err => {
|
|
2089
|
-
deferred.resolve();
|
|
2090
|
-
if (callback) callback(err);
|
|
2091
|
-
});
|
|
2092
|
-
return deferred;
|
|
2093
|
-
}
|
|
2094
|
-
loadLanguages(lngs, callback) {
|
|
2095
|
-
const deferred = defer();
|
|
2096
|
-
if (isString(lngs)) lngs = [lngs];
|
|
2097
|
-
const preloaded = this.options.preload || [];
|
|
2098
|
-
const newLngs = lngs.filter(lng => preloaded.indexOf(lng) < 0 && this.services.languageUtils.isSupportedCode(lng));
|
|
2099
|
-
if (!newLngs.length) {
|
|
2100
|
-
if (callback) callback();
|
|
2101
|
-
return Promise.resolve();
|
|
2102
|
-
}
|
|
2103
|
-
this.options.preload = preloaded.concat(newLngs);
|
|
2104
|
-
this.loadResources(err => {
|
|
2105
|
-
deferred.resolve();
|
|
2106
|
-
if (callback) callback(err);
|
|
2107
|
-
});
|
|
2108
|
-
return deferred;
|
|
2109
|
-
}
|
|
2110
|
-
dir(lng) {
|
|
2111
|
-
if (!lng) lng = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language);
|
|
2112
|
-
if (!lng) return 'rtl';
|
|
2113
|
-
try {
|
|
2114
|
-
const l = new Intl.Locale(lng);
|
|
2115
|
-
if (l && l.getTextInfo) {
|
|
2116
|
-
const ti = l.getTextInfo();
|
|
2117
|
-
if (ti && ti.direction) return ti.direction;
|
|
2118
|
-
}
|
|
2119
|
-
} catch (e) {}
|
|
2120
|
-
const rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb'];
|
|
2121
|
-
const languageUtils = this.services?.languageUtils || new LanguageUtil(get());
|
|
2122
|
-
if (lng.toLowerCase().indexOf('-latn') > 1) return 'ltr';
|
|
2123
|
-
return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';
|
|
2124
|
-
}
|
|
2125
|
-
static createInstance(options = {}, callback) {
|
|
2126
|
-
const instance = new I18n(options, callback);
|
|
2127
|
-
instance.createInstance = I18n.createInstance;
|
|
2128
|
-
return instance;
|
|
2129
|
-
}
|
|
2130
|
-
cloneInstance(options = {}, callback = noop) {
|
|
2131
|
-
const forkResourceStore = options.forkResourceStore;
|
|
2132
|
-
if (forkResourceStore) delete options.forkResourceStore;
|
|
2133
|
-
const mergedOptions = {
|
|
2134
|
-
...this.options,
|
|
2135
|
-
...options,
|
|
2136
|
-
...{
|
|
2137
|
-
isClone: true
|
|
2138
|
-
}
|
|
2139
|
-
};
|
|
2140
|
-
const clone = new I18n(mergedOptions);
|
|
2141
|
-
if (options.debug !== undefined || options.prefix !== undefined) {
|
|
2142
|
-
clone.logger = clone.logger.clone(options);
|
|
2143
|
-
}
|
|
2144
|
-
const membersToCopy = ['store', 'services', 'language'];
|
|
2145
|
-
membersToCopy.forEach(m => {
|
|
2146
|
-
clone[m] = this[m];
|
|
2147
|
-
});
|
|
2148
|
-
clone.services = {
|
|
2149
|
-
...this.services
|
|
2150
|
-
};
|
|
2151
|
-
clone.services.utils = {
|
|
2152
|
-
hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
|
|
2153
|
-
};
|
|
2154
|
-
if (forkResourceStore) {
|
|
2155
|
-
const clonedData = Object.keys(this.store.data).reduce((prev, l) => {
|
|
2156
|
-
prev[l] = {
|
|
2157
|
-
...this.store.data[l]
|
|
2158
|
-
};
|
|
2159
|
-
prev[l] = Object.keys(prev[l]).reduce((acc, n) => {
|
|
2160
|
-
acc[n] = {
|
|
2161
|
-
...prev[l][n]
|
|
2162
|
-
};
|
|
2163
|
-
return acc;
|
|
2164
|
-
}, prev[l]);
|
|
2165
|
-
return prev;
|
|
2166
|
-
}, {});
|
|
2167
|
-
clone.store = new ResourceStore(clonedData, mergedOptions);
|
|
2168
|
-
clone.services.resourceStore = clone.store;
|
|
2169
|
-
}
|
|
2170
|
-
if (options.interpolation) clone.services.interpolator = new Interpolator(mergedOptions);
|
|
2171
|
-
clone.translator = new Translator(clone.services, mergedOptions);
|
|
2172
|
-
clone.translator.on('*', (event, ...args) => {
|
|
2173
|
-
clone.emit(event, ...args);
|
|
2174
|
-
});
|
|
2175
|
-
clone.init(mergedOptions, callback);
|
|
2176
|
-
clone.translator.options = mergedOptions;
|
|
2177
|
-
clone.translator.backendConnector.services.utils = {
|
|
2178
|
-
hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
|
|
2179
|
-
};
|
|
2180
|
-
return clone;
|
|
2181
|
-
}
|
|
2182
|
-
toJSON() {
|
|
2183
|
-
return {
|
|
2184
|
-
options: this.options,
|
|
2185
|
-
store: this.store,
|
|
2186
|
-
language: this.language,
|
|
2187
|
-
languages: this.languages,
|
|
2188
|
-
resolvedLanguage: this.resolvedLanguage
|
|
2189
|
-
};
|
|
2190
|
-
}
|
|
2191
|
-
}
|
|
2192
|
-
const instance = I18n.createInstance();
|
|
2193
|
-
|
|
2194
|
-
const createInstance = instance.createInstance;
|
|
2195
|
-
|
|
2196
|
-
const DEFAULT_LANG = "nl";
|
|
2197
|
-
function getComponentClosestLanguage(element) {
|
|
2198
|
-
const closestLangElement = element.closest("[lang]");
|
|
2199
|
-
if (closestLangElement instanceof HTMLElement) {
|
|
2200
|
-
return closestLangElement.lang || DEFAULT_LANG;
|
|
2201
|
-
}
|
|
2202
|
-
if (element.parentNode instanceof ShadowRoot && element.parentNode.host instanceof HTMLElement) {
|
|
2203
|
-
return getComponentClosestLanguage(element.parentNode.host);
|
|
2204
|
-
}
|
|
2205
|
-
if (element.parentElement instanceof HTMLElement) {
|
|
2206
|
-
return getComponentClosestLanguage(element.parentElement);
|
|
2207
|
-
}
|
|
2208
|
-
return DEFAULT_LANG;
|
|
2209
|
-
}
|
|
2210
|
-
function i18n(getElement, resources) {
|
|
2211
|
-
const element = getElement();
|
|
2212
|
-
const i18NextInstance = createInstance();
|
|
2213
|
-
i18NextInstance.init({
|
|
2214
|
-
fallbackLng: DEFAULT_LANG,
|
|
2215
|
-
resources,
|
|
2216
|
-
defaultNS: element.tagName.toLowerCase(),
|
|
2217
|
-
interpolation: { escapeValue: false },
|
|
2218
|
-
});
|
|
2219
|
-
let detectedLanguage = false;
|
|
2220
|
-
return (key, variables) => {
|
|
2221
|
-
if (!detectedLanguage) {
|
|
2222
|
-
detectedLanguage = true;
|
|
2223
|
-
const language = getComponentClosestLanguage(element);
|
|
2224
|
-
i18NextInstance.changeLanguage(language);
|
|
2225
|
-
}
|
|
2226
|
-
return i18NextInstance.t(key, variables);
|
|
2227
|
-
};
|
|
2228
|
-
}
|
|
2229
|
-
|
|
2230
|
-
export { i18n as i };
|
|
2231
|
-
//# sourceMappingURL=i18n.js.map
|
|
2232
|
-
|
|
2233
|
-
//# sourceMappingURL=i18n.js.map
|
|
1
|
+
const t=t=>"string"==typeof t,s=()=>{let t,s;const i=new Promise(((i,e)=>{t=i,s=e}));return i.resolve=t,i.reject=s,i},i=t=>null==t?"":""+t,e=/###/g,n=t=>t&&t.indexOf("###")>-1?t.replace(e,"."):t,o=s=>!s||t(s),r=(s,i,e)=>{const r=t(i)?i.split("."):i;let h=0;for(;h<r.length-1;){if(o(s))return{};const t=n(r[h]);!s[t]&&e&&(s[t]=new e),s=Object.prototype.hasOwnProperty.call(s,t)?s[t]:{},++h}return o(s)?{}:{obj:s,k:n(r[h])}},h=(t,s,i)=>{const{obj:e,k:n}=r(t,s,Object);if(void 0!==e||1===s.length)return void(e[n]=i);let o=s[s.length-1],h=s.slice(0,s.length-1),a=r(t,h,Object);for(;void 0===a.obj&&h.length;)o=`${h[h.length-1]}.${o}`,h=h.slice(0,h.length-1),a=r(t,h,Object),a?.obj&&void 0!==a.obj[`${a.k}.${o}`]&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=i},a=(t,s)=>{const{obj:i,k:e}=r(t,s);if(i&&Object.prototype.hasOwnProperty.call(i,e))return i[e]},c=(s,i,e)=>{for(const n in i)"__proto__"!==n&&"constructor"!==n&&(n in s?t(s[n])||s[n]instanceof String||t(i[n])||i[n]instanceof String?e&&(s[n]=i[n]):c(s[n],i[n],e):s[n]=i[n]);return s},l=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var u={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const d=s=>t(s)?s.replace(/[&<>"'\/]/g,(t=>u[t])):s,f=[" ",",","?","!",";"],p=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const s=this.regExpMap.get(t);if(void 0!==s)return s;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}(20),g=(t,s,i=".")=>{if(!t)return;if(t[s]){if(!Object.prototype.hasOwnProperty.call(t,s))return;return t[s]}const e=s.split(i);let n=t;for(let t=0;t<e.length;){if(!n||"object"!=typeof n)return;let s,o="";for(let r=t;r<e.length;++r)if(r!==t&&(o+=i),o+=e[r],s=n[o],void 0!==s){if(["string","number","boolean"].indexOf(typeof s)>-1&&r<e.length-1)continue;t+=r-t+1;break}n=s}return n},y=t=>t?.replace("_","-"),m={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,s){console?.[t]?.apply?.(console,s)}};class v{constructor(t,s={}){this.init(t,s)}init(t,s={}){this.prefix=s.prefix||"i18next:",this.logger=t||m,this.options=s,this.debug=s.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(s,i,e,n){return n&&!this.debug?null:(t(s[0])&&(s[0]=`${e}${this.prefix} ${s[0]}`),this.logger[i](s))}create(t){return new v(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new v(this.logger,t)}}var $=new v;class b{constructor(){this.observers={}}on(t,s){return t.split(" ").forEach((t=>{this.observers[t]||(this.observers[t]=new Map);const i=this.observers[t].get(s)||0;this.observers[t].set(s,i+1)})),this}off(t,s){this.observers[t]&&(s?this.observers[t].delete(s):delete this.observers[t])}emit(t,...s){this.observers[t]&&Array.from(this.observers[t].entries()).forEach((([t,i])=>{for(let e=0;e<i;e++)t(...s)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((([i,e])=>{for(let n=0;n<e;n++)i.apply(i,[t,...s])}))}}class x extends b{constructor(t,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=s,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const s=this.options.ns.indexOf(t);s>-1&&this.options.ns.splice(s,1)}getResource(s,i,e,n={}){const o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,r=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let h;s.indexOf(".")>-1?h=s.split("."):(h=[s,i],e&&(Array.isArray(e)?h.push(...e):t(e)&&o?h.push(...e.split(o)):h.push(e)));const c=a(this.data,h);return!c&&!i&&!e&&s.indexOf(".")>-1&&(s=h[0],i=h[1],e=h.slice(2).join(".")),!c&&r&&t(e)?g(this.data?.[s]?.[i],e,o):c}addResource(t,s,i,e,n={silent:!1}){const o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let r=[t,s];i&&(r=r.concat(o?i.split(o):i)),t.indexOf(".")>-1&&(r=t.split("."),e=s,s=r[1]),this.addNamespaces(s),h(this.data,r,e),n.silent||this.emit("added",t,s,i,e)}addResources(s,i,e,n={silent:!1}){for(const n in e)(t(e[n])||Array.isArray(e[n]))&&this.addResource(s,i,n,e[n],{silent:!0});n.silent||this.emit("added",s,i,e)}addResourceBundle(t,s,i,e,n,o={silent:!1,skipCopy:!1}){let r=[t,s];t.indexOf(".")>-1&&(r=t.split("."),e=i,i=s,s=r[1]),this.addNamespaces(s);let l=a(this.data,r)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),e?c(l,i,n):l={...l,...i},h(this.data,r,l),o.silent||this.emit("added",t,s,i)}removeResourceBundle(t,s){this.hasResourceBundle(t,s)&&delete this.data[t][s],this.removeNamespaces(s),this.emit("removed",t,s)}hasResourceBundle(t,s){return void 0!==this.getResource(t,s)}getResourceBundle(t,s){return s||(s=this.options.defaultNS),this.getResource(t,s)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const s=this.getDataByLanguage(t);return!!(s&&Object.keys(s)||[]).find((t=>s[t]&&Object.keys(s[t]).length>0))}toJSON(){return this.data}}var w={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,s,i,e,n){return t.forEach((t=>{s=this.processors[t]?.process(s,i,e,n)??s})),s}};const j=Symbol("i18next/PATH_KEY");function O(t,s){const{[j]:i}=t(function(){const t=[],s=Object.create(null);let i;return s.get=(e,n)=>(i?.revoke?.(),n===j?t:(t.push(n),i=Proxy.revocable(e,s),i.proxy)),Proxy.revocable(Object.create(null),s).proxy}());return i.join(s?.keySeparator??".")}const S={},k=s=>!t(s)&&"boolean"!=typeof s&&"number"!=typeof s;class N extends b{constructor(t,s={}){var i,e;super(),i=t,e=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((t=>{i[t]&&(e[t]=i[t])})),this.options=s,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=$.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,s={interpolation:{}}){const i={...s};if(null==t)return!1;const e=this.resolve(t,i);if(void 0===e?.res)return!1;const n=k(e.res);return!1!==i.returnObjects||!n}extractFromKey(s,i){let e=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===e&&(e=":");const n=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let o=i.ns||this.options.defaultNS||[];const r=e&&s.indexOf(e)>-1,h=!(this.options.userDefinedKeySeparator||i.keySeparator||this.options.userDefinedNsSeparator||i.nsSeparator||((t,s,i)=>{s=s||"",i=i||"";const e=f.filter((t=>s.indexOf(t)<0&&i.indexOf(t)<0));if(0===e.length)return!0;const n=p.getRegExp(`(${e.map((t=>"?"===t?"\\?":t)).join("|")})`);let o=!n.test(t);if(!o){const s=t.indexOf(i);s>0&&!n.test(t.substring(0,s))&&(o=!0)}return o})(s,e,n));if(r&&!h){const i=s.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:s,namespaces:t(o)?[o]:o};const r=s.split(e);(e!==n||e===n&&this.options.ns.indexOf(r[0])>-1)&&(o=r.shift()),s=r.join(n)}return{key:s,namespaces:t(o)?[o]:o}}translate(s,i,e){let n="object"==typeof i?{...i}:i;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==s)return"";"function"==typeof s&&(s=O(s,{...this.options,...n})),Array.isArray(s)||(s=[String(s)]);const o=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:h,namespaces:a}=this.extractFromKey(s[s.length-1],n),c=a[a.length-1];let l=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===l&&(l=":");const u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===u?.toLowerCase())return d?o?{res:`${c}${l}${h}`,usedKey:h,exactUsedKey:h,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${l}${h}`:o?{res:h,usedKey:h,exactUsedKey:h,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:h;const f=this.resolve(s,n);let p=f?.res;const g=f?.usedKey||h,y=f?.exactUsedKey||h,m=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,$=void 0!==n.count&&!t(n.count),b=N.hasDefaultValue(n),x=$?this.pluralResolver.getSuffix(u,n.count,n):"",w=n.ordinal&&$?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",j=$&&!n.ordinal&&0===n.count,S=j&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${x}`]||n[`defaultValue${w}`]||n.defaultValue;let L=p;v&&!p&&b&&(L=S);const R=k(L),P=Object.prototype.toString.apply(L);if(!(v&&L&&R&&["[object Number]","[object Function]","[object RegExp]"].indexOf(P)<0)||t(m)&&Array.isArray(L))if(v&&t(m)&&Array.isArray(p))p=p.join(m),p&&(p=this.extendTranslation(p,s,n,e));else{let t=!1,i=!1;!this.isValidLookup(p)&&b&&(t=!0,p=S),this.isValidLookup(p)||(i=!0,p=h);const o=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:p,a=b&&S!==p&&this.options.updateMissing;if(i||t||a){if(this.logger.log(a?"updateKey":"missingKey",u,c,h,a?S:p),r){const t=this.resolve(h,{...n,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const s=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&s&&s[0])for(let i=0;i<s.length;i++)t.push(s[i]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(n.lng||this.language):t.push(n.lng||this.language);const i=(t,s,i)=>{const e=b&&i!==p?i:o;this.options.missingKeyHandler?this.options.missingKeyHandler(t,c,s,e,a,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,c,s,e,a,n),this.emit("missingKey",t,c,s,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&$?t.forEach((t=>{const s=this.pluralResolver.getSuffixes(t,n);j&&n[`defaultValue${this.options.pluralSeparator}zero`]&&s.indexOf(`${this.options.pluralSeparator}zero`)<0&&s.push(`${this.options.pluralSeparator}zero`),s.forEach((s=>{i([t],h+s,n[`defaultValue${s}`]||S)}))})):i(t,h,S))}p=this.extendTranslation(p,s,n,f,e),i&&p===h&&this.options.appendNamespaceToMissingKey&&(p=`${c}${l}${h}`),(i||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${l}${h}`:h,t?p:void 0,n))}else{if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,L,{...n,ns:a}):`key '${h} (${this.language})' returned an object instead of string.`;return o?(f.res=t,f.usedParams=this.getUsedParamsDetails(n),f):t}if(r){const t=Array.isArray(L),s=t?[]:{},i=t?y:g;for(const t in L)if(Object.prototype.hasOwnProperty.call(L,t)){const e=`${i}${r}${t}`;s[t]=this.translate(e,b&&!p?{...n,defaultValue:k(S)?S[t]:void 0,joinArrays:!1,ns:a}:{...n,joinArrays:!1,ns:a}),s[t]===e&&(s[t]=L[t])}p=s}}return o?(f.res=p,f.usedParams=this.getUsedParamsDetails(n),f):p}extendTranslation(s,i,e,n,o){if(this.i18nFormat?.parse)s=this.i18nFormat.parse(s,{...this.options.interpolation.defaultVariables,...e},e.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!e.skipInterpolation){e.interpolation&&this.interpolator.init({...e,interpolation:{...this.options.interpolation,...e.interpolation}});const r=t(s)&&(void 0!==e?.interpolation?.skipOnVariables?e.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(r){const t=s.match(this.interpolator.nestingRegexp);h=t&&t.length}let a=e.replace&&!t(e.replace)?e.replace:e;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),s=this.interpolator.interpolate(s,a,e.lng||this.language||n.usedLng,e),r){const t=s.match(this.interpolator.nestingRegexp);h<(t&&t.length)&&(e.nest=!1)}!e.lng&&n&&n.res&&(e.lng=this.language||n.usedLng),!1!==e.nest&&(s=this.interpolator.nest(s,((...t)=>o?.[0]!==t[0]||e.context?this.translate(...t,i):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${i[0]}`),null)),e)),e.interpolation&&this.interpolator.reset()}const r=e.postProcess||this.options.postProcess,h=t(r)?[r]:r;return null!=s&&h?.length&&!1!==e.applyPostProcessor&&(s=w.handle(h,s,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(e)},...e}:e,this)),s}resolve(s,i={}){let e,n,o,r,h;return t(s)&&(s=[s]),s.forEach((s=>{if(this.isValidLookup(e))return;const a=this.extractFromKey(s,i),c=a.key;n=c;let l=a.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const u=void 0!==i.count&&!t(i.count),d=u&&!i.ordinal&&0===i.count,f=void 0!==i.context&&(t(i.context)||"number"==typeof i.context)&&""!==i.context,p=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);l.forEach((t=>{this.isValidLookup(e)||(h=t,S[`${p[0]}-${t}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(h)||(S[`${p[0]}-${t}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${h}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((s=>{if(this.isValidLookup(e))return;r=s;const n=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(n,c,s,t,i);else{let t;u&&(t=this.pluralResolver.getSuffix(s,i.count,i));const e=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(i.ordinal&&0===t.indexOf(o)&&n.push(c+t.replace(o,this.options.pluralSeparator)),n.push(c+t),d&&n.push(c+e)),f){const s=`${c}${this.options.contextSeparator||"_"}${i.context}`;n.push(s),u&&(i.ordinal&&0===t.indexOf(o)&&n.push(s+t.replace(o,this.options.pluralSeparator)),n.push(s+t),d&&n.push(s+e))}}let h;for(;h=n.pop();)this.isValidLookup(e)||(o=h,e=this.getResource(s,t,h,i))})))}))})),{res:e,usedKey:n,exactUsedKey:o,usedLng:r,usedNS:h}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,s,i,e={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,s,i,e):this.resourceStore.getResource(t,s,i,e)}getUsedParamsDetails(s={}){const i=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],e=s.replace&&!t(s.replace);let n=e?s.replace:s;if(e&&void 0!==s.count&&(n.count=s.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!e){n={...n};for(const t of i)delete n[t]}return n}static hasDefaultValue(t){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&"defaultValue"===s.substring(0,12)&&void 0!==t[s])return!0;return!1}}class L{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$.create("languageUtils")}getScriptPartFromCode(t){if(!(t=y(t))||t.indexOf("-")<0)return null;const s=t.split("-");return 2===s.length?null:(s.pop(),"x"===s[s.length-1].toLowerCase()?null:this.formatLanguageCode(s.join("-")))}getLanguagePartFromCode(t){if(!(t=y(t))||t.indexOf("-")<0)return t;const s=t.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(s){if(t(s)&&s.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(s)[0]}catch(t){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?s.toLowerCase():s)}return this.options.cleanCode||this.options.lowerCaseLng?s.toLowerCase():s}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let s;return t.forEach((t=>{if(s)return;const i=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(i)||(s=i)})),!s&&this.options.supportedLngs&&t.forEach((t=>{if(s)return;const i=this.getScriptPartFromCode(t);if(this.isSupportedCode(i))return s=i;const e=this.getLanguagePartFromCode(t);if(this.isSupportedCode(e))return s=e;s=this.options.supportedLngs.find((t=>t===e?t:t.indexOf("-")<0&&e.indexOf("-")<0?void 0:t.indexOf("-")>0&&e.indexOf("-")<0&&t.substring(0,t.indexOf("-"))===e||0===t.indexOf(e)&&e.length>1?t:void 0))})),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(s,i){if(!s)return[];if("function"==typeof s&&(s=s(i)),t(s)&&(s=[s]),Array.isArray(s))return s;if(!i)return s.default||[];let e=s[i];return e||(e=s[this.getScriptPartFromCode(i)]),e||(e=s[this.formatLanguageCode(i)]),e||(e=s[this.getLanguagePartFromCode(i)]),e||(e=s.default),e||[]}toResolveHierarchy(s,i){const e=this.getFallbackCodes((!1===i?[]:i)||this.options.fallbackLng||[],s),n=[],o=t=>{t&&(this.isSupportedCode(t)?n.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return t(s)&&(s.indexOf("-")>-1||s.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(s)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(s)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(s))):t(s)&&o(this.formatLanguageCode(s)),e.forEach((t=>{n.indexOf(t)<0&&o(this.formatLanguageCode(t))})),n}}const R={zero:0,one:1,two:2,few:3,many:4,other:5},P={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class E{constructor(t,s={}){this.languageUtils=t,this.options=s,this.logger=$.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,s={}){const i=y("dev"===t?"en":t),e=s.ordinal?"ordinal":"cardinal",n=JSON.stringify({cleanedCode:i,type:e});if(n in this.pluralRulesCache)return this.pluralRulesCache[n];let o;try{o=new Intl.PluralRules(i,{type:e})}catch(i){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),P;if(!t.match(/-|_/))return P;const e=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(e,s)}return this.pluralRulesCache[n]=o,o}needsPlural(t,s={}){let i=this.getRule(t,s);return i||(i=this.getRule("dev",s)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,s,i={}){return this.getSuffixes(t,i).map((t=>`${s}${t}`))}getSuffixes(t,s={}){let i=this.getRule(t,s);return i||(i=this.getRule("dev",s)),i?i.resolvedOptions().pluralCategories.sort(((t,s)=>R[t]-R[s])).map((t=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):[]}getSuffix(t,s,i={}){const e=this.getRule(t,i);return e?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${e.select(s)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",s,i))}}const C=(s,i,e,n=".",o=!0)=>{let r=((t,s,i)=>{const e=a(t,i);return void 0!==e?e:a(s,i)})(s,i,e);return!r&&o&&t(e)&&(r=g(s,e,n),void 0===r&&(r=g(i,e,n))),r},I=t=>t.replace(/\$/g,"$$$$");class T{constructor(t={}){this.logger=$.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:s,escapeValue:i,useRawValueToEscape:e,prefix:n,prefixEscaped:o,suffix:r,suffixEscaped:h,formatSeparator:a,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:g,nestingSuffixEscaped:y,nestingOptionsSeparator:m,maxReplaces:v,alwaysFormat:$}=t.interpolation;this.escape=void 0!==s?s:d,this.escapeValue=void 0===i||i,this.useRawValueToEscape=void 0!==e&&e,this.prefix=n?l(n):o||"{{",this.suffix=r?l(r):h||"}}",this.formatSeparator=a||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=f?l(f):p||l("$t("),this.nestingSuffix=g?l(g):y||l(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==$&&$,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,s)=>t?.source===s?(t.lastIndex=0,t):new RegExp(s,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(s,e,n,o){let r,h,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=t=>{if(t.indexOf(this.formatSeparator)<0){const s=C(e,c,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(s,void 0,n,{...o,...e,interpolationkey:t}):s}const s=t.split(this.formatSeparator),i=s.shift().trim(),r=s.join(this.formatSeparator).trim();return this.format(C(e,c,i,this.options.keySeparator,this.options.ignoreJSONStructure),r,n,{...o,...e,interpolationkey:i})};this.resetRegExp();const u=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=void 0!==o?.interpolation?.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>I(t)},{regex:this.regexp,safeValue:t=>I(this.escapeValue?this.escape(t):t)}].forEach((e=>{for(a=0;r=e.regex.exec(s);){const n=r[1].trim();if(h=l(n),void 0===h)if("function"==typeof u){const i=u(s,r,o);h=t(i)?i:""}else if(o&&Object.prototype.hasOwnProperty.call(o,n))h="";else{if(d){h=r[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${s}`),h=""}else t(h)||this.useRawValueToEscape||(h=i(h));const c=e.safeValue(h);if(s=s.replace(r[0],c),d?(e.regex.lastIndex+=h.length,e.regex.lastIndex-=r[0].length):e.regex.lastIndex=0,a++,a>=this.maxReplaces)break}})),s}nest(s,e,n={}){let o,r,h;const a=(t,s)=>{const i=this.nestingOptionsSeparator;if(t.indexOf(i)<0)return t;const e=t.split(new RegExp(`${l(i)}[ ]*{`));let n=`{${e[1]}`;t=e[0],n=this.interpolate(n,h);const o=n.match(/'/g),r=n.match(/"/g);((o?.length??0)%2==0&&!r||(r?.length??0)%2!=0)&&(n=n.replace(/'/g,'"'));try{h=JSON.parse(n),s&&(h={...s,...h})}catch(s){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,s),`${t}${i}${n}`}return h.defaultValue&&h.defaultValue.indexOf(this.prefix)>-1&&delete h.defaultValue,t};for(;o=this.nestingRegexp.exec(s);){let c=[];h={...n},h=h.replace&&!t(h.replace)?h.replace:h,h.applyPostProcessor=!1,delete h.defaultValue;const l=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(-1!==l&&(c=o[1].slice(l).split(this.formatSeparator).map((t=>t.trim())).filter(Boolean),o[1]=o[1].slice(0,l)),r=e(a.call(this,o[1].trim(),h),h),r&&o[0]===s&&!t(r))return r;t(r)||(r=i(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${s}`),r=""),c.length&&(r=c.reduce(((t,s)=>this.format(t,s,n.lng,{...n,interpolationkey:o[1].trim()})),r.trim())),s=s.replace(o[0],r),this.regexp.lastIndex=0}return s}}const z=t=>{const s={};return(i,e,n)=>{let o=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(o={...o,[n.interpolationkey]:void 0});const r=e+JSON.stringify(o);let h=s[r];return h||(h=t(y(e),n),s[r]=h),h(i)}},A=t=>(s,i,e)=>t(y(i),e)(s);class V{constructor(t={}){this.logger=$.create("formatter"),this.options=t,this.init(t)}init(t,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const i=s.cacheInBuiltFormats?z:A;this.formats={number:i(((t,s)=>{const i=new Intl.NumberFormat(t,{...s});return t=>i.format(t)})),currency:i(((t,s)=>{const i=new Intl.NumberFormat(t,{...s,style:"currency"});return t=>i.format(t)})),datetime:i(((t,s)=>{const i=new Intl.DateTimeFormat(t,{...s});return t=>i.format(t)})),relativetime:i(((t,s)=>{const i=new Intl.RelativeTimeFormat(t,{...s});return t=>i.format(t,s.range||"day")})),list:i(((t,s)=>{const i=new Intl.ListFormat(t,{...s});return t=>i.format(t)}))}}add(t,s){this.formats[t.toLowerCase().trim()]=s}addCached(t,s){this.formats[t.toLowerCase().trim()]=z(s)}format(t,s,i,e={}){const n=s.split(this.formatSeparator);if(n.length>1&&n[0].indexOf("(")>1&&n[0].indexOf(")")<0&&n.find((t=>t.indexOf(")")>-1))){const t=n.findIndex((t=>t.indexOf(")")>-1));n[0]=[n[0],...n.splice(1,t)].join(this.formatSeparator)}return n.reduce(((t,s)=>{const{formatName:n,formatOptions:o}=(t=>{let s=t.toLowerCase().trim();const i={};if(t.indexOf("(")>-1){const e=t.split("(");s=e[0].toLowerCase().trim();const n=e[1].substring(0,e[1].length-1);"currency"===s&&n.indexOf(":")<0?i.currency||(i.currency=n.trim()):"relativetime"===s&&n.indexOf(":")<0?i.range||(i.range=n.trim()):n.split(";").forEach((t=>{if(t){const[s,...e]=t.split(":"),n=e.join(":").trim().replace(/^'+|'+$/g,""),o=s.trim();i[o]||(i[o]=n),"false"===n&&(i[o]=!1),"true"===n&&(i[o]=!0),isNaN(n)||(i[o]=parseInt(n,10))}}))}return{formatName:s,formatOptions:i}})(s);if(this.formats[n]){let s=t;try{const r=e?.formatParams?.[e.interpolationkey]||{};s=this.formats[n](t,r.locale||r.lng||e.locale||e.lng||i,{...o,...e,...r})}catch(t){this.logger.warn(t)}return s}return this.logger.warn(`there was no format function for ${n}`),t}),t)}}class K extends b{constructor(t,s,i,e={}){super(),this.backend=t,this.store=s,this.services=i,this.languageUtils=i.languageUtils,this.options=e,this.logger=$.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=e.maxParallelReads||10,this.readingCalls=0,this.maxRetries=e.maxRetries>=0?e.maxRetries:5,this.retryTimeout=e.retryTimeout>=1?e.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,e.backend,e)}queueLoad(t,s,i,e){const n={},o={},r={},h={};return t.forEach((t=>{let e=!0;s.forEach((s=>{const r=`${t}|${s}`;!i.reload&&this.store.hasResourceBundle(t,s)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===o[r]&&(o[r]=!0):(this.state[r]=1,e=!1,void 0===o[r]&&(o[r]=!0),void 0===n[r]&&(n[r]=!0),void 0===h[s]&&(h[s]=!0)))})),e||(r[t]=!0)})),(Object.keys(n).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:e}),{toLoad:Object.keys(n),pending:Object.keys(o),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(h)}}loaded(t,s,i){const e=t.split("|"),n=e[0],o=e[1];s&&this.emit("failedLoading",n,o,s),!s&&i&&this.store.addResourceBundle(n,o,i,void 0,void 0,{skipCopy:!0}),this.state[t]=s?-1:2,s&&i&&(this.state[t]=0);const h={};this.queue.forEach((i=>{((t,s,i)=>{const{obj:e,k:n}=r(t,s,Object);e[n]=e[n]||[],e[n].push(i)})(i.loaded,[n],o),((t,s)=>{void 0!==t.pending[s]&&(delete t.pending[s],t.pendingCount--)})(i,t),s&&i.errors.push(s),0!==i.pendingCount||i.done||(Object.keys(i.loaded).forEach((t=>{h[t]||(h[t]={});const s=i.loaded[t];s.length&&s.forEach((s=>{void 0===h[t][s]&&(h[t][s]=!0)}))})),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())})),this.emit("loaded",h),this.queue=this.queue.filter((t=>!t.done))}read(t,s,i,e=0,n=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:s,fcName:i,tried:e,wait:n,callback:o});this.readingCalls++;const r=(r,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}r&&h&&e<this.maxRetries?setTimeout((()=>{this.read.call(this,t,s,i,e+1,2*n,o)}),n):o(r,h)},h=this.backend[i].bind(this.backend);if(2!==h.length)return h(t,s,r);try{const i=h(t,s);i&&"function"==typeof i.then?i.then((t=>r(null,t))).catch(r):r(null,i)}catch(t){r(t)}}prepareLoading(s,i,e={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();t(s)&&(s=this.languageUtils.toResolveHierarchy(s)),t(i)&&(i=[i]);const o=this.queueLoad(s,i,e,n);if(!o.toLoad.length)return o.pending.length||n(),null;o.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,s,i){this.prepareLoading(t,s,{},i)}reload(t,s,i){this.prepareLoading(t,s,{reload:!0},i)}loadOne(t,s=""){const i=t.split("|"),e=i[0],n=i[1];this.read(e,n,"read",void 0,void 0,((i,o)=>{i&&this.logger.warn(`${s}loading namespace ${n} for language ${e} failed`,i),!i&&o&&this.logger.log(`${s}loaded namespace ${n} for language ${e}`,o),this.loaded(t,i,o)}))}saveMissing(t,s,i,e,n,o={},r=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(s)){if(null!=i&&""!==i){if(this.backend?.create){const h={...o,isUpdate:n},a=this.backend.create.bind(this.backend);if(a.length<6)try{let n;n=5===a.length?a(t,s,i,e,h):a(t,s,i,e),n&&"function"==typeof n.then?n.then((t=>r(null,t))).catch(r):r(null,n)}catch(t){r(t)}else a(t,s,i,e,r,h)}t&&t[0]&&this.store.addResource(t[0],s,i,e)}}else this.logger.warn(`did not save key "${i}" as the namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const B=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:s=>{let i={};if("object"==typeof s[1]&&(i=s[1]),t(s[1])&&(i.defaultValue=s[1]),t(s[2])&&(i.tDescription=s[2]),"object"==typeof s[2]||"object"==typeof s[3]){const t=s[3]||s[2];Object.keys(t).forEach((s=>{i[s]=t[s]}))}return i},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),M=s=>(t(s.ns)&&(s.ns=[s.ns]),t(s.fallbackLng)&&(s.fallbackLng=[s.fallbackLng]),t(s.fallbackNS)&&(s.fallbackNS=[s.fallbackNS]),s.supportedLngs?.indexOf?.("cimode")<0&&(s.supportedLngs=s.supportedLngs.concat(["cimode"])),"boolean"==typeof s.initImmediate&&(s.initAsync=s.initImmediate),s),_=()=>{},F="__i18next_supportNoticeShown";class D extends b{constructor(t={},s){var i;if(super(),this.options=M(t),this.services={},this.logger=$,this.modules={external:[]},i=this,Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((t=>{"function"==typeof i[t]&&(i[t]=i[t].bind(i))})),s&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,s),this;setTimeout((()=>{this.init(t,s)}),0)}}init(i={},e){this.isInitializing=!0,"function"==typeof i&&(e=i,i={}),null==i.defaultNS&&i.ns&&(t(i.ns)?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));const n=B();var o;this.options={...n,...this.options,...M(i)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==i.keySeparator&&(this.options.userDefinedKeySeparator=i.keySeparator),void 0!==i.nsSeparator&&(this.options.userDefinedNsSeparator=i.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(o=this,o?.modules?.backend?.name?.indexOf("Locize")>0||o?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||o?.options?.backend?.backends&&o.options.backend.backends.some((t=>t?.name?.indexOf("Locize")>0||t?.constructor?.name?.indexOf("Locize")>0))||o?.options?.backend?.projectId||o?.options?.backend?.backendOptions&&o.options.backend.backendOptions.some((t=>t?.projectId)))||"undefined"!=typeof globalThis&&globalThis[F]||("undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),"undefined"!=typeof globalThis&&(globalThis[F]=!0));const r=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;$.init(this.modules.logger?r(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:V;const s=new L(this.options);this.store=new x(this.options.resources,this.options);const i=this.services;i.logger=$,i.resourceStore=this.store,i.languageUtils=s,i.pluralResolver=new E(s,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!t||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(i.formatter=r(t),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new T(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new K(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",((t,...s)=>{this.emit(t,...s)})),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new N(this.services,this.options),this.translator.on("*",((t,...s)=>{this.emit(t,...s)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,e||(e=_),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=(...s)=>this.store[t](...s)})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=(...s)=>(this.store[t](...s),this)}));const h=s(),a=()=>{const t=(t,s)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),h.resolve(s),e(t,s)};if(this.languages&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),h}loadResources(s,i=_){let e=i;const n=t(s)?s:this.language;if("function"==typeof s&&(e=s),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return e();const t=[],s=s=>{s&&"cimode"!==s&&this.services.languageUtils.toResolveHierarchy(s).forEach((s=>{"cimode"!==s&&t.indexOf(s)<0&&t.push(s)}))};n?s(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>s(t))),this.options.preload?.forEach?.((t=>s(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),e(t)}))}else e(null)}reloadResources(t,i,e){const n=s();return"function"==typeof t&&(e=t,t=void 0),"function"==typeof i&&(e=i,i=void 0),t||(t=this.languages),i||(i=this.options.ns),e||(e=_),this.services.backendConnector.reload(t,i,(t=>{n.resolve(),e(t)})),n}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&w.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1)){for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(i,e){this.isLanguageChangingTo=i;const n=s();this.emit("languageChanging",i);const o=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},r=(t,s)=>{s?this.isLanguageChangingTo===i&&(o(s),this.translator.changeLanguage(s),this.isLanguageChangingTo=void 0,this.emit("languageChanged",s),this.logger.log("languageChanged",s)):this.isLanguageChangingTo=void 0,n.resolve(((...t)=>this.t(...t))),e&&e(t,((...t)=>this.t(...t)))},h=s=>{i||s||!this.services.languageDetector||(s=[]);const e=t(s)?s:s&&s[0],n=this.store.hasLanguageSomeTranslations(e)?e:this.services.languageUtils.getBestMatchFromCodes(t(s)?[s]:s);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector?.cacheUserLanguage?.(n)),this.loadResources(n,(t=>{r(t,n)}))};return i||!this.services.languageDetector||this.services.languageDetector.async?!i&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(h):this.services.languageDetector.detect(h):h(i):h(this.services.languageDetector.detect()),n}getFixedT(s,i,e){const n=(t,s,...i)=>{let o;o="object"!=typeof s?this.options.overloadTranslationOptionHandler([t,s].concat(i)):{...s},o.lng=o.lng||n.lng,o.lngs=o.lngs||n.lngs,o.ns=o.ns||n.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||e||n.keyPrefix);const r=this.options.keySeparator||".";let h;return o.keyPrefix&&Array.isArray(t)?h=t.map((t=>("function"==typeof t&&(t=O(t,{...this.options,...s})),`${o.keyPrefix}${r}${t}`))):("function"==typeof t&&(t=O(t,{...this.options,...s})),h=o.keyPrefix?`${o.keyPrefix}${r}${t}`:t),this.t(h,o)};return t(s)?n.lng=s:n.lngs=s,n.ns=i,n.keyPrefix=e,n}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,s={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=s.lng||this.resolvedLanguage||this.languages[0],e=!!this.options&&this.options.fallbackLng,n=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;const o=(t,s)=>{const i=this.services.backendConnector.state[`${t}|${s}`];return-1===i||0===i||2===i};if(s.precheck){const t=s.precheck(this,o);if(void 0!==t)return t}return!(!this.hasResourceBundle(i,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!o(i,t)||e&&!o(n,t)))}loadNamespaces(i,e){const n=s();return this.options.ns?(t(i)&&(i=[i]),i.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}loadLanguages(i,e){const n=s();t(i)&&(i=[i]);const o=this.options.preload||[],r=i.filter((t=>o.indexOf(t)<0&&this.services.languageUtils.isSupportedCode(t)));return r.length?(this.options.preload=o.concat(r),this.loadResources((t=>{n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const s=new Intl.Locale(t);if(s&&s.getTextInfo){const t=s.getTextInfo();if(t&&t.direction)return t.direction}}catch(t){}const s=this.services?.languageUtils||new L(B());return t.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(s.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},s){const i=new D(t,s);return i.createInstance=D.createInstance,i}cloneInstance(t={},s=_){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const e={...this.options,...t,isClone:!0},n=new D(e);if(void 0===t.debug&&void 0===t.prefix||(n.logger=n.logger.clone(t)),["store","services","language"].forEach((t=>{n[t]=this[t]})),n.services={...this.services},n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},i){const t=Object.keys(this.store.data).reduce(((t,s)=>(t[s]={...this.store.data[s]},t[s]=Object.keys(t[s]).reduce(((i,e)=>(i[e]={...t[s][e]},i)),t[s]),t)),{});n.store=new x(t,e),n.services.resourceStore=n.store}if(t.interpolation){const s={...B().interpolation,...this.options.interpolation,...t.interpolation},i={...e,interpolation:s};n.services.interpolator=new T(i)}return n.translator=new N(n.services,e),n.translator.on("*",((t,...s)=>{n.emit(t,...s)})),n.init(e,s),n.translator.options=e,n.translator.backendConnector.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},n}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const H=D.createInstance().createInstance,J="nl";function U(t){const s=t.closest("[lang]");return s instanceof HTMLElement?s.lang||J:t.parentNode instanceof ShadowRoot&&t.parentNode.host instanceof HTMLElement?U(t.parentNode.host):t.parentElement instanceof HTMLElement?U(t.parentElement):J}function W(t,s){const i=t(),e=H();e.init({fallbackLng:J,resources:s,defaultNS:i.tagName.toLowerCase(),interpolation:{escapeValue:!1}});let n=!1;return(t,s)=>{if(!n){n=!0;const t=U(i);e.changeLanguage(t)}return e.t(t,s)}}export{W as i}
|