@vc-shell/framework 1.1.44 → 1.1.46

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.
Files changed (453) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/core/plugins/modularity/loader.ts +150 -74
  3. package/core/services/app-bar-mobile-buttons-service.ts +1 -1
  4. package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
  5. package/dist/core/services/app-bar-mobile-buttons-service.d.ts +1 -1
  6. package/dist/core/services/app-bar-mobile-buttons-service.d.ts.map +1 -1
  7. package/dist/framework.js +33355 -295
  8. package/dist/index.css +1 -9
  9. package/dist/index.d.ts +0 -4
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/locales/de.json +0 -84
  12. package/dist/locales/en.json +0 -84
  13. package/dist/shared/components/blade-navigation/components/vc-blade-navigation/_internal/vc-mobile-back-button.vue.d.ts.map +1 -1
  14. package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts +1 -1
  15. package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts.map +1 -1
  16. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.d.ts.map +1 -1
  17. package/dist/shared/components/change-password-button/change-password-button.vue.d.ts.map +1 -1
  18. package/dist/shared/components/logout-button/logout-button.vue.d.ts.map +1 -1
  19. package/dist/shared/components/settings-menu-item/settings-menu-item.vue.d.ts.map +1 -1
  20. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +2 -2
  21. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +6 -6
  22. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
  23. package/dist/tsconfig.tsbuildinfo +1 -1
  24. package/dist/ui/components/atoms/vc-hint/vc-hint.vue.d.ts.map +1 -1
  25. package/dist/ui/components/atoms/vc-icon/icons/MenuBurgerIcon.vue.d.ts.map +1 -1
  26. package/dist/ui/components/atoms/vc-icon/icons/index.d.ts +0 -26
  27. package/dist/ui/components/atoms/vc-icon/icons/index.d.ts.map +1 -1
  28. package/dist/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue.d.ts.map +1 -1
  29. package/dist/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue.d.ts.map +1 -1
  30. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
  31. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts +0 -5
  32. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
  33. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts +0 -20
  34. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts.map +1 -1
  35. package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts.map +1 -1
  36. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts +36 -0
  37. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts.map +1 -0
  38. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts +17 -0
  39. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts.map +1 -0
  40. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +16 -2381
  41. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
  42. package/dist/ui/components/molecules/vc-form/vc-form.vue.d.ts.map +1 -1
  43. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +1 -1
  44. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
  45. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +1 -1
  46. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
  47. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue.d.ts.map +1 -1
  48. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
  49. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts.map +1 -1
  50. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  51. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue.d.ts.map +1 -1
  52. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue.d.ts.map +1 -1
  53. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue.d.ts.map +1 -1
  54. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
  55. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +2 -2
  56. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +2 -2
  57. package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
  58. package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts.map +1 -1
  59. package/dist/vendor-boolbase-Cp9L0GAZ.js +25 -0
  60. package/dist/vendor-cheerio-HN9zIPZn.js +3135 -0
  61. package/dist/vendor-cheerio-select-5Ry0HvBq.js +306 -0
  62. package/dist/vendor-core-js-l0sNRNKZ.js +1 -0
  63. package/dist/vendor-css-select-DRIZ9kfZ.js +966 -0
  64. package/dist/vendor-css-what-DuPJ1HEF.js +448 -0
  65. package/dist/vendor-cypress-signalr-mock-BKdBJpdt.js +778 -0
  66. package/dist/vendor-date-fns-515YWkk-.js +6724 -0
  67. package/dist/vendor-dom-serializer-nQMsqjYW.js +286 -0
  68. package/dist/vendor-dom7-CJLPMwy5.js +941 -0
  69. package/dist/vendor-domelementtype-CjSzQey5.js +53 -0
  70. package/dist/vendor-domhandler-9z8cS16a.js +484 -0
  71. package/dist/vendor-dompurify-CRFzu7ib.js +1336 -0
  72. package/dist/vendor-domutils-Bc-Opz-v.js +981 -0
  73. package/dist/vendor-entities-Bfsx4xOQ.js +636 -0
  74. package/dist/vendor-floating-ui-core-wV8u8QP4.js +511 -0
  75. package/dist/vendor-floating-ui-dom-DDnRPs17.js +706 -0
  76. package/dist/vendor-floating-ui-utils-OMIFy1QU.js +296 -0
  77. package/dist/vendor-floating-ui-vue-D-tCDAMm.js +167 -0
  78. package/dist/vendor-fontsource-plus-jakarta-sans.css +1 -0
  79. package/dist/vendor-headlessui-vue-CY9FRgTb.js +83 -0
  80. package/dist/vendor-htmlparser2-B1dhFPOs.js +1426 -0
  81. package/dist/vendor-iconify-vue-DfRGgyNu.js +1840 -0
  82. package/dist/vendor-intlify-core-base-BuknsFQe.js +1876 -0
  83. package/dist/vendor-intlify-message-compiler-CuOQDWx1.js +1508 -0
  84. package/dist/vendor-intlify-shared-Cz4YRMuC.js +241 -0
  85. package/dist/vendor-iso-639-1-BJCk9DvE.js +819 -0
  86. package/dist/vendor-linkify-it-CKUf4vsc.js +830 -0
  87. package/dist/vendor-linkifyjs-BfyGgbCh.js +1756 -0
  88. package/dist/vendor-lodash-es-BySUOlwf.js +18333 -0
  89. package/dist/vendor-markdown-it-D-apazHa.js +6000 -0
  90. package/dist/vendor-markdown-it-task-lists-rxMVH6Ku.js +131 -0
  91. package/dist/vendor-mdurl-BNh2CCgT.js +537 -0
  92. package/dist/vendor-microsoft-applicationinsights-analytics-js-kG3lLg8X.js +1275 -0
  93. package/dist/vendor-microsoft-applicationinsights-cfgsync-js-C0uQkiQq.js +591 -0
  94. package/dist/vendor-microsoft-applicationinsights-channel-js-Dyd_PXA3.js +2153 -0
  95. package/dist/vendor-microsoft-applicationinsights-common-CfmP1_Qr.js +2470 -0
  96. package/dist/vendor-microsoft-applicationinsights-core-js-Cq4YSEvZ.js +6589 -0
  97. package/dist/vendor-microsoft-applicationinsights-dependencies-js-C56OBFr4.js +1510 -0
  98. package/dist/vendor-microsoft-applicationinsights-properties-js-CBJTBawx.js +761 -0
  99. package/dist/vendor-microsoft-applicationinsights-shims-CX8sJgar.js +70 -0
  100. package/dist/vendor-microsoft-applicationinsights-web-pim2ri-g.js +667 -0
  101. package/dist/vendor-microsoft-dynamicproto-js-CFBBUu9p.js +520 -0
  102. package/dist/vendor-microsoft-signalr-dUnlRsGm.js +3339 -0
  103. package/dist/vendor-moment-Mki5YqAR.js +5679 -0
  104. package/dist/vendor-nevware21-ts-async-CLMApQ9E.js +395 -0
  105. package/dist/vendor-nevware21-ts-utils-e8v8Jty3.js +1160 -0
  106. package/dist/vendor-normalize-css.css +1 -0
  107. package/dist/vendor-nth-check-Bx8TxtJt.js +157 -0
  108. package/dist/vendor-orderedmap-dGG6uMFJ.js +137 -0
  109. package/dist/vendor-parse5-Bt2NhSzR.js +8432 -0
  110. package/dist/vendor-parse5-htmlparser2-tree-adapter-BUUtKzf8.js +216 -0
  111. package/dist/vendor-popperjs-core-Cr2byIky.js +1790 -0
  112. package/dist/vendor-prettier-B4PaeWRQ.js +98 -0
  113. package/dist/vendor-prosemirror-commands-BH9lWGpW.js +561 -0
  114. package/dist/vendor-prosemirror-dropcursor-CeyPcxrA.js +146 -0
  115. package/dist/vendor-prosemirror-gapcursor-U8UoUJII.js +236 -0
  116. package/dist/vendor-prosemirror-history-BDaJkvNx.js +414 -0
  117. package/dist/vendor-prosemirror-keymap-BbWvIWmH.js +128 -0
  118. package/dist/vendor-prosemirror-markdown-gB0PXBbz.js +866 -0
  119. package/dist/vendor-prosemirror-model-BZu3WVcD.js +3463 -0
  120. package/dist/vendor-prosemirror-schema-list-Bl9NpKA7.js +158 -0
  121. package/dist/vendor-prosemirror-state-BvL9Pxph.js +1003 -0
  122. package/dist/vendor-prosemirror-tables-17qAnviK.js +2159 -0
  123. package/dist/vendor-prosemirror-transform-CE9VV3qg.js +2156 -0
  124. package/dist/vendor-prosemirror-view-CU2WTHT7.js +5811 -0
  125. package/dist/vendor-punycode-js-iAs5RxMf.js +441 -0
  126. package/dist/vendor-rope-sequence-BdXDKoGt.js +207 -0
  127. package/dist/vendor-semver-CVLMK-S4.js +2702 -0
  128. package/dist/vendor-ssr-window-s6OpKa3O.js +150 -0
  129. package/dist/vendor-swiper-CdiyNHVt.js +5679 -0
  130. package/dist/vendor-swiper.css +1 -0
  131. package/dist/vendor-tanstack-virtual-core-l0sNRNKZ.js +1 -0
  132. package/dist/vendor-tanstack-vue-virtual-l0sNRNKZ.js +1 -0
  133. package/dist/vendor-tippy-js-DWFe2TfK.js +1647 -0
  134. package/dist/vendor-tiptap-core-NfwGfaQk.js +4910 -0
  135. package/dist/vendor-tiptap-extension-blockquote-jmWBTtsI.js +57 -0
  136. package/dist/vendor-tiptap-extension-bold-p5frh4ak.js +97 -0
  137. package/dist/vendor-tiptap-extension-bubble-menu-KUhZSfrs.js +218 -0
  138. package/dist/vendor-tiptap-extension-bullet-list-COmZRoSB.js +73 -0
  139. package/dist/vendor-tiptap-extension-code-block-DyTARZss.js +221 -0
  140. package/dist/vendor-tiptap-extension-code-jVv6CXpX.js +75 -0
  141. package/dist/vendor-tiptap-extension-document-DssuotYs.js +13 -0
  142. package/dist/vendor-tiptap-extension-dropcursor-BoO0Qv91.js +26 -0
  143. package/dist/vendor-tiptap-extension-floating-menu-CrO8CN5w.js +165 -0
  144. package/dist/vendor-tiptap-extension-gapcursor-KpsWEoMD.js +30 -0
  145. package/dist/vendor-tiptap-extension-hard-break-ldOzhSvf.js +68 -0
  146. package/dist/vendor-tiptap-extension-heading-CKz2llX0.js +77 -0
  147. package/dist/vendor-tiptap-extension-history-DeKZ2VQ9.js +48 -0
  148. package/dist/vendor-tiptap-extension-horizontal-rule-CAjWRyDS.js +92 -0
  149. package/dist/vendor-tiptap-extension-image-ZagcEYuk.js +76 -0
  150. package/dist/vendor-tiptap-extension-italic-CM4xdznY.js +96 -0
  151. package/dist/vendor-tiptap-extension-link-Z-AMC4Ri.js +414 -0
  152. package/dist/vendor-tiptap-extension-list-item-BJi5QpXc.js +37 -0
  153. package/dist/vendor-tiptap-extension-ordered-list-C_TMrfBE.js +97 -0
  154. package/dist/vendor-tiptap-extension-paragraph-CQw0E0Au.js +39 -0
  155. package/dist/vendor-tiptap-extension-placeholder-BBNVKfa_.js +66 -0
  156. package/dist/vendor-tiptap-extension-strike-DUyMYX1Z.js +79 -0
  157. package/dist/vendor-tiptap-extension-table-cell-CoDIMPA5.js +47 -0
  158. package/dist/vendor-tiptap-extension-table-header-DvbGHnmw.js +47 -0
  159. package/dist/vendor-tiptap-extension-table-row-D1uqN5Aj.js +26 -0
  160. package/dist/vendor-tiptap-extension-table-tKS4MOM4.js +354 -0
  161. package/dist/vendor-tiptap-extension-text-DtRBhKB2.js +12 -0
  162. package/dist/vendor-tiptap-extension-underline-DqaSFp_P.js +50 -0
  163. package/dist/vendor-tiptap-markdown-7-PCADTU.js +1017 -0
  164. package/dist/vendor-tiptap-pm-l0sNRNKZ.js +1 -0
  165. package/dist/vendor-tiptap-starter-kit-CDSV_Zuu.js +88 -0
  166. package/dist/vendor-tiptap-vue-3-DZg2fjq_.js +268 -0
  167. package/dist/vendor-truncate-html-3qQY0Djo.js +196 -0
  168. package/dist/vendor-uc-micro-jjt6LQ65.js +23 -0
  169. package/dist/vendor-vee-validate-i18n-v_gHjRmD.js +154 -0
  170. package/dist/vendor-vee-validate-rules-DzV3VY3N.js +536 -0
  171. package/dist/vendor-vue-currency-input-DGAkEFBO.js +545 -0
  172. package/dist/vendor-vue-demi-l0sNRNKZ.js +1 -0
  173. package/dist/vendor-vue-devtools-api-DXYR8qBG.js +169 -0
  174. package/dist/vendor-vue-i18n-Co752uk3.js +1897 -0
  175. package/dist/vendor-vue3-application-insights-CYWFCr_J.js +119 -0
  176. package/dist/vendor-vue3-touch-events-BJEAiSa3.js +416 -0
  177. package/dist/vendor-vuepic-vue-datepicker-BSWXRSiu.js +5019 -0
  178. package/dist/vendor-vuepic-vue-datepicker.css +1 -0
  179. package/dist/vendor-vueuse-components-l1bL12mE.js +339 -0
  180. package/dist/vendor-vueuse-core-DGcJOmwG.js +7743 -0
  181. package/dist/vendor-vueuse-shared-_mOXsFuM.js +1568 -0
  182. package/dist/vendor-w3c-keyname-BOm2dtJm.js +121 -0
  183. package/package.json +22 -11
  184. package/shared/components/blade-navigation/components/vc-blade-navigation/_internal/vc-mobile-back-button.vue +3 -3
  185. package/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.ts +2 -1
  186. package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.ts +1 -0
  187. package/shared/components/change-password-button/change-password-button.vue +1 -2
  188. package/shared/components/logout-button/logout-button.vue +1 -2
  189. package/shared/components/notifications/components/notification-container/index.ts +1 -1
  190. package/shared/components/notifications/core/notification.ts +1 -1
  191. package/shared/components/settings-menu-item/settings-menu-item.vue +1 -0
  192. package/shared/components/sidebar/sidebar.vue +2 -2
  193. package/shared/modules/dynamic/pages/dynamic-blade-list.vue +2 -1
  194. package/ui/components/atoms/vc-hint/vc-hint.vue +2 -0
  195. package/ui/components/atoms/vc-icon/composables/use-icon.ts +1 -1
  196. package/ui/components/atoms/vc-icon/icons/MenuBurgerIcon.vue +18 -14
  197. package/ui/components/atoms/vc-icon/icons/index.ts +1 -27
  198. package/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue +7 -11
  199. package/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue +37 -31
  200. package/ui/components/atoms/vc-icon/vc-icon-examples.vue +1 -1
  201. package/ui/components/atoms/vc-icon/vc-icon.stories.ts +4 -5
  202. package/ui/components/atoms/vc-icon/vc-icon.vue +43 -186
  203. package/ui/components/atoms/vc-icon/vc-lucide-icon.vue +22 -70
  204. package/ui/components/atoms/vc-icon/vc-material-icon.vue +28 -59
  205. package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +2 -3
  206. package/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue +103 -0
  207. package/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue +252 -0
  208. package/ui/components/molecules/vc-editor/vc-editor.stories.ts +1 -4
  209. package/ui/components/molecules/vc-editor/vc-editor.vue +666 -360
  210. package/ui/components/molecules/vc-form/vc-form.vue +7 -5
  211. package/ui/components/molecules/vc-input/vc-input.vue +1 -1
  212. package/ui/components/molecules/vc-pagination/vc-pagination.vue +4 -17
  213. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarMobileActions.vue +1 -1
  214. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue +1 -3
  215. package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +1 -4
  216. package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +1 -3
  217. package/ui/components/organisms/vc-app/vc-app.backupsb.ts +214 -214
  218. package/ui/components/organisms/vc-app/vc-app.vue +3 -5
  219. package/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +3 -10
  220. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/mobile/vc-blade-toolbar-mobile.vue +1 -1
  221. package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue +2 -2
  222. package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue +2 -2
  223. package/ui/components/organisms/vc-blade/vc-blade.vue +4 -5
  224. package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +1 -3
  225. package/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue +1 -2
  226. package/ui/components/organisms/vc-table/composables/useTableState.ts +5 -5
  227. package/dist/apl-B2DGVGxc.js +0 -76
  228. package/dist/asciiarmor-2LVJmxlE.js +0 -34
  229. package/dist/asn1-jKiBa2Ya.js +0 -95
  230. package/dist/asterisk-DS281yxp.js +0 -271
  231. package/dist/brainfuck-C_p9pTT8.js +0 -34
  232. package/dist/clike-DGTaUp48.js +0 -620
  233. package/dist/clojure-CCKyeQKf.js +0 -800
  234. package/dist/cmake-CuaCgAKt.js +0 -28
  235. package/dist/cobol-BlTKFDRj.js +0 -72
  236. package/dist/coffeescript-BVCvwO8I.js +0 -179
  237. package/dist/commonlisp-D_kxz07b.js +0 -75
  238. package/dist/crystal-D309uH6_.js +0 -217
  239. package/dist/css-BkF-NPzE.js +0 -1553
  240. package/dist/cypher-BMq4Fwjl.js +0 -68
  241. package/dist/d-BZcgY6La.js +0 -127
  242. package/dist/diff-Cg9d_RX2.js +0 -18
  243. package/dist/dockerfile-DIy8NleC.js +0 -194
  244. package/dist/dtd-CtLokQ-U.js +0 -84
  245. package/dist/dylan-QYeExnWK.js +0 -234
  246. package/dist/ebnf-DUPDuY4r.js +0 -78
  247. package/dist/ecl-CiXN-g_D.js +0 -121
  248. package/dist/eiffel-yQhjl4T1.js +0 -110
  249. package/dist/elm-CNT9vbN0.js +0 -108
  250. package/dist/erlang-CFOYdy9e.js +0 -487
  251. package/dist/factor-DDOC7X6P.js +0 -65
  252. package/dist/fcl-CPC2WYrI.js +0 -103
  253. package/dist/forth-BmxRyE9S.js +0 -60
  254. package/dist/fortran-9bvPyrOW.js +0 -442
  255. package/dist/gas-cpmYfFX2.js +0 -183
  256. package/dist/gherkin-CJuwpceU.js +0 -34
  257. package/dist/groovy-DZeT_VM-.js +0 -146
  258. package/dist/haskell-Bvt3Qq1t.js +0 -375
  259. package/dist/haxe-70NVW1pR.js +0 -359
  260. package/dist/http-D9LttvKF.js +0 -44
  261. package/dist/idl-B6TRFYjl.js +0 -947
  262. package/dist/index-4DWvmoYg.js +0 -71
  263. package/dist/index-52o7mJaX.js +0 -156
  264. package/dist/index-B0KatioT.js +0 -98
  265. package/dist/index-BP3W8zuk.js +0 -268
  266. package/dist/index-BykT5L1A.js +0 -148134
  267. package/dist/index-CfXo9hsG.js +0 -75
  268. package/dist/index-Ch37pBUt.js +0 -308
  269. package/dist/index-D2KGkAYT.js +0 -93
  270. package/dist/index-D83zQom_.js +0 -58
  271. package/dist/index-DuQrVLbu.js +0 -134
  272. package/dist/index-_fdMid5h.js +0 -288
  273. package/dist/index-a1wO-owY.js +0 -545
  274. package/dist/index-crMpNSFe.js +0 -611
  275. package/dist/index-dmBRpHHY.js +0 -137
  276. package/dist/index-kBdB14Fz.js +0 -341
  277. package/dist/index-uBhy41le.js +0 -249
  278. package/dist/index-zZrijNsr.js +0 -299
  279. package/dist/javascript-C2yteZeJ.js +0 -691
  280. package/dist/jinja2-DnB6dQmV.js +0 -154
  281. package/dist/julia-DpvXAuO6.js +0 -241
  282. package/dist/livescript-CanGTf8u.js +0 -272
  283. package/dist/lua-XplVlWi_.js +0 -217
  284. package/dist/mathematica-jaRHnSxC.js +0 -35
  285. package/dist/mbox-BctzC1hL.js +0 -76
  286. package/dist/mirc-CFBPAOaF.js +0 -72
  287. package/dist/mllike-BSnXJBGA.js +0 -272
  288. package/dist/modelica-vUgVs--1.js +0 -93
  289. package/dist/mscgen-Cpl0NYLN.js +0 -104
  290. package/dist/mumps-CQoS1kWX.js +0 -25
  291. package/dist/nginx-zDPm3Z74.js +0 -89
  292. package/dist/nsis-fePjrhq7.js +0 -62
  293. package/dist/ntriples-CsNjv2QF.js +0 -79
  294. package/dist/octave-C8PmmSRH.js +0 -143
  295. package/dist/oz-Ce8aN8oE.js +0 -151
  296. package/dist/pascal-De0D6mP7.js +0 -77
  297. package/dist/perl-B4bSCe1C.js +0 -915
  298. package/dist/pig-D24Z8EXi.js +0 -54
  299. package/dist/powershell-DkYVfTzP.js +0 -249
  300. package/dist/properties-Dn9wna3M.js +0 -26
  301. package/dist/protobuf-BPIjwpzm.js +0 -49
  302. package/dist/pug-CwAQJzGR.js +0 -248
  303. package/dist/puppet-nyd4dhjf.js +0 -45
  304. package/dist/python-BkR3uSy8.js +0 -313
  305. package/dist/q-DXjKs-tC.js +0 -83
  306. package/dist/r-LKEuhEGI.js +0 -104
  307. package/dist/rpm-IznJm2Xc.js +0 -57
  308. package/dist/ruby-CcYfvIk6.js +0 -228
  309. package/dist/sas-7E8yHoCW.js +0 -105
  310. package/dist/scheme-DjibxsNh.js +0 -124
  311. package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts +0 -113
  312. package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts.map +0 -1
  313. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts +0 -3
  314. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts.map +0 -1
  315. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts +0 -102
  316. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts.map +0 -1
  317. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts +0 -4
  318. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts.map +0 -1
  319. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts +0 -3
  320. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts.map +0 -1
  321. package/dist/shell-C0C2sNA_.js +0 -182
  322. package/dist/sieve-Bwz7vjP5.js +0 -72
  323. package/dist/simple-mode-B0dvCdAA.js +0 -89
  324. package/dist/smalltalk-Bhddl2pB.js +0 -48
  325. package/dist/solr-BNlsLglM.js +0 -41
  326. package/dist/sparql-FarWu_Gb.js +0 -197
  327. package/dist/spreadsheet-C-cy4P5N.js +0 -49
  328. package/dist/sql-CfG5lQ3l.js +0 -282
  329. package/dist/stex-Du4h4KAU.js +0 -129
  330. package/dist/stylus-CAdqWld3.js +0 -250
  331. package/dist/swift-DSxqR9R6.js +0 -230
  332. package/dist/tcl-xfoLljhY.js +0 -81
  333. package/dist/textile-D1AWE-pc.js +0 -295
  334. package/dist/tiddlywiki-5wqsXtSk.js +0 -155
  335. package/dist/tiki-__Kn3CeS.js +0 -181
  336. package/dist/toml-BHiuTcfn.js +0 -49
  337. package/dist/troff-D2UO-fKf.js +0 -35
  338. package/dist/ttcn-Bsa4sfRm.js +0 -123
  339. package/dist/ttcn-cfg-Bac_acMi.js +0 -88
  340. package/dist/turtle-xwJUxoPV.js +0 -80
  341. package/dist/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue.d.ts +0 -7
  342. package/dist/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue.d.ts.map +0 -1
  343. package/dist/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue.d.ts +0 -7
  344. package/dist/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue.d.ts.map +0 -1
  345. package/dist/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue.d.ts +0 -7
  346. package/dist/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue.d.ts.map +0 -1
  347. package/dist/ui/components/atoms/vc-icon/icons/BellIcon.vue.d.ts +0 -7
  348. package/dist/ui/components/atoms/vc-icon/icons/BellIcon.vue.d.ts.map +0 -1
  349. package/dist/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue.d.ts +0 -7
  350. package/dist/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue.d.ts.map +0 -1
  351. package/dist/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue.d.ts +0 -7
  352. package/dist/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue.d.ts.map +0 -1
  353. package/dist/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue.d.ts +0 -7
  354. package/dist/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue.d.ts.map +0 -1
  355. package/dist/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue.d.ts +0 -7
  356. package/dist/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue.d.ts.map +0 -1
  357. package/dist/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue.d.ts +0 -7
  358. package/dist/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue.d.ts.map +0 -1
  359. package/dist/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue.d.ts +0 -7
  360. package/dist/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue.d.ts.map +0 -1
  361. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue.d.ts +0 -7
  362. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue.d.ts.map +0 -1
  363. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue.d.ts +0 -7
  364. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue.d.ts.map +0 -1
  365. package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts +0 -7
  366. package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts.map +0 -1
  367. package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts +0 -7
  368. package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts.map +0 -1
  369. package/dist/ui/components/atoms/vc-icon/icons/LogoutIcon.vue.d.ts +0 -7
  370. package/dist/ui/components/atoms/vc-icon/icons/LogoutIcon.vue.d.ts.map +0 -1
  371. package/dist/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue.d.ts +0 -7
  372. package/dist/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue.d.ts.map +0 -1
  373. package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts +0 -7
  374. package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts.map +0 -1
  375. package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts +0 -7
  376. package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts.map +0 -1
  377. package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts +0 -7
  378. package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts.map +0 -1
  379. package/dist/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue.d.ts +0 -7
  380. package/dist/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue.d.ts.map +0 -1
  381. package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts +0 -7
  382. package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts.map +0 -1
  383. package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts +0 -7
  384. package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts.map +0 -1
  385. package/dist/ui/components/atoms/vc-icon/icons/SearchIcon.vue.d.ts +0 -7
  386. package/dist/ui/components/atoms/vc-icon/icons/SearchIcon.vue.d.ts.map +0 -1
  387. package/dist/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue.d.ts +0 -7
  388. package/dist/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue.d.ts.map +0 -1
  389. package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts +0 -7
  390. package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts.map +0 -1
  391. package/dist/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue.d.ts +0 -7
  392. package/dist/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue.d.ts.map +0 -1
  393. package/dist/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue.d.ts +0 -7
  394. package/dist/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue.d.ts.map +0 -1
  395. package/dist/vb-c2kQGd6-.js +0 -74
  396. package/dist/vbscript-1f_Dhg5H.js +0 -324
  397. package/dist/velocity-DJd0pTTC.js +0 -96
  398. package/dist/verilog-CiS1jyi5.js +0 -262
  399. package/dist/vhdl-T9HkrbI2.js +0 -106
  400. package/dist/webidl-CjfDENEo.js +0 -155
  401. package/dist/xquery-BUQdORAS.js +0 -422
  402. package/dist/yacas-C0absKBh.js +0 -73
  403. package/dist/z80-Pki2zAjW.js +0 -61
  404. package/shared/modules/dynamic/components/fields/storybook/Button.stories.ts +0 -186
  405. package/shared/modules/dynamic/components/fields/storybook/Card.stories.ts +0 -175
  406. package/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.ts +0 -185
  407. package/shared/modules/dynamic/components/fields/storybook/ContentField.stories.ts +0 -245
  408. package/shared/modules/dynamic/components/fields/storybook/EditorField.stories.ts +0 -192
  409. package/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.ts +0 -347
  410. package/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.ts +0 -239
  411. package/shared/modules/dynamic/components/fields/storybook/ImageField.stories.ts +0 -186
  412. package/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.ts +0 -281
  413. package/shared/modules/dynamic/components/fields/storybook/InputField.stories.ts +0 -312
  414. package/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.ts +0 -361
  415. package/shared/modules/dynamic/components/fields/storybook/RadioButtonGroup.stories.ts +0 -224
  416. package/shared/modules/dynamic/components/fields/storybook/RatingField.stories.ts +0 -131
  417. package/shared/modules/dynamic/components/fields/storybook/SelectField.stories.ts +0 -666
  418. package/shared/modules/dynamic/components/fields/storybook/StatusField.stories.ts +0 -202
  419. package/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.ts +0 -178
  420. package/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.ts +0 -203
  421. package/shared/modules/dynamic/components/fields/storybook/VideoField.stories.ts +0 -92
  422. package/shared/modules/dynamic/components/fields/storybook/common/args.ts +0 -130
  423. package/shared/modules/dynamic/components/fields/storybook/common/templates.ts +0 -8
  424. package/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.ts +0 -54
  425. package/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.ts +0 -16
  426. package/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.ts +0 -41
  427. package/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue +0 -15
  428. package/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue +0 -20
  429. package/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue +0 -13
  430. package/ui/components/atoms/vc-icon/icons/BellIcon.vue +0 -14
  431. package/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue +0 -13
  432. package/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue +0 -13
  433. package/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue +0 -13
  434. package/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue +0 -13
  435. package/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue +0 -16
  436. package/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue +0 -20
  437. package/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue +0 -14
  438. package/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue +0 -14
  439. package/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue +0 -27
  440. package/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue +0 -22
  441. package/ui/components/atoms/vc-icon/icons/LogoutIcon.vue +0 -13
  442. package/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue +0 -14
  443. package/ui/components/atoms/vc-icon/icons/OffersIcon.vue +0 -23
  444. package/ui/components/atoms/vc-icon/icons/OrdersIcon.vue +0 -19
  445. package/ui/components/atoms/vc-icon/icons/PeopleIcon.vue +0 -21
  446. package/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue +0 -20
  447. package/ui/components/atoms/vc-icon/icons/ProductsIcon.vue +0 -23
  448. package/ui/components/atoms/vc-icon/icons/ProfileIcon.vue +0 -18
  449. package/ui/components/atoms/vc-icon/icons/SearchIcon.vue +0 -14
  450. package/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue +0 -21
  451. package/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue +0 -16
  452. package/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue +0 -26
  453. package/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue +0 -19
@@ -0,0 +1,1756 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED DO NOT EDIT DIRECTLY
2
+ // See update-tlds.js for encoding/decoding format
3
+ // https://data.iana.org/TLD/tlds-alpha-by-domain.txt
4
+ const encodedTlds = 'aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2';
5
+ // Internationalized domain names containing non-ASCII
6
+ const encodedUtlds = 'ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2';
7
+
8
+ /**
9
+ * @template A
10
+ * @template B
11
+ * @param {A} target
12
+ * @param {B} properties
13
+ * @return {A & B}
14
+ */
15
+ const assign = (target, properties) => {
16
+ for (const key in properties) {
17
+ target[key] = properties[key];
18
+ }
19
+ return target;
20
+ };
21
+
22
+ /**
23
+ * Finite State Machine generation utilities
24
+ */
25
+
26
+ /**
27
+ * @template T
28
+ * @typedef {{ [group: string]: T[] }} Collections
29
+ */
30
+
31
+ /**
32
+ * @typedef {{ [group: string]: true }} Flags
33
+ */
34
+
35
+ // Keys in scanner Collections instances
36
+ const numeric = 'numeric';
37
+ const ascii = 'ascii';
38
+ const alpha = 'alpha';
39
+ const asciinumeric = 'asciinumeric';
40
+ const alphanumeric = 'alphanumeric';
41
+ const domain = 'domain';
42
+ const emoji = 'emoji';
43
+ const scheme = 'scheme';
44
+ const slashscheme = 'slashscheme';
45
+ const whitespace = 'whitespace';
46
+
47
+ /**
48
+ * @template T
49
+ * @param {string} name
50
+ * @param {Collections<T>} groups to register in
51
+ * @returns {T[]} Current list of tokens in the given collection
52
+ */
53
+ function registerGroup(name, groups) {
54
+ if (!(name in groups)) {
55
+ groups[name] = [];
56
+ }
57
+ return groups[name];
58
+ }
59
+
60
+ /**
61
+ * @template T
62
+ * @param {T} t token to add
63
+ * @param {Collections<T>} groups
64
+ * @param {Flags} flags
65
+ */
66
+ function addToGroups(t, flags, groups) {
67
+ if (flags[numeric]) {
68
+ flags[asciinumeric] = true;
69
+ flags[alphanumeric] = true;
70
+ }
71
+ if (flags[ascii]) {
72
+ flags[asciinumeric] = true;
73
+ flags[alpha] = true;
74
+ }
75
+ if (flags[asciinumeric]) {
76
+ flags[alphanumeric] = true;
77
+ }
78
+ if (flags[alpha]) {
79
+ flags[alphanumeric] = true;
80
+ }
81
+ if (flags[alphanumeric]) {
82
+ flags[domain] = true;
83
+ }
84
+ if (flags[emoji]) {
85
+ flags[domain] = true;
86
+ }
87
+ for (const k in flags) {
88
+ const group = registerGroup(k, groups);
89
+ if (group.indexOf(t) < 0) {
90
+ group.push(t);
91
+ }
92
+ }
93
+ }
94
+
95
+ /**
96
+ * @template T
97
+ * @param {T} t token to check
98
+ * @param {Collections<T>} groups
99
+ * @returns {Flags} group flags that contain this token
100
+ */
101
+ function flagsForToken(t, groups) {
102
+ const result = {};
103
+ for (const c in groups) {
104
+ if (groups[c].indexOf(t) >= 0) {
105
+ result[c] = true;
106
+ }
107
+ }
108
+ return result;
109
+ }
110
+
111
+ /**
112
+ * @template T
113
+ * @typedef {null | T } Transition
114
+ */
115
+
116
+ /**
117
+ * Define a basic state machine state. j is the list of character transitions,
118
+ * jr is the list of regex-match transitions, jd is the default state to
119
+ * transition to t is the accepting token type, if any. If this is the terminal
120
+ * state, then it does not emit a token.
121
+ *
122
+ * The template type T represents the type of the token this state accepts. This
123
+ * should be a string (such as of the token exports in `text.js`) or a
124
+ * MultiToken subclass (from `multi.js`)
125
+ *
126
+ * @template T
127
+ * @param {T} [token] Token that this state emits
128
+ */
129
+ function State(token = null) {
130
+ // this.n = null; // DEBUG: State name
131
+ /** @type {{ [input: string]: State<T> }} j */
132
+ this.j = {}; // IMPLEMENTATION 1
133
+ // this.j = []; // IMPLEMENTATION 2
134
+ /** @type {[RegExp, State<T>][]} jr */
135
+ this.jr = [];
136
+ /** @type {?State<T>} jd */
137
+ this.jd = null;
138
+ /** @type {?T} t */
139
+ this.t = token;
140
+ }
141
+
142
+ /**
143
+ * Scanner token groups
144
+ * @type Collections<string>
145
+ */
146
+ State.groups = {};
147
+ State.prototype = {
148
+ accepts() {
149
+ return !!this.t;
150
+ },
151
+ /**
152
+ * Follow an existing transition from the given input to the next state.
153
+ * Does not mutate.
154
+ * @param {string} input character or token type to transition on
155
+ * @returns {?State<T>} the next state, if any
156
+ */
157
+ go(input) {
158
+ const state = this;
159
+ const nextState = state.j[input];
160
+ if (nextState) {
161
+ return nextState;
162
+ }
163
+ for (let i = 0; i < state.jr.length; i++) {
164
+ const regex = state.jr[i][0];
165
+ const nextState = state.jr[i][1]; // note: might be empty to prevent default jump
166
+ if (nextState && regex.test(input)) {
167
+ return nextState;
168
+ }
169
+ }
170
+ // Nowhere left to jump! Return default, if any
171
+ return state.jd;
172
+ },
173
+ /**
174
+ * Whether the state has a transition for the given input. Set the second
175
+ * argument to true to only look for an exact match (and not a default or
176
+ * regular-expression-based transition)
177
+ * @param {string} input
178
+ * @param {boolean} exactOnly
179
+ */
180
+ has(input, exactOnly = false) {
181
+ return exactOnly ? input in this.j : !!this.go(input);
182
+ },
183
+ /**
184
+ * Short for "transition all"; create a transition from the array of items
185
+ * in the given list to the same final resulting state.
186
+ * @param {string | string[]} inputs Group of inputs to transition on
187
+ * @param {Transition<T> | State<T>} [next] Transition options
188
+ * @param {Flags} [flags] Collections flags to add token to
189
+ * @param {Collections<T>} [groups] Master list of token groups
190
+ */
191
+ ta(inputs, next, flags, groups) {
192
+ for (let i = 0; i < inputs.length; i++) {
193
+ this.tt(inputs[i], next, flags, groups);
194
+ }
195
+ },
196
+ /**
197
+ * Short for "take regexp transition"; defines a transition for this state
198
+ * when it encounters a token which matches the given regular expression
199
+ * @param {RegExp} regexp Regular expression transition (populate first)
200
+ * @param {T | State<T>} [next] Transition options
201
+ * @param {Flags} [flags] Collections flags to add token to
202
+ * @param {Collections<T>} [groups] Master list of token groups
203
+ * @returns {State<T>} taken after the given input
204
+ */
205
+ tr(regexp, next, flags, groups) {
206
+ groups = groups || State.groups;
207
+ let nextState;
208
+ if (next && next.j) {
209
+ nextState = next;
210
+ } else {
211
+ // Token with maybe token groups
212
+ nextState = new State(next);
213
+ if (flags && groups) {
214
+ addToGroups(next, flags, groups);
215
+ }
216
+ }
217
+ this.jr.push([regexp, nextState]);
218
+ return nextState;
219
+ },
220
+ /**
221
+ * Short for "take transitions", will take as many sequential transitions as
222
+ * the length of the given input and returns the
223
+ * resulting final state.
224
+ * @param {string | string[]} input
225
+ * @param {T | State<T>} [next] Transition options
226
+ * @param {Flags} [flags] Collections flags to add token to
227
+ * @param {Collections<T>} [groups] Master list of token groups
228
+ * @returns {State<T>} taken after the given input
229
+ */
230
+ ts(input, next, flags, groups) {
231
+ let state = this;
232
+ const len = input.length;
233
+ if (!len) {
234
+ return state;
235
+ }
236
+ for (let i = 0; i < len - 1; i++) {
237
+ state = state.tt(input[i]);
238
+ }
239
+ return state.tt(input[len - 1], next, flags, groups);
240
+ },
241
+ /**
242
+ * Short for "take transition", this is a method for building/working with
243
+ * state machines.
244
+ *
245
+ * If a state already exists for the given input, returns it.
246
+ *
247
+ * If a token is specified, that state will emit that token when reached by
248
+ * the linkify engine.
249
+ *
250
+ * If no state exists, it will be initialized with some default transitions
251
+ * that resemble existing default transitions.
252
+ *
253
+ * If a state is given for the second argument, that state will be
254
+ * transitioned to on the given input regardless of what that input
255
+ * previously did.
256
+ *
257
+ * Specify a token group flags to define groups that this token belongs to.
258
+ * The token will be added to corresponding entires in the given groups
259
+ * object.
260
+ *
261
+ * @param {string} input character, token type to transition on
262
+ * @param {T | State<T>} [next] Transition options
263
+ * @param {Flags} [flags] Collections flags to add token to
264
+ * @param {Collections<T>} [groups] Master list of groups
265
+ * @returns {State<T>} taken after the given input
266
+ */
267
+ tt(input, next, flags, groups) {
268
+ groups = groups || State.groups;
269
+ const state = this;
270
+
271
+ // Check if existing state given, just a basic transition
272
+ if (next && next.j) {
273
+ state.j[input] = next;
274
+ return next;
275
+ }
276
+ const t = next;
277
+
278
+ // Take the transition with the usual default mechanisms and use that as
279
+ // a template for creating the next state
280
+ let nextState,
281
+ templateState = state.go(input);
282
+ if (templateState) {
283
+ nextState = new State();
284
+ assign(nextState.j, templateState.j);
285
+ nextState.jr.push.apply(nextState.jr, templateState.jr);
286
+ nextState.jd = templateState.jd;
287
+ nextState.t = templateState.t;
288
+ } else {
289
+ nextState = new State();
290
+ }
291
+ if (t) {
292
+ // Ensure newly token is in the same groups as the old token
293
+ if (groups) {
294
+ if (nextState.t && typeof nextState.t === 'string') {
295
+ const allFlags = assign(flagsForToken(nextState.t, groups), flags);
296
+ addToGroups(t, allFlags, groups);
297
+ } else if (flags) {
298
+ addToGroups(t, flags, groups);
299
+ }
300
+ }
301
+ nextState.t = t; // overwrite anything that was previously there
302
+ }
303
+ state.j[input] = nextState;
304
+ return nextState;
305
+ }
306
+ };
307
+
308
+ // Helper functions to improve minification (not exported outside linkifyjs module)
309
+
310
+ /**
311
+ * @template T
312
+ * @param {State<T>} state
313
+ * @param {string | string[]} input
314
+ * @param {Flags} [flags]
315
+ * @param {Collections<T>} [groups]
316
+ */
317
+ const ta = (state, input, next, flags, groups) => state.ta(input, next, flags, groups);
318
+
319
+ /**
320
+ * @template T
321
+ * @param {State<T>} state
322
+ * @param {RegExp} regexp
323
+ * @param {T | State<T>} [next]
324
+ * @param {Flags} [flags]
325
+ * @param {Collections<T>} [groups]
326
+ */
327
+ const tr = (state, regexp, next, flags, groups) => state.tr(regexp, next, flags, groups);
328
+
329
+ /**
330
+ * @template T
331
+ * @param {State<T>} state
332
+ * @param {string | string[]} input
333
+ * @param {T | State<T>} [next]
334
+ * @param {Flags} [flags]
335
+ * @param {Collections<T>} [groups]
336
+ */
337
+ const ts = (state, input, next, flags, groups) => state.ts(input, next, flags, groups);
338
+
339
+ /**
340
+ * @template T
341
+ * @param {State<T>} state
342
+ * @param {string} input
343
+ * @param {T | State<T>} [next]
344
+ * @param {Collections<T>} [groups]
345
+ * @param {Flags} [flags]
346
+ */
347
+ const tt = (state, input, next, flags, groups) => state.tt(input, next, flags, groups);
348
+
349
+ /******************************************************************************
350
+ Text Tokens
351
+ Identifiers for token outputs from the regexp scanner
352
+ ******************************************************************************/
353
+
354
+ // A valid web domain token
355
+ const WORD = 'WORD'; // only contains a-z
356
+ const UWORD = 'UWORD'; // contains letters other than a-z, used for IDN
357
+ const ASCIINUMERICAL = 'ASCIINUMERICAL'; // contains a-z, 0-9
358
+ const ALPHANUMERICAL = 'ALPHANUMERICAL'; // contains numbers and letters other than a-z, used for IDN
359
+
360
+ // Special case of word
361
+ const LOCALHOST = 'LOCALHOST';
362
+
363
+ // Valid top-level domain, special case of WORD (see tlds.js)
364
+ const TLD = 'TLD';
365
+
366
+ // Valid IDN TLD, special case of UWORD (see tlds.js)
367
+ const UTLD = 'UTLD';
368
+
369
+ // The scheme portion of a web URI protocol. Supported types include: `mailto`,
370
+ // `file`, and user-defined custom protocols. Limited to schemes that contain
371
+ // only letters
372
+ const SCHEME = 'SCHEME';
373
+
374
+ // Similar to SCHEME, except makes distinction for schemes that must always be
375
+ // followed by `://`, not just `:`. Supported types include `http`, `https`,
376
+ // `ftp`, `ftps`
377
+ const SLASH_SCHEME = 'SLASH_SCHEME';
378
+
379
+ // Any sequence of digits 0-9
380
+ const NUM = 'NUM';
381
+
382
+ // Any number of consecutive whitespace characters that are not newline
383
+ const WS = 'WS';
384
+
385
+ // New line (unix style)
386
+ const NL = 'NL'; // \n
387
+
388
+ // Opening/closing bracket classes
389
+ // TODO: Rename OPEN -> LEFT and CLOSE -> RIGHT in v5 to fit with Unicode names
390
+ // Also rename angle brackes to LESSTHAN and GREATER THAN
391
+ const OPENBRACE = 'OPENBRACE'; // {
392
+ const CLOSEBRACE = 'CLOSEBRACE'; // }
393
+ const OPENBRACKET = 'OPENBRACKET'; // [
394
+ const CLOSEBRACKET = 'CLOSEBRACKET'; // ]
395
+ const OPENPAREN = 'OPENPAREN'; // (
396
+ const CLOSEPAREN = 'CLOSEPAREN'; // )
397
+ const OPENANGLEBRACKET = 'OPENANGLEBRACKET'; // <
398
+ const CLOSEANGLEBRACKET = 'CLOSEANGLEBRACKET'; // >
399
+ const FULLWIDTHLEFTPAREN = 'FULLWIDTHLEFTPAREN'; // (
400
+ const FULLWIDTHRIGHTPAREN = 'FULLWIDTHRIGHTPAREN'; // )
401
+ const LEFTCORNERBRACKET = 'LEFTCORNERBRACKET'; // 「
402
+ const RIGHTCORNERBRACKET = 'RIGHTCORNERBRACKET'; // 」
403
+ const LEFTWHITECORNERBRACKET = 'LEFTWHITECORNERBRACKET'; // 『
404
+ const RIGHTWHITECORNERBRACKET = 'RIGHTWHITECORNERBRACKET'; // 』
405
+ const FULLWIDTHLESSTHAN = 'FULLWIDTHLESSTHAN'; // <
406
+ const FULLWIDTHGREATERTHAN = 'FULLWIDTHGREATERTHAN'; // >
407
+
408
+ // Various symbols
409
+ const AMPERSAND = 'AMPERSAND'; // &
410
+ const APOSTROPHE = 'APOSTROPHE'; // '
411
+ const ASTERISK = 'ASTERISK'; // *
412
+ const AT = 'AT'; // @
413
+ const BACKSLASH = 'BACKSLASH'; // \
414
+ const BACKTICK = 'BACKTICK'; // `
415
+ const CARET = 'CARET'; // ^
416
+ const COLON = 'COLON'; // :
417
+ const COMMA = 'COMMA'; // ,
418
+ const DOLLAR = 'DOLLAR'; // $
419
+ const DOT = 'DOT'; // .
420
+ const EQUALS = 'EQUALS'; // =
421
+ const EXCLAMATION = 'EXCLAMATION'; // !
422
+ const HYPHEN = 'HYPHEN'; // -
423
+ const PERCENT = 'PERCENT'; // %
424
+ const PIPE = 'PIPE'; // |
425
+ const PLUS = 'PLUS'; // +
426
+ const POUND = 'POUND'; // #
427
+ const QUERY = 'QUERY'; // ?
428
+ const QUOTE = 'QUOTE'; // "
429
+ const FULLWIDTHMIDDLEDOT = 'FULLWIDTHMIDDLEDOT'; // ・
430
+
431
+ const SEMI = 'SEMI'; // ;
432
+ const SLASH = 'SLASH'; // /
433
+ const TILDE = 'TILDE'; // ~
434
+ const UNDERSCORE = 'UNDERSCORE'; // _
435
+
436
+ // Emoji symbol
437
+ const EMOJI$1 = 'EMOJI';
438
+
439
+ // Default token - anything that is not one of the above
440
+ const SYM = 'SYM';
441
+
442
+ var tk = /*#__PURE__*/Object.freeze({
443
+ __proto__: null,
444
+ ALPHANUMERICAL: ALPHANUMERICAL,
445
+ AMPERSAND: AMPERSAND,
446
+ APOSTROPHE: APOSTROPHE,
447
+ ASCIINUMERICAL: ASCIINUMERICAL,
448
+ ASTERISK: ASTERISK,
449
+ AT: AT,
450
+ BACKSLASH: BACKSLASH,
451
+ BACKTICK: BACKTICK,
452
+ CARET: CARET,
453
+ CLOSEANGLEBRACKET: CLOSEANGLEBRACKET,
454
+ CLOSEBRACE: CLOSEBRACE,
455
+ CLOSEBRACKET: CLOSEBRACKET,
456
+ CLOSEPAREN: CLOSEPAREN,
457
+ COLON: COLON,
458
+ COMMA: COMMA,
459
+ DOLLAR: DOLLAR,
460
+ DOT: DOT,
461
+ EMOJI: EMOJI$1,
462
+ EQUALS: EQUALS,
463
+ EXCLAMATION: EXCLAMATION,
464
+ FULLWIDTHGREATERTHAN: FULLWIDTHGREATERTHAN,
465
+ FULLWIDTHLEFTPAREN: FULLWIDTHLEFTPAREN,
466
+ FULLWIDTHLESSTHAN: FULLWIDTHLESSTHAN,
467
+ FULLWIDTHMIDDLEDOT: FULLWIDTHMIDDLEDOT,
468
+ FULLWIDTHRIGHTPAREN: FULLWIDTHRIGHTPAREN,
469
+ HYPHEN: HYPHEN,
470
+ LEFTCORNERBRACKET: LEFTCORNERBRACKET,
471
+ LEFTWHITECORNERBRACKET: LEFTWHITECORNERBRACKET,
472
+ LOCALHOST: LOCALHOST,
473
+ NL: NL,
474
+ NUM: NUM,
475
+ OPENANGLEBRACKET: OPENANGLEBRACKET,
476
+ OPENBRACE: OPENBRACE,
477
+ OPENBRACKET: OPENBRACKET,
478
+ OPENPAREN: OPENPAREN,
479
+ PERCENT: PERCENT,
480
+ PIPE: PIPE,
481
+ PLUS: PLUS,
482
+ POUND: POUND,
483
+ QUERY: QUERY,
484
+ QUOTE: QUOTE,
485
+ RIGHTCORNERBRACKET: RIGHTCORNERBRACKET,
486
+ RIGHTWHITECORNERBRACKET: RIGHTWHITECORNERBRACKET,
487
+ SCHEME: SCHEME,
488
+ SEMI: SEMI,
489
+ SLASH: SLASH,
490
+ SLASH_SCHEME: SLASH_SCHEME,
491
+ SYM: SYM,
492
+ TILDE: TILDE,
493
+ TLD: TLD,
494
+ UNDERSCORE: UNDERSCORE,
495
+ UTLD: UTLD,
496
+ UWORD: UWORD,
497
+ WORD: WORD,
498
+ WS: WS
499
+ });
500
+
501
+ // Note that these two Unicode ones expand into a really big one with Babel
502
+ const ASCII_LETTER = /[a-z]/;
503
+ const LETTER = /\p{L}/u; // Any Unicode character with letter data type
504
+ const EMOJI = /\p{Emoji}/u; // Any Unicode emoji character
505
+ const DIGIT = /\d/;
506
+ const SPACE = /\s/;
507
+
508
+ /**
509
+ The scanner provides an interface that takes a string of text as input, and
510
+ outputs an array of tokens instances that can be used for easy URL parsing.
511
+ */
512
+
513
+ const CR = '\r'; // carriage-return character
514
+ const LF = '\n'; // line-feed character
515
+ const EMOJI_VARIATION = '\ufe0f'; // Variation selector, follows heart and others
516
+ const EMOJI_JOINER = '\u200d'; // zero-width joiner
517
+ const OBJECT_REPLACEMENT = '\ufffc'; // whitespace placeholder that sometimes appears in rich text editors
518
+
519
+ let tlds = null,
520
+ utlds = null; // don't change so only have to be computed once
521
+
522
+ /**
523
+ * Scanner output token:
524
+ * - `t` is the token name (e.g., 'NUM', 'EMOJI', 'TLD')
525
+ * - `v` is the value of the token (e.g., '123', '❤️', 'com')
526
+ * - `s` is the start index of the token in the original string
527
+ * - `e` is the end index of the token in the original string
528
+ * @typedef {{t: string, v: string, s: number, e: number}} Token
529
+ */
530
+
531
+ /**
532
+ * @template T
533
+ * @typedef {{ [collection: string]: T[] }} Collections
534
+ */
535
+
536
+ /**
537
+ * Initialize the scanner character-based state machine for the given start
538
+ * state
539
+ * @param {[string, boolean][]} customSchemes List of custom schemes, where each
540
+ * item is a length-2 tuple with the first element set to the string scheme, and
541
+ * the second element set to `true` if the `://` after the scheme is optional
542
+ */
543
+ function init$2(customSchemes = []) {
544
+ // Frequently used states (name argument removed during minification)
545
+ /** @type Collections<string> */
546
+ const groups = {}; // of tokens
547
+ State.groups = groups;
548
+ /** @type State<string> */
549
+ const Start = new State();
550
+ if (tlds == null) {
551
+ tlds = decodeTlds(encodedTlds);
552
+ }
553
+ if (utlds == null) {
554
+ utlds = decodeTlds(encodedUtlds);
555
+ }
556
+
557
+ // States for special URL symbols that accept immediately after start
558
+ tt(Start, "'", APOSTROPHE);
559
+ tt(Start, '{', OPENBRACE);
560
+ tt(Start, '}', CLOSEBRACE);
561
+ tt(Start, '[', OPENBRACKET);
562
+ tt(Start, ']', CLOSEBRACKET);
563
+ tt(Start, '(', OPENPAREN);
564
+ tt(Start, ')', CLOSEPAREN);
565
+ tt(Start, '<', OPENANGLEBRACKET);
566
+ tt(Start, '>', CLOSEANGLEBRACKET);
567
+ tt(Start, '(', FULLWIDTHLEFTPAREN);
568
+ tt(Start, ')', FULLWIDTHRIGHTPAREN);
569
+ tt(Start, '「', LEFTCORNERBRACKET);
570
+ tt(Start, '」', RIGHTCORNERBRACKET);
571
+ tt(Start, '『', LEFTWHITECORNERBRACKET);
572
+ tt(Start, '』', RIGHTWHITECORNERBRACKET);
573
+ tt(Start, '<', FULLWIDTHLESSTHAN);
574
+ tt(Start, '>', FULLWIDTHGREATERTHAN);
575
+ tt(Start, '&', AMPERSAND);
576
+ tt(Start, '*', ASTERISK);
577
+ tt(Start, '@', AT);
578
+ tt(Start, '`', BACKTICK);
579
+ tt(Start, '^', CARET);
580
+ tt(Start, ':', COLON);
581
+ tt(Start, ',', COMMA);
582
+ tt(Start, '$', DOLLAR);
583
+ tt(Start, '.', DOT);
584
+ tt(Start, '=', EQUALS);
585
+ tt(Start, '!', EXCLAMATION);
586
+ tt(Start, '-', HYPHEN);
587
+ tt(Start, '%', PERCENT);
588
+ tt(Start, '|', PIPE);
589
+ tt(Start, '+', PLUS);
590
+ tt(Start, '#', POUND);
591
+ tt(Start, '?', QUERY);
592
+ tt(Start, '"', QUOTE);
593
+ tt(Start, '/', SLASH);
594
+ tt(Start, ';', SEMI);
595
+ tt(Start, '~', TILDE);
596
+ tt(Start, '_', UNDERSCORE);
597
+ tt(Start, '\\', BACKSLASH);
598
+ tt(Start, '・', FULLWIDTHMIDDLEDOT);
599
+ const Num = tr(Start, DIGIT, NUM, {
600
+ [numeric]: true
601
+ });
602
+ tr(Num, DIGIT, Num);
603
+ const Asciinumeric = tr(Num, ASCII_LETTER, ASCIINUMERICAL, {
604
+ [asciinumeric]: true
605
+ });
606
+ const Alphanumeric = tr(Num, LETTER, ALPHANUMERICAL, {
607
+ [alphanumeric]: true
608
+ });
609
+
610
+ // State which emits a word token
611
+ const Word = tr(Start, ASCII_LETTER, WORD, {
612
+ [ascii]: true
613
+ });
614
+ tr(Word, DIGIT, Asciinumeric);
615
+ tr(Word, ASCII_LETTER, Word);
616
+ tr(Asciinumeric, DIGIT, Asciinumeric);
617
+ tr(Asciinumeric, ASCII_LETTER, Asciinumeric);
618
+
619
+ // Same as previous, but specific to non-fsm.ascii alphabet words
620
+ const UWord = tr(Start, LETTER, UWORD, {
621
+ [alpha]: true
622
+ });
623
+ tr(UWord, ASCII_LETTER); // Non-accepting
624
+ tr(UWord, DIGIT, Alphanumeric);
625
+ tr(UWord, LETTER, UWord);
626
+ tr(Alphanumeric, DIGIT, Alphanumeric);
627
+ tr(Alphanumeric, ASCII_LETTER); // Non-accepting
628
+ tr(Alphanumeric, LETTER, Alphanumeric); // Non-accepting
629
+
630
+ // Whitespace jumps
631
+ // Tokens of only non-newline whitespace are arbitrarily long
632
+ // If any whitespace except newline, more whitespace!
633
+ const Nl = tt(Start, LF, NL, {
634
+ [whitespace]: true
635
+ });
636
+ const Cr = tt(Start, CR, WS, {
637
+ [whitespace]: true
638
+ });
639
+ const Ws = tr(Start, SPACE, WS, {
640
+ [whitespace]: true
641
+ });
642
+ tt(Start, OBJECT_REPLACEMENT, Ws);
643
+ tt(Cr, LF, Nl); // \r\n
644
+ tt(Cr, OBJECT_REPLACEMENT, Ws);
645
+ tr(Cr, SPACE, Ws);
646
+ tt(Ws, CR); // non-accepting state to avoid mixing whitespaces
647
+ tt(Ws, LF); // non-accepting state to avoid mixing whitespaces
648
+ tr(Ws, SPACE, Ws);
649
+ tt(Ws, OBJECT_REPLACEMENT, Ws);
650
+
651
+ // Emoji tokens. They are not grouped by the scanner except in cases where a
652
+ // zero-width joiner is present
653
+ const Emoji = tr(Start, EMOJI, EMOJI$1, {
654
+ [emoji]: true
655
+ });
656
+ tt(Emoji, '#'); // no transition, emoji regex seems to match #
657
+ tr(Emoji, EMOJI, Emoji);
658
+ tt(Emoji, EMOJI_VARIATION, Emoji);
659
+ // tt(Start, EMOJI_VARIATION, Emoji); // This one is sketchy
660
+
661
+ const EmojiJoiner = tt(Emoji, EMOJI_JOINER);
662
+ tt(EmojiJoiner, '#');
663
+ tr(EmojiJoiner, EMOJI, Emoji);
664
+ // tt(EmojiJoiner, EMOJI_VARIATION, Emoji); // also sketchy
665
+
666
+ // Generates states for top-level domains
667
+ // Note that this is most accurate when tlds are in alphabetical order
668
+ const wordjr = [[ASCII_LETTER, Word], [DIGIT, Asciinumeric]];
669
+ const uwordjr = [[ASCII_LETTER, null], [LETTER, UWord], [DIGIT, Alphanumeric]];
670
+ for (let i = 0; i < tlds.length; i++) {
671
+ fastts(Start, tlds[i], TLD, WORD, wordjr);
672
+ }
673
+ for (let i = 0; i < utlds.length; i++) {
674
+ fastts(Start, utlds[i], UTLD, UWORD, uwordjr);
675
+ }
676
+ addToGroups(TLD, {
677
+ tld: true,
678
+ ascii: true
679
+ }, groups);
680
+ addToGroups(UTLD, {
681
+ utld: true,
682
+ alpha: true
683
+ }, groups);
684
+
685
+ // Collect the states generated by different protocols. NOTE: If any new TLDs
686
+ // get added that are also protocols, set the token to be the same as the
687
+ // protocol to ensure parsing works as expected.
688
+ fastts(Start, 'file', SCHEME, WORD, wordjr);
689
+ fastts(Start, 'mailto', SCHEME, WORD, wordjr);
690
+ fastts(Start, 'http', SLASH_SCHEME, WORD, wordjr);
691
+ fastts(Start, 'https', SLASH_SCHEME, WORD, wordjr);
692
+ fastts(Start, 'ftp', SLASH_SCHEME, WORD, wordjr);
693
+ fastts(Start, 'ftps', SLASH_SCHEME, WORD, wordjr);
694
+ addToGroups(SCHEME, {
695
+ scheme: true,
696
+ ascii: true
697
+ }, groups);
698
+ addToGroups(SLASH_SCHEME, {
699
+ slashscheme: true,
700
+ ascii: true
701
+ }, groups);
702
+
703
+ // Register custom schemes. Assumes each scheme is asciinumeric with hyphens
704
+ customSchemes = customSchemes.sort((a, b) => a[0] > b[0] ? 1 : -1);
705
+ for (let i = 0; i < customSchemes.length; i++) {
706
+ const sch = customSchemes[i][0];
707
+ const optionalSlashSlash = customSchemes[i][1];
708
+ const flags = optionalSlashSlash ? {
709
+ [scheme]: true
710
+ } : {
711
+ [slashscheme]: true
712
+ };
713
+ if (sch.indexOf('-') >= 0) {
714
+ flags[domain] = true;
715
+ } else if (!ASCII_LETTER.test(sch)) {
716
+ flags[numeric] = true; // numbers only
717
+ } else if (DIGIT.test(sch)) {
718
+ flags[asciinumeric] = true;
719
+ } else {
720
+ flags[ascii] = true;
721
+ }
722
+ ts(Start, sch, sch, flags);
723
+ }
724
+
725
+ // Localhost token
726
+ ts(Start, 'localhost', LOCALHOST, {
727
+ ascii: true
728
+ });
729
+
730
+ // Set default transition for start state (some symbol)
731
+ Start.jd = new State(SYM);
732
+ return {
733
+ start: Start,
734
+ tokens: assign({
735
+ groups
736
+ }, tk)
737
+ };
738
+ }
739
+
740
+ /**
741
+ Given a string, returns an array of TOKEN instances representing the
742
+ composition of that string.
743
+
744
+ @method run
745
+ @param {State<string>} start scanner starting state
746
+ @param {string} str input string to scan
747
+ @return {Token[]} list of tokens, each with a type and value
748
+ */
749
+ function run$1(start, str) {
750
+ // State machine is not case sensitive, so input is tokenized in lowercased
751
+ // form (still returns regular case). Uses selective `toLowerCase` because
752
+ // lowercasing the entire string causes the length and character position to
753
+ // vary in some non-English strings with V8-based runtimes.
754
+ const iterable = stringToArray(str.replace(/[A-Z]/g, c => c.toLowerCase()));
755
+ const charCount = iterable.length; // <= len if there are emojis, etc
756
+ const tokens = []; // return value
757
+
758
+ // cursor through the string itself, accounting for characters that have
759
+ // width with length 2 such as emojis
760
+ let cursor = 0;
761
+
762
+ // Cursor through the array-representation of the string
763
+ let charCursor = 0;
764
+
765
+ // Tokenize the string
766
+ while (charCursor < charCount) {
767
+ let state = start;
768
+ let nextState = null;
769
+ let tokenLength = 0;
770
+ let latestAccepting = null;
771
+ let sinceAccepts = -1;
772
+ let charsSinceAccepts = -1;
773
+ while (charCursor < charCount && (nextState = state.go(iterable[charCursor]))) {
774
+ state = nextState;
775
+
776
+ // Keep track of the latest accepting state
777
+ if (state.accepts()) {
778
+ sinceAccepts = 0;
779
+ charsSinceAccepts = 0;
780
+ latestAccepting = state;
781
+ } else if (sinceAccepts >= 0) {
782
+ sinceAccepts += iterable[charCursor].length;
783
+ charsSinceAccepts++;
784
+ }
785
+ tokenLength += iterable[charCursor].length;
786
+ cursor += iterable[charCursor].length;
787
+ charCursor++;
788
+ }
789
+
790
+ // Roll back to the latest accepting state
791
+ cursor -= sinceAccepts;
792
+ charCursor -= charsSinceAccepts;
793
+ tokenLength -= sinceAccepts;
794
+
795
+ // No more jumps, just make a new token from the last accepting one
796
+ tokens.push({
797
+ t: latestAccepting.t,
798
+ // token type/name
799
+ v: str.slice(cursor - tokenLength, cursor),
800
+ // string value
801
+ s: cursor - tokenLength,
802
+ // start index
803
+ e: cursor // end index (excluding)
804
+ });
805
+ }
806
+ return tokens;
807
+ }
808
+
809
+ /**
810
+ * Convert a String to an Array of characters, taking into account that some
811
+ * characters like emojis take up two string indexes.
812
+ *
813
+ * Adapted from core-js (MIT license)
814
+ * https://github.com/zloirock/core-js/blob/2d69cf5f99ab3ea3463c395df81e5a15b68f49d9/packages/core-js/internals/string-multibyte.js
815
+ *
816
+ * @function stringToArray
817
+ * @param {string} str
818
+ * @returns {string[]}
819
+ */
820
+ function stringToArray(str) {
821
+ const result = [];
822
+ const len = str.length;
823
+ let index = 0;
824
+ while (index < len) {
825
+ let first = str.charCodeAt(index);
826
+ let second;
827
+ let char = first < 0xd800 || first > 0xdbff || index + 1 === len || (second = str.charCodeAt(index + 1)) < 0xdc00 || second > 0xdfff ? str[index] // single character
828
+ : str.slice(index, index + 2); // two-index characters
829
+ result.push(char);
830
+ index += char.length;
831
+ }
832
+ return result;
833
+ }
834
+
835
+ /**
836
+ * Fast version of ts function for when transition defaults are well known
837
+ * @param {State<string>} state
838
+ * @param {string} input
839
+ * @param {string} t
840
+ * @param {string} defaultt
841
+ * @param {[RegExp, State<string>][]} jr
842
+ * @returns {State<string>}
843
+ */
844
+ function fastts(state, input, t, defaultt, jr) {
845
+ let next;
846
+ const len = input.length;
847
+ for (let i = 0; i < len - 1; i++) {
848
+ const char = input[i];
849
+ if (state.j[char]) {
850
+ next = state.j[char];
851
+ } else {
852
+ next = new State(defaultt);
853
+ next.jr = jr.slice();
854
+ state.j[char] = next;
855
+ }
856
+ state = next;
857
+ }
858
+ next = new State(t);
859
+ next.jr = jr.slice();
860
+ state.j[input[len - 1]] = next;
861
+ return next;
862
+ }
863
+
864
+ /**
865
+ * Converts a string of Top-Level Domain names encoded in update-tlds.js back
866
+ * into a list of strings.
867
+ * @param {str} encoded encoded TLDs string
868
+ * @returns {str[]} original TLDs list
869
+ */
870
+ function decodeTlds(encoded) {
871
+ const words = [];
872
+ const stack = [];
873
+ let i = 0;
874
+ let digits = '0123456789';
875
+ while (i < encoded.length) {
876
+ let popDigitCount = 0;
877
+ while (digits.indexOf(encoded[i + popDigitCount]) >= 0) {
878
+ popDigitCount++; // encountered some digits, have to pop to go one level up trie
879
+ }
880
+ if (popDigitCount > 0) {
881
+ words.push(stack.join('')); // whatever preceded the pop digits must be a word
882
+ for (let popCount = parseInt(encoded.substring(i, i + popDigitCount), 10); popCount > 0; popCount--) {
883
+ stack.pop();
884
+ }
885
+ i += popDigitCount;
886
+ } else {
887
+ stack.push(encoded[i]); // drop down a level into the trie
888
+ i++;
889
+ }
890
+ }
891
+ return words;
892
+ }
893
+
894
+ /**
895
+ * An object where each key is a valid DOM Event Name such as `click` or `focus`
896
+ * and each value is an event handler function.
897
+ *
898
+ * https://developer.mozilla.org/en-US/docs/Web/API/Element#events
899
+ * @typedef {?{ [event: string]: Function }} EventListeners
900
+ */
901
+
902
+ /**
903
+ * All formatted properties required to render a link, including `tagName`,
904
+ * `attributes`, `content` and `eventListeners`.
905
+ * @typedef {{ tagName: any, attributes: {[attr: string]: any}, content: string,
906
+ * eventListeners: EventListeners }} IntermediateRepresentation
907
+ */
908
+
909
+ /**
910
+ * Specify either an object described by the template type `O` or a function.
911
+ *
912
+ * The function takes a string value (usually the link's href attribute), the
913
+ * link type (`'url'`, `'hashtag`', etc.) and an internal token representation
914
+ * of the link. It should return an object of the template type `O`
915
+ * @template O
916
+ * @typedef {O | ((value: string, type: string, token: MultiToken) => O)} OptObj
917
+ */
918
+
919
+ /**
920
+ * Specify either a function described by template type `F` or an object.
921
+ *
922
+ * Each key in the object should be a link type (`'url'`, `'hashtag`', etc.). Each
923
+ * value should be a function with template type `F` that is called when the
924
+ * corresponding link type is encountered.
925
+ * @template F
926
+ * @typedef {F | { [type: string]: F}} OptFn
927
+ */
928
+
929
+ /**
930
+ * Specify either a value with template type `V`, a function that returns `V` or
931
+ * an object where each value resolves to `V`.
932
+ *
933
+ * The function takes a string value (usually the link's href attribute), the
934
+ * link type (`'url'`, `'hashtag`', etc.) and an internal token representation
935
+ * of the link. It should return an object of the template type `V`
936
+ *
937
+ * For the object, each key should be a link type (`'url'`, `'hashtag`', etc.).
938
+ * Each value should either have type `V` or a function that returns V. This
939
+ * function similarly takes a string value and a token.
940
+ *
941
+ * Example valid types for `Opt<string>`:
942
+ *
943
+ * ```js
944
+ * 'hello'
945
+ * (value, type, token) => 'world'
946
+ * { url: 'hello', email: (value, token) => 'world'}
947
+ * ```
948
+ * @template V
949
+ * @typedef {V | ((value: string, type: string, token: MultiToken) => V) | { [type: string]: V | ((value: string, token: MultiToken) => V) }} Opt
950
+ */
951
+
952
+ /**
953
+ * See available options: https://linkify.js.org/docs/options.html
954
+ * @typedef {{
955
+ * defaultProtocol?: string,
956
+ * events?: OptObj<EventListeners>,
957
+ * format?: Opt<string>,
958
+ * formatHref?: Opt<string>,
959
+ * nl2br?: boolean,
960
+ * tagName?: Opt<any>,
961
+ * target?: Opt<string>,
962
+ * rel?: Opt<string>,
963
+ * validate?: Opt<boolean>,
964
+ * truncate?: Opt<number>,
965
+ * className?: Opt<string>,
966
+ * attributes?: OptObj<({ [attr: string]: any })>,
967
+ * ignoreTags?: string[],
968
+ * render?: OptFn<((ir: IntermediateRepresentation) => any)>
969
+ * }} Opts
970
+ */
971
+
972
+ /**
973
+ * @type Required<Opts>
974
+ */
975
+ const defaults = {
976
+ defaultProtocol: 'http',
977
+ events: null,
978
+ format: noop,
979
+ formatHref: noop,
980
+ nl2br: false,
981
+ tagName: 'a',
982
+ target: null,
983
+ rel: null,
984
+ validate: true,
985
+ truncate: Infinity,
986
+ className: null,
987
+ attributes: null,
988
+ ignoreTags: [],
989
+ render: null
990
+ };
991
+
992
+ /**
993
+ * Utility class for linkify interfaces to apply specified
994
+ * {@link Opts formatting and rendering options}.
995
+ *
996
+ * @param {Opts | Options} [opts] Option value overrides.
997
+ * @param {(ir: IntermediateRepresentation) => any} [defaultRender] (For
998
+ * internal use) default render function that determines how to generate an
999
+ * HTML element based on a link token's derived tagName, attributes and HTML.
1000
+ * Similar to render option
1001
+ */
1002
+ function Options(opts, defaultRender = null) {
1003
+ let o = assign({}, defaults);
1004
+ if (opts) {
1005
+ o = assign(o, opts instanceof Options ? opts.o : opts);
1006
+ }
1007
+
1008
+ // Ensure all ignored tags are uppercase
1009
+ const ignoredTags = o.ignoreTags;
1010
+ const uppercaseIgnoredTags = [];
1011
+ for (let i = 0; i < ignoredTags.length; i++) {
1012
+ uppercaseIgnoredTags.push(ignoredTags[i].toUpperCase());
1013
+ }
1014
+ /** @protected */
1015
+ this.o = o;
1016
+ if (defaultRender) {
1017
+ this.defaultRender = defaultRender;
1018
+ }
1019
+ this.ignoreTags = uppercaseIgnoredTags;
1020
+ }
1021
+ Options.prototype = {
1022
+ o: defaults,
1023
+ /**
1024
+ * @type string[]
1025
+ */
1026
+ ignoreTags: [],
1027
+ /**
1028
+ * @param {IntermediateRepresentation} ir
1029
+ * @returns {any}
1030
+ */
1031
+ defaultRender(ir) {
1032
+ return ir;
1033
+ },
1034
+ /**
1035
+ * Returns true or false based on whether a token should be displayed as a
1036
+ * link based on the user options.
1037
+ * @param {MultiToken} token
1038
+ * @returns {boolean}
1039
+ */
1040
+ check(token) {
1041
+ return this.get('validate', token.toString(), token);
1042
+ },
1043
+ // Private methods
1044
+
1045
+ /**
1046
+ * Resolve an option's value based on the value of the option and the given
1047
+ * params. If operator and token are specified and the target option is
1048
+ * callable, automatically calls the function with the given argument.
1049
+ * @template {keyof Opts} K
1050
+ * @param {K} key Name of option to use
1051
+ * @param {string} [operator] will be passed to the target option if it's a
1052
+ * function. If not specified, RAW function value gets returned
1053
+ * @param {MultiToken} [token] The token from linkify.tokenize
1054
+ * @returns {Opts[K] | any}
1055
+ */
1056
+ get(key, operator, token) {
1057
+ const isCallable = operator != null;
1058
+ let option = this.o[key];
1059
+ if (!option) {
1060
+ return option;
1061
+ }
1062
+ if (typeof option === 'object') {
1063
+ option = token.t in option ? option[token.t] : defaults[key];
1064
+ if (typeof option === 'function' && isCallable) {
1065
+ option = option(operator, token);
1066
+ }
1067
+ } else if (typeof option === 'function' && isCallable) {
1068
+ option = option(operator, token.t, token);
1069
+ }
1070
+ return option;
1071
+ },
1072
+ /**
1073
+ * @template {keyof Opts} L
1074
+ * @param {L} key Name of options object to use
1075
+ * @param {string} [operator]
1076
+ * @param {MultiToken} [token]
1077
+ * @returns {Opts[L] | any}
1078
+ */
1079
+ getObj(key, operator, token) {
1080
+ let obj = this.o[key];
1081
+ if (typeof obj === 'function' && operator != null) {
1082
+ obj = obj(operator, token.t, token);
1083
+ }
1084
+ return obj;
1085
+ },
1086
+ /**
1087
+ * Convert the given token to a rendered element that may be added to the
1088
+ * calling-interface's DOM
1089
+ * @param {MultiToken} token Token to render to an HTML element
1090
+ * @returns {any} Render result; e.g., HTML string, DOM element, React
1091
+ * Component, etc.
1092
+ */
1093
+ render(token) {
1094
+ const ir = token.render(this); // intermediate representation
1095
+ const renderFn = this.get('render', null, token) || this.defaultRender;
1096
+ return renderFn(ir, token.t, token);
1097
+ }
1098
+ };
1099
+ function noop(val) {
1100
+ return val;
1101
+ }
1102
+
1103
+ /******************************************************************************
1104
+ Multi-Tokens
1105
+ Tokens composed of arrays of TextTokens
1106
+ ******************************************************************************/
1107
+
1108
+ /**
1109
+ * @param {string} value
1110
+ * @param {Token[]} tokens
1111
+ */
1112
+ function MultiToken(value, tokens) {
1113
+ this.t = 'token';
1114
+ this.v = value;
1115
+ this.tk = tokens;
1116
+ }
1117
+
1118
+ /**
1119
+ * Abstract class used for manufacturing tokens of text tokens. That is rather
1120
+ * than the value for a token being a small string of text, it's value an array
1121
+ * of text tokens.
1122
+ *
1123
+ * Used for grouping together URLs, emails, hashtags, and other potential
1124
+ * creations.
1125
+ * @class MultiToken
1126
+ * @property {string} t
1127
+ * @property {string} v
1128
+ * @property {Token[]} tk
1129
+ * @abstract
1130
+ */
1131
+ MultiToken.prototype = {
1132
+ isLink: false,
1133
+ /**
1134
+ * Return the string this token represents.
1135
+ * @return {string}
1136
+ */
1137
+ toString() {
1138
+ return this.v;
1139
+ },
1140
+ /**
1141
+ * What should the value for this token be in the `href` HTML attribute?
1142
+ * Returns the `.toString` value by default.
1143
+ * @param {string} [scheme]
1144
+ * @return {string}
1145
+ */
1146
+ toHref(scheme) {
1147
+ return this.toString();
1148
+ },
1149
+ /**
1150
+ * @param {Options} options Formatting options
1151
+ * @returns {string}
1152
+ */
1153
+ toFormattedString(options) {
1154
+ const val = this.toString();
1155
+ const truncate = options.get('truncate', val, this);
1156
+ const formatted = options.get('format', val, this);
1157
+ return truncate && formatted.length > truncate ? formatted.substring(0, truncate) + '…' : formatted;
1158
+ },
1159
+ /**
1160
+ *
1161
+ * @param {Options} options
1162
+ * @returns {string}
1163
+ */
1164
+ toFormattedHref(options) {
1165
+ return options.get('formatHref', this.toHref(options.get('defaultProtocol')), this);
1166
+ },
1167
+ /**
1168
+ * The start index of this token in the original input string
1169
+ * @returns {number}
1170
+ */
1171
+ startIndex() {
1172
+ return this.tk[0].s;
1173
+ },
1174
+ /**
1175
+ * The end index of this token in the original input string (up to this
1176
+ * index but not including it)
1177
+ * @returns {number}
1178
+ */
1179
+ endIndex() {
1180
+ return this.tk[this.tk.length - 1].e;
1181
+ },
1182
+ /**
1183
+ Returns an object of relevant values for this token, which includes keys
1184
+ * type - Kind of token ('url', 'email', etc.)
1185
+ * value - Original text
1186
+ * href - The value that should be added to the anchor tag's href
1187
+ attribute
1188
+ @method toObject
1189
+ @param {string} [protocol] `'http'` by default
1190
+ */
1191
+ toObject(protocol = defaults.defaultProtocol) {
1192
+ return {
1193
+ type: this.t,
1194
+ value: this.toString(),
1195
+ isLink: this.isLink,
1196
+ href: this.toHref(protocol),
1197
+ start: this.startIndex(),
1198
+ end: this.endIndex()
1199
+ };
1200
+ },
1201
+ /**
1202
+ *
1203
+ * @param {Options} options Formatting option
1204
+ */
1205
+ toFormattedObject(options) {
1206
+ return {
1207
+ type: this.t,
1208
+ value: this.toFormattedString(options),
1209
+ isLink: this.isLink,
1210
+ href: this.toFormattedHref(options),
1211
+ start: this.startIndex(),
1212
+ end: this.endIndex()
1213
+ };
1214
+ },
1215
+ /**
1216
+ * Whether this token should be rendered as a link according to the given options
1217
+ * @param {Options} options
1218
+ * @returns {boolean}
1219
+ */
1220
+ validate(options) {
1221
+ return options.get('validate', this.toString(), this);
1222
+ },
1223
+ /**
1224
+ * Return an object that represents how this link should be rendered.
1225
+ * @param {Options} options Formattinng options
1226
+ */
1227
+ render(options) {
1228
+ const token = this;
1229
+ const href = this.toHref(options.get('defaultProtocol'));
1230
+ const formattedHref = options.get('formatHref', href, this);
1231
+ const tagName = options.get('tagName', href, token);
1232
+ const content = this.toFormattedString(options);
1233
+ const attributes = {};
1234
+ const className = options.get('className', href, token);
1235
+ const target = options.get('target', href, token);
1236
+ const rel = options.get('rel', href, token);
1237
+ const attrs = options.getObj('attributes', href, token);
1238
+ const eventListeners = options.getObj('events', href, token);
1239
+ attributes.href = formattedHref;
1240
+ if (className) {
1241
+ attributes.class = className;
1242
+ }
1243
+ if (target) {
1244
+ attributes.target = target;
1245
+ }
1246
+ if (rel) {
1247
+ attributes.rel = rel;
1248
+ }
1249
+ if (attrs) {
1250
+ assign(attributes, attrs);
1251
+ }
1252
+ return {
1253
+ tagName,
1254
+ attributes,
1255
+ content,
1256
+ eventListeners
1257
+ };
1258
+ }
1259
+ };
1260
+
1261
+ /**
1262
+ * Create a new token that can be emitted by the parser state machine
1263
+ * @param {string} type readable type of the token
1264
+ * @param {object} props properties to assign or override, including isLink = true or false
1265
+ * @returns {new (value: string, tokens: Token[]) => MultiToken} new token class
1266
+ */
1267
+ function createTokenClass(type, props) {
1268
+ class Token extends MultiToken {
1269
+ constructor(value, tokens) {
1270
+ super(value, tokens);
1271
+ this.t = type;
1272
+ }
1273
+ }
1274
+ for (const p in props) {
1275
+ Token.prototype[p] = props[p];
1276
+ }
1277
+ Token.t = type;
1278
+ return Token;
1279
+ }
1280
+
1281
+ /**
1282
+ Represents a list of tokens making up a valid email address
1283
+ */
1284
+ const Email = createTokenClass('email', {
1285
+ isLink: true,
1286
+ toHref() {
1287
+ return 'mailto:' + this.toString();
1288
+ }
1289
+ });
1290
+
1291
+ /**
1292
+ Represents some plain text
1293
+ */
1294
+ const Text = createTokenClass('text');
1295
+
1296
+ /**
1297
+ Multi-linebreak token - represents a line break
1298
+ @class Nl
1299
+ */
1300
+ const Nl = createTokenClass('nl');
1301
+
1302
+ /**
1303
+ Represents a list of text tokens making up a valid URL
1304
+ @class Url
1305
+ */
1306
+ const Url = createTokenClass('url', {
1307
+ isLink: true,
1308
+ /**
1309
+ Lowercases relevant parts of the domain and adds the protocol if
1310
+ required. Note that this will not escape unsafe HTML characters in the
1311
+ URL.
1312
+ @param {string} [scheme] default scheme (e.g., 'https')
1313
+ @return {string} the full href
1314
+ */
1315
+ toHref(scheme = defaults.defaultProtocol) {
1316
+ // Check if already has a prefix scheme
1317
+ return this.hasProtocol() ? this.v : `${scheme}://${this.v}`;
1318
+ },
1319
+ /**
1320
+ * Check whether this URL token has a protocol
1321
+ * @return {boolean}
1322
+ */
1323
+ hasProtocol() {
1324
+ const tokens = this.tk;
1325
+ return tokens.length >= 2 && tokens[0].t !== LOCALHOST && tokens[1].t === COLON;
1326
+ }
1327
+ });
1328
+
1329
+ /**
1330
+ Not exactly parser, more like the second-stage scanner (although we can
1331
+ theoretically hotswap the code here with a real parser in the future... but
1332
+ for a little URL-finding utility abstract syntax trees may be a little
1333
+ overkill).
1334
+
1335
+ URL format: http://en.wikipedia.org/wiki/URI_scheme
1336
+ Email format: http://en.wikipedia.org/wiki/EmailAddress (links to RFC in
1337
+ reference)
1338
+
1339
+ @module linkify
1340
+ @submodule parser
1341
+ @main run
1342
+ */
1343
+
1344
+ const makeState = arg => new State(arg);
1345
+
1346
+ /**
1347
+ * Generate the parser multi token-based state machine
1348
+ * @param {{ groups: Collections<string> }} tokens
1349
+ */
1350
+ function init$1({
1351
+ groups
1352
+ }) {
1353
+ // Types of characters the URL can definitely end in
1354
+ const qsAccepting = groups.domain.concat([AMPERSAND, ASTERISK, AT, BACKSLASH, BACKTICK, CARET, DOLLAR, EQUALS, HYPHEN, NUM, PERCENT, PIPE, PLUS, POUND, SLASH, SYM, TILDE, UNDERSCORE]);
1355
+
1356
+ // Types of tokens that can follow a URL and be part of the query string
1357
+ // but cannot be the very last characters
1358
+ // Characters that cannot appear in the URL at all should be excluded
1359
+ const qsNonAccepting = [APOSTROPHE, COLON, COMMA, DOT, EXCLAMATION, PERCENT, QUERY, QUOTE, SEMI, OPENANGLEBRACKET, CLOSEANGLEBRACKET, OPENBRACE, CLOSEBRACE, CLOSEBRACKET, OPENBRACKET, OPENPAREN, CLOSEPAREN, FULLWIDTHLEFTPAREN, FULLWIDTHRIGHTPAREN, LEFTCORNERBRACKET, RIGHTCORNERBRACKET, LEFTWHITECORNERBRACKET, RIGHTWHITECORNERBRACKET, FULLWIDTHLESSTHAN, FULLWIDTHGREATERTHAN];
1360
+
1361
+ // For addresses without the mailto prefix
1362
+ // Tokens allowed in the localpart of the email
1363
+ const localpartAccepting = [AMPERSAND, APOSTROPHE, ASTERISK, BACKSLASH, BACKTICK, CARET, DOLLAR, EQUALS, HYPHEN, OPENBRACE, CLOSEBRACE, PERCENT, PIPE, PLUS, POUND, QUERY, SLASH, SYM, TILDE, UNDERSCORE];
1364
+
1365
+ // The universal starting state.
1366
+ /**
1367
+ * @type State<Token>
1368
+ */
1369
+ const Start = makeState();
1370
+ const Localpart = tt(Start, TILDE); // Local part of the email address
1371
+ ta(Localpart, localpartAccepting, Localpart);
1372
+ ta(Localpart, groups.domain, Localpart);
1373
+ const Domain = makeState(),
1374
+ Scheme = makeState(),
1375
+ SlashScheme = makeState();
1376
+ ta(Start, groups.domain, Domain); // parsed string ends with a potential domain name (A)
1377
+ ta(Start, groups.scheme, Scheme); // e.g., 'mailto'
1378
+ ta(Start, groups.slashscheme, SlashScheme); // e.g., 'http'
1379
+
1380
+ ta(Domain, localpartAccepting, Localpart);
1381
+ ta(Domain, groups.domain, Domain);
1382
+ const LocalpartAt = tt(Domain, AT); // Local part of the email address plus @
1383
+
1384
+ tt(Localpart, AT, LocalpartAt); // close to an email address now
1385
+
1386
+ // Local part of an email address can be e.g. 'http' or 'mailto'
1387
+ tt(Scheme, AT, LocalpartAt);
1388
+ tt(SlashScheme, AT, LocalpartAt);
1389
+ const LocalpartDot = tt(Localpart, DOT); // Local part of the email address plus '.' (localpart cannot end in .)
1390
+ ta(LocalpartDot, localpartAccepting, Localpart);
1391
+ ta(LocalpartDot, groups.domain, Localpart);
1392
+ const EmailDomain = makeState();
1393
+ ta(LocalpartAt, groups.domain, EmailDomain); // parsed string starts with local email info + @ with a potential domain name
1394
+ ta(EmailDomain, groups.domain, EmailDomain);
1395
+ const EmailDomainDot = tt(EmailDomain, DOT); // domain followed by DOT
1396
+ ta(EmailDomainDot, groups.domain, EmailDomain);
1397
+ const Email$1 = makeState(Email); // Possible email address (could have more tlds)
1398
+ ta(EmailDomainDot, groups.tld, Email$1);
1399
+ ta(EmailDomainDot, groups.utld, Email$1);
1400
+ tt(LocalpartAt, LOCALHOST, Email$1);
1401
+
1402
+ // Hyphen can jump back to a domain name
1403
+ const EmailDomainHyphen = tt(EmailDomain, HYPHEN); // parsed string starts with local email info + @ with a potential domain name
1404
+ tt(EmailDomainHyphen, HYPHEN, EmailDomainHyphen);
1405
+ ta(EmailDomainHyphen, groups.domain, EmailDomain);
1406
+ ta(Email$1, groups.domain, EmailDomain);
1407
+ tt(Email$1, DOT, EmailDomainDot);
1408
+ tt(Email$1, HYPHEN, EmailDomainHyphen);
1409
+
1410
+ // Final possible email states
1411
+ const EmailColon = tt(Email$1, COLON); // URL followed by colon (potential port number here)
1412
+ /*const EmailColonPort = */
1413
+ ta(EmailColon, groups.numeric, Email); // URL followed by colon and port number
1414
+
1415
+ // Account for dots and hyphens. Hyphens are usually parts of domain names
1416
+ // (but not TLDs)
1417
+ const DomainHyphen = tt(Domain, HYPHEN); // domain followed by hyphen
1418
+ const DomainDot = tt(Domain, DOT); // domain followed by DOT
1419
+ tt(DomainHyphen, HYPHEN, DomainHyphen);
1420
+ ta(DomainHyphen, groups.domain, Domain);
1421
+ ta(DomainDot, localpartAccepting, Localpart);
1422
+ ta(DomainDot, groups.domain, Domain);
1423
+ const DomainDotTld = makeState(Url); // Simplest possible URL with no query string
1424
+ ta(DomainDot, groups.tld, DomainDotTld);
1425
+ ta(DomainDot, groups.utld, DomainDotTld);
1426
+ ta(DomainDotTld, groups.domain, Domain);
1427
+ ta(DomainDotTld, localpartAccepting, Localpart);
1428
+ tt(DomainDotTld, DOT, DomainDot);
1429
+ tt(DomainDotTld, HYPHEN, DomainHyphen);
1430
+ tt(DomainDotTld, AT, LocalpartAt);
1431
+ const DomainDotTldColon = tt(DomainDotTld, COLON); // URL followed by colon (potential port number here)
1432
+ const DomainDotTldColonPort = makeState(Url); // TLD followed by a port number
1433
+ ta(DomainDotTldColon, groups.numeric, DomainDotTldColonPort);
1434
+
1435
+ // Long URL with optional port and maybe query string
1436
+ const Url$1 = makeState(Url);
1437
+
1438
+ // URL with extra symbols at the end, followed by an opening bracket
1439
+ const UrlNonaccept = makeState(); // URL followed by some symbols (will not be part of the final URL)
1440
+
1441
+ // Query strings
1442
+ ta(Url$1, qsAccepting, Url$1);
1443
+ ta(Url$1, qsNonAccepting, UrlNonaccept);
1444
+ ta(UrlNonaccept, qsAccepting, Url$1);
1445
+ ta(UrlNonaccept, qsNonAccepting, UrlNonaccept);
1446
+
1447
+ // Become real URLs after `SLASH` or `COLON NUM SLASH`
1448
+ // Here works with or without scheme:// prefix
1449
+ tt(DomainDotTld, SLASH, Url$1);
1450
+ tt(DomainDotTldColonPort, SLASH, Url$1);
1451
+
1452
+ // Note that domains that begin with schemes are treated slighly differently
1453
+ const SchemeColon = tt(Scheme, COLON); // e.g., 'mailto:'
1454
+ const SlashSchemeColon = tt(SlashScheme, COLON); // e.g., 'http:'
1455
+ const SlashSchemeColonSlash = tt(SlashSchemeColon, SLASH); // e.g., 'http:/'
1456
+
1457
+ const UriPrefix = tt(SlashSchemeColonSlash, SLASH); // e.g., 'http://'
1458
+
1459
+ // Scheme states can transition to domain states
1460
+ ta(Scheme, groups.domain, Domain);
1461
+ tt(Scheme, DOT, DomainDot);
1462
+ tt(Scheme, HYPHEN, DomainHyphen);
1463
+ ta(SlashScheme, groups.domain, Domain);
1464
+ tt(SlashScheme, DOT, DomainDot);
1465
+ tt(SlashScheme, HYPHEN, DomainHyphen);
1466
+
1467
+ // Force URL with scheme prefix followed by anything sane
1468
+ ta(SchemeColon, groups.domain, Url$1);
1469
+ tt(SchemeColon, SLASH, Url$1);
1470
+ tt(SchemeColon, QUERY, Url$1);
1471
+ ta(UriPrefix, groups.domain, Url$1);
1472
+ ta(UriPrefix, qsAccepting, Url$1);
1473
+ tt(UriPrefix, SLASH, Url$1);
1474
+ const bracketPairs = [[OPENBRACE, CLOSEBRACE],
1475
+ // {}
1476
+ [OPENBRACKET, CLOSEBRACKET],
1477
+ // []
1478
+ [OPENPAREN, CLOSEPAREN],
1479
+ // ()
1480
+ [OPENANGLEBRACKET, CLOSEANGLEBRACKET],
1481
+ // <>
1482
+ [FULLWIDTHLEFTPAREN, FULLWIDTHRIGHTPAREN],
1483
+ // ()
1484
+ [LEFTCORNERBRACKET, RIGHTCORNERBRACKET],
1485
+ // 「」
1486
+ [LEFTWHITECORNERBRACKET, RIGHTWHITECORNERBRACKET],
1487
+ // 『』
1488
+ [FULLWIDTHLESSTHAN, FULLWIDTHGREATERTHAN] // <>
1489
+ ];
1490
+ for (let i = 0; i < bracketPairs.length; i++) {
1491
+ const [OPEN, CLOSE] = bracketPairs[i];
1492
+ const UrlOpen = tt(Url$1, OPEN); // URL followed by open bracket
1493
+
1494
+ // Continue not accepting for open brackets
1495
+ tt(UrlNonaccept, OPEN, UrlOpen);
1496
+
1497
+ // Closing bracket component. This character WILL be included in the URL
1498
+ tt(UrlOpen, CLOSE, Url$1);
1499
+
1500
+ // URL that beings with an opening bracket, followed by a symbols.
1501
+ // Note that the final state can still be `UrlOpen` (if the URL has a
1502
+ // single opening bracket for some reason).
1503
+ const UrlOpenQ = makeState(Url);
1504
+ ta(UrlOpen, qsAccepting, UrlOpenQ);
1505
+ const UrlOpenSyms = makeState(); // UrlOpen followed by some symbols it cannot end it
1506
+ ta(UrlOpen, qsNonAccepting);
1507
+
1508
+ // URL that begins with an opening bracket, followed by some symbols
1509
+ ta(UrlOpenQ, qsAccepting, UrlOpenQ);
1510
+ ta(UrlOpenQ, qsNonAccepting, UrlOpenSyms);
1511
+ ta(UrlOpenSyms, qsAccepting, UrlOpenQ);
1512
+ ta(UrlOpenSyms, qsNonAccepting, UrlOpenSyms);
1513
+
1514
+ // Close brace/bracket to become regular URL
1515
+ tt(UrlOpenQ, CLOSE, Url$1);
1516
+ tt(UrlOpenSyms, CLOSE, Url$1);
1517
+ }
1518
+ tt(Start, LOCALHOST, DomainDotTld); // localhost is a valid URL state
1519
+ tt(Start, NL, Nl); // single new line
1520
+
1521
+ return {
1522
+ start: Start,
1523
+ tokens: tk
1524
+ };
1525
+ }
1526
+
1527
+ /**
1528
+ * Run the parser state machine on a list of scanned string-based tokens to
1529
+ * create a list of multi tokens, each of which represents a URL, email address,
1530
+ * plain text, etc.
1531
+ *
1532
+ * @param {State<MultiToken>} start parser start state
1533
+ * @param {string} input the original input used to generate the given tokens
1534
+ * @param {Token[]} tokens list of scanned tokens
1535
+ * @returns {MultiToken[]}
1536
+ */
1537
+ function run(start, input, tokens) {
1538
+ let len = tokens.length;
1539
+ let cursor = 0;
1540
+ let multis = [];
1541
+ let textTokens = [];
1542
+ while (cursor < len) {
1543
+ let state = start;
1544
+ let secondState = null;
1545
+ let nextState = null;
1546
+ let multiLength = 0;
1547
+ let latestAccepting = null;
1548
+ let sinceAccepts = -1;
1549
+ while (cursor < len && !(secondState = state.go(tokens[cursor].t))) {
1550
+ // Starting tokens with nowhere to jump to.
1551
+ // Consider these to be just plain text
1552
+ textTokens.push(tokens[cursor++]);
1553
+ }
1554
+ while (cursor < len && (nextState = secondState || state.go(tokens[cursor].t))) {
1555
+ // Get the next state
1556
+ secondState = null;
1557
+ state = nextState;
1558
+
1559
+ // Keep track of the latest accepting state
1560
+ if (state.accepts()) {
1561
+ sinceAccepts = 0;
1562
+ latestAccepting = state;
1563
+ } else if (sinceAccepts >= 0) {
1564
+ sinceAccepts++;
1565
+ }
1566
+ cursor++;
1567
+ multiLength++;
1568
+ }
1569
+ if (sinceAccepts < 0) {
1570
+ // No accepting state was found, part of a regular text token add
1571
+ // the first text token to the text tokens array and try again from
1572
+ // the next
1573
+ cursor -= multiLength;
1574
+ if (cursor < len) {
1575
+ textTokens.push(tokens[cursor]);
1576
+ cursor++;
1577
+ }
1578
+ } else {
1579
+ // Accepting state!
1580
+ // First close off the textTokens (if available)
1581
+ if (textTokens.length > 0) {
1582
+ multis.push(initMultiToken(Text, input, textTokens));
1583
+ textTokens = [];
1584
+ }
1585
+
1586
+ // Roll back to the latest accepting state
1587
+ cursor -= sinceAccepts;
1588
+ multiLength -= sinceAccepts;
1589
+
1590
+ // Create a new multitoken
1591
+ const Multi = latestAccepting.t;
1592
+ const subtokens = tokens.slice(cursor - multiLength, cursor);
1593
+ multis.push(initMultiToken(Multi, input, subtokens));
1594
+ }
1595
+ }
1596
+
1597
+ // Finally close off the textTokens (if available)
1598
+ if (textTokens.length > 0) {
1599
+ multis.push(initMultiToken(Text, input, textTokens));
1600
+ }
1601
+ return multis;
1602
+ }
1603
+
1604
+ /**
1605
+ * Utility function for instantiating a new multitoken with all the relevant
1606
+ * fields during parsing.
1607
+ * @param {new (value: string, tokens: Token[]) => MultiToken} Multi class to instantiate
1608
+ * @param {string} input original input string
1609
+ * @param {Token[]} tokens consecutive tokens scanned from input string
1610
+ * @returns {MultiToken}
1611
+ */
1612
+ function initMultiToken(Multi, input, tokens) {
1613
+ const startIdx = tokens[0].s;
1614
+ const endIdx = tokens[tokens.length - 1].e;
1615
+ const value = input.slice(startIdx, endIdx);
1616
+ return new Multi(value, tokens);
1617
+ }
1618
+
1619
+ const warn = typeof console !== 'undefined' && console && console.warn || (() => {});
1620
+ const warnAdvice = 'until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.';
1621
+
1622
+ // Side-effect initialization state
1623
+ const INIT = {
1624
+ scanner: null,
1625
+ parser: null,
1626
+ tokenQueue: [],
1627
+ pluginQueue: [],
1628
+ customSchemes: [],
1629
+ initialized: false
1630
+ };
1631
+
1632
+ /**
1633
+ * @typedef {{
1634
+ * start: State<string>,
1635
+ * tokens: { groups: Collections<string> } & typeof tk
1636
+ * }} ScannerInit
1637
+ */
1638
+
1639
+ /**
1640
+ * @typedef {{
1641
+ * start: State<MultiToken>,
1642
+ * tokens: typeof multi
1643
+ * }} ParserInit
1644
+ */
1645
+
1646
+ /**
1647
+ * @typedef {(arg: { scanner: ScannerInit }) => void} TokenPlugin
1648
+ */
1649
+
1650
+ /**
1651
+ * @typedef {(arg: { scanner: ScannerInit, parser: ParserInit }) => void} Plugin
1652
+ */
1653
+
1654
+ /**
1655
+ * De-register all plugins and reset the internal state-machine. Used for
1656
+ * testing; not required in practice.
1657
+ * @private
1658
+ */
1659
+ function reset() {
1660
+ State.groups = {};
1661
+ INIT.scanner = null;
1662
+ INIT.parser = null;
1663
+ INIT.tokenQueue = [];
1664
+ INIT.pluginQueue = [];
1665
+ INIT.customSchemes = [];
1666
+ INIT.initialized = false;
1667
+ return INIT;
1668
+ }
1669
+
1670
+ /**
1671
+ * Detect URLs with the following additional protocol. Anything with format
1672
+ * "protocol://..." will be considered a link. If `optionalSlashSlash` is set to
1673
+ * `true`, anything with format "protocol:..." will be considered a link.
1674
+ * @param {string} scheme
1675
+ * @param {boolean} [optionalSlashSlash]
1676
+ */
1677
+ function registerCustomProtocol(scheme, optionalSlashSlash = false) {
1678
+ if (INIT.initialized) {
1679
+ warn(`linkifyjs: already initialized - will not register custom scheme "${scheme}" ${warnAdvice}`);
1680
+ }
1681
+ if (!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(scheme)) {
1682
+ throw new Error(`linkifyjs: incorrect scheme format.
1683
+ 1. Must only contain digits, lowercase ASCII letters or "-"
1684
+ 2. Cannot start or end with "-"
1685
+ 3. "-" cannot repeat`);
1686
+ }
1687
+ INIT.customSchemes.push([scheme, optionalSlashSlash]);
1688
+ }
1689
+
1690
+ /**
1691
+ * Initialize the linkify state machine. Called automatically the first time
1692
+ * linkify is called on a string, but may be called manually as well.
1693
+ */
1694
+ function init() {
1695
+ // Initialize scanner state machine and plugins
1696
+ INIT.scanner = init$2(INIT.customSchemes);
1697
+ for (let i = 0; i < INIT.tokenQueue.length; i++) {
1698
+ INIT.tokenQueue[i][1]({
1699
+ scanner: INIT.scanner
1700
+ });
1701
+ }
1702
+
1703
+ // Initialize parser state machine and plugins
1704
+ INIT.parser = init$1(INIT.scanner.tokens);
1705
+ for (let i = 0; i < INIT.pluginQueue.length; i++) {
1706
+ INIT.pluginQueue[i][1]({
1707
+ scanner: INIT.scanner,
1708
+ parser: INIT.parser
1709
+ });
1710
+ }
1711
+ INIT.initialized = true;
1712
+ return INIT;
1713
+ }
1714
+
1715
+ /**
1716
+ * Parse a string into tokens that represent linkable and non-linkable sub-components
1717
+ * @param {string} str
1718
+ * @return {MultiToken[]} tokens
1719
+ */
1720
+ function tokenize(str) {
1721
+ if (!INIT.initialized) {
1722
+ init();
1723
+ }
1724
+ return run(INIT.parser.start, str, run$1(INIT.scanner.start, str));
1725
+ }
1726
+ tokenize.scan = run$1; // for testing
1727
+
1728
+ /**
1729
+ * Find a list of linkable items in the given string.
1730
+ * @param {string} str string to find links in
1731
+ * @param {string | Opts} [type] either formatting options or specific type of
1732
+ * links to find, e.g., 'url' or 'email'
1733
+ * @param {Opts} [opts] formatting options for final output. Cannot be specified
1734
+ * if opts already provided in `type` argument
1735
+ */
1736
+ function find(str, type = null, opts = null) {
1737
+ if (type && typeof type === 'object') {
1738
+ if (opts) {
1739
+ throw Error(`linkifyjs: Invalid link type ${type}; must be a string`);
1740
+ }
1741
+ opts = type;
1742
+ type = null;
1743
+ }
1744
+ const options = new Options(opts);
1745
+ const tokens = tokenize(str);
1746
+ const filtered = [];
1747
+ for (let i = 0; i < tokens.length; i++) {
1748
+ const token = tokens[i];
1749
+ if (token.isLink && (!type || token.t === type) && options.check(token)) {
1750
+ filtered.push(token.toFormattedObject(options));
1751
+ }
1752
+ }
1753
+ return filtered;
1754
+ }
1755
+
1756
+ export { reset as a, find as f, registerCustomProtocol as r, tokenize as t };