@ncino/web-components 8.0.0-preview.36 → 8.0.0-preview.38
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/_virtual/index2.js +1 -1
- package/dist/_virtual/index3.js +1 -1
- package/dist/_virtual/index_html.js +1 -1
- package/dist/_virtual/index_react.js +1 -1
- package/dist/components/card/card.js +1 -1
- package/dist/components/headline-card/gator/headline-card.gator.js +3 -3
- package/dist/components/image-card/gator/image-card.gator.js +41 -0
- package/dist/components/image-card/image-card.js +1 -0
- package/dist/components/image-card/index.js +1 -0
- package/dist/components/input/gator/help-text/help-text.gator.js +3 -3
- package/dist/components/input/gator/input-label/input-label.gator.js +4 -4
- package/dist/components/input/gator/input-phone/input-phone.gator.js +1 -1
- package/dist/components/input-rich-text/ckeditor-config.js +1 -1
- package/dist/components/input-rich-text/input-rich-text.slds.js +2 -2
- package/dist/components/loading-spinner/gator/loading-spinner.gator.js +2 -2
- package/dist/components/panel/gator/panel.storybook-test.js +1 -1
- package/dist/index.gator.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-alignment@46.1.0 → @ckeditor_ckeditor5-alignment@46.1.1}/node_modules/@ckeditor/ckeditor5-alignment/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autoformat@46.1.0 → @ckeditor_ckeditor5-autoformat@46.1.1}/node_modules/@ckeditor/ckeditor5-autoformat/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-autosave@46.1.0 → @ckeditor_ckeditor5-autosave@46.1.1}/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-basic-styles@46.1.0 → @ckeditor_ckeditor5-basic-styles@46.1.1}/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-block-quote@46.1.0 → @ckeditor_ckeditor5-block-quote@46.1.1}/node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-clipboard@46.1.0 → @ckeditor_ckeditor5-clipboard@46.1.1}/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-cloud-services@46.1.0 → @ckeditor_ckeditor5-cloud-services@46.1.1}/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-code-block@46.1.0 → @ckeditor_ckeditor5-code-block@46.1.1}/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-core@46.1.0 → @ckeditor_ckeditor5-core@46.1.1}/node_modules/@ckeditor/ckeditor5-core/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-editor-classic@46.1.0 → @ckeditor_ckeditor5-editor-classic@46.1.1}/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-engine@46.1.0 → @ckeditor_ckeditor5-engine@46.1.1}/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-enter@46.1.0 → @ckeditor_ckeditor5-enter@46.1.1}/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-essentials@46.1.0 → @ckeditor_ckeditor5-essentials@46.1.1}/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-find-and-replace@46.1.0 → @ckeditor_ckeditor5-find-and-replace@46.1.1}/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-font@46.1.0 → @ckeditor_ckeditor5-font@46.1.1}/node_modules/@ckeditor/ckeditor5-font/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-heading@46.1.0 → @ckeditor_ckeditor5-heading@46.1.1}/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-highlight@46.1.0 → @ckeditor_ckeditor5-highlight@46.1.1}/node_modules/@ckeditor/ckeditor5-highlight/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-horizontal-line@46.1.0 → @ckeditor_ckeditor5-horizontal-line@46.1.1}/node_modules/@ckeditor/ckeditor5-horizontal-line/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-html-embed@46.1.0 → @ckeditor_ckeditor5-html-embed@46.1.1}/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-html-support@46.1.0 → @ckeditor_ckeditor5-html-support@46.1.1}/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-image@46.1.0 → @ckeditor_ckeditor5-image@46.1.1}/node_modules/@ckeditor/ckeditor5-image/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-indent@46.1.0 → @ckeditor_ckeditor5-indent@46.1.1}/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-language@46.1.0 → @ckeditor_ckeditor5-language@46.1.1}/node_modules/@ckeditor/ckeditor5-language/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-link@46.1.0 → @ckeditor_ckeditor5-link@46.1.1}/node_modules/@ckeditor/ckeditor5-link/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-list@46.1.0 → @ckeditor_ckeditor5-list@46.1.1}/node_modules/@ckeditor/ckeditor5-list/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-markdown-gfm@46.1.0 → @ckeditor_ckeditor5-markdown-gfm@46.1.1}/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-media-embed@46.1.0 → @ckeditor_ckeditor5-media-embed@46.1.1}/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-mention@46.1.0 → @ckeditor_ckeditor5-mention@46.1.1}/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-page-break@46.1.0 → @ckeditor_ckeditor5-page-break@46.1.1}/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-paragraph@46.1.0 → @ckeditor_ckeditor5-paragraph@46.1.1}/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-paste-from-office@46.1.0 → @ckeditor_ckeditor5-paste-from-office@46.1.1}/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-remove-format@46.1.0 → @ckeditor_ckeditor5-remove-format@46.1.1}/node_modules/@ckeditor/ckeditor5-remove-format/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-select-all@46.1.0 → @ckeditor_ckeditor5-select-all@46.1.1}/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-show-blocks@46.1.0 → @ckeditor_ckeditor5-show-blocks@46.1.1}/node_modules/@ckeditor/ckeditor5-show-blocks/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-source-editing@46.1.0 → @ckeditor_ckeditor5-source-editing@46.1.1}/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-special-characters@46.1.0 → @ckeditor_ckeditor5-special-characters@46.1.1}/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-style@46.1.0 → @ckeditor_ckeditor5-style@46.1.1}/node_modules/@ckeditor/ckeditor5-style/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-table@46.1.0 → @ckeditor_ckeditor5-table@46.1.1}/node_modules/@ckeditor/ckeditor5-table/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-typing@46.1.0 → @ckeditor_ckeditor5-typing@46.1.1}/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-ui@46.1.0 → @ckeditor_ckeditor5-ui@46.1.1}/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-undo@46.1.0 → @ckeditor_ckeditor5-undo@46.1.1}/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-upload@46.1.0 → @ckeditor_ckeditor5-upload@46.1.1}/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-utils@46.1.0 → @ckeditor_ckeditor5-utils@46.1.1}/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-widget@46.1.0 → @ckeditor_ckeditor5-widget@46.1.1}/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.6/node_modules/@figma/code-connect/dist/connect/helpers.js +1 -0
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.6/node_modules/@figma/code-connect/dist/html/external.js +1 -0
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.6/node_modules/@figma/code-connect/dist/html/index_html.js +1 -0
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.6/node_modules/@figma/code-connect/dist/react/external.js +1 -0
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.6/node_modules/@figma/code-connect/dist/react/index_react.js +1 -0
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.6/node_modules/@figma/code-connect/package.json.js +1 -0
- package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/conversions.js +1 -1
- package/dist/node_modules/.pnpm/color-string@2.0.1/node_modules/color-string/index.js +1 -1
- package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/PhoneNumber.js +1 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.24/node_modules/libphonenumber-js/es6/format.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.24/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.24/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.24/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.24/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +1 -0
- package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +1 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.24/node_modules/libphonenumber-js/es6/isPossible.js +1 -0
- package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/metadata.js +1 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.24/node_modules/libphonenumber-js/es6/parse.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.24/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +2 -0
- package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/metadata.min.json.js +1 -1
- package/dist/node_modules/.pnpm/react@19.2.0/node_modules/react/index.js +1 -1
- package/dist/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.js +1 -1
- package/dist/packages/web-components/src/components/image-card/gator/image-card.gator.scss.js +1 -0
- package/dist/packages/web-components/src/components/input/gator/help-text/help-text.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/input/gator/input-label/input-label.gator.scss.js +1 -1
- package/dist/packages/web-components/src/components/loading-spinner/gator/loading-spinner.gator.scss.js +1 -1
- package/dist/types/components/card/card.d.ts +1 -0
- package/dist/types/components/image-card/gator/image-card.gator.d.ts +30 -0
- package/dist/types/components/image-card/gator/image-card.gator.test.d.ts +0 -0
- package/dist/types/components/image-card/image-card.d.ts +25 -0
- package/dist/types/components/image-card/index.d.ts +1 -0
- package/dist/types/components/input/gator/input-label/input-label.gator.d.ts +1 -0
- package/dist/types/index.gator.d.ts +1 -0
- package/dist/utils/brand-color-utils.js +1 -1
- package/dist/utils/vitest-a11y-utils.js +1 -1
- package/package.json +12 -12
- package/web-types.json +83 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.5/node_modules/@figma/code-connect/dist/connect/helpers.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.5/node_modules/@figma/code-connect/dist/html/external.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.5/node_modules/@figma/code-connect/dist/html/index_html.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.5/node_modules/@figma/code-connect/dist/react/external.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.5/node_modules/@figma/code-connect/dist/react/index_react.js +0 -1
- package/dist/node_modules/.pnpm/@figma_code-connect@1.3.5/node_modules/@figma/code-connect/package.json.js +0 -1
- package/dist/node_modules/.pnpm/color-name@2.0.0/node_modules/color-name/index.js +0 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.15/node_modules/libphonenumber-js/es6/format.js +0 -2
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.15/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +0 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.15/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +0 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.15/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +0 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.15/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +0 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.15/node_modules/libphonenumber-js/es6/isPossible.js +0 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.15/node_modules/libphonenumber-js/es6/parse.js +0 -1
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.15/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +0 -2
- package/dist/packages/web-components/src/components/input/gator/help-text/help-text.gator.tokens.scss.js +0 -1
- /package/dist/assets/node_modules/.pnpm/{ckeditor5@46.1.0 → ckeditor5@46.1.1}/node_modules/ckeditor5/dist/ckeditor5.css +0 -0
- /package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-icons@46.1.0 → @ckeditor_ckeditor5-icons@46.1.1}/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@ckeditor_ckeditor5-watchdog@46.1.0 → @ckeditor_ckeditor5-watchdog@46.1.1}/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.5 → @figma_code-connect@1.3.6}/node_modules/@figma/code-connect/dist/client/external.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.5 → @figma_code-connect@1.3.6}/node_modules/@figma/code-connect/dist/client/figma_client.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.5 → @figma_code-connect@1.3.6}/node_modules/@figma/code-connect/dist/common/fetch.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.5 → @figma_code-connect@1.3.6}/node_modules/@figma/code-connect/dist/common/logging.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.5 → @figma_code-connect@1.3.6}/node_modules/@figma/code-connect/dist/common/updates.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.5 → @figma_code-connect@1.3.6}/node_modules/@figma/code-connect/dist/connect/external_types.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.5 → @figma_code-connect@1.3.6}/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.5 → @figma_code-connect@1.3.6}/node_modules/@figma/code-connect/dist/connect/index_common.js +0 -0
- /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.5 → @figma_code-connect@1.3.6}/node_modules/@figma/code-connect/dist/html/template_literal.js +0 -0
- /package/dist/node_modules/.pnpm/{@vitest_browser@3.2.4_msw@2.7.3_@types_node@24.7.2_typescript@5.9.2__playwright@1.56.0__2a7121fca36270446cf14c9f6eba946b → @vitest_browser@3.2.4_msw@2.7.3_@types_node@24.7.2_typescript@5.9.3__playwright@1.56.0__7ad78200fd030137af34fe232ff09ad4}/node_modules/@vitest/browser/context.js +0 -0
- /package/dist/node_modules/.pnpm/{color@5.0.0 → color@5.0.2}/node_modules/color/index.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/ParseError.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/isObject.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/isValid.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/normalizeArguments.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/parsePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/es6/tools/semver-compare.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js +0 -0
- /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.15 → libphonenumber-js@1.12.24}/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@9.1.10_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.7.2_typescript@5._652d66c1986a052cd7f432ab057a0281 → storybook@9.1.10_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.7.2_typescript@5._5840b52d77463bfbf25f4b960c0b3a83}/node_modules/storybook/dist/client-logger/index.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@9.1.10_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.7.2_typescript@5._652d66c1986a052cd7f432ab057a0281 → storybook@9.1.10_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.7.2_typescript@5._5840b52d77463bfbf25f4b960c0b3a83}/node_modules/storybook/dist/core-events/index.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@9.1.10_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.7.2_typescript@5._652d66c1986a052cd7f432ab057a0281 → storybook@9.1.10_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.7.2_typescript@5._5840b52d77463bfbf25f4b960c0b3a83}/node_modules/storybook/dist/instrumenter/index.js +0 -0
- /package/dist/node_modules/.pnpm/{storybook@9.1.10_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.7.2_typescript@5._652d66c1986a052cd7f432ab057a0281 → storybook@9.1.10_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.7.2_typescript@5._5840b52d77463bfbf25f4b960c0b3a83}/node_modules/storybook/dist/test/index.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.7.2_@vitest_browser@3.2.4_@vitest_ui@3._47325f69253f67ce043411db438d4713 → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.7.2_@vitest_browser@3.2.4_@vitest_ui@3._8fc2fba47a45bae10a0e0e4f0a3c9eee}/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.7.2_@vitest_browser@3.2.4_@vitest_ui@3._47325f69253f67ce043411db438d4713 → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.7.2_@vitest_browser@3.2.4_@vitest_ui@3._8fc2fba47a45bae10a0e0e4f0a3c9eee}/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.7.2_@vitest_browser@3.2.4_@vitest_ui@3._47325f69253f67ce043411db438d4713 → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.7.2_@vitest_browser@3.2.4_@vitest_ui@3._8fc2fba47a45bae10a0e0e4f0a3c9eee}/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +0 -0
- /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.7.2_@vitest_browser@3.2.4_@vitest_ui@3._47325f69253f67ce043411db438d4713 → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.7.2_@vitest_browser@3.2.4_@vitest_ui@3._8fc2fba47a45bae10a0e0e4f0a3c9eee}/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Plugin as u,Command as _}from"../../../../../@ckeditor_ckeditor5-core@46.1.
|
|
1
|
+
import{Plugin as u,Command as _}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{transformOperationSets as B,NoOperation as b}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{ButtonView as y,MenuBarMenuListItemButtonView as R}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{IconUndo as p,IconRedo as f}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";/**
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/class g extends _{_stack=[];_createdBatches=new WeakSet;constructor(t){super(t),this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(t.data,"set",(e,o)=>{o[1]={...o[1]};const s=o[1];s.batchType||(s.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(t.data,"set",(e,o)=>{o[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(t){const e=this.editor.model.document.selection,o={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:o}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,o){const s=this.editor.model,i=s.document,n=[],d=t.map(r=>r.getTransformedByOperations(o)),h=d.flat();for(const r of d){const l=r.filter(c=>c.root!=i.graveyard).filter(c=>!C(c,h));l.length&&(k(l),n.push(l[0]))}n.length&&s.change(r=>{r.setSelection(n,{backward:e})})}_undo(t,e){const o=this.editor.model,s=o.document;this._createdBatches.add(e);const i=t.operations.slice().filter(n=>n.isDocumentOperation);i.reverse();for(const n of i){const d=n.baseVersion+1,h=Array.from(s.history.getOperations(d)),l=B([n.getReversed()],h,{useRelations:!0,document:this.editor.model.document,forceWeakRemove:!0}).operationsA;for(let c of l){const m=c.affectedSelectable;m&&!o.canEditAt(m)&&(c=new b(c.baseVersion)),e.addOperation(c),o.applyOperation(c),s.history.setOperationAsUndone(n,c)}}}}function k(a){a.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let t=1;t<a.length;t++){const o=a[t-1].getJoined(a[t],!0);o&&(t--,a.splice(t,2,o))}}function C(a,t){return t.some(e=>e!==a&&e.containsRange(a,!0))}class T extends g{execute(t=null){const e=t?this._stack.findIndex(i=>i.batch==t):this._stack.length-1,o=this._stack.splice(e,1)[0],s=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(s,()=>{this._undo(o.batch,s);const i=this.editor.model.document.history.getOperations(o.batch.baseVersion);this._restoreSelection(o.selection.ranges,o.selection.isBackward,i)}),this.fire("revert",o.batch,s),this.refresh()}}class U extends g{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(e,()=>{const s=t.batch.operations[t.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(s);this._restoreSelection(t.selection.ranges,t.selection.isBackward,i),this._undo(t.batch,e)}),this.refresh()}}class O extends u{_undoCommand;_redoCommand;_batchRegistry=new WeakSet;static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.t;this._undoCommand=new T(t),this._redoCommand=new U(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(o,s)=>{const i=s[0];if(!i.isDocumentOperation)return;const n=i.batch,d=this._redoCommand.createdBatches.has(n),h=this._undoCommand.createdBatches.has(n);this._batchRegistry.has(n)||(this._batchRegistry.add(n),n.isUndoable&&(d?this._undoCommand.addBatch(n):h||(this._undoCommand.addBatch(n),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(o,s,i)=>{this._redoCommand.addBatch(i)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Undo"),keystroke:"CTRL+Z"},{label:e("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class w extends u{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale,o=t.t,s=e.uiLanguageDirection=="ltr"?p:f,i=e.uiLanguageDirection=="ltr"?f:p;this._addButtonsToFactory("undo",o("Undo"),"CTRL+Z",s),this._addButtonsToFactory("redo",o("Redo"),"CTRL+Y",i)}_addButtonsToFactory(t,e,o,s){const i=this.editor;i.ui.componentFactory.add(t,()=>{const n=this._createButton(y,t,e,o,s);return n.set({tooltip:!0}),n}),i.ui.componentFactory.add("menuBar:"+t,()=>this._createButton(R,t,e,o,s))}_createButton(t,e,o,s,i){const n=this.editor,d=n.locale,h=n.commands.get(e),r=new t(d);return r.set({label:o,icon:i,keystroke:s}),r.bind("isEnabled").to(h,"isEnabled"),this.listenTo(r,"execute",()=>{n.execute(e),n.editing.view.focus()}),r}}class L extends u{static get requires(){return[O,w]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}}export{U as RedoCommand,L as Undo,T as UndoCommand,O as UndoEditing,g as UndoRedoBaseCommand,w as UndoUI};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Plugin as h,PendingActions as o}from"../../../../../@ckeditor_ckeditor5-core@46.1.
|
|
1
|
+
import{Plugin as h,PendingActions as o}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{Collection as u,logWarning as c,ObservableMixin as p,uid as g,CKEditorError as d}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";/**
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/class _ extends p(){total;_reader;_data;constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((r,s)=>{t.onload=()=>{const a=t.result;this._data=a,r(a)},t.onerror=()=>{s("error")},t.onabort=()=>{s("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}class n extends h{loaders=new u;_loadersMap=new Map;_pendingAction=null;static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[o]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return c("filerepository-no-upload-adapter"),null;const t=new l(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(r=>{this._loadersMap.set(r,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let r=0;for(const s of this.loaders)r+=s.uploaded;this.uploaded=r}),t.on("change:uploadTotal",()=>{let r=0;for(const s of this.loaders)s.uploadTotal&&(r+=s.uploadTotal);this.uploadTotal=r}),t}destroyLoader(e){const t=e instanceof l?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((r,s)=>{r===t&&this._loadersMap.delete(s)})}_updatePendingAction(){const e=this.editor.plugins.get(o);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,r=s=>`${t("Upload in progress")} ${parseInt(s)}%.`;this._pendingAction=e.add(r(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",r)}}else e.remove(this._pendingAction),this._pendingAction=null}}class l extends p(){id;_filePromiseWrapper;_adapter;_reader;constructor(e,t){super(),this.id=g(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new _,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(r,s)=>s?r/s*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new d("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new d("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((r,s)=>{t.rejecter=s,t.isFulfilled=!1,e.then(a=>{t.isFulfilled=!0,r(a)}).catch(a=>{t.isFulfilled=!0,s(a)})}),t}}class b extends h{static get requires(){return[n]}static get pluginName(){return"Base64UploadAdapter"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(n).createUploadAdapter=e=>new f(e)}}let f=class{loader;reader;constructor(e){this.loader=e}upload(){return new Promise((e,t)=>{const r=this.reader=new window.FileReader;r.addEventListener("load",()=>{e({default:r.result})}),r.addEventListener("error",s=>{t(s)}),r.addEventListener("abort",()=>{t()}),this.loader.file.then(s=>{r.readAsDataURL(s)})})}abort(){this.reader.abort()}};export{b as Base64UploadAdapter,_ as FileReader,n as FileRepository};
|
|
@@ -21,7 +21,7 @@ import{isObject as Ot}from"../../../../../es-toolkit@1.39.5/node_modules/es-tool
|
|
|
21
21
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
22
22
|
*/const ne="https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html";class d extends Error{context;data;constructor(t,n,i,s){super(ie(t,i,s)),this.name="CKEditorError",this.context=n,this.data=i,s&&(this.stack=s.stack)}is(t){return t==="CKEditorError"}static rethrowUnexpectedError(t,n){throw t.is&&t.is("CKEditorError")?t:new d("unexpected-error",n,void 0,t)}}function un(e,t){console.warn(...At(e,t))}function dn(e,t){console.error(...At(e,t))}function It(e){return`
|
|
23
23
|
Read more: ${ne}#error-${e}`}function ie(e,t,n){const i=new WeakSet,o=t?` ${JSON.stringify(t,(a,c)=>{if(typeof c=="object"&&c!==null){if(i.has(c))return`[object ${c.constructor.name}]`;i.add(c)}return c})}`:"",r=It(e),l=n?`
|
|
24
|
-
Original error: ${n.name}: ${n.message}`:"";return e+o+r+l}function At(e,t){const n=It(e);return t?[e,t,n]:[e,n]}const se="46.1.
|
|
24
|
+
Original error: ${n.name}: ${n.message}`:"";return e+o+r+l}function At(e,t){const n=It(e);return t?[e,t,n]:[e,n]}const se="46.1.1",hn=new Date(2025,8,15);/* istanbul ignore next -- @preserve */if(globalThis.CKEDITOR_VERSION)throw new d("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=se;const A=Symbol("listeningTo"),G=Symbol("emitterId"),E=Symbol("delegations"),oe=I(Object);function I(e){if(!e)return oe;class t extends e{on(i,s,o){this.listenTo(this,i,s,o)}once(i,s,o){let r=!1;const l=(a,...c)=>{r||(r=!0,a.off(),s.call(this,a,...c))};this.listenTo(this,i,l,o)}off(i,s){this.stopListening(this,i,s)}listenTo(i,s,o,r={}){let l,a;this[A]||(this[A]={});const c=this[A];O(i)||Ct(i);const f=O(i);(l=c[f])||(l=c[f]={emitter:i,callbacks:{}}),(a=l.callbacks[s])||(a=l.callbacks[s]=[]),a.push(o),fe(this,i,s,o,r)}stopListening(i,s,o){const r=this[A];let l=i&&O(i);const a=r&&l?r[l]:void 0,c=a&&s?a.callbacks[s]:void 0;if(!(!r||i&&!a||s&&!c))if(o)W(this,i,s,o),c.indexOf(o)!==-1&&(c.length===1?delete a.callbacks[s]:W(this,i,s,o));else if(c){for(;o=c.pop();)W(this,i,s,o);delete a.callbacks[s]}else if(a){for(s in a.callbacks)this.stopListening(i,s);delete r[l]}else{for(l in r)this.stopListening(r[l].emitter);delete this[A]}}fire(i,...s){try{const o=i instanceof H?i:new H(this,i),r=o.name;let l=ae(this,r);if(o.path.push(this),l){l=l.slice();for(let c=0;c<l.length;c++){const f=l[c].callback;if(f.call(this,o,...s),o.off.called&&(delete o.off.called,this._removeEventListener(r,f)),o.stop.called)break}}const a=this[E];if(a){const c=a.get(r),f=a.get("*");c&<(c,o,s),f&<(f,o,s)}return o.return}catch(o){/* istanbul ignore next -- @preserve */d.rethrowUnexpectedError(o,this)}}delegate(...i){return{to:(s,o)=>{this[E]||(this[E]=new Map),i.forEach(r=>{const l=this[E].get(r);l?l.set(s,o):this[E].set(r,new Map([[s,o]]))})}}}stopDelegating(i,s){if(this[E])if(!i)this[E].clear();else if(!s)this[E].delete(i);else{const o=this[E].get(i);o&&o.delete(s)}}_addEventListener(i,s,o){ce(this,i);const r=q(this,i),l=U.get(o.priority),a={callback:s,priority:l};for(const c of r)ee(c,a)}_removeEventListener(i,s){const o=q(this,i);for(const r of o)for(let l=0;l<r.length;l++)r[l].callback==s&&(r.splice(l,1),l--)}}return t}function re(e,t){const n=e[A];return n&&n[t]?n[t].emitter:null}function Ct(e,t){e[G]||(e[G]=t||X())}function O(e){return e[G]}function Lt(e){return e._events||Object.defineProperty(e,"_events",{value:{}}),e._events}function le(){return{callbacks:[],childEvents:[]}}function ce(e,t){const n=Lt(e);if(n[t])return;let i=t,s=null;const o=[];for(;i!==""&&!n[i];)n[i]=le(),o.push(n[i]),s&&n[i].childEvents.push(s),s=i,i=i.substr(0,i.lastIndexOf(":"));if(i!==""){for(const r of o)r.callbacks=n[i].callbacks.slice();n[i].childEvents.push(s)}}function q(e,t){const n=Lt(e)[t];if(!n)return[];let i=[n.callbacks];for(let s=0;s<n.childEvents.length;s++){const o=q(e,n.childEvents[s]);i=i.concat(o)}return i}function ae(e,t){if(!e._events)return null;let n=t;do{const i=e._events[n];if(i&&i.callbacks&&i.callbacks.length)return i.callbacks;const s=n.lastIndexOf(":");n=s>-1?n.substring(0,s):""}while(n);return null}function lt(e,t,n){for(let[i,s]of e){s?typeof s=="function"&&(s=s(t.name)):s=t.name;const o=new H(t.source,s);o.path=[...t.path],i.fire(o,...n)}}function fe(e,t,n,i,s){t._addEventListener?t._addEventListener(n,i,s):e._addEventListener.call(t,n,i,s)}function W(e,t,n,i){t._removeEventListener?t._removeEventListener(n,i):e._removeEventListener.call(t,n,i)}const S=Symbol("observableProperties"),R=Symbol("boundObservables"),V=Symbol("boundProperties"),x=Symbol("decoratedMethods"),ct=Symbol("decoratedOriginal"),ue=kt(I());function kt(e){if(!e)return ue;class t extends e{set(i,s){if(Ot(i)){Object.keys(i).forEach(r=>{this.set(r,i[r])},this);return}K(this);const o=this[S];if(i in this&&!o.has(i))throw new d("observable-set-cannot-override",this);Object.defineProperty(this,i,{enumerable:!0,configurable:!0,get(){return o.get(i)},set(r){const l=o.get(i);let a=this.fire(`set:${i}`,i,r,l);a===void 0&&(a=r),(l!==a||!o.has(i))&&(o.set(i,a),this.fire(`change:${i}`,i,a,l))}}),this[i]=s}bind(...i){if(!i.length||!at(i))throw new d("observable-bind-wrong-properties",this);if(new Set(i).size!==i.length)throw new d("observable-bind-duplicate-properties",this);K(this);const s=this[V];i.forEach(r=>{if(s.has(r))throw new d("observable-bind-rebind",this)});const o=new Map;return i.forEach(r=>{const l={property:r,to:[]};s.set(r,l),o.set(r,l)}),{to:de,toMany:he,_observable:this,_bindProperties:i,_to:[],_bindings:o}}unbind(...i){if(!this[S])return;const s=this[V],o=this[R];if(i.length){if(!at(i))throw new d("observable-unbind-wrong-properties",this);i.forEach(r=>{const l=s.get(r);l&&(l.to.forEach(([a,c])=>{const f=o.get(a),u=f[c];u.delete(l),u.size||delete f[c],Object.keys(f).length||(o.delete(a),this.stopListening(a,"change"))}),s.delete(r))})}else o.forEach((r,l)=>{this.stopListening(l,"change")}),o.clear(),s.clear()}decorate(i){K(this);const s=this[i];if(!s)throw new d("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:i});this.on(i,(o,r)=>{o.return=s.apply(this,r)}),this[i]=function(...o){return this.fire(i,o)},this[i][ct]=s,this[x]||(this[x]=[]),this[x].push(i)}stopListening(i,s,o){if(!i&&this[x]){for(const r of this[x])this[r]=this[r][ct];delete this[x]}super.stopListening(i,s,o)}[S];[x];[V];[R]}return t}function K(e){e[S]||(Object.defineProperty(e,S,{value:new Map}),Object.defineProperty(e,R,{value:new Map}),Object.defineProperty(e,V,{value:new Map}))}function de(...e){const t=ge(...e),n=Array.from(this._bindings.keys()),i=n.length;if(!t.callback&&t.to.length>1)throw new d("observable-bind-to-no-callback",this);if(i>1&&t.callback)throw new d("observable-bind-to-extra-callback",this);t.to.forEach(s=>{if(s.properties.length&&s.properties.length!==i)throw new d("observable-bind-to-properties-length",this);s.properties.length||(s.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(n[0]).callback=t.callback),_e(this._observable,this._to),be(this),this._bindProperties.forEach(s=>{Mt(this._observable,s)})}function he(e,t,n){if(this._bindings.size>1)throw new d("observable-bind-to-many-not-one-binding",this);this.to(...pe(e,t),n)}function pe(e,t){const n=e.map(i=>[i,t]);return Array.prototype.concat.apply([],n)}function at(e){return e.every(t=>typeof t=="string")}function ge(...e){if(!e.length)throw new d("observable-bind-to-parse-error",null);const t={to:[]};let n;return typeof e[e.length-1]=="function"&&(t.callback=e.pop()),e.forEach(i=>{if(typeof i=="string")n.properties.push(i);else if(typeof i=="object")n={observable:i,properties:[]},t.to.push(n);else throw new d("observable-bind-to-parse-error",null)}),t}function me(e,t,n,i){const s=e[R],o=s.get(n),r=o||{};r[i]||(r[i]=new Set),r[i].add(t),o||s.set(n,r)}function be(e){let t;e._bindings.forEach((n,i)=>{e._to.forEach(s=>{t=s.properties[n.callback?0:e._bindProperties.indexOf(i)],n.to.push([s.observable,t]),me(e._observable,n,s.observable,t)})})}function Mt(e,t){const i=e[V].get(t);let s;i.callback?s=i.callback.apply(e,i.to.map(o=>o[0][o[1]])):(s=i.to[0],s=s[0][s[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=s:e.set(t,s)}function _e(e,t){t.forEach(n=>{const i=e[R];let s;i.get(n.observable)||e.listenTo(n.observable,"change",(o,r)=>{s=i.get(n.observable)[r],s&&s.forEach(l=>{Mt(e,l.property)})})})}/**
|
|
25
25
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
26
26
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
27
27
|
*/class pn{_replacedElements;constructor(){this._replacedElements=[]}replace(t,n){this._replacedElements.push({element:t,newElement:n}),t.style.display="none",n&&t.parentNode.insertBefore(n,t.nextSibling)}restore(){this._replacedElements.forEach(({element:t,newElement:n})=>{t.style.display="",n&&n.remove()}),this._replacedElements=[]}}/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Plugin as E}from"../../../../../@ckeditor_ckeditor5-core@46.1.
|
|
1
|
+
import{Plugin as E}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{MouseObserver as H,PointerObserver as K,ModelTreeWalker as j}from"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{Delete as D}from"../../../../../@ckeditor_ckeditor5-typing@46.1.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js";import{keyCodes as S,env as T,getLocalizedArrowKeyCodeDirection as $,logWarning as U,CKEditorError as I,isForwardArrowKeyCode as q,getRangeFromMouseEvent as G,global as k,DomEmitterMixin as Y,toArray as O,Rect as b,ObservableMixin as F,compareArrays as X,EmitterMixin as J}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{IconReturnArrow as Q,IconDragHandle as Z}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import{ContextualBalloon as ee,ToolbarView as te,BalloonPanelView as ie,IconView as oe,Template as C,View as ne}from"../../../../../@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js";import{Enter as se}from"../../../../../@ckeditor_ckeditor5-enter@46.1.1/node_modules/@ckeditor/ckeditor5-enter/dist/index.js";import{throttle as re}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/throttle.js";/**
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/class le extends J(){_stack=[];add(e,t){const i=this._stack,o=i[0];this._insertDescriptor(e);const n=i[0];o!==n&&!P(o,n)&&this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}remove(e,t){const i=this._stack,o=i[0];this._removeDescriptor(e);const n=i[0];o!==n&&!P(o,n)&&this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}_insertDescriptor(e){const t=this._stack,i=t.findIndex(n=>n.id===e.id);if(P(e,t[i]))return;i>-1&&t.splice(i,1);let o=0;for(;t[o]&&ce(t[o],e);)o++;t.splice(o,0,e)}_removeDescriptor(e){const t=this._stack,i=t.findIndex(o=>o.id===e);i>-1&&t.splice(i,1)}}function P(s,e){return s&&e&&s.priority==e.priority&&v(s.classes)==v(e.classes)}function ce(s,e){return s.priority>e.priority?!0:s.priority<e.priority?!1:v(s.classes)>v(e.classes)}function v(s){return Array.isArray(s)?s.sort().join(","):s}const ae="ck-widget",A="ck-widget_selected";function p(s){return s.is("element")?!!s.getCustomProperty("widget"):!1}function et(s,e,t={}){if(!s.is("containerElement"))throw new I("widget-to-widget-wrong-element-type",null,{element:s});return e.setAttribute("contenteditable","false",s),e.addClass(ae,s),e.setCustomProperty("widget",!0,s),s.getFillerOffset=pe,e.setCustomProperty("widgetLabel",[],s),t.label&&ue(s,t.label),t.hasSelectionHandle&&fe(s,e),N(s,e),s}function de(s,e,t){if(e.classes&&t.addClass(O(e.classes),s),e.attributes)for(const i in e.attributes)t.setAttribute(i,e.attributes[i],s)}function he(s,e,t){if(e.classes&&t.removeClass(O(e.classes),s),e.attributes)for(const i in e.attributes)t.removeAttribute(i,s)}function N(s,e,t=de,i=he){const o=new le;o.on("change:top",(l,c)=>{c.oldDescriptor&&i(s,c.oldDescriptor,c.writer),c.newDescriptor&&t(s,c.newDescriptor,c.writer)});const n=(l,c,a)=>o.add(c,a),r=(l,c,a)=>o.remove(c,a);e.setCustomProperty("addHighlight",n,s),e.setCustomProperty("removeHighlight",r,s)}function ue(s,e){s.getCustomProperty("widgetLabel").push(e)}function ge(s){return s.getCustomProperty("widgetLabel").reduce((t,i)=>typeof i=="function"?t?t+". "+i():i():t?t+". "+i:i,"")}function tt(s,e,t={}){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],s),t.withAriaRole!==!1&&e.setAttribute("role","textbox",s),s.isReadOnly||e.setAttribute("tabindex","-1",s),t.label&&e.setAttribute("aria-label",t.label,s),e.setAttribute("contenteditable",s.isReadOnly?"false":"true",s),s.on("change:isReadOnly",(i,o,n)=>{e.setAttribute("contenteditable",n?"false":"true",s),n?e.removeAttribute("tabindex",s):e.setAttribute("tabindex","-1",s)}),s.on("change:isFocused",(i,o,n)=>{n?e.addClass("ck-editor__nested-editable_focused",s):e.removeClass("ck-editor__nested-editable_focused",s)}),N(s,e),s}function it(s,e){const t=s.getSelectedElement();if(t){const i=w(s);if(i)return e.createRange(e.createPositionAt(t,i))}return e.schema.findOptimalInsertionRange(s)}function pe(){return null}function fe(s,e){const t=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(i){const o=this.toDomElement(i),n=new oe;return n.set("content",Z),n.render(),o.appendChild(n.element),o});e.insert(e.createPositionAt(s,0),t),e.addClass(["ck-widget_with-selection-handle"],s)}function me(s){const e=l=>{const{width:c,paddingLeft:a,paddingRight:h}=l.ownerDocument.defaultView.getComputedStyle(l);return parseFloat(c)-(parseFloat(a)||0)-(parseFloat(h)||0)},t=s.parentElement;if(!t)return 0;let i=e(t);const o=5;let n=0,r=t;for(;isNaN(i);){if(r=r.parentElement,++n>o)return 0;i=e(r)}return i}function we(s,e=new b(s)){const t=me(s);return t?e.width/t*100:0}const m="widget-type-around";function _(s,e,t){return!!s&&p(s)&&!t.isInline(e)}function _e(s){return s.closest(".ck-widget__type-around__button")}function be(s){return s.classList.contains("ck-widget__type-around__button_before")?"before":"after"}function ye(s,e){const t=s.closest(".ck-widget");return e.mapDomToView(t)}function w(s){return s.getAttribute(m)}const M=["before","after"],ve=new DOMParser().parseFromString(Q,"image/svg+xml").firstChild,R="ck-widget__type-around_disabled";class Ee extends E{_currentFakeCaretModelElement=null;static get pluginName(){return"WidgetTypeAround"}static get isOfficialPlugin(){return!0}static get requires(){return[se,D]}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(i,o,n)=>{t.change(r=>{for(const l of t.document.roots)n?r.removeClass(R,l):r.addClass(R,l)}),n||e.model.change(r=>{r.removeSelectionAttribute(m)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const i=this.editor,o=i.editing.view,n=i.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);i.execute("insertParagraph",{position:i.model.createPositionAt(e,t),attributes:n}),o.focus(),o.scrollToTheSelection()}_listenToIfEnabled(e,t,i,o){this.listenTo(e,t,(...n)=>{this.isEnabled&&i(...n)},o)}_insertParagraphAccordingToFakeCaretPosition(){const i=this.editor.model.document.selection,o=w(i);if(!o)return!1;const n=i.getSelectedElement();return this._insertParagraph(n,o),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,i=e.locale.t,o={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(n,r,l)=>{const c=l.mapper.toViewElement(r.item);c&&_(c,r.item,t)&&(Pe(l.writer,o,c),c.getCustomProperty("widgetLabel").push(()=>this.isEnabled?i("Press Enter to type after or press Shift + Enter to type before the widget"):""))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,i=t.document.selection,o=t.schema,n=e.editing.view;this._listenToIfEnabled(n.document,"arrowKey",(l,c)=>{this._handleArrowKeyPress(l,c)},{context:[p,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",(l,c)=>{c.directChange&&e.model.change(a=>{a.removeSelectionAttribute(m)})}),this._listenToIfEnabled(t.document,"change:data",()=>{const l=i.getSelectedElement();if(l){const c=e.editing.mapper.toViewElement(l);if(_(c,l,o))return}e.model.change(c=>{c.removeSelectionAttribute(m)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(l,c,a)=>{const h=a.writer;if(this._currentFakeCaretModelElement){const f=a.mapper.toViewElement(this._currentFakeCaretModelElement);f&&(h.removeClass(M.map(r),f),this._currentFakeCaretModelElement=null)}const d=c.selection.getSelectedElement();if(!d)return;const g=a.mapper.toViewElement(d);if(!_(g,d,o))return;const u=w(c.selection);u&&(h.addClass(r(u),g),this._currentFakeCaretModelElement=d)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(l,c,a)=>{a||e.model.change(h=>{h.removeSelectionAttribute(m)})});function r(l){return`ck-widget_type-around_show-fake-caret_${l}`}}_handleArrowKeyPress(e,t){const i=this.editor,o=i.model,n=o.document.selection,r=o.schema,l=i.editing.view,c=t.keyCode,a=q(c,i.locale.contentLanguageDirection),h=l.document.selection.getSelectedElement(),d=i.editing.mapper.toModelElement(h);let g;_(h,d,r)?g=this._handleArrowKeyPressOnSelectedWidget(a):n.isCollapsed?g=this._handleArrowKeyPressWhenSelectionNextToAWidget(a):t.shiftKey||(g=this._handleArrowKeyPressWhenNonCollapsedSelection(a)),g&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const i=this.editor.model,o=i.document.selection,n=w(o);return i.change(r=>{if(n){if(!(n===(e?"after":"before")))return r.removeSelectionAttribute(m),!0}else return r.setSelectionAttribute(m,e?"after":"before"),!0;return!1})}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,i=t.model,o=i.schema,n=t.plugins.get("Widget"),r=n._getObjectElementNextToSelection(e),l=t.editing.mapper.toViewElement(r);return _(l,r,o)?(i.change(c=>{n._setSelectionOverElement(r),c.setSelectionAttribute(m,e?"before":"after")}),!0):!1}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,i=t.model,o=i.schema,n=t.editing.mapper,r=i.document.selection,l=e?r.getLastPosition().nodeBefore:r.getFirstPosition().nodeAfter,c=n.toViewElement(l);return _(c,l,o)?(i.change(a=>{a.setSelection(l,"on"),a.setSelectionAttribute(m,e?"after":"before")}),!0):!1}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(i,o)=>{const n=_e(o.domTarget);if(!n)return;const r=be(n),l=ye(n,t.domConverter),c=e.editing.mapper.toModelElement(l);this._insertParagraph(c,r),o.preventDefault(),i.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,i=e.editing.view;this._listenToIfEnabled(i.document,"enter",(o,n)=>{if(o.eventPhase!="atTarget")return;const r=t.getSelectedElement(),l=e.editing.mapper.toViewElement(r),c=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:_(l,r,c)&&(this._insertParagraph(r,n.isSoft?"before":"after"),a=!0),a&&(n.preventDefault(),o.stop())},{context:p})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor.editing.view.document;this._listenToIfEnabled(t,"insertText",(i,o)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(o.selection=t.selection)},{priority:"high"}),T.isAndroid?this._listenToIfEnabled(t,"keydown",(i,o)=>{o.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(t,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"highest"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,i=e.model,o=i.schema;this._listenToIfEnabled(t.document,"delete",(n,r)=>{if(n.eventPhase!="atTarget")return;const l=w(i.document.selection);if(!l)return;const c=r.direction,a=i.document.selection.getSelectedElement(),h=l==="before",d=c=="forward";if(h===d)e.execute("delete",{selection:i.createSelection(a,"on")});else{const u=o.getNearestSelectionRange(i.createPositionAt(a,l),c);if(u)if(!u.isCollapsed)i.change(f=>{f.setSelection(u),e.execute(d?"deleteForward":"delete")});else{const f=i.createSelection(u.start);if(i.modifySelection(f,{direction:c}),!f.focus.isEqual(u.start))i.change(y=>{y.setSelection(u),e.execute(d?"deleteForward":"delete")});else{const y=Ce(o,u.start.parent);i.deleteContent(i.createSelection(y,"on"),{doNotAutoparagraph:!0})}}}r.preventDefault(),n.stop()},{context:p})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,i=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(o,[n,r])=>{if(r&&!r.is("documentSelection"))return;const l=w(i);if(l)return o.stop(),t.change(c=>{const a=i.getSelectedElement(),h=t.createPositionAt(a,l),d=c.createSelection(h),g=t.insertContent(n,d);return c.setSelection(d),g})},{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,i=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(o,n)=>{const[,r,l={}]=n;if(r&&!r.is("documentSelection"))return;const c=w(i);c&&(l.findOptimalPosition=c,n[3]=l)},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,i=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(o,[n])=>{if(n&&!n.is("documentSelection"))return;w(i)&&o.stop()},{priority:"high"})}}function Pe(s,e,t){const i=s.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(o){const n=this.toDomElement(o);return Se(n,e),Te(n),n});s.insert(s.createPositionAt(t,"end"),i)}function Se(s,e){for(const t of M){const i=new C({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${t}`],title:e[t],"aria-hidden":"true"},children:[s.ownerDocument.importNode(ve,!0)]});s.appendChild(i.render())}}function Te(s){const e=new C({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});s.appendChild(e.render())}function Ce(s,e){let t=e;for(const i of e.getAncestors({parentFirst:!0})){if(i.childCount>1||s.isLimit(i))break;t=i}return t}function ke(s){const e=s.model;return(t,i)=>{const o=i.keyCode==S.arrowup,n=i.keyCode==S.arrowdown,r=i.shiftKey,l=e.document.selection;if(!o&&!n)return;const c=n;if(r&&We(l,c))return;const a=Ae(s,l,c);if(a){if(a.isCollapsed){if(l.isCollapsed)return;if(r)return}(a.isCollapsed||Re(s,a,c))&&(e.change(h=>{const d=c?a.end:a.start;if(r){const g=e.createSelection(l.anchor);g.setFocus(d),h.setSelection(g)}else h.setSelection(d)}),t.stop(),i.preventDefault(),i.stopPropagation())}}}function Ae(s,e,t){const i=s.model;if(t){const o=e.isCollapsed?e.focus:e.getLastPosition(),n=W(i,o,"forward");if(!n)return null;const r=i.createRange(o,n),l=x(i.schema,r,"backward");return l?i.createRange(o,l):null}else{const o=e.isCollapsed?e.focus:e.getFirstPosition(),n=W(i,o,"backward");if(!n)return null;const r=i.createRange(n,o),l=x(i.schema,r,"forward");return l?i.createRange(l,o):null}}function W(s,e,t){const i=s.schema,o=s.createRangeIn(e.root),n=t=="forward"?"elementStart":"elementEnd";for(const{previousPosition:r,item:l,type:c}of o.getWalker({startPosition:e,direction:t})){if(i.isLimit(l)&&!i.isInline(l))return r;if(c==n&&i.isBlock(l))return null}return null}function x(s,e,t){const i=t=="backward"?e.end:e.start;if(s.checkChild(i,"$text"))return i;for(const{nextPosition:o}of e.getWalker({direction:t}))if(s.checkChild(o,"$text"))return o;return null}function Re(s,e,t){const i=s.model,o=s.view.domConverter;if(t){const a=i.createSelection(e.start);i.modifySelection(a),!a.focus.isAtEnd&&!e.start.isEqual(a.focus)&&(e=i.createRange(a.focus,e.end))}const n=s.mapper.toViewRange(e),r=o.viewRangeToDom(n),l=b.getDomRangeRects(r);let c;for(const a of l){if(c===void 0){c=Math.round(a.bottom);continue}if(Math.round(a.top)>=c)return!1;c=Math.max(c,Math.round(a.bottom))}return!0}function We(s,e){return!s.isCollapsed&&s.isBackward==e}class ot extends E{_previouslySelected=new Set;static get pluginName(){return"Widget"}static get isOfficialPlugin(){return!0}static get requires(){return[Ee,D]}init(){const e=this.editor,t=e.editing.view,i=t.document,o=e.t;this.editor.editing.downcastDispatcher.on("selection",(n,r,l)=>{const c=l.writer,a=r.selection;if(a.isCollapsed)return;const h=a.getSelectedElement();if(!h)return;const d=e.editing.mapper.toViewElement(h);p(d)&&l.consumable.consume(a,"selection")&&c.setSelection(c.createRangeOn(d),{fake:!0,label:ge(d)})}),this.editor.editing.downcastDispatcher.on("selection",(n,r,l)=>{this._clearPreviouslySelectedWidgets(l.writer);const c=l.writer,a=c.document.selection;let h=null;for(const d of a.getRanges())for(const g of d){const u=g.item;p(u)&&!Ve(u,h)&&(c.addClass(A,u),this._previouslySelected.add(u),h=u)}},{priority:"low"}),t.addObserver(H),t.addObserver(K),this.listenTo(i,"mousedown",(...n)=>this._onMousedown(...n)),this.listenTo(i,"pointerdown",(...n)=>this._onPointerdown(...n)),this.listenTo(i,"arrowKey",(...n)=>{this._handleSelectionChangeOnArrowKeyPress(...n)},{context:[p,"$text"]}),this.listenTo(i,"arrowKey",(...n)=>{this._preventDefaultOnArrowKeyPress(...n)},{context:"$root"}),this.listenTo(i,"arrowKey",ke(this.editor.editing),{context:"$text"}),this.listenTo(i,"delete",(n,r)=>{this._handleDelete(r.direction=="forward")&&(r.preventDefault(),n.stop())},{context:"$root"}),this.listenTo(i,"tab",(n,r)=>{n.eventPhase=="atTarget"&&(r.shiftKey||this._selectFirstNestedEditable()&&(r.preventDefault(),n.stop()))},{context:p,priority:"low"}),this.listenTo(i,"tab",(n,r)=>{r.shiftKey&&this._selectAncestorWidget()&&(r.preventDefault(),n.stop())},{priority:"low"}),this.listenTo(i,"keydown",(n,r)=>{r.keystroke==S.esc&&this._selectAncestorWidget()&&(r.preventDefault(),n.stop())},{priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:o("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:o("Move focus from an editable area back to the parent widget"),keystroke:"Esc"},{label:o("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:o("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:o("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:o("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,t){const i=t.target;i&&t.domEvent.detail>=3&&this._selectBlockContent(i)&&t.preventDefault()}_onPointerdown(e,t){if(!t.domEvent.isPrimary)return;const i=this.editor,o=i.editing.view,n=o.document;let r=t.target;if(!r)return;if(!p(r)){const c=xe(r);if(!c)return;if(p(c))r=c;else{const a=ze(o,t);if(a&&p(a))r=a;else return}}(T.isAndroid||T.isiOS)&&t.preventDefault(),n.isFocused||o.focus();const l=i.editing.mapper.toModelElement(r);this._setSelectionOverElement(l)}_selectBlockContent(e){const t=this.editor,i=t.model,o=t.editing.mapper,n=i.schema,r=o.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,0)),l=He(o.toModelElement(r),i.schema);return l?(i.change(c=>{const a=n.isLimit(l)?null:De(c.createPositionAfter(l),n),h=c.createPositionAt(l,0),d=a?c.createPositionAt(a,0):c.createPositionAt(l,"end");c.setSelection(c.createRange(h,d))}),!0):!1}_handleSelectionChangeOnArrowKeyPress(e,t){const i=t.keyCode,o=this.editor.model,n=o.schema,r=o.document.selection,l=r.getSelectedElement(),c=$(i,this.editor.locale.contentLanguageDirection),a=c=="down"||c=="right",h=c=="up"||c=="down";if(l&&n.isObject(l)){const g=a?r.getLastPosition():r.getFirstPosition(),u=n.getNearestSelectionRange(g,a?"forward":"backward");u&&(o.change(f=>{f.setSelection(u)}),t.preventDefault(),e.stop());return}if(!r.isCollapsed&&!t.shiftKey){const g=r.getFirstPosition(),u=r.getLastPosition(),f=g.nodeAfter,y=u.nodeBefore;(f&&n.isObject(f)||y&&n.isObject(y))&&(o.change(B=>{B.setSelection(a?u:g)}),t.preventDefault(),e.stop());return}if(!r.isCollapsed)return;const d=this._getObjectElementNextToSelection(a);if(d&&n.isObject(d)){if(n.isInline(d)&&h)return;this._setSelectionOverElement(d),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const i=this.editor.model,o=i.schema,n=i.document.selection.getSelectedElement();n&&o.isObject(n)&&(t.preventDefault(),e.stop())}_handleDelete(e){const i=this.editor.model.document.selection;if(!this.editor.model.canEditAt(i)||!i.isCollapsed)return;const o=this._getObjectElementNextToSelection(e);if(o)return this.editor.model.change(n=>{let r=i.anchor.parent;for(;r.isEmpty;){const l=r;r=l.parent,n.remove(l)}this._setSelectionOverElement(o)}),!0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,i=t.schema,o=t.document.selection,n=t.createSelection(o);if(t.modifySelection(n,{direction:e?"forward":"backward"}),n.isEqual(o))return null;const r=e?n.focus.nodeBefore:n.focus.nodeAfter;return r&&i.isObject(r)?r:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(A,t);this._previouslySelected.clear()}_selectFirstNestedEditable(){const e=this.editor,i=this.editor.editing.view.document;for(const o of i.selection.getFirstRange().getItems())if(o.is("editableElement")){const n=e.editing.mapper.toModelElement(o);/* istanbul ignore next -- @preserve */if(!n)continue;const r=e.model.createPositionAt(n,0),l=e.model.schema.getNearestSelectionRange(r,"forward");return e.model.change(c=>{c.setSelection(l)}),!0}return!1}_selectAncestorWidget(){const e=this.editor,t=e.editing.mapper,o=e.editing.view.document.selection.getFirstPosition().parent,r=(o.is("$text")?o.parent:o).findAncestor(p);if(!r)return!1;const l=t.toModelElement(r);/* istanbul ignore next -- @preserve */return l?(e.model.change(c=>{c.setSelection(l,"on")}),!0):!1}}function xe(s){let e=s;for(;e;){if(e.is("editableElement")||p(e))return e;e=e.parent}return null}function ze(s,e){const t=G(e.domEvent);let i=null;if(t?i=s.domConverter.domRangeToView(t):i=s.createRange(s.createPositionAt(e.target,0)),!i)return null;const o=i.start;if(!o.parent)return null;let n=o.parent;return o.parent.is("editableElement")&&(o.isAtEnd&&o.nodeBefore?n=o.nodeBefore:o.isAtStart&&o.nodeAfter&&(n=o.nodeAfter)),n.is("$text")?n.parent:n}function Ve(s,e){return e?Array.from(s.getAncestors()).includes(e):!1}function He(s,e){for(const t of s.getAncestors({includeSelf:!0,parentFirst:!0})){if(e.checkChild(t,"$text"))return t;if(e.isLimit(t)&&!e.isObject(t))break}return null}function De(s,e){const t=new j({startPosition:s});for(const{item:i}of t){if(e.isLimit(i)||!i.is("element"))return null;if(e.checkChild(i,"$text"))return i}return null}class nt extends E{_toolbarDefinitions=new Map;_balloon;static get requires(){return[ee]}static get pluginName(){return"WidgetToolbarRepository"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",i=>{Ie(e.editing.view.document.selection)&&i.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:i,getRelatedElement:o,balloonClassName:n="ck-toolbar-container",positions:r}){if(!i.length){U("widget-toolbar-no-items",{toolbarId:e});return}const l=this.editor,c=l.t,a=new te(l.locale);if(a.ariaLabel=t||c("Widget toolbar"),this._toolbarDefinitions.has(e))throw new I("widget-toolbar-duplicated",this,{toolbarId:e});const h={view:a,getRelatedElement:o,balloonClassName:n,itemsConfig:i,positions:r,initialized:!1};l.ui.addToolbar(a,{isContextual:!0,beforeFocus:()=>{const d=o(l.editing.view.document.selection);d&&this._showToolbar(h,d)},afterBlur:()=>{this._hideToolbar(h)}}),this._toolbarDefinitions.set(e,h)}_updateToolbarsVisibility(){let e=0,t=null,i=null;for(const o of this._toolbarDefinitions.values()){const n=o.getRelatedElement(this.editor.editing.view.document.selection);if(!this.isEnabled||!n)this._isToolbarInBalloon(o)&&this._hideToolbar(o);else if(!this.editor.ui.focusTracker.isFocused)this._isToolbarVisible(o)&&this._hideToolbar(o);else{const r=n.getAncestors().length;r>e&&(e=r,t=n,i=o)}}i&&this._showToolbar(i,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?z(this.editor,t,e.positions):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:L(this.editor,t,e.positions),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const i of this._toolbarDefinitions.values())if(this._isToolbarVisible(i)){const o=i.getRelatedElement(this.editor.editing.view.document.selection);z(this.editor,o,e.positions)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function z(s,e,t){const i=s.plugins.get("ContextualBalloon"),o=L(s,e,t);i.updatePosition(o)}function L(s,e,t){const i=s.editing.view,o=ie.defaultPositions;return{target:i.domConverter.mapViewToDom(e),positions:t||[o.northArrowSouth,o.northArrowSouthWest,o.northArrowSouthEast,o.southArrowNorth,o.southArrowNorthWest,o.southArrowNorthEast,o.viewportStickyNorth]}}function Ie(s){const e=s.getSelectedElement();return!!(e&&p(e))}class Oe extends F(){_referenceCoordinates;_options;_originalWidth;_originalHeight;_originalWidthPercents;_aspectRatio;constructor(e){super(),this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,t,i){const o=new b(t);this.activeHandlePosition=Me(e),this._referenceCoordinates=Fe(t,Le(this.activeHandlePosition)),this._originalWidth=o.width,this._originalHeight=o.height,this._aspectRatio=o.width/o.height;const n=i.style.width;n&&n.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(n):this._originalWidthPercents=we(i,o)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}function Fe(s,e){const t=new b(s),i=e.split("-"),o={x:i[1]=="right"?t.right:t.left,y:i[0]=="bottom"?t.bottom:t.top};return o.x+=s.ownerDocument.defaultView.scrollX,o.y+=s.ownerDocument.defaultView.scrollY,o}function Ne(s){return`ck-widget__resizer__handle-${s}`}function Me(s){const e=["top-left","top-right","bottom-right","bottom-left"];for(const t of e)if(s.classList.contains(Ne(t)))return t}function Le(s){const e=s.split("-"),t={top:"bottom",bottom:"top",left:"right",right:"left"};return`${t[e[0]]}-${t[e[1]]}`}class Be extends ne{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",t=>t?`ck-orientation-${t}`:"")],style:{display:e.if("_isVisible","none",t=>!t)}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",(i,o)=>i!==null&&o!==null),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(i,o,n)=>e.unit==="px"?`${i}×${o}`:`${n}%`),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",(i,o,n)=>o<50||n<50?"above-center":i)}_dismiss(){this.unbind(),this._isVisible=!1}}class V extends F(){_state;_sizeView;_options;_viewResizerWrapper=null;_initialViewWidth;constructor(e){super(),this._options=e,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",(t,i)=>t&&i),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",t=>{!this.state.proposedWidth&&!this.state.proposedWidthPercents&&(this._cleanup(),t.stop())},{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change(t=>{t.removeClass("ck-hidden",this._viewResizerWrapper)})}hide(){this._options.editor.editing.view.change(t=>{t.addClass("ck-hidden",this._viewResizerWrapper)})}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change(o=>{const n=o.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(r){const l=this.toDomElement(r);return e._appendHandles(l),e._appendSizeUI(l),l});o.insert(o.createPositionAt(t,"end"),n),o.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=n,this.isVisible||this.hide()}),this.on("change:isVisible",()=>{this.isVisible?(this.show(),this.redraw()):this.hide()})}begin(e){this._state=new Oe(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);this._options.editor.editing.view.change(a=>{const h=this._options.unit||"%",d=(h==="%"?t.widthPercents:t.width)+h;a.setStyle("width",d,this._options.viewElement)});const o=this._getHandleHost(),n=new b(o),r=Math.round(n.width),l=Math.round(n.height),c=new b(o);t.width=Math.round(c.width),t.height=Math.round(c.height),this.redraw(n),this.state.update({...t,handleHostWidth:r,handleHostHeight:l})}commit(){const e=this._options.unit||"%",t=(e==="%"?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!$e(t))return;const i=t.parentElement,o=this._getHandleHost(),n=this._viewResizerWrapper,r=[n.getStyle("width"),n.getStyle("height"),n.getStyle("left"),n.getStyle("top")];let l;if(i.isSameNode(o)){const c=e||new b(o);l=[c.width+"px",c.height+"px",void 0,void 0]}else l=[o.offsetWidth+"px",o.offsetHeight+"px",o.offsetLeft+"px",o.offsetTop+"px"];X(r,l)!=="same"&&this._options.editor.editing.view.change(c=>{c.setStyle({width:l[0],height:l[1],left:l[2],top:l[3]},n)})}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss(),this._options.editor.editing.view.change(t=>{t.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state,i=je(e),o=this._options.isCentered?this._options.isCentered(this):!0,n={x:t._referenceCoordinates.x-(i.x+t.originalWidth),y:i.y-t.originalHeight-t._referenceCoordinates.y};o&&t.activeHandlePosition.endsWith("-right")&&(n.x=i.x-(t._referenceCoordinates.x+t.originalWidth)),o&&(n.x*=2);let r=Math.abs(t.originalWidth+n.x),l=Math.abs(t.originalHeight+n.y);return(r/t.aspectRatio>l?"width":"height")=="width"?l=r/t.aspectRatio:r=l*t.aspectRatio,{width:Math.round(r),height:Math.round(l),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*r*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const i of t)e.appendChild(new C({tag:"div",attributes:{class:`ck-widget__resizer__handle ${Ke(i)}`}}).render())}_appendSizeUI(e){this._sizeView=new Be,this._sizeView.render(),e.appendChild(this._sizeView.element)}}function Ke(s){return`ck-widget__resizer__handle-${s}`}function je(s){return{x:s.pageX,y:s.pageY}}function $e(s){return s&&s.ownerDocument&&s.ownerDocument.contains(s)}class st extends E{_resizers=new Map;_observer;_redrawSelectedResizerThrottled;static get pluginName(){return"WidgetResize"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.editing,t=k.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),e.view.addObserver(H),this._observer=new(Y()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=re(()=>this.redrawSelectedResizer(),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",()=>{for(const[o,n]of this._resizers)o.isAttached()||(this._resizers.delete(o),n.destroy())},{priority:"lowest"}),this._observer.listenTo(k.window,"resize",this._redrawSelectedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",()=>{const o=i.getSelectedElement(),n=this.getResizerByViewElement(o)||null;n?this.select(n):this.deselect()})}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawSelectedResizerThrottled.cancel()}select(e){this.deselect(),this.selectedResizer=e,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(e){const t=new V(e),i=this.editor.plugins;if(t.attach(),i.has("WidgetToolbarRepository")){const r=i.get("WidgetToolbarRepository");t.on("begin",()=>{r.forceDisabled("resize")},{priority:"lowest"}),t.on("cancel",()=>{r.clearForceDisabled("resize")},{priority:"highest"}),t.on("commit",()=>{r.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(e.viewElement,t);const n=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(n)==t&&this.select(t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){const i=t.domTarget;V.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i)||null,this._activeResizer&&(this._activeResizer.begin(i),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}export{ae as WIDGET_CLASS_NAME,A as WIDGET_SELECTED_CLASS_NAME,ot as Widget,le as WidgetHighlightStack,st as WidgetResize,Oe as WidgetResizeState,V as WidgetResizer,nt as WidgetToolbarRepository,Ee as WidgetTypeAround,m as _WIDGET_TYPE_AROUND_SELECTION_ATTRIBUTE,Be as _WidgetSizeView,_e as _getClosestWidgetTypeAroundDomButton,ye as _getClosestWidgetViewElement,be as _getWidgetTypeAroundButtonPosition,w as _getWidgetTypeAroundFakeCaretPosition,me as calculateResizeHostAncestorWidth,we as calculateResizeHostPercentageWidth,it as findOptimalInsertionRange,ge as getLabel,_ as isTypeAroundWidget,p as isWidget,N as setHighlightHandling,ue as setLabel,et as toWidget,tt as toWidgetEditable,ke as verticalWidgetNavigationHandler};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__exports as a}from"../../../../../../../../_virtual/helpers.js";import M from"../../../../../../../../_virtual/___vite-browser-external.js";import{__require as j}from"../common/logging.js";var g;function $(){return g?a:(g=1,(function(i){var m={},_=a&&a.__createBinding||(Object.create?(function(n,e,t,o){o===void 0&&(o=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,o,r)}):(function(n,e,t,o){o===void 0&&(o=t),n[o]=e[t]})),v=a&&a.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),h=a&&a.__importStar||(function(){var n=function(e){return n=Object.getOwnPropertyNames||function(t){var o=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(o[o.length]=r);return o},n(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var o=n(e),r=0;r<o.length;r++)o[r]!=="default"&&_(t,e,o[r]);return v(t,e),t}})();Object.defineProperty(i,"__esModule",{value:!0}),i.validateNodeId=void 0,i.isComponent=f,i.parseNodeIds=b,i.parseFileKey=O,i.findComponentsInDocument=P,i.figmaUrlOfComponent=w,i.normalizePropName=C,i.exitWithFeedbackMessage=p;const y=h(M),l=j(),N=/^I?[0-9]+:[0-9]+(;[0-9]+:[0-9]+)*$/;function f(n){return n.type==="COMPONENT"||n.type==="COMPONENT_SET"}const I=function(n){const e=n.replace("-",":");return N.test(e)||(l.logger.error(`Invalid figma node URL: the provided node-id "${n}" is invalid`),p(1)),e};i.validateNodeId=I;function b(n){const e=[];for(const t of n){const r=y.parse(t,!0).query["node-id"];if(r&&typeof r=="string"){const u=(0,i.validateNodeId)(r);e.push(u)}else if(Array.isArray(r))for(const u of r){const d=(0,i.validateNodeId)(u);e.push(d)}}return e}function O(n){return n.match(/(?:file|design)\/([a-zA-Z0-9]+)/)?.[1]}function P(n,e){const t=[],o=n.children;for(const r of o){if(r.type!=="CANVAS")continue;const u=r.id,d=r.name,s=r.children;for(;s.length>0;){const c=s.pop();if(e&&e.includes(c.id)){if(!f(c))throw new Error("Specified node is not a component or a component set");t.push({...c,pageId:u,pageName:d})}!e&&f(c)&&t.push({...c,pageId:u,pageName:d}),Array.isArray(c.children)&&!f(c)&&s.push(...c.children)}}return t}function w(n,e){const t=m.FILE_URL||"https://figma.com/file/",r=n.id.replace(":","-").replace(":","-");return`${t}${e}/?node-id=${r}`}function C(n){return n.replace(/#[0-9:]*/g,"")}function p(n){l.logger.info("Please raise any bugs or feedback at https://github.com/figma/code-connect/issues."),process.exit(n)}})(a),a)}export{$ as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__exports as t}from"../../../../../../../../_virtual/external.js";import{__require as l}from"../connect/external_types.js";var i;function y(){return i?t:(i=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.textContent=e.className=e.nestedProps=e.string=e.enum=e.boolean=void 0,e.instanceType=r,e.instance=r,e.connect=a,e.children=c;const n=l();Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return n.booleanType}}),Object.defineProperty(e,"enum",{enumerable:!0,get:function(){return n.enumType}}),Object.defineProperty(e,"string",{enumerable:!0,get:function(){return n.stringType}}),Object.defineProperty(e,"nestedProps",{enumerable:!0,get:function(){return n.nestedPropsType}}),Object.defineProperty(e,"className",{enumerable:!0,get:function(){return n.classNameType}}),Object.defineProperty(e,"textContent",{enumerable:!0,get:function(){return n.textContentType}});function a(u,o){}function c(u){return{__tag:"HtmlTemplateString"}}function r(u){return{__tag:"HtmlTemplateString"}}})(t),t)}export{y as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__exports as t}from"../../../../../../../../_virtual/index_html2.js";import{__require as p}from"./external.js";import{__require as g}from"./template_literal.js";import{__require as v}from"../connect/index_common.js";var o;function j(){if(o)return t;o=1;var l=t&&t.__createBinding||(Object.create?(function(u,e,i,r){r===void 0&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(u,r,n)}):(function(u,e,i,r){r===void 0&&(r=i),u[r]=e[i]})),_=t&&t.__setModuleDefault||(Object.create?(function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}):function(u,e){u.default=e}),f=t&&t.__importStar||(function(){var u=function(e){return u=Object.getOwnPropertyNames||function(i){var r=[];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[r.length]=n);return r},u(e)};return function(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var r=u(e),n=0;n<r.length;n++)r[n]!=="default"&&l(i,e,r[n]);return _(i,e),i}})();Object.defineProperty(t,"__esModule",{value:!0}),t.html=t.client=t.figma=void 0;const c=f(p()),m=g(),s=(0,v().getClient)();t.client=s;const a=c;t.figma=a;const d=m.html;return t.html=d,t.default=a,t}export{j as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__exports as a}from"../../../../../../../../_virtual/external3.js";import{__require as s}from"../../../../../../react@19.2.0/node_modules/react/index.js";import{__require as p}from"../connect/external_types.js";var f;function P(){return f?a:(f=1,(function(t){var o=a&&a.__createBinding||(Object.create?(function(i,e,r,n){n===void 0&&(n=r);var u=Object.getOwnPropertyDescriptor(e,r);(!u||("get"in u?!e.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(i,n,u)}):(function(i,e,r,n){n===void 0&&(n=r),i[n]=e[r]})),l=a&&a.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),_=a&&a.__importStar||(function(){var i=function(e){return i=Object.getOwnPropertyNames||function(r){var n=[];for(var u in r)Object.prototype.hasOwnProperty.call(r,u)&&(n[n.length]=u);return n},i(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=i(e),u=0;u<n.length;u++)n[u]!=="default"&&o(r,e,n[u]);return l(r,e),r}})();Object.defineProperty(t,"__esModule",{value:!0}),t.instance=t.textContent=t.className=t.nestedProps=t.string=t.enum=t.boolean=void 0,t.connect=d,t.children=y;const b=_(s()),c=p();Object.defineProperty(t,"boolean",{enumerable:!0,get:function(){return c.booleanType}}),Object.defineProperty(t,"enum",{enumerable:!0,get:function(){return c.enumType}}),Object.defineProperty(t,"string",{enumerable:!0,get:function(){return c.stringType}}),Object.defineProperty(t,"nestedProps",{enumerable:!0,get:function(){return c.nestedPropsType}}),Object.defineProperty(t,"className",{enumerable:!0,get:function(){return c.classNameType}}),Object.defineProperty(t,"textContent",{enumerable:!0,get:function(){return c.textContentType}}),Object.defineProperty(t,"instance",{enumerable:!0,get:function(){return c.instanceType}});function d(i,e,r){}function y(i){return b.createElement("div")}})(a),a)}export{P as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__exports as n}from"../../../../../../../../_virtual/index_react2.js";import{__require as s}from"./external.js";import{__require as p}from"../connect/index_common.js";var o;function O(){if(o)return n;o=1;var c=n&&n.__createBinding||(Object.create?(function(u,e,i,r){r===void 0&&(r=i);var t=Object.getOwnPropertyDescriptor(e,i);(!t||("get"in t?!e.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(u,r,t)}):(function(u,e,i,r){r===void 0&&(r=i),u[r]=e[i]})),f=n&&n.__setModuleDefault||(Object.create?(function(u,e){Object.defineProperty(u,"default",{enumerable:!0,value:e})}):function(u,e){u.default=e}),_=n&&n.__importStar||(function(){var u=function(e){return u=Object.getOwnPropertyNames||function(i){var r=[];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(r[r.length]=t);return r},u(e)};return function(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var r=u(e),t=0;t<r.length;t++)r[t]!=="default"&&c(i,e,r[t]);return f(i,e),i}})();Object.defineProperty(n,"__esModule",{value:!0}),n.client=n.figma=void 0;const l=_(s()),d=(0,p().getClient)();n.client=d;const a=l;return n.figma=a,n.default=a,n}export{O as __require};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="1.3.6",o={version:e};export{o as default,e as version};
|
package/dist/node_modules/.pnpm/color-convert@3.1.0/node_modules/color-convert/conversions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import g from"../../../color-name@2.0.0/node_modules/color-name/index.js";const M={};for(const n of Object.keys(g))M[g[n]]=n;const a={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},f=(6/29)**3;function b(n){const o=n>.0031308?1.055*n**.4166666666666667-.055:n*12.92;return Math.min(Math.max(0,o),1)}function m(n){return n>.04045?((n+.055)/1.055)**2.4:n/12.92}for(const n of Object.keys(a)){if(!("channels"in a[n]))throw new Error("missing channels property: "+n);if(!("labels"in a[n]))throw new Error("missing channel labels property: "+n);if(a[n].labels.length!==a[n].channels)throw new Error("channel and label counts mismatch: "+n);const{channels:o,labels:s}=a[n];delete a[n].channels,delete a[n].labels,Object.defineProperty(a[n],"channels",{value:o}),Object.defineProperty(a[n],"labels",{value:s})}a.rgb.hsl=function(n){const o=n[0]/255,s=n[1]/255,c=n[2]/255,t=Math.min(o,s,c),e=Math.max(o,s,c),r=e-t;let l,_;switch(e){case t:{l=0;break}case o:{l=(s-c)/r;break}case s:{l=2+(c-o)/r;break}case c:{l=4+(o-s)/r;break}}l=Math.min(l*60,360),l<0&&(l+=360);const i=(t+e)/2;return e===t?_=0:i<=.5?_=r/(e+t):_=r/(2-e-t),[l,_*100,i*100]};a.rgb.hsv=function(n){let o,s,c,t,e;const r=n[0]/255,l=n[1]/255,_=n[2]/255,i=Math.max(r,l,_),u=i-Math.min(r,l,_),h=function(k){return(i-k)/6/u+1/2};if(u===0)t=0,e=0;else{switch(e=u/i,o=h(r),s=h(l),c=h(_),i){case r:{t=c-s;break}case l:{t=1/3+o-c;break}case _:{t=2/3+s-o;break}}t<0?t+=1:t>1&&(t-=1)}return[t*360,e*100,i*100]};a.rgb.hwb=function(n){const o=n[0],s=n[1];let c=n[2];const t=a.rgb.hsl(n)[0],e=1/255*Math.min(o,Math.min(s,c));return c=1-1/255*Math.max(o,Math.max(s,c)),[t,e*100,c*100]};a.rgb.oklab=function(n){const o=m(n[0]/255),s=m(n[1]/255),c=m(n[2]/255),t=Math.cbrt(.4122214708*o+.5363325363*s+.0514459929*c),e=Math.cbrt(.2119034982*o+.6806995451*s+.1073969566*c),r=Math.cbrt(.0883024619*o+.2817188376*s+.6299787005*c),l=.2104542553*t+.793617785*e-.0040720468*r,_=1.9779984951*t-2.428592205*e+.4505937099*r,i=.0259040371*t+.7827717662*e-.808675766*r;return[l*100,_*100,i*100]};a.rgb.cmyk=function(n){const o=n[0]/255,s=n[1]/255,c=n[2]/255,t=Math.min(1-o,1-s,1-c),e=(1-o-t)/(1-t)||0,r=(1-s-t)/(1-t)||0,l=(1-c-t)/(1-t)||0;return[e*100,r*100,l*100,t*100]};function y(n,o){return(n[0]-o[0])**2+(n[1]-o[1])**2+(n[2]-o[2])**2}a.rgb.keyword=function(n){const o=M[n];if(o)return o;let s=Number.POSITIVE_INFINITY,c;for(const t of Object.keys(g)){const e=g[t],r=y(n,e);r<s&&(s=r,c=t)}return c};a.keyword.rgb=function(n){return g[n]};a.rgb.xyz=function(n){const o=m(n[0]/255),s=m(n[1]/255),c=m(n[2]/255),t=o*.4124564+s*.3575761+c*.1804375,e=o*.2126729+s*.7151522+c*.072175,r=o*.0193339+s*.119192+c*.9503041;return[t*100,e*100,r*100]};a.rgb.lab=function(n){const o=a.rgb.xyz(n);let s=o[0],c=o[1],t=o[2];s/=95.047,c/=100,t/=108.883,s=s>f?s**(1/3):7.787*s+16/116,c=c>f?c**(1/3):7.787*c+16/116,t=t>f?t**(1/3):7.787*t+16/116;const e=116*c-16,r=500*(s-c),l=200*(c-t);return[e,r,l]};a.hsl.rgb=function(n){const o=n[0]/360,s=n[1]/100,c=n[2]/100;let t,e;if(s===0)return e=c*255,[e,e,e];const r=c<.5?c*(1+s):c+s-c*s,l=2*c-r,_=[0,0,0];for(let i=0;i<3;i++)t=o+1/3*-(i-1),t<0&&t++,t>1&&t--,6*t<1?e=l+(r-l)*6*t:2*t<1?e=r:3*t<2?e=l+(r-l)*(2/3-t)*6:e=l,_[i]=e*255;return _};a.hsl.hsv=function(n){const o=n[0];let s=n[1]/100,c=n[2]/100,t=s;const e=Math.max(c,.01);c*=2,s*=c<=1?c:2-c,t*=e<=1?e:2-e;const r=(c+s)/2,l=c===0?2*t/(e+t):2*s/(c+s);return[o,l*100,r*100]};a.hsv.rgb=function(n){const o=n[0]/60,s=n[1]/100;let c=n[2]/100;const t=Math.floor(o)%6,e=o-Math.floor(o),r=255*c*(1-s),l=255*c*(1-s*e),_=255*c*(1-s*(1-e));switch(c*=255,t){case 0:return[c,_,r];case 1:return[l,c,r];case 2:return[r,c,_];case 3:return[r,l,c];case 4:return[_,r,c];case 5:return[c,r,l]}};a.hsv.hsl=function(n){const o=n[0],s=n[1]/100,c=n[2]/100,t=Math.max(c,.01);let e,r;r=(2-s)*c;const l=(2-s)*t;return e=s*t,e/=l<=1?l:2-l,e=e||0,r/=2,[o,e*100,r*100]};a.hwb.rgb=function(n){const o=n[0]/360;let s=n[1]/100,c=n[2]/100;const t=s+c;let e;t>1&&(s/=t,c/=t);const r=Math.floor(6*o),l=1-c;e=6*o-r,(r&1)!==0&&(e=1-e);const _=s+e*(l-s);let i,u,h;switch(r){default:case 6:case 0:{i=l,u=_,h=s;break}case 1:{i=_,u=l,h=s;break}case 2:{i=s,u=l,h=_;break}case 3:{i=s,u=_,h=l;break}case 4:{i=_,u=s,h=l;break}case 5:{i=l,u=s,h=_;break}}return[i*255,u*255,h*255]};a.cmyk.rgb=function(n){const o=n[0]/100,s=n[1]/100,c=n[2]/100,t=n[3]/100,e=1-Math.min(1,o*(1-t)+t),r=1-Math.min(1,s*(1-t)+t),l=1-Math.min(1,c*(1-t)+t);return[e*255,r*255,l*255]};a.xyz.rgb=function(n){const o=n[0]/100,s=n[1]/100,c=n[2]/100;let t,e,r;return t=o*3.2404542+s*-1.5371385+c*-.4985314,e=o*-.969266+s*1.8760108+c*.041556,r=o*.0556434+s*-.2040259+c*1.0572252,t=b(t),e=b(e),r=b(r),[t*255,e*255,r*255]};a.xyz.lab=function(n){let o=n[0],s=n[1],c=n[2];o/=95.047,s/=100,c/=108.883,o=o>f?o**(1/3):7.787*o+16/116,s=s>f?s**(1/3):7.787*s+16/116,c=c>f?c**(1/3):7.787*c+16/116;const t=116*s-16,e=500*(o-s),r=200*(s-c);return[t,e,r]};a.xyz.oklab=function(n){const o=n[0]/100,s=n[1]/100,c=n[2]/100,t=Math.cbrt(.8189330101*o+.3618667424*s-.1288597137*c),e=Math.cbrt(.0329845436*o+.9293118715*s+.0361456387*c),r=Math.cbrt(.0482003018*o+.2643662691*s+.633851707*c),l=.2104542553*t+.793617785*e-.0040720468*r,_=1.9779984951*t-2.428592205*e+.4505937099*r,i=.0259040371*t+.7827717662*e-.808675766*r;return[l*100,_*100,i*100]};a.oklab.oklch=function(n){return a.lab.lch(n)};a.oklab.xyz=function(n){const o=n[0]/100,s=n[1]/100,c=n[2]/100,t=(.999999998*o+.396337792*s+.215803758*c)**3,e=(1.000000008*o-.105561342*s-.063854175*c)**3,r=(1.000000055*o-.089484182*s-1.291485538*c)**3,l=1.227013851*t-.55779998*e+.281256149*r,_=-.040580178*t+1.11225687*e-.071676679*r,i=-.076381285*t-.421481978*e+1.58616322*r;return[l*100,_*100,i*100]};a.oklab.rgb=function(n){const o=n[0]/100,s=n[1]/100,c=n[2]/100,t=(o+.3963377774*s+.2158037573*c)**3,e=(o-.1055613458*s-.0638541728*c)**3,r=(o-.0894841775*s-1.291485548*c)**3,l=b(4.0767416621*t-3.3077115913*e+.2309699292*r),_=b(-1.2684380046*t+2.6097574011*e-.3413193965*r),i=b(-.0041960863*t-.7034186147*e+1.707614701*r);return[l*255,_*255,i*255]};a.oklch.oklab=function(n){return a.lch.lab(n)};a.lab.xyz=function(n){const o=n[0],s=n[1],c=n[2];let t,e,r;e=(o+16)/116,t=s/500+e,r=e-c/200;const l=e**3,_=t**3,i=r**3;return e=l>f?l:(e-16/116)/7.787,t=_>f?_:(t-16/116)/7.787,r=i>f?i:(r-16/116)/7.787,t*=95.047,e*=100,r*=108.883,[t,e,r]};a.lab.lch=function(n){const o=n[0],s=n[1],c=n[2];let t;t=Math.atan2(c,s)*360/2/Math.PI,t<0&&(t+=360);const r=Math.sqrt(s*s+c*c);return[o,r,t]};a.lch.lab=function(n){const o=n[0],s=n[1],t=n[2]/360*2*Math.PI,e=s*Math.cos(t),r=s*Math.sin(t);return[o,e,r]};a.rgb.ansi16=function(n,o=null){const[s,c,t]=n;let e=o===null?a.rgb.hsv(n)[2]:o;if(e=Math.round(e/50),e===0)return 30;let r=30+(Math.round(t/255)<<2|Math.round(c/255)<<1|Math.round(s/255));return e===2&&(r+=60),r};a.hsv.ansi16=function(n){return a.rgb.ansi16(a.hsv.rgb(n),n[2])};a.rgb.ansi256=function(n){const o=n[0],s=n[1],c=n[2];return o>>4===s>>4&&s>>4===c>>4?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(s/255*5)+Math.round(c/255*5)};a.ansi16.rgb=function(n){n=n[0];let o=n%10;if(o===0||o===7)return n>50&&(o+=3.5),o=o/10.5*255,[o,o,o];const s=(Math.trunc(n>50)+1)*.5,c=(o&1)*s*255,t=(o>>1&1)*s*255,e=(o>>2&1)*s*255;return[c,t,e]};a.ansi256.rgb=function(n){if(n=n[0],n>=232){const e=(n-232)*10+8;return[e,e,e]}n-=16;let o;const s=Math.floor(n/36)/5*255,c=Math.floor((o=n%36)/6)/5*255,t=o%6/5*255;return[s,c,t]};a.rgb.hex=function(n){const s=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".slice(s.length)+s};a.hex.rgb=function(n){const o=n.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!o)return[0,0,0];let s=o[0];o[0].length===3&&(s=[...s].map(l=>l+l).join(""));const c=Number.parseInt(s,16),t=c>>16&255,e=c>>8&255,r=c&255;return[t,e,r]};a.rgb.hcg=function(n){const o=n[0]/255,s=n[1]/255,c=n[2]/255,t=Math.max(Math.max(o,s),c),e=Math.min(Math.min(o,s),c),r=t-e;let l;const _=r<1?e/(1-r):0;return r<=0?l=0:t===o?l=(s-c)/r%6:t===s?l=2+(c-o)/r:l=4+(o-s)/r,l/=6,l%=1,[l*360,r*100,_*100]};a.hsl.hcg=function(n){const o=n[1]/100,s=n[2]/100,c=s<.5?2*o*s:2*o*(1-s);let t=0;return c<1&&(t=(s-.5*c)/(1-c)),[n[0],c*100,t*100]};a.hsv.hcg=function(n){const o=n[1]/100,s=n[2]/100,c=o*s;let t=0;return c<1&&(t=(s-c)/(1-c)),[n[0],c*100,t*100]};a.hcg.rgb=function(n){const o=n[0]/360,s=n[1]/100,c=n[2]/100;if(s===0)return[c*255,c*255,c*255];const t=[0,0,0],e=o%1*6,r=e%1,l=1-r;let _=0;switch(Math.floor(e)){case 0:{t[0]=1,t[1]=r,t[2]=0;break}case 1:{t[0]=l,t[1]=1,t[2]=0;break}case 2:{t[0]=0,t[1]=1,t[2]=r;break}case 3:{t[0]=0,t[1]=l,t[2]=1;break}case 4:{t[0]=r,t[1]=0,t[2]=1;break}default:t[0]=1,t[1]=0,t[2]=l}return _=(1-s)*c,[(s*t[0]+_)*255,(s*t[1]+_)*255,(s*t[2]+_)*255]};a.hcg.hsv=function(n){const o=n[1]/100,s=n[2]/100,c=o+s*(1-o);let t=0;return c>0&&(t=o/c),[n[0],t*100,c*100]};a.hcg.hsl=function(n){const o=n[1]/100,c=n[2]/100*(1-o)+.5*o;let t=0;return c>0&&c<.5?t=o/(2*c):c>=.5&&c<1&&(t=o/(2*(1-c))),[n[0],t*100,c*100]};a.hcg.hwb=function(n){const o=n[1]/100,s=n[2]/100,c=o+s*(1-o);return[n[0],(c-o)*100,(1-c)*100]};a.hwb.hcg=function(n){const o=n[1]/100,c=1-n[2]/100,t=c-o;let e=0;return t<1&&(e=(c-t)/(1-t)),[n[0],t*100,e*100]};a.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};a.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};a.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};a.gray.hsl=function(n){return[0,0,n[0]]};a.gray.hsv=a.gray.hsl;a.gray.hwb=function(n){return[0,100,n[0]]};a.gray.cmyk=function(n){return[0,0,0,n[0]]};a.gray.lab=function(n){return[n[0],0,0]};a.gray.hex=function(n){const o=Math.round(n[0]/100*255)&255,c=((o<<16)+(o<<8)+o).toString(16).toUpperCase();return"000000".slice(c.length)+c};a.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]};export{a as default};
|
|
1
|
+
import g from"../../../color-name@2.0.2/node_modules/color-name/index.js";const M={};for(const n of Object.keys(g))M[g[n]]=n;const a={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},f=(6/29)**3;function b(n){const o=n>.0031308?1.055*n**.4166666666666667-.055:n*12.92;return Math.min(Math.max(0,o),1)}function m(n){return n>.04045?((n+.055)/1.055)**2.4:n/12.92}for(const n of Object.keys(a)){if(!("channels"in a[n]))throw new Error("missing channels property: "+n);if(!("labels"in a[n]))throw new Error("missing channel labels property: "+n);if(a[n].labels.length!==a[n].channels)throw new Error("channel and label counts mismatch: "+n);const{channels:o,labels:s}=a[n];delete a[n].channels,delete a[n].labels,Object.defineProperty(a[n],"channels",{value:o}),Object.defineProperty(a[n],"labels",{value:s})}a.rgb.hsl=function(n){const o=n[0]/255,s=n[1]/255,c=n[2]/255,t=Math.min(o,s,c),e=Math.max(o,s,c),r=e-t;let l,_;switch(e){case t:{l=0;break}case o:{l=(s-c)/r;break}case s:{l=2+(c-o)/r;break}case c:{l=4+(o-s)/r;break}}l=Math.min(l*60,360),l<0&&(l+=360);const i=(t+e)/2;return e===t?_=0:i<=.5?_=r/(e+t):_=r/(2-e-t),[l,_*100,i*100]};a.rgb.hsv=function(n){let o,s,c,t,e;const r=n[0]/255,l=n[1]/255,_=n[2]/255,i=Math.max(r,l,_),u=i-Math.min(r,l,_),h=function(k){return(i-k)/6/u+1/2};if(u===0)t=0,e=0;else{switch(e=u/i,o=h(r),s=h(l),c=h(_),i){case r:{t=c-s;break}case l:{t=1/3+o-c;break}case _:{t=2/3+s-o;break}}t<0?t+=1:t>1&&(t-=1)}return[t*360,e*100,i*100]};a.rgb.hwb=function(n){const o=n[0],s=n[1];let c=n[2];const t=a.rgb.hsl(n)[0],e=1/255*Math.min(o,Math.min(s,c));return c=1-1/255*Math.max(o,Math.max(s,c)),[t,e*100,c*100]};a.rgb.oklab=function(n){const o=m(n[0]/255),s=m(n[1]/255),c=m(n[2]/255),t=Math.cbrt(.4122214708*o+.5363325363*s+.0514459929*c),e=Math.cbrt(.2119034982*o+.6806995451*s+.1073969566*c),r=Math.cbrt(.0883024619*o+.2817188376*s+.6299787005*c),l=.2104542553*t+.793617785*e-.0040720468*r,_=1.9779984951*t-2.428592205*e+.4505937099*r,i=.0259040371*t+.7827717662*e-.808675766*r;return[l*100,_*100,i*100]};a.rgb.cmyk=function(n){const o=n[0]/255,s=n[1]/255,c=n[2]/255,t=Math.min(1-o,1-s,1-c),e=(1-o-t)/(1-t)||0,r=(1-s-t)/(1-t)||0,l=(1-c-t)/(1-t)||0;return[e*100,r*100,l*100,t*100]};function y(n,o){return(n[0]-o[0])**2+(n[1]-o[1])**2+(n[2]-o[2])**2}a.rgb.keyword=function(n){const o=M[n];if(o)return o;let s=Number.POSITIVE_INFINITY,c;for(const t of Object.keys(g)){const e=g[t],r=y(n,e);r<s&&(s=r,c=t)}return c};a.keyword.rgb=function(n){return g[n]};a.rgb.xyz=function(n){const o=m(n[0]/255),s=m(n[1]/255),c=m(n[2]/255),t=o*.4124564+s*.3575761+c*.1804375,e=o*.2126729+s*.7151522+c*.072175,r=o*.0193339+s*.119192+c*.9503041;return[t*100,e*100,r*100]};a.rgb.lab=function(n){const o=a.rgb.xyz(n);let s=o[0],c=o[1],t=o[2];s/=95.047,c/=100,t/=108.883,s=s>f?s**(1/3):7.787*s+16/116,c=c>f?c**(1/3):7.787*c+16/116,t=t>f?t**(1/3):7.787*t+16/116;const e=116*c-16,r=500*(s-c),l=200*(c-t);return[e,r,l]};a.hsl.rgb=function(n){const o=n[0]/360,s=n[1]/100,c=n[2]/100;let t,e;if(s===0)return e=c*255,[e,e,e];const r=c<.5?c*(1+s):c+s-c*s,l=2*c-r,_=[0,0,0];for(let i=0;i<3;i++)t=o+1/3*-(i-1),t<0&&t++,t>1&&t--,6*t<1?e=l+(r-l)*6*t:2*t<1?e=r:3*t<2?e=l+(r-l)*(2/3-t)*6:e=l,_[i]=e*255;return _};a.hsl.hsv=function(n){const o=n[0];let s=n[1]/100,c=n[2]/100,t=s;const e=Math.max(c,.01);c*=2,s*=c<=1?c:2-c,t*=e<=1?e:2-e;const r=(c+s)/2,l=c===0?2*t/(e+t):2*s/(c+s);return[o,l*100,r*100]};a.hsv.rgb=function(n){const o=n[0]/60,s=n[1]/100;let c=n[2]/100;const t=Math.floor(o)%6,e=o-Math.floor(o),r=255*c*(1-s),l=255*c*(1-s*e),_=255*c*(1-s*(1-e));switch(c*=255,t){case 0:return[c,_,r];case 1:return[l,c,r];case 2:return[r,c,_];case 3:return[r,l,c];case 4:return[_,r,c];case 5:return[c,r,l]}};a.hsv.hsl=function(n){const o=n[0],s=n[1]/100,c=n[2]/100,t=Math.max(c,.01);let e,r;r=(2-s)*c;const l=(2-s)*t;return e=s*t,e/=l<=1?l:2-l,e=e||0,r/=2,[o,e*100,r*100]};a.hwb.rgb=function(n){const o=n[0]/360;let s=n[1]/100,c=n[2]/100;const t=s+c;let e;t>1&&(s/=t,c/=t);const r=Math.floor(6*o),l=1-c;e=6*o-r,(r&1)!==0&&(e=1-e);const _=s+e*(l-s);let i,u,h;switch(r){default:case 6:case 0:{i=l,u=_,h=s;break}case 1:{i=_,u=l,h=s;break}case 2:{i=s,u=l,h=_;break}case 3:{i=s,u=_,h=l;break}case 4:{i=_,u=s,h=l;break}case 5:{i=l,u=s,h=_;break}}return[i*255,u*255,h*255]};a.cmyk.rgb=function(n){const o=n[0]/100,s=n[1]/100,c=n[2]/100,t=n[3]/100,e=1-Math.min(1,o*(1-t)+t),r=1-Math.min(1,s*(1-t)+t),l=1-Math.min(1,c*(1-t)+t);return[e*255,r*255,l*255]};a.xyz.rgb=function(n){const o=n[0]/100,s=n[1]/100,c=n[2]/100;let t,e,r;return t=o*3.2404542+s*-1.5371385+c*-.4985314,e=o*-.969266+s*1.8760108+c*.041556,r=o*.0556434+s*-.2040259+c*1.0572252,t=b(t),e=b(e),r=b(r),[t*255,e*255,r*255]};a.xyz.lab=function(n){let o=n[0],s=n[1],c=n[2];o/=95.047,s/=100,c/=108.883,o=o>f?o**(1/3):7.787*o+16/116,s=s>f?s**(1/3):7.787*s+16/116,c=c>f?c**(1/3):7.787*c+16/116;const t=116*s-16,e=500*(o-s),r=200*(s-c);return[t,e,r]};a.xyz.oklab=function(n){const o=n[0]/100,s=n[1]/100,c=n[2]/100,t=Math.cbrt(.8189330101*o+.3618667424*s-.1288597137*c),e=Math.cbrt(.0329845436*o+.9293118715*s+.0361456387*c),r=Math.cbrt(.0482003018*o+.2643662691*s+.633851707*c),l=.2104542553*t+.793617785*e-.0040720468*r,_=1.9779984951*t-2.428592205*e+.4505937099*r,i=.0259040371*t+.7827717662*e-.808675766*r;return[l*100,_*100,i*100]};a.oklab.oklch=function(n){return a.lab.lch(n)};a.oklab.xyz=function(n){const o=n[0]/100,s=n[1]/100,c=n[2]/100,t=(.999999998*o+.396337792*s+.215803758*c)**3,e=(1.000000008*o-.105561342*s-.063854175*c)**3,r=(1.000000055*o-.089484182*s-1.291485538*c)**3,l=1.227013851*t-.55779998*e+.281256149*r,_=-.040580178*t+1.11225687*e-.071676679*r,i=-.076381285*t-.421481978*e+1.58616322*r;return[l*100,_*100,i*100]};a.oklab.rgb=function(n){const o=n[0]/100,s=n[1]/100,c=n[2]/100,t=(o+.3963377774*s+.2158037573*c)**3,e=(o-.1055613458*s-.0638541728*c)**3,r=(o-.0894841775*s-1.291485548*c)**3,l=b(4.0767416621*t-3.3077115913*e+.2309699292*r),_=b(-1.2684380046*t+2.6097574011*e-.3413193965*r),i=b(-.0041960863*t-.7034186147*e+1.707614701*r);return[l*255,_*255,i*255]};a.oklch.oklab=function(n){return a.lch.lab(n)};a.lab.xyz=function(n){const o=n[0],s=n[1],c=n[2];let t,e,r;e=(o+16)/116,t=s/500+e,r=e-c/200;const l=e**3,_=t**3,i=r**3;return e=l>f?l:(e-16/116)/7.787,t=_>f?_:(t-16/116)/7.787,r=i>f?i:(r-16/116)/7.787,t*=95.047,e*=100,r*=108.883,[t,e,r]};a.lab.lch=function(n){const o=n[0],s=n[1],c=n[2];let t;t=Math.atan2(c,s)*360/2/Math.PI,t<0&&(t+=360);const r=Math.sqrt(s*s+c*c);return[o,r,t]};a.lch.lab=function(n){const o=n[0],s=n[1],t=n[2]/360*2*Math.PI,e=s*Math.cos(t),r=s*Math.sin(t);return[o,e,r]};a.rgb.ansi16=function(n,o=null){const[s,c,t]=n;let e=o===null?a.rgb.hsv(n)[2]:o;if(e=Math.round(e/50),e===0)return 30;let r=30+(Math.round(t/255)<<2|Math.round(c/255)<<1|Math.round(s/255));return e===2&&(r+=60),r};a.hsv.ansi16=function(n){return a.rgb.ansi16(a.hsv.rgb(n),n[2])};a.rgb.ansi256=function(n){const o=n[0],s=n[1],c=n[2];return o>>4===s>>4&&s>>4===c>>4?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(s/255*5)+Math.round(c/255*5)};a.ansi16.rgb=function(n){n=n[0];let o=n%10;if(o===0||o===7)return n>50&&(o+=3.5),o=o/10.5*255,[o,o,o];const s=(Math.trunc(n>50)+1)*.5,c=(o&1)*s*255,t=(o>>1&1)*s*255,e=(o>>2&1)*s*255;return[c,t,e]};a.ansi256.rgb=function(n){if(n=n[0],n>=232){const e=(n-232)*10+8;return[e,e,e]}n-=16;let o;const s=Math.floor(n/36)/5*255,c=Math.floor((o=n%36)/6)/5*255,t=o%6/5*255;return[s,c,t]};a.rgb.hex=function(n){const s=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".slice(s.length)+s};a.hex.rgb=function(n){const o=n.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!o)return[0,0,0];let s=o[0];o[0].length===3&&(s=[...s].map(l=>l+l).join(""));const c=Number.parseInt(s,16),t=c>>16&255,e=c>>8&255,r=c&255;return[t,e,r]};a.rgb.hcg=function(n){const o=n[0]/255,s=n[1]/255,c=n[2]/255,t=Math.max(Math.max(o,s),c),e=Math.min(Math.min(o,s),c),r=t-e;let l;const _=r<1?e/(1-r):0;return r<=0?l=0:t===o?l=(s-c)/r%6:t===s?l=2+(c-o)/r:l=4+(o-s)/r,l/=6,l%=1,[l*360,r*100,_*100]};a.hsl.hcg=function(n){const o=n[1]/100,s=n[2]/100,c=s<.5?2*o*s:2*o*(1-s);let t=0;return c<1&&(t=(s-.5*c)/(1-c)),[n[0],c*100,t*100]};a.hsv.hcg=function(n){const o=n[1]/100,s=n[2]/100,c=o*s;let t=0;return c<1&&(t=(s-c)/(1-c)),[n[0],c*100,t*100]};a.hcg.rgb=function(n){const o=n[0]/360,s=n[1]/100,c=n[2]/100;if(s===0)return[c*255,c*255,c*255];const t=[0,0,0],e=o%1*6,r=e%1,l=1-r;let _=0;switch(Math.floor(e)){case 0:{t[0]=1,t[1]=r,t[2]=0;break}case 1:{t[0]=l,t[1]=1,t[2]=0;break}case 2:{t[0]=0,t[1]=1,t[2]=r;break}case 3:{t[0]=0,t[1]=l,t[2]=1;break}case 4:{t[0]=r,t[1]=0,t[2]=1;break}default:t[0]=1,t[1]=0,t[2]=l}return _=(1-s)*c,[(s*t[0]+_)*255,(s*t[1]+_)*255,(s*t[2]+_)*255]};a.hcg.hsv=function(n){const o=n[1]/100,s=n[2]/100,c=o+s*(1-o);let t=0;return c>0&&(t=o/c),[n[0],t*100,c*100]};a.hcg.hsl=function(n){const o=n[1]/100,c=n[2]/100*(1-o)+.5*o;let t=0;return c>0&&c<.5?t=o/(2*c):c>=.5&&c<1&&(t=o/(2*(1-c))),[n[0],t*100,c*100]};a.hcg.hwb=function(n){const o=n[1]/100,s=n[2]/100,c=o+s*(1-o);return[n[0],(c-o)*100,(1-c)*100]};a.hwb.hcg=function(n){const o=n[1]/100,c=1-n[2]/100,t=c-o;let e=0;return t<1&&(e=(c-t)/(1-t)),[n[0],t*100,e*100]};a.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};a.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};a.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};a.gray.hsl=function(n){return[0,0,n[0]]};a.gray.hsv=a.gray.hsl;a.gray.hwb=function(n){return[0,100,n[0]]};a.gray.cmyk=function(n){return[0,0,0,n[0]]};a.gray.lab=function(n){return[n[0],0,0]};a.gray.hex=function(n){const o=Math.round(n[0]/100*255)&255,c=((o<<16)+(o<<8)+o).toString(16).toUpperCase();return"000000".slice(c.length)+c};a.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import f from"../../../color-name@2.0.
|
|
1
|
+
import f from"../../../color-name@2.0.2/node_modules/color-name/index.js";const b=Object.create(null);for(const t in f)Object.hasOwn(f,t)&&(b[f[t]]=t);const a={to:{},get:{}};a.get=function(t){const o=t.slice(0,3).toLowerCase();let n,u;switch(o){case"hsl":{n=a.get.hsl(t),u="hsl";break}case"hwb":{n=a.get.hwb(t),u="hwb";break}default:{n=a.get.rgb(t),u="rgb";break}}return n?{model:u,value:n}:null};a.get.rgb=function(t){if(!t)return null;const o=/^#([a-f\d]{3,4})$/i,n=/^#([a-f\d]{6})([a-f\d]{2})?$/i,u=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,d=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,h=/^(\w+)$/;let s=[0,0,0,1],e,r,l;if(e=t.match(n)){for(l=e[2],e=e[1],r=0;r<3;r++){const i=r*2;s[r]=Number.parseInt(e.slice(i,i+2),16)}l&&(s[3]=Number.parseInt(l,16)/255)}else if(e=t.match(o)){for(e=e[1],l=e[3],r=0;r<3;r++)s[r]=Number.parseInt(e[r]+e[r],16);l&&(s[3]=Number.parseInt(l+l,16)/255)}else if(e=t.match(u)){for(r=0;r<3;r++)s[r]=Number.parseInt(e[r+1],10);e[4]&&(s[3]=e[5]?Number.parseFloat(e[4])*.01:Number.parseFloat(e[4]))}else if(e=t.match(d)){for(r=0;r<3;r++)s[r]=Math.round(Number.parseFloat(e[r+1])*2.55);e[4]&&(s[3]=e[5]?Number.parseFloat(e[4])*.01:Number.parseFloat(e[4]))}else return(e=t.match(h))?e[1]==="transparent"?[0,0,0,0]:Object.hasOwn(f,e[1])?(s=f[e[1]],s[3]=1,s):null:null;for(r=0;r<3;r++)s[r]=c(s[r],0,255);return s[3]=c(s[3],0,1),s};a.get.hsl=function(t){if(!t)return null;const o=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=t.match(o);if(n){const u=Number.parseFloat(n[4]),d=(Number.parseFloat(n[1])%360+360)%360,h=c(Number.parseFloat(n[2]),0,100),s=c(Number.parseFloat(n[3]),0,100),e=c(Number.isNaN(u)?1:u,0,1);return[d,h,s,e]}return null};a.get.hwb=function(t){if(!t)return null;const o=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=t.match(o);if(n){const u=Number.parseFloat(n[4]),d=(Number.parseFloat(n[1])%360+360)%360,h=c(Number.parseFloat(n[2]),0,100),s=c(Number.parseFloat(n[3]),0,100),e=c(Number.isNaN(u)?1:u,0,1);return[d,h,s,e]}return null};a.to.hex=function(...t){return"#"+m(t[0])+m(t[1])+m(t[2])+(t[3]<1?m(Math.round(t[3]*255)):"")};a.to.rgb=function(...t){return t.length<4||t[3]===1?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"};a.to.rgb.percent=function(...t){const o=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),u=Math.round(t[2]/255*100);return t.length<4||t[3]===1?"rgb("+o+"%, "+n+"%, "+u+"%)":"rgba("+o+"%, "+n+"%, "+u+"%, "+t[3]+")"};a.to.hsl=function(...t){return t.length<4||t[3]===1?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};a.to.hwb=function(...t){let o="";return t.length>=4&&t[3]!==1&&(o=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+o+")"};a.to.keyword=function(...t){return b[t.slice(0,3)]};function c(t,o,n){return Math.min(Math.max(o,t),n)}function m(t){const o=Math.round(t).toString(16).toUpperCase();return o.length<2?"0"+o:o}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import l,{validateMetadata as h}from"./metadata.js";import d from"./isPossible.js";import v from"./isValid.js";import w from"./helpers/getNumberType.js";import P from"./helpers/getPossibleCountriesForNumber.js";import C from"./helpers/extractCountryCallingCode.js";import s from"./helpers/isObject.js";import E from"./format.js";function o(r){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(r)}function f(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),e.push.apply(e,n)}return e}function c(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?f(Object(e),!0).forEach(function(n){j(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):f(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function j(r,t,e){return(t=y(t))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function O(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function k(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,y(n.key),n)}}function N(r,t,e){return t&&k(r.prototype,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function y(r){var t=T(r,"string");return o(t)=="symbol"?t:t+""}function T(r,t){if(o(r)!="object"||!r)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t);if(o(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}var U=(function(){function r(t,e,n){if(O(this,r),!t)throw new TypeError("First argument is required");if(typeof t!="string")throw new TypeError("First argument must be a string");if(t[0]==="+"&&!e)throw new TypeError("`metadata` argument not passed");if(s(e)&&s(e.countries)){n=e;var i=t;if(!_.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var u=C(i,void 0,void 0,n),m=u.countryCallingCode,p=u.number;if(e=p,t=m,!e)throw new Error("Invalid `number` argument passed: too short")}if(!e)throw new TypeError("`nationalNumber` argument is required");if(typeof e!="string")throw new TypeError("`nationalNumber` argument must be a string");h(n);var a=S(t,n),b=a.country,g=a.countryCallingCode;this.country=b,this.countryCallingCode=g,this.nationalNumber=e,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return n}}return N(r,[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:P(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return d(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return v(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var e=new l(this.getMetadata());return e.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return w(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,n){return E(this,e,n?c(c({},n),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}])})(),M=function(t){return/^[A-Z]{2}$/.test(t)};function S(r,t){var e,n,i=new l(t);return M(r)?(e=r,i.selectNumberingPlan(e),n=i.countryCallingCode()):n=r,{country:e,countryCallingCode:n}}var _=/^\+\d+$/;export{U as default};
|
|
1
|
+
import l,{validateMetadata as h}from"./metadata.js";import d from"./isPossible.js";import v from"./isValid.js";import w from"./helpers/getNumberType.js";import P from"./helpers/getPossibleCountriesForNumber.js";import C from"./helpers/extractCountryCallingCode.js";import s from"./helpers/isObject.js";import E from"./format.js";function o(r){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(r)}function f(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),e.push.apply(e,n)}return e}function c(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?f(Object(e),!0).forEach(function(n){j(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):f(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function j(r,t,e){return(t=y(t))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function O(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function k(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,y(n.key),n)}}function N(r,t,e){return t&&k(r.prototype,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function y(r){var t=T(r,"string");return o(t)=="symbol"?t:t+""}function T(r,t){if(o(r)!="object"||!r)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t);if(o(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}var U=(function(){function r(t,e,n){if(O(this,r),!t)throw new TypeError("First argument is required");if(typeof t!="string")throw new TypeError("First argument must be a string");if(t[0]==="+"&&!e)throw new TypeError("`metadata` argument not passed");if(s(e)&&s(e.countries)){n=e;var i=t;if(!_.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var u=C(i,void 0,void 0,void 0,n),m=u.countryCallingCode,p=u.number;if(e=p,t=m,!e)throw new Error("Invalid `number` argument passed: too short")}if(!e)throw new TypeError("`nationalNumber` argument is required");if(typeof e!="string")throw new TypeError("`nationalNumber` argument must be a string");h(n);var a=S(t,n),b=a.country,g=a.countryCallingCode;this.country=b,this.countryCallingCode=g,this.nationalNumber=e,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return n}}return N(r,[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:P(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return d(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return v(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var e=new l(this.getMetadata());return e.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return w(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,n){return E(this,e,n?c(c({},n),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}])})(),M=function(t){return/^[A-Z]{2}$/.test(t)};function S(r,t){var e,n,i=new l(t);return M(r)?(e=r,i.selectNumberingPlan(e),n=i.countryCallingCode()):n=r,{country:e,countryCallingCode:n}}var _=/^\+\d+$/;export{U as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import N from"./helpers/matchesEntirely.js";import g from"./helpers/formatNationalNumberUsingFormat.js";import m,{getCountryCallingCode as s}from"./metadata.js";import h from"./helpers/getIddPrefix.js";import{formatRFC3966 as I}from"./helpers/RFC3966.js";var l={formatExtension:function(t,r,e){return"".concat(t).concat(e.ext()).concat(r)}};function O(n,t,r,e){if(r?r=E({},l,r):r=l,e=new m(e),n.country&&n.country!=="001"){if(!e.hasCountry(n.country))throw new Error("Unknown country: ".concat(n.country));e.selectNumberingPlan(n.country)}else if(n.countryCallingCode)e.selectNumberingPlan(n.countryCallingCode);else return n.phone||"";var o=e.countryCallingCode(),a=r.v2?n.nationalNumber:n.phone,c;switch(t){case"NATIONAL":return a?(c=f(a,n.carrierCode,"NATIONAL",e,r),u(c,n.ext,e,r.formatExtension)):"";case"INTERNATIONAL":return a?(c=f(a,null,"INTERNATIONAL",e,r),c="+".concat(o," ").concat(c),u(c,n.ext,e,r.formatExtension)):"+".concat(o);case"E.164":return"+".concat(o).concat(a);case"RFC3966":return I({number:"+".concat(o).concat(a),ext:n.ext});case"IDD":if(!r.fromCountry)return;var i=A(a,n.carrierCode,o,r.fromCountry,e);return u(i,n.ext,e,r.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function f(n,t,r,e,o){var a=x(e.formats(),n);return a?g(n,a,{useInternationalFormat:r==="INTERNATIONAL",withNationalPrefix:!(a.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&o&&o.nationalPrefix===!1)}):n}function x(n,t){return v(n,function(r){if(r.leadingDigitsPatterns().length>0){var e=r.leadingDigitsPatterns()[r.leadingDigitsPatterns().length-1];if(t.search(e)!==0)return!1}return N(t,r.pattern())})}function u(n,t,r,e){return t?e(n,t,r):n}function A(n,t,r,e,o){var a=s(e,o.metadata);if(a===r){var c=f(n,t,"NATIONAL",o);return r==="1"?r+" "+c:c}var i=h(e,void 0,o.metadata);if(i)return"".concat(i," ").concat(r," ").concat(f(n,null,"INTERNATIONAL",o))}function E(){for(var n=1,t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];for(;n<r.length;){if(r[n])for(var o in r[n])r[0][o]=r[n][o];n++}return r[0]}function v(n,t){for(var r=0;r<n.length;){if(t(n[r]))return n[r];r++}}export{x as chooseFormatForNumber,O as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import h from"../metadata.js";function L(i,r,u){return s(i,r,void 0,u)}function s(i,r,u,e){r&&(e=new h(e.metadata),e.selectNumberingPlan(r));var f=e.type(u),n=f&&f.possibleLengths()||e.possibleLengths();if(!n)return"IS_POSSIBLE";var t=i.length,l=n[0];return l===t?"IS_POSSIBLE":l>t?"TOO_SHORT":n[n.length-1]<t?"TOO_LONG":n.indexOf(t,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}export{s as checkNumberLengthForType,L as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import M from"./stripIddPrefix.js";import I from"./extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js";import R from"../metadata.js";import{MAX_LENGTH_COUNTRY_CODE as S}from"../constants.js";function O(r,s,e,f,i){if(!r)return{};var l;if(r[0]!=="+"){var n=M(r,e,f,i);if(n&&n!==r)l=!0,r="+"+n;else{if(e||f){var N=I(r,s,e,f,i),c=N.countryCallingCode,t=N.number;if(c)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:c,number:t}}return{number:r}}}if(r[1]==="0")return{};i=new R(i);for(var o=2;o-1<=S&&o<=r.length;){var _=r.slice(1,o);if(i.hasCallingCode(_))return i.selectNumberingPlan(_),{countryCallingCodeSource:l?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:_,number:r.slice(o)};o++}return{}}export{O as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import m,{getCountryCallingCode as b}from"../metadata.js";import g from"./matchesEntirely.js";import u from"./extractNationalNumber.js";import h from"./checkNumberLength.js";function P(r,o,e,c,n){var i=e?b(e,n):c;if(r.indexOf(i)===0){n=new m(n),n.selectNumberingPlan(e,i);var l=r.slice(i.length),C=u(l,o,n),N=C.nationalNumber,f=u(r,o,n),t=f.nationalNumber;if(!g(t,n.nationalNumberPattern())&&g(N,n.nationalNumberPattern())||h(t,o,n)==="TOO_LONG")return{countryCallingCode:i,number:l}}return{number:r}}export{P as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import l from"./extractNationalNumberFromPossiblyIncompleteNumber.js";import o from"./matchesEntirely.js";import u from"./checkNumberLength.js";import N from"./getCountryByCallingCode.js";function g(e,n,r){var i=l(e,r),a=i.carrierCode,t=i.nationalNumber;if(t!==e){if(!m(e,t,r))return{nationalNumber:e};if(r.numberingPlan.possibleLengths()&&(n||(n=N(r.numberingPlan.callingCode(),{nationalNumber:t,metadata:r})),!f(t,n,r)))return{nationalNumber:e}}return{nationalNumber:t,carrierCode:a}}function m(e,n,r){return!(o(e,r.nationalNumberPattern())&&!o(n,r.nationalNumberPattern()))}function f(e,n,r){switch(u(e,n,r)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}export{g as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import l from"../metadata.js";import f from"./getNumberType.js";function d(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=s(e))||r){t&&(e=t);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(e,r){if(e){if(typeof e=="string")return i(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,r):void 0}}function i(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,a=Array(r);t<r;t++)a[t]=e[t];return a}function y(e,r){var t=r.countries,a=r.metadata;a=new l(a);for(var u=d(t),o;!(o=u()).done;){var n=o.value;if(a.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(e,r){if(e){if(typeof e=="string")return i(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,r):void 0}}function i(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,a=Array(r);t<r;t++)a[t]=e[t];return a}function y(e,r){var t=r.countries,a=r.metadata;a=new l(a);for(var u=d(t),o;!(o=u()).done;){var n=o.value;if(a.selectNumberingPlan(n),a.leadingDigits()){if(e&&e.search(a.leadingDigits())===0)return n}else if(f({phone:e,country:n},void 0,a.metadata))return n}}export{y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"./metadata.js";import l from"./helpers/checkNumberLength.js";function u(e,n,r){if(n===void 0&&(n={}),r=new o(r),n.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.selectNumberingPlan(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}}if(r.possibleLengths())return s(e.phone||e.nationalNumber,e.country,r);if(e.countryCallingCode&&r.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function s(e,n,r){switch(l(e,n,r)){case"IS_POSSIBLE":return!0;default:return!1}}export{u as default,s as isPossibleNumber};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import f from"./tools/semver-compare.js";import l from"./helpers/isObject.js";function a(n){"@babel/helpers - typeof";return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(n)}function o(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function y(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,v(i.key),i)}}function u(n,t,e){return t&&y(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function v(n){var t=P(n,"string");return a(t)=="symbol"?t:t+""}function P(n,t){if(a(n)!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t);if(a(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}var d="1.2.0",p="1.7.35",h=" ext. ",C=/^\d+$/,b=(function(){function n(t){o(this,n),_(t),this.metadata=t,m.call(this,t)}return u(n,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(e){return e!=="001"})}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return this.getCountryMetadata(e)!==void 0}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var i=this.countryCallingCodes()[e];if(i&&i.length===1&&i[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,i){if(e&&C.test(e)&&(i=e,e=null),e&&e!=="001"){if(!this.hasCountry(e))throw new Error("Unknown country: ".concat(e));this.numberingPlan=new g(this.getCountryMetadata(e),this)}else if(i){if(!this.hasCallingCode(i))throw new Error("Unknown calling code: ".concat(i));this.numberingPlan=new g(this.getNumberingPlanMetadata(i),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var i=this.countryCallingCodes()[e];if(i)return i.length===1&&i[0].length===3?void 0:i}},{key:"getCountryCodeForCallingCode",value:function(e){var i=this.getCountryCodesForCallingCode(e);if(i)return i[0]}},{key:"getNumberingPlanMetadata",value:function(e){var i=this.getCountryCodeForCallingCode(e);if(i)return this.getCountryMetadata(i);if(this.nonGeographic()){var r=this.nonGeographic()[e];if(r)return r}else{var s=this.countryCallingCodes()[e];if(s&&s.length===1&&s[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(e){return this.numberingPlan.type(e)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}])})(),g=(function(){function n(t,e){o(this,n),this.globalMetadataObject=e,this.metadata=t,m.call(this,e.metadata)}return u(n,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this,i=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return i.map(function(r){return new F(r,e)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}},{key:"type",value:function(e){if(this.hasTypes()&&c(this.types(),e))return new x(c(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?h:this.metadata[13]||h}}])})(),F=(function(){function n(t,e){o(this,n),this._format=t,this.metadata=e}return u(n,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!k.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])})(),k=/^\(?\$1\)?$/,x=(function(){function n(t,e){o(this,n),this.type=t,this.metadata=e}return u(n,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])})();function c(n,t){switch(t){case"FIXED_LINE":return n[0];case"MOBILE":return n[1];case"TOLL_FREE":return n[2];case"PREMIUM_RATE":return n[3];case"PERSONAL_NUMBER":return n[4];case"VOICEMAIL":return n[5];case"UAN":return n[6];case"PAGER":return n[7];case"VOIP":return n[8];case"SHARED_COST":return n[9]}}function _(n){if(!n)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!l(n)||!l(n.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(l(n)?"an object of shape: { "+Object.keys(n).join(", ")+" }":"a "+N(n)+": "+n,"."))}var N=function(t){return a(t)};function R(n,t){if(t=new b(t),t.hasCountry(n))return t.
|
|
1
|
+
import f from"./tools/semver-compare.js";import l from"./helpers/isObject.js";function a(n){"@babel/helpers - typeof";return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(n)}function o(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function y(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,v(i.key),i)}}function u(n,t,e){return t&&y(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function v(n){var t=P(n,"string");return a(t)=="symbol"?t:t+""}function P(n,t){if(a(n)!="object"||!n)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t);if(a(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}var d="1.2.0",p="1.7.35",h=" ext. ",C=/^\d+$/,b=(function(){function n(t){o(this,n),_(t),this.metadata=t,m.call(this,t)}return u(n,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(e){return e!=="001"})}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return this.getCountryMetadata(e)!==void 0}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var i=this.countryCallingCodes()[e];if(i&&i.length===1&&i[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,i){if(e&&C.test(e)&&(i=e,e=null),e&&e!=="001"){if(!this.hasCountry(e))throw new Error("Unknown country: ".concat(e));this.numberingPlan=new g(this.getCountryMetadata(e),this)}else if(i){if(!this.hasCallingCode(i))throw new Error("Unknown calling code: ".concat(i));this.numberingPlan=new g(this.getNumberingPlanMetadata(i),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var i=this.countryCallingCodes()[e];if(i)return i.length===1&&i[0].length===3?void 0:i}},{key:"getCountryCodeForCallingCode",value:function(e){var i=this.getCountryCodesForCallingCode(e);if(i)return i[0]}},{key:"getNumberingPlanMetadata",value:function(e){var i=this.getCountryCodeForCallingCode(e);if(i)return this.getCountryMetadata(i);if(this.nonGeographic()){var r=this.nonGeographic()[e];if(r)return r}else{var s=this.countryCallingCodes()[e];if(s&&s.length===1&&s[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(e){return this.numberingPlan.type(e)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}])})(),g=(function(){function n(t,e){o(this,n),this.globalMetadataObject=e,this.metadata=t,m.call(this,e.metadata)}return u(n,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this,i=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return i.map(function(r){return new F(r,e)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}},{key:"type",value:function(e){if(this.hasTypes()&&c(this.types(),e))return new x(c(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?h:this.metadata[13]||h}}])})(),F=(function(){function n(t,e){o(this,n),this._format=t,this.metadata=e}return u(n,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!k.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])})(),k=/^\(?\$1\)?$/,x=(function(){function n(t,e){o(this,n),this.type=t,this.metadata=e}return u(n,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])})();function c(n,t){switch(t){case"FIXED_LINE":return n[0];case"MOBILE":return n[1];case"TOLL_FREE":return n[2];case"PREMIUM_RATE":return n[3];case"PERSONAL_NUMBER":return n[4];case"VOICEMAIL":return n[5];case"UAN":return n[6];case"PAGER":return n[7];case"VOIP":return n[8];case"SHARED_COST":return n[9]}}function _(n){if(!n)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!l(n)||!l(n.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(l(n)?"an object of shape: { "+Object.keys(n).join(", ")+" }":"a "+N(n)+": "+n,"."))}var N=function(t){return a(t)};function R(n,t){if(t=new b(t),t.hasCountry(n))return t.selectNumberingPlan(n).countryCallingCode();throw new Error("Unknown country: ".concat(n))}function O(n,t){return t.countries.hasOwnProperty(n)}function m(n){var t=n.version;typeof t=="number"?(this.v1=t===1,this.v2=t===2,this.v3=t===3,this.v4=t===4):t?f(t,d)===-1?this.v2=!0:f(t,p)===-1?this.v3=!0:this.v4=!0:this.v1=!0}export{b as default,R as getCountryCallingCode,O as isSupportedCountry,_ as validateMetadata};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MIN_LENGTH_FOR_NSN as g,MAX_LENGTH_FOR_NSN as h,PLUS_CHARS as P,VALID_DIGITS as d}from"./constants.js";import m from"./ParseError.js";import T,{getCountryCallingCode as O}from"./metadata.js";import s,{isViablePhoneNumberStart as v}from"./helpers/isViablePhoneNumber.js";import w from"./helpers/extension/extractExtension.js";import y from"./parseIncompletePhoneNumber.js";import{isPossibleNumber as S}from"./isPossible.js";import x from"./PhoneNumber.js";import R from"./helpers/matchesEntirely.js";import E from"./helpers/extractCountryCallingCode.js";import I from"./helpers/extractNationalNumber.js";import A from"./helpers/getCountryByCallingCode.js";import p from"./helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js";var H=250,L=new RegExp("["+P+d+"]"),U=new RegExp("[^"+d+"#]+$");function Z(t,r,n){if(r=r||{},n=new T(n),r.defaultCountry&&!n.hasCountry(r.defaultCountry))throw r.v2?new m("INVALID_COUNTRY"):new Error("Unknown country: ".concat(r.defaultCountry));var e=G(t,r.v2,r.extract),l=e.number,c=e.ext,i=e.error;if(!l){if(r.v2)throw i==="TOO_SHORT"?new m("TOO_SHORT"):new m("NOT_A_NUMBER");return{}}var a=D(l,r.defaultCountry,r.defaultCallingCode,n),o=a.country,u=a.nationalNumber,N=a.countryCallingCode,_=a.countryCallingCodeSource,f=a.carrierCode;if(!n.hasSelectedNumberingPlan()){if(r.v2)throw new m("INVALID_COUNTRY");return{}}if(!u||u.length<g){if(r.v2)throw new m("TOO_SHORT");return{}}if(u.length>h){if(r.v2)throw new m("TOO_LONG");return{}}if(r.v2){var C=new x(N,u,n.metadata);return o&&(C.country=o),f&&(C.carrierCode=f),c&&(C.ext=c),C.__countryCallingCodeSource=_,C}var b=(r.extended?n.hasSelectedNumberingPlan():o)?R(u,n.nationalNumberPattern()):!1;return r.extended?{country:o,countryCallingCode:N,carrierCode:f,valid:b,possible:b?!0:!!(r.extended===!0&&n.possibleLengths()&&S(u,o,n)),phone:u,ext:c}:b?M(o,u,c):{}}function F(t,r,n){if(t){if(t.length>H){if(n)throw new m("TOO_LONG");return}if(r===!1)return t;var e=t.search(L);if(!(e<0))return t.slice(e).replace(U,"")}}function G(t,r,n){var e=p(t,{extractFormattedPhoneNumber:function(i){return F(i,n,r)}});if(!e)return{};if(!s(e))return v(e)?{error:"TOO_SHORT"}:{};var l=w(e);return l.ext?l:{number:e}}function M(t,r,n){var e={country:t,phone:r};return n&&(e.ext=n),e}function D(t,r,n,e){var l=E(y(t),void 0,r,n,e.metadata),c=l.countryCallingCodeSource,i=l.countryCallingCode,a=l.number,o;if(i)e.selectNumberingPlan(i);else if(a&&(r||n))e.selectNumberingPlan(r,n),r&&(o=r),i=n||O(r,e.metadata);else return{};if(!a)return{countryCallingCodeSource:c,countryCallingCode:i};var u=I(y(a),o,e),N=u.nationalNumber,_=u.carrierCode,f=A(i,{nationalNumber:N,metadata:e});return f&&(o=f,f==="001"||e.selectNumberingPlan(o)),{country:o,countryCallingCode:i,countryCallingCodeSource:c,nationalNumber:N,carrierCode:_}}export{Z as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{parseDigit as i}from"./helpers/parseDigits.js";function u(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=l(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l(e,t){if(e){if(typeof e=="string")return o(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e){for(var t="",r=u(e.split("")),n;!(n=r()).done;){var a=n.value;t+=f(a,t)||""}return t}function f(e,t,r){return e==="+"?t?void 0:"+":i(e)}export{c as default,f as parsePhoneNumberCharacter};
|