@vc-shell/framework 1.1.46 → 1.1.47

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 (360) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/core/plugins/modularity/loader.ts +126 -97
  3. package/dist/assets/042c75b764bc78a7.svg +1 -0
  4. package/dist/assets/0ba156439a339f2a.svg +1 -0
  5. package/dist/assets/0be560bfb22d0e72.woff2 +0 -0
  6. package/dist/assets/0f590f8a94577092.svg +1 -0
  7. package/dist/assets/0fc5820f8be53a1b.svg +1 -0
  8. package/dist/assets/10768e2cc79fc60b.svg +1 -0
  9. package/dist/assets/11b3d25a56fd9a21.woff2 +0 -0
  10. package/dist/assets/157b8721e0600ea8.svg +1 -0
  11. package/dist/assets/15e91cdd649cde9a.svg +1 -0
  12. package/dist/assets/1a3e84b2457f709a.woff +0 -0
  13. package/dist/assets/1de63eb118636cce.svg +1 -0
  14. package/dist/assets/1ea01de36eb5491b.svg +1 -0
  15. package/dist/assets/204eaf512fde2023.svg +1 -0
  16. package/dist/assets/2088983edf42e153.svg +1 -0
  17. package/dist/assets/208f810a9321a327.svg +1 -0
  18. package/dist/assets/21220a9d10e6c558.svg +1 -0
  19. package/dist/assets/220db345a102045d.woff2 +0 -0
  20. package/dist/assets/225da11d23968333.svg +1 -0
  21. package/dist/assets/226f862dd81bdc13.woff2 +0 -0
  22. package/dist/assets/23a2d53395ddb14f.woff +0 -0
  23. package/dist/assets/259e6ad461a52ad7.svg +1 -0
  24. package/dist/assets/261e6dec4d53b9ac.woff +0 -0
  25. package/dist/assets/262f46a0b6d94bb6.svg +1 -0
  26. package/dist/assets/2857c513073467da.svg +1 -0
  27. package/dist/assets/2b3be7889467d98f.woff +0 -0
  28. package/dist/assets/2d4e6190eec72737.svg +1 -0
  29. package/dist/assets/2eba973185078bc8.woff +0 -0
  30. package/dist/assets/327511cd4a7ba7f9.woff +0 -0
  31. package/dist/assets/334d3f6bc766c516.woff +0 -0
  32. package/dist/assets/34ff7dd0c2285956.svg +1 -0
  33. package/dist/assets/3d26b7c1ab78bbe2.woff +0 -0
  34. package/dist/assets/3f8c4cc8099e34b6.woff2 +0 -0
  35. package/dist/assets/40a0e53b79ce63c6.woff2 +0 -0
  36. package/dist/assets/41275bcb979cb650.svg +1 -0
  37. package/dist/assets/42df4e2d6fa3fd2a.woff2 +0 -0
  38. package/dist/assets/434f7982590e462f.woff +0 -0
  39. package/dist/assets/4ae5f23e0ca888e7.woff2 +0 -0
  40. package/dist/assets/4d7a77b0e5373992.svg +1 -0
  41. package/dist/assets/4e43c74354534fb3.svg +1 -0
  42. package/dist/assets/4fe75f5117100705.svg +1 -0
  43. package/dist/assets/52610491f372cb0c.woff2 +0 -0
  44. package/dist/assets/52e261a005074e1b.woff +0 -0
  45. package/dist/assets/5304c3d05a5f9789.woff2 +0 -0
  46. package/dist/assets/572bb1bb4156a9c1.svg +1 -0
  47. package/dist/assets/5b3661be8be679d0.woff2 +0 -0
  48. package/dist/assets/5d96cfcc5bedd917.woff2 +0 -0
  49. package/dist/assets/6075995d7e74da46.woff2 +0 -0
  50. package/dist/assets/617c4736236e199e.woff +0 -0
  51. package/dist/assets/6619e9e10beea0e7.woff2 +0 -0
  52. package/dist/assets/67230f05dc94a265.svg +1 -0
  53. package/dist/assets/6798e4dd4add9b48.svg +1 -0
  54. package/dist/assets/698ec6c722d4cb05.woff2 +0 -0
  55. package/dist/assets/6a3e73faf406cf33.svg +1 -0
  56. package/dist/assets/72de3a63bc0b70dd.svg +1 -0
  57. package/dist/assets/74c6a6ab81bb6340.woff2 +0 -0
  58. package/dist/assets/74ed5f8a78e71106.svg +1 -0
  59. package/dist/assets/7ce0c166fd6a1204.woff +0 -0
  60. package/dist/assets/7d55399c2a7bc985.svg +1 -0
  61. package/dist/assets/7d970675c69fca1d.woff +0 -0
  62. package/dist/assets/7eda727273fd98d3.svg +1 -0
  63. package/dist/assets/7f6ebfd707b76ca2.woff +0 -0
  64. package/dist/assets/7fa898d213fcc7bc.woff2 +0 -0
  65. package/dist/assets/861e6b7192b3b6c7.woff +0 -0
  66. package/dist/assets/8bbcde81ba21ecb2.woff2 +0 -0
  67. package/dist/assets/8f6657e5e0b8d3e4.woff +0 -0
  68. package/dist/assets/910b0d99b9e26568.svg +1 -0
  69. package/dist/assets/91eee1aa81f72683.woff +0 -0
  70. package/dist/assets/92508f8707159b51.svg +1 -0
  71. package/dist/assets/9392bf1d591e1abb.svg +1 -0
  72. package/dist/assets/97e8d4984ba0713a.woff2 +0 -0
  73. package/dist/assets/9cb83236f6bb7ab1.svg +1 -0
  74. package/dist/assets/9d37314695c0b68d.woff +0 -0
  75. package/dist/assets/a18404194e3f9047.svg +1 -0
  76. package/dist/assets/a2017fe7f0a26510.svg +1 -0
  77. package/dist/assets/a47034e65dbcc3d7.woff +0 -0
  78. package/dist/assets/a617e11804bbacb7.woff +0 -0
  79. package/dist/assets/ab6e7190bb1492d5.woff2 +0 -0
  80. package/dist/assets/abf88f301a0730f4.svg +1 -0
  81. package/dist/assets/aed17cb6fdad2ada.woff2 +0 -0
  82. package/dist/assets/b1a596e31ad1185a.svg +1 -0
  83. package/dist/assets/b27767411c8427be.woff +0 -0
  84. package/dist/assets/b291dc35a17511f7.woff +0 -0
  85. package/dist/assets/b325adcae33bbe7a.svg +1 -0
  86. package/dist/assets/b372390551ca2fa1.svg +1 -0
  87. package/dist/assets/b5bb1e8fc975decd.svg +1 -0
  88. package/dist/assets/b645a4a2181b9dc1.svg +1 -0
  89. package/dist/assets/b6499ddce0a4ef7d.svg +1 -0
  90. package/dist/assets/b94421fadd23b0f2.svg +1 -0
  91. package/dist/assets/bb28fb0f27f1c11b.svg +1 -0
  92. package/dist/assets/bfbe205759295eca.woff2 +0 -0
  93. package/dist/assets/ca791c5ca5848a03.svg +1 -0
  94. package/dist/assets/cb32840ce330103f.woff +0 -0
  95. package/dist/assets/d084bda16abe8a56.svg +1 -0
  96. package/dist/assets/d32b129cae2fffd6.svg +1 -0
  97. package/dist/assets/d35a4c7113315758.woff2 +0 -0
  98. package/dist/assets/d3f792f54ae4c307.svg +1 -0
  99. package/dist/assets/d5a5b8630120073d.svg +1 -0
  100. package/dist/assets/d5f9664ebbfb104b.svg +1 -0
  101. package/dist/assets/d80b05788e407de7.woff2 +0 -0
  102. package/dist/assets/d84247b59449dd88.woff2 +0 -0
  103. package/dist/assets/dd05d43ff0df2fc7.svg +1 -0
  104. package/dist/assets/e38acaa1757232e0.svg +1 -0
  105. package/dist/assets/e4a8550f1c7ffe36.svg +1 -0
  106. package/dist/assets/e5adb5ae3a3698f6.svg +1 -0
  107. package/dist/assets/e61a1889bac955f4.woff2 +0 -0
  108. package/dist/assets/e72bb11356af94c7.svg +1 -0
  109. package/dist/assets/e98196a9f8dcb2f0.svg +1 -0
  110. package/dist/assets/ebec912a42ad49ff.woff +0 -0
  111. package/dist/assets/f09d89268e4c0317.svg +1 -0
  112. package/dist/assets/f276d55184e05a07.woff +0 -0
  113. package/dist/assets/f5722262b6e7214e.woff2 +0 -0
  114. package/dist/assets/f7fc8bf46089d8b2.svg +1 -0
  115. package/dist/assets/fcb1c1ffb5640194.woff +0 -0
  116. package/dist/assets/fe141d99763f5d2b.woff +0 -0
  117. package/dist/assets/fed13b0d59903483.svg +1 -0
  118. package/dist/assets/fed757d2c2344ead.woff2 +0 -0
  119. package/dist/assets/ffc438f20e79ce73.woff +0 -0
  120. package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
  121. package/dist/framework.js +16544 -25878
  122. package/dist/index.css +1 -1
  123. package/dist/index.d.ts +5 -8
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/tsconfig.tsbuildinfo +1 -1
  126. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
  127. package/dist/vendor-boolbase-Bgn9I6iN.js +21 -0
  128. package/dist/vendor-cheerio-CleDsuQZ.js +1053 -0
  129. package/dist/vendor-cheerio-select-CVkYl3Z-.js +191 -0
  130. package/dist/vendor-css-select-CtIzVIiG.js +622 -0
  131. package/dist/vendor-css-what-CZZaquJM.js +267 -0
  132. package/dist/vendor-cypress-signalr-mock-CdKwIhWw.js +769 -0
  133. package/dist/vendor-date-fns-CdFbeoHV.js +2989 -0
  134. package/dist/vendor-dom-serializer-CugO0RdN.js +213 -0
  135. package/dist/vendor-dom7-wvIUV9pT.js +529 -0
  136. package/dist/vendor-domelementtype-B3sFIGaC.js +21 -0
  137. package/dist/vendor-domhandler-CL40eeX9.js +311 -0
  138. package/dist/vendor-dompurify-eYFoHPwR.js +528 -0
  139. package/dist/vendor-domutils-D3Y2YQFR.js +386 -0
  140. package/dist/vendor-entities-v26HW8wW.js +363 -0
  141. package/dist/vendor-floating-ui-core-C9uEvi1M.js +349 -0
  142. package/dist/vendor-floating-ui-dom-CZkYGmv4.js +393 -0
  143. package/dist/vendor-floating-ui-utils-Bx3BTd6_.js +259 -0
  144. package/dist/vendor-floating-ui-vue-CLOiVYP7.js +107 -0
  145. package/dist/vendor-headlessui-vue-Dg0Llidi.js +961 -0
  146. package/dist/vendor-htmlparser2-CXL_uhMI.js +735 -0
  147. package/dist/vendor-iconify-vue-D4fihzvl.js +1205 -0
  148. package/dist/vendor-intlify-core-base-Bvt2vJFV.js +1129 -0
  149. package/dist/vendor-intlify-message-compiler-1VxNzq21.js +945 -0
  150. package/dist/vendor-intlify-shared-D7kiPMOG.js +130 -0
  151. package/dist/vendor-iso-639-1-dVGfSUIM.js +781 -0
  152. package/dist/vendor-linkify-it-LzoUhj6C.js +199 -0
  153. package/dist/vendor-linkifyjs-DTu7SY_Y.js +705 -0
  154. package/dist/vendor-lodash-es-CrYlgAi8.js +4816 -0
  155. package/dist/vendor-markdown-it-4AJoRTAg.js +2263 -0
  156. package/dist/vendor-markdown-it-task-lists-Byg1-ms9.js +69 -0
  157. package/dist/vendor-mdurl-DZFDNdqC.js +192 -0
  158. package/dist/vendor-microsoft-applicationinsights-analytics-js-DA-ctcAL.js +1105 -0
  159. package/dist/vendor-microsoft-applicationinsights-cfgsync-js-COfRj-2q.js +261 -0
  160. package/dist/vendor-microsoft-applicationinsights-channel-js-MTPYhH-I.js +1809 -0
  161. package/dist/vendor-microsoft-applicationinsights-common-CDVnJ6MR.js +1921 -0
  162. package/dist/vendor-microsoft-applicationinsights-core-js-D7Aicf8S.js +4127 -0
  163. package/dist/vendor-microsoft-applicationinsights-dependencies-js-CvQWWraU.js +1399 -0
  164. package/dist/vendor-microsoft-applicationinsights-properties-js-C0Iv1cZE.js +572 -0
  165. package/dist/vendor-microsoft-applicationinsights-shims-CxtPYiwp.js +43 -0
  166. package/dist/vendor-microsoft-applicationinsights-web-BRuQAzjU.js +487 -0
  167. package/dist/vendor-microsoft-dynamicproto-js-DSkQkH3T.js +147 -0
  168. package/dist/vendor-microsoft-signalr-qIrag5xx.js +1761 -0
  169. package/dist/vendor-moment-CwOqp704.js +2589 -0
  170. package/dist/vendor-nevware21-ts-async-FAyg3c9V.js +260 -0
  171. package/dist/vendor-nevware21-ts-utils-Dy41wRhA.js +853 -0
  172. package/dist/vendor-nth-check-BE7AeBMg.js +45 -0
  173. package/dist/vendor-orderedmap-B3SOk52B.js +103 -0
  174. package/dist/vendor-parse5-DqztJOGh.js +5747 -0
  175. package/dist/vendor-parse5-htmlparser2-tree-adapter-CNubfdOP.js +143 -0
  176. package/dist/vendor-popperjs-core-LGjf7Wza.js +905 -0
  177. package/dist/vendor-prettier-D8C9GG-0.js +4858 -0
  178. package/dist/vendor-prosemirror-commands-BqYcdumy.js +344 -0
  179. package/dist/vendor-prosemirror-dropcursor-zknUsW5x.js +86 -0
  180. package/dist/vendor-prosemirror-gapcursor-DjOZhP78.js +200 -0
  181. package/dist/vendor-prosemirror-history-l8l3CFac.js +248 -0
  182. package/dist/vendor-prosemirror-keymap-C17r08p-.js +62 -0
  183. package/dist/vendor-prosemirror-markdown-WJEDhc-w.js +650 -0
  184. package/dist/vendor-prosemirror-model-BN5TnJD_.js +2736 -0
  185. package/dist/vendor-prosemirror-schema-list-CR0gi7aY.js +87 -0
  186. package/dist/vendor-prosemirror-state-B0bFP8WI.js +821 -0
  187. package/dist/vendor-prosemirror-tables-B1txTKlC.js +1711 -0
  188. package/dist/vendor-prosemirror-transform-Bo7kNPme.js +1507 -0
  189. package/dist/vendor-prosemirror-view--C7TZvmQ.js +3746 -0
  190. package/dist/vendor-punycode-js-CNI-zL6U.js +133 -0
  191. package/dist/vendor-rope-sequence-sEGCUMi8.js +100 -0
  192. package/dist/vendor-semver-BoKYtkQw.js +1021 -0
  193. package/dist/vendor-ssr-window-D4k3p53c.js +133 -0
  194. package/dist/vendor-swiper-CMVLTGu0.js +2825 -0
  195. package/dist/vendor-tippy-js-BGdgwGX-.js +812 -0
  196. package/dist/vendor-tiptap-core-BRY37Sb2.js +2806 -0
  197. package/dist/vendor-tiptap-extension-blockquote-CPd5qv-9.js +43 -0
  198. package/dist/vendor-tiptap-extension-bold-B0GwBNks.js +71 -0
  199. package/dist/vendor-tiptap-extension-bubble-menu-B0sZZld7.js +128 -0
  200. package/dist/vendor-tiptap-extension-bullet-list-CQm4ReOu.js +53 -0
  201. package/dist/vendor-tiptap-extension-code-C8cy6bRj.js +51 -0
  202. package/dist/vendor-tiptap-extension-code-block-BqTchNEf.js +133 -0
  203. package/dist/vendor-tiptap-extension-document-Dka1Uu0g.js +9 -0
  204. package/dist/vendor-tiptap-extension-dropcursor-CFSh-BuE.js +20 -0
  205. package/dist/vendor-tiptap-extension-floating-menu-H8PB4zeI.js +99 -0
  206. package/dist/vendor-tiptap-extension-gapcursor-CzwfD_IT.js +24 -0
  207. package/dist/vendor-tiptap-extension-hard-break-Rm6aVcrK.js +55 -0
  208. package/dist/vendor-tiptap-extension-heading-CavI6u1v.js +54 -0
  209. package/dist/vendor-tiptap-extension-history-WEN1_74D.js +35 -0
  210. package/dist/vendor-tiptap-extension-horizontal-rule-DZkUEL6s.js +58 -0
  211. package/dist/vendor-tiptap-extension-image-B67_mxGM.js +64 -0
  212. package/dist/vendor-tiptap-extension-italic-BshxBFou.js +70 -0
  213. package/dist/vendor-tiptap-extension-link-CJAQIgui.js +262 -0
  214. package/dist/vendor-tiptap-extension-list-item-DF-iMpqO.js +33 -0
  215. package/dist/vendor-tiptap-extension-ordered-list-CN8MF-kN.js +71 -0
  216. package/dist/vendor-tiptap-extension-paragraph-DI577lM5.js +33 -0
  217. package/dist/vendor-tiptap-extension-placeholder-DwAtlfAF.js +52 -0
  218. package/dist/vendor-tiptap-extension-strike-CIty09KN.js +61 -0
  219. package/dist/vendor-tiptap-extension-table-C5nv-GUb.js +213 -0
  220. package/dist/vendor-tiptap-extension-table-cell-DXbBhJW3.js +40 -0
  221. package/dist/vendor-tiptap-extension-table-header-rtggsYXA.js +40 -0
  222. package/dist/vendor-tiptap-extension-table-row-67khjMDt.js +22 -0
  223. package/dist/vendor-tiptap-extension-text-D1OHb_a1.js +8 -0
  224. package/dist/vendor-tiptap-extension-underline-IqWixw3m.js +40 -0
  225. package/dist/vendor-tiptap-markdown-DVxB1hbO.js +825 -0
  226. package/dist/vendor-tiptap-starter-kit-CPH9gu2X.js +29 -0
  227. package/dist/vendor-tiptap-vue-3-CkBe4_xM.js +225 -0
  228. package/dist/vendor-truncate-html-Bx1HJzRq.js +145 -0
  229. package/dist/vendor-uc-micro-4lbSaZOs.js +17 -0
  230. package/dist/vendor-vee-validate-i18n-zT8NxX3R.js +93 -0
  231. package/dist/vendor-vee-validate-rules-DDeNM2Gc.js +314 -0
  232. package/dist/vendor-vue-currency-input-DxWnS-HB.js +315 -0
  233. package/dist/vendor-vue-devtools-api-aVYGocXp.js +93 -0
  234. package/dist/vendor-vue-i18n-DPtOLen3.js +1359 -0
  235. package/dist/vendor-vue3-application-insights-dAGGfA_M.js +69 -0
  236. package/dist/vendor-vue3-touch-events-8Pa3HHlV.js +169 -0
  237. package/dist/vendor-vuepic-vue-datepicker-DglsiNYa.js +4997 -0
  238. package/dist/vendor-vueuse-components-DtK_mxpP.js +219 -0
  239. package/dist/vendor-vueuse-core-cB-c7DzH.js +5129 -0
  240. package/dist/vendor-vueuse-shared-Dg7PMM0z.js +1169 -0
  241. package/dist/vendor-w3c-keyname-CLxH8j-f.js +92 -0
  242. package/dist/vendor-whatwg-fetch-l0sNRNKZ.js +1 -0
  243. package/package.json +5 -4
  244. package/ui/components/atoms/vc-icon/vc-lucide-icon.vue +2 -1
  245. package/dist/vendor-boolbase-Cp9L0GAZ.js +0 -25
  246. package/dist/vendor-cheerio-HN9zIPZn.js +0 -3135
  247. package/dist/vendor-cheerio-select-5Ry0HvBq.js +0 -306
  248. package/dist/vendor-css-select-DRIZ9kfZ.js +0 -966
  249. package/dist/vendor-css-what-DuPJ1HEF.js +0 -448
  250. package/dist/vendor-cypress-signalr-mock-BKdBJpdt.js +0 -778
  251. package/dist/vendor-date-fns-515YWkk-.js +0 -6724
  252. package/dist/vendor-dom-serializer-nQMsqjYW.js +0 -286
  253. package/dist/vendor-dom7-CJLPMwy5.js +0 -941
  254. package/dist/vendor-domelementtype-CjSzQey5.js +0 -53
  255. package/dist/vendor-domhandler-9z8cS16a.js +0 -484
  256. package/dist/vendor-dompurify-CRFzu7ib.js +0 -1336
  257. package/dist/vendor-domutils-Bc-Opz-v.js +0 -981
  258. package/dist/vendor-entities-Bfsx4xOQ.js +0 -636
  259. package/dist/vendor-floating-ui-core-wV8u8QP4.js +0 -511
  260. package/dist/vendor-floating-ui-dom-DDnRPs17.js +0 -706
  261. package/dist/vendor-floating-ui-utils-OMIFy1QU.js +0 -296
  262. package/dist/vendor-floating-ui-vue-D-tCDAMm.js +0 -167
  263. package/dist/vendor-fontsource-plus-jakarta-sans.css +0 -1
  264. package/dist/vendor-headlessui-vue-CY9FRgTb.js +0 -83
  265. package/dist/vendor-htmlparser2-B1dhFPOs.js +0 -1426
  266. package/dist/vendor-iconify-vue-DfRGgyNu.js +0 -1840
  267. package/dist/vendor-intlify-core-base-BuknsFQe.js +0 -1876
  268. package/dist/vendor-intlify-message-compiler-CuOQDWx1.js +0 -1508
  269. package/dist/vendor-intlify-shared-Cz4YRMuC.js +0 -241
  270. package/dist/vendor-iso-639-1-BJCk9DvE.js +0 -819
  271. package/dist/vendor-linkify-it-CKUf4vsc.js +0 -830
  272. package/dist/vendor-linkifyjs-BfyGgbCh.js +0 -1756
  273. package/dist/vendor-lodash-es-BySUOlwf.js +0 -18333
  274. package/dist/vendor-markdown-it-D-apazHa.js +0 -6000
  275. package/dist/vendor-markdown-it-task-lists-rxMVH6Ku.js +0 -131
  276. package/dist/vendor-mdurl-BNh2CCgT.js +0 -537
  277. package/dist/vendor-microsoft-applicationinsights-analytics-js-kG3lLg8X.js +0 -1275
  278. package/dist/vendor-microsoft-applicationinsights-cfgsync-js-C0uQkiQq.js +0 -591
  279. package/dist/vendor-microsoft-applicationinsights-channel-js-Dyd_PXA3.js +0 -2153
  280. package/dist/vendor-microsoft-applicationinsights-common-CfmP1_Qr.js +0 -2470
  281. package/dist/vendor-microsoft-applicationinsights-core-js-Cq4YSEvZ.js +0 -6589
  282. package/dist/vendor-microsoft-applicationinsights-dependencies-js-C56OBFr4.js +0 -1510
  283. package/dist/vendor-microsoft-applicationinsights-properties-js-CBJTBawx.js +0 -761
  284. package/dist/vendor-microsoft-applicationinsights-shims-CX8sJgar.js +0 -70
  285. package/dist/vendor-microsoft-applicationinsights-web-pim2ri-g.js +0 -667
  286. package/dist/vendor-microsoft-dynamicproto-js-CFBBUu9p.js +0 -520
  287. package/dist/vendor-microsoft-signalr-dUnlRsGm.js +0 -3339
  288. package/dist/vendor-moment-Mki5YqAR.js +0 -5679
  289. package/dist/vendor-nevware21-ts-async-CLMApQ9E.js +0 -395
  290. package/dist/vendor-nevware21-ts-utils-e8v8Jty3.js +0 -1160
  291. package/dist/vendor-nth-check-Bx8TxtJt.js +0 -157
  292. package/dist/vendor-orderedmap-dGG6uMFJ.js +0 -137
  293. package/dist/vendor-parse5-Bt2NhSzR.js +0 -8432
  294. package/dist/vendor-parse5-htmlparser2-tree-adapter-BUUtKzf8.js +0 -216
  295. package/dist/vendor-popperjs-core-Cr2byIky.js +0 -1790
  296. package/dist/vendor-prettier-B4PaeWRQ.js +0 -98
  297. package/dist/vendor-prosemirror-commands-BH9lWGpW.js +0 -561
  298. package/dist/vendor-prosemirror-dropcursor-CeyPcxrA.js +0 -146
  299. package/dist/vendor-prosemirror-gapcursor-U8UoUJII.js +0 -236
  300. package/dist/vendor-prosemirror-history-BDaJkvNx.js +0 -414
  301. package/dist/vendor-prosemirror-keymap-BbWvIWmH.js +0 -128
  302. package/dist/vendor-prosemirror-markdown-gB0PXBbz.js +0 -866
  303. package/dist/vendor-prosemirror-model-BZu3WVcD.js +0 -3463
  304. package/dist/vendor-prosemirror-schema-list-Bl9NpKA7.js +0 -158
  305. package/dist/vendor-prosemirror-state-BvL9Pxph.js +0 -1003
  306. package/dist/vendor-prosemirror-tables-17qAnviK.js +0 -2159
  307. package/dist/vendor-prosemirror-transform-CE9VV3qg.js +0 -2156
  308. package/dist/vendor-prosemirror-view-CU2WTHT7.js +0 -5811
  309. package/dist/vendor-punycode-js-iAs5RxMf.js +0 -441
  310. package/dist/vendor-rope-sequence-BdXDKoGt.js +0 -207
  311. package/dist/vendor-semver-CVLMK-S4.js +0 -2702
  312. package/dist/vendor-ssr-window-s6OpKa3O.js +0 -150
  313. package/dist/vendor-swiper-CdiyNHVt.js +0 -5679
  314. package/dist/vendor-tippy-js-DWFe2TfK.js +0 -1647
  315. package/dist/vendor-tiptap-core-NfwGfaQk.js +0 -4910
  316. package/dist/vendor-tiptap-extension-blockquote-jmWBTtsI.js +0 -57
  317. package/dist/vendor-tiptap-extension-bold-p5frh4ak.js +0 -97
  318. package/dist/vendor-tiptap-extension-bubble-menu-KUhZSfrs.js +0 -218
  319. package/dist/vendor-tiptap-extension-bullet-list-COmZRoSB.js +0 -73
  320. package/dist/vendor-tiptap-extension-code-block-DyTARZss.js +0 -221
  321. package/dist/vendor-tiptap-extension-code-jVv6CXpX.js +0 -75
  322. package/dist/vendor-tiptap-extension-document-DssuotYs.js +0 -13
  323. package/dist/vendor-tiptap-extension-dropcursor-BoO0Qv91.js +0 -26
  324. package/dist/vendor-tiptap-extension-floating-menu-CrO8CN5w.js +0 -165
  325. package/dist/vendor-tiptap-extension-gapcursor-KpsWEoMD.js +0 -30
  326. package/dist/vendor-tiptap-extension-hard-break-ldOzhSvf.js +0 -68
  327. package/dist/vendor-tiptap-extension-heading-CKz2llX0.js +0 -77
  328. package/dist/vendor-tiptap-extension-history-DeKZ2VQ9.js +0 -48
  329. package/dist/vendor-tiptap-extension-horizontal-rule-CAjWRyDS.js +0 -92
  330. package/dist/vendor-tiptap-extension-image-ZagcEYuk.js +0 -76
  331. package/dist/vendor-tiptap-extension-italic-CM4xdznY.js +0 -96
  332. package/dist/vendor-tiptap-extension-link-Z-AMC4Ri.js +0 -414
  333. package/dist/vendor-tiptap-extension-list-item-BJi5QpXc.js +0 -37
  334. package/dist/vendor-tiptap-extension-ordered-list-C_TMrfBE.js +0 -97
  335. package/dist/vendor-tiptap-extension-paragraph-CQw0E0Au.js +0 -39
  336. package/dist/vendor-tiptap-extension-placeholder-BBNVKfa_.js +0 -66
  337. package/dist/vendor-tiptap-extension-strike-DUyMYX1Z.js +0 -79
  338. package/dist/vendor-tiptap-extension-table-cell-CoDIMPA5.js +0 -47
  339. package/dist/vendor-tiptap-extension-table-header-DvbGHnmw.js +0 -47
  340. package/dist/vendor-tiptap-extension-table-row-D1uqN5Aj.js +0 -26
  341. package/dist/vendor-tiptap-extension-table-tKS4MOM4.js +0 -354
  342. package/dist/vendor-tiptap-extension-text-DtRBhKB2.js +0 -12
  343. package/dist/vendor-tiptap-extension-underline-DqaSFp_P.js +0 -50
  344. package/dist/vendor-tiptap-markdown-7-PCADTU.js +0 -1017
  345. package/dist/vendor-tiptap-starter-kit-CDSV_Zuu.js +0 -88
  346. package/dist/vendor-tiptap-vue-3-DZg2fjq_.js +0 -268
  347. package/dist/vendor-truncate-html-3qQY0Djo.js +0 -196
  348. package/dist/vendor-uc-micro-jjt6LQ65.js +0 -23
  349. package/dist/vendor-vee-validate-i18n-v_gHjRmD.js +0 -154
  350. package/dist/vendor-vee-validate-rules-DzV3VY3N.js +0 -536
  351. package/dist/vendor-vue-currency-input-DGAkEFBO.js +0 -545
  352. package/dist/vendor-vue-devtools-api-DXYR8qBG.js +0 -169
  353. package/dist/vendor-vue-i18n-Co752uk3.js +0 -1897
  354. package/dist/vendor-vue3-application-insights-CYWFCr_J.js +0 -119
  355. package/dist/vendor-vue3-touch-events-BJEAiSa3.js +0 -416
  356. package/dist/vendor-vuepic-vue-datepicker-BSWXRSiu.js +0 -5019
  357. package/dist/vendor-vueuse-components-l1bL12mE.js +0 -339
  358. package/dist/vendor-vueuse-core-DGcJOmwG.js +0 -7743
  359. package/dist/vendor-vueuse-shared-_mOXsFuM.js +0 -1568
  360. package/dist/vendor-w3c-keyname-BOm2dtJm.js +0 -121
@@ -1,1840 +0,0 @@
1
- import { defineComponent, ref, shallowRef, onMounted, watch, onUnmounted, h, nextTick } from 'vue';
2
-
3
- const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
4
- const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
5
- const colonSeparated = value.split(":");
6
- if (value.slice(0, 1) === "@") {
7
- if (colonSeparated.length < 2 || colonSeparated.length > 3) {
8
- return null;
9
- }
10
- provider = colonSeparated.shift().slice(1);
11
- }
12
- if (colonSeparated.length > 3 || !colonSeparated.length) {
13
- return null;
14
- }
15
- if (colonSeparated.length > 1) {
16
- const name2 = colonSeparated.pop();
17
- const prefix = colonSeparated.pop();
18
- const result = {
19
- // Allow provider without '@': "provider:prefix:name"
20
- provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
21
- prefix,
22
- name: name2
23
- };
24
- return validate && !validateIconName(result) ? null : result;
25
- }
26
- const name = colonSeparated[0];
27
- const dashSeparated = name.split("-");
28
- if (dashSeparated.length > 1) {
29
- const result = {
30
- provider,
31
- prefix: dashSeparated.shift(),
32
- name: dashSeparated.join("-")
33
- };
34
- return validate && !validateIconName(result) ? null : result;
35
- }
36
- if (allowSimpleName && provider === "") {
37
- const result = {
38
- provider,
39
- prefix: "",
40
- name
41
- };
42
- return validate && !validateIconName(result, allowSimpleName) ? null : result;
43
- }
44
- return null;
45
- };
46
- const validateIconName = (icon, allowSimpleName) => {
47
- if (!icon) {
48
- return false;
49
- }
50
- return !!// Check prefix: cannot be empty, unless allowSimpleName is enabled
51
- // Check name: cannot be empty
52
- ((allowSimpleName && icon.prefix === "" || !!icon.prefix) && !!icon.name);
53
- };
54
-
55
- const defaultIconDimensions = Object.freeze(
56
- {
57
- left: 0,
58
- top: 0,
59
- width: 16,
60
- height: 16
61
- }
62
- );
63
- const defaultIconTransformations = Object.freeze({
64
- rotate: 0,
65
- vFlip: false,
66
- hFlip: false
67
- });
68
- const defaultIconProps = Object.freeze({
69
- ...defaultIconDimensions,
70
- ...defaultIconTransformations
71
- });
72
- const defaultExtendedIconProps = Object.freeze({
73
- ...defaultIconProps,
74
- body: "",
75
- hidden: false
76
- });
77
-
78
- function mergeIconTransformations(obj1, obj2) {
79
- const result = {};
80
- if (!obj1.hFlip !== !obj2.hFlip) {
81
- result.hFlip = true;
82
- }
83
- if (!obj1.vFlip !== !obj2.vFlip) {
84
- result.vFlip = true;
85
- }
86
- const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
87
- if (rotate) {
88
- result.rotate = rotate;
89
- }
90
- return result;
91
- }
92
-
93
- function mergeIconData(parent, child) {
94
- const result = mergeIconTransformations(parent, child);
95
- for (const key in defaultExtendedIconProps) {
96
- if (key in defaultIconTransformations) {
97
- if (key in parent && !(key in result)) {
98
- result[key] = defaultIconTransformations[key];
99
- }
100
- } else if (key in child) {
101
- result[key] = child[key];
102
- } else if (key in parent) {
103
- result[key] = parent[key];
104
- }
105
- }
106
- return result;
107
- }
108
-
109
- function getIconsTree(data, names) {
110
- const icons = data.icons;
111
- const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
112
- const resolved = /* @__PURE__ */ Object.create(null);
113
- function resolve(name) {
114
- if (icons[name]) {
115
- return resolved[name] = [];
116
- }
117
- if (!(name in resolved)) {
118
- resolved[name] = null;
119
- const parent = aliases[name] && aliases[name].parent;
120
- const value = parent && resolve(parent);
121
- if (value) {
122
- resolved[name] = [parent].concat(value);
123
- }
124
- }
125
- return resolved[name];
126
- }
127
- (Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
128
- return resolved;
129
- }
130
-
131
- function internalGetIconData(data, name, tree) {
132
- const icons = data.icons;
133
- const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
134
- let currentProps = {};
135
- function parse(name2) {
136
- currentProps = mergeIconData(
137
- icons[name2] || aliases[name2],
138
- currentProps
139
- );
140
- }
141
- parse(name);
142
- tree.forEach(parse);
143
- return mergeIconData(data, currentProps);
144
- }
145
-
146
- function parseIconSet(data, callback) {
147
- const names = [];
148
- if (typeof data !== "object" || typeof data.icons !== "object") {
149
- return names;
150
- }
151
- if (data.not_found instanceof Array) {
152
- data.not_found.forEach((name) => {
153
- callback(name, null);
154
- names.push(name);
155
- });
156
- }
157
- const tree = getIconsTree(data);
158
- for (const name in tree) {
159
- const item = tree[name];
160
- if (item) {
161
- callback(name, internalGetIconData(data, name, item));
162
- names.push(name);
163
- }
164
- }
165
- return names;
166
- }
167
-
168
- const optionalPropertyDefaults = {
169
- provider: "",
170
- aliases: {},
171
- not_found: {},
172
- ...defaultIconDimensions
173
- };
174
- function checkOptionalProps(item, defaults) {
175
- for (const prop in defaults) {
176
- if (prop in item && typeof item[prop] !== typeof defaults[prop]) {
177
- return false;
178
- }
179
- }
180
- return true;
181
- }
182
- function quicklyValidateIconSet(obj) {
183
- if (typeof obj !== "object" || obj === null) {
184
- return null;
185
- }
186
- const data = obj;
187
- if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") {
188
- return null;
189
- }
190
- if (!checkOptionalProps(obj, optionalPropertyDefaults)) {
191
- return null;
192
- }
193
- const icons = data.icons;
194
- for (const name in icons) {
195
- const icon = icons[name];
196
- if (
197
- // Name cannot be empty
198
- !name || // Must have body
199
- typeof icon.body !== "string" || // Check other props
200
- !checkOptionalProps(
201
- icon,
202
- defaultExtendedIconProps
203
- )
204
- ) {
205
- return null;
206
- }
207
- }
208
- const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
209
- for (const name in aliases) {
210
- const icon = aliases[name];
211
- const parent = icon.parent;
212
- if (
213
- // Name cannot be empty
214
- !name || // Parent must be set and point to existing icon
215
- typeof parent !== "string" || !icons[parent] && !aliases[parent] || // Check other props
216
- !checkOptionalProps(
217
- icon,
218
- defaultExtendedIconProps
219
- )
220
- ) {
221
- return null;
222
- }
223
- }
224
- return data;
225
- }
226
-
227
- const dataStorage = /* @__PURE__ */ Object.create(null);
228
- function newStorage(provider, prefix) {
229
- return {
230
- provider,
231
- prefix,
232
- icons: /* @__PURE__ */ Object.create(null),
233
- missing: /* @__PURE__ */ new Set()
234
- };
235
- }
236
- function getStorage(provider, prefix) {
237
- const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
238
- return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
239
- }
240
- function addIconSet(storage, data) {
241
- if (!quicklyValidateIconSet(data)) {
242
- return [];
243
- }
244
- return parseIconSet(data, (name, icon) => {
245
- if (icon) {
246
- storage.icons[name] = icon;
247
- } else {
248
- storage.missing.add(name);
249
- }
250
- });
251
- }
252
- function addIconToStorage(storage, name, icon) {
253
- try {
254
- if (typeof icon.body === "string") {
255
- storage.icons[name] = { ...icon };
256
- return true;
257
- }
258
- } catch (err) {
259
- }
260
- return false;
261
- }
262
-
263
- let simpleNames = false;
264
- function allowSimpleNames(allow) {
265
- if (typeof allow === "boolean") {
266
- simpleNames = allow;
267
- }
268
- return simpleNames;
269
- }
270
- function getIconData(name) {
271
- const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
272
- if (icon) {
273
- const storage = getStorage(icon.provider, icon.prefix);
274
- const iconName = icon.name;
275
- return storage.icons[iconName] || (storage.missing.has(iconName) ? null : void 0);
276
- }
277
- }
278
- function addIcon(name, data) {
279
- const icon = stringToIcon(name, true, simpleNames);
280
- if (!icon) {
281
- return false;
282
- }
283
- const storage = getStorage(icon.provider, icon.prefix);
284
- if (data) {
285
- return addIconToStorage(storage, icon.name, data);
286
- } else {
287
- storage.missing.add(icon.name);
288
- return true;
289
- }
290
- }
291
- function addCollection(data, provider) {
292
- if (typeof data !== "object") {
293
- return false;
294
- }
295
- if (typeof provider !== "string") {
296
- provider = data.provider || "";
297
- }
298
- if (simpleNames && !provider && !data.prefix) {
299
- let added = false;
300
- if (quicklyValidateIconSet(data)) {
301
- data.prefix = "";
302
- parseIconSet(data, (name, icon) => {
303
- if (addIcon(name, icon)) {
304
- added = true;
305
- }
306
- });
307
- }
308
- return added;
309
- }
310
- const prefix = data.prefix;
311
- if (!validateIconName({
312
- prefix,
313
- name: "a"
314
- })) {
315
- return false;
316
- }
317
- const storage = getStorage(provider, prefix);
318
- return !!addIconSet(storage, data);
319
- }
320
-
321
- const defaultIconSizeCustomisations = Object.freeze({
322
- width: null,
323
- height: null
324
- });
325
- const defaultIconCustomisations = Object.freeze({
326
- // Dimensions
327
- ...defaultIconSizeCustomisations,
328
- // Transformations
329
- ...defaultIconTransformations
330
- });
331
-
332
- const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
333
- const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
334
- function calculateSize(size, ratio, precision) {
335
- if (ratio === 1) {
336
- return size;
337
- }
338
- precision = precision || 100;
339
- if (typeof size === "number") {
340
- return Math.ceil(size * ratio * precision) / precision;
341
- }
342
- if (typeof size !== "string") {
343
- return size;
344
- }
345
- const oldParts = size.split(unitsSplit);
346
- if (oldParts === null || !oldParts.length) {
347
- return size;
348
- }
349
- const newParts = [];
350
- let code = oldParts.shift();
351
- let isNumber = unitsTest.test(code);
352
- while (true) {
353
- if (isNumber) {
354
- const num = parseFloat(code);
355
- if (isNaN(num)) {
356
- newParts.push(code);
357
- } else {
358
- newParts.push(Math.ceil(num * ratio * precision) / precision);
359
- }
360
- } else {
361
- newParts.push(code);
362
- }
363
- code = oldParts.shift();
364
- if (code === void 0) {
365
- return newParts.join("");
366
- }
367
- isNumber = !isNumber;
368
- }
369
- }
370
-
371
- function splitSVGDefs(content, tag = "defs") {
372
- let defs = "";
373
- const index = content.indexOf("<" + tag);
374
- while (index >= 0) {
375
- const start = content.indexOf(">", index);
376
- const end = content.indexOf("</" + tag);
377
- if (start === -1 || end === -1) {
378
- break;
379
- }
380
- const endEnd = content.indexOf(">", end);
381
- if (endEnd === -1) {
382
- break;
383
- }
384
- defs += content.slice(start + 1, end).trim();
385
- content = content.slice(0, index).trim() + content.slice(endEnd + 1);
386
- }
387
- return {
388
- defs,
389
- content
390
- };
391
- }
392
- function mergeDefsAndContent(defs, content) {
393
- return defs ? "<defs>" + defs + "</defs>" + content : content;
394
- }
395
- function wrapSVGContent(body, start, end) {
396
- const split = splitSVGDefs(body);
397
- return mergeDefsAndContent(split.defs, start + split.content + end);
398
- }
399
-
400
- const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
401
- function iconToSVG(icon, customisations) {
402
- const fullIcon = {
403
- ...defaultIconProps,
404
- ...icon
405
- };
406
- const fullCustomisations = {
407
- ...defaultIconCustomisations,
408
- ...customisations
409
- };
410
- const box = {
411
- left: fullIcon.left,
412
- top: fullIcon.top,
413
- width: fullIcon.width,
414
- height: fullIcon.height
415
- };
416
- let body = fullIcon.body;
417
- [fullIcon, fullCustomisations].forEach((props) => {
418
- const transformations = [];
419
- const hFlip = props.hFlip;
420
- const vFlip = props.vFlip;
421
- let rotation = props.rotate;
422
- if (hFlip) {
423
- if (vFlip) {
424
- rotation += 2;
425
- } else {
426
- transformations.push(
427
- "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
428
- );
429
- transformations.push("scale(-1 1)");
430
- box.top = box.left = 0;
431
- }
432
- } else if (vFlip) {
433
- transformations.push(
434
- "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
435
- );
436
- transformations.push("scale(1 -1)");
437
- box.top = box.left = 0;
438
- }
439
- let tempValue;
440
- if (rotation < 0) {
441
- rotation -= Math.floor(rotation / 4) * 4;
442
- }
443
- rotation = rotation % 4;
444
- switch (rotation) {
445
- case 1:
446
- tempValue = box.height / 2 + box.top;
447
- transformations.unshift(
448
- "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
449
- );
450
- break;
451
- case 2:
452
- transformations.unshift(
453
- "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
454
- );
455
- break;
456
- case 3:
457
- tempValue = box.width / 2 + box.left;
458
- transformations.unshift(
459
- "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
460
- );
461
- break;
462
- }
463
- if (rotation % 2 === 1) {
464
- if (box.left !== box.top) {
465
- tempValue = box.left;
466
- box.left = box.top;
467
- box.top = tempValue;
468
- }
469
- if (box.width !== box.height) {
470
- tempValue = box.width;
471
- box.width = box.height;
472
- box.height = tempValue;
473
- }
474
- }
475
- if (transformations.length) {
476
- body = wrapSVGContent(
477
- body,
478
- '<g transform="' + transformations.join(" ") + '">',
479
- "</g>"
480
- );
481
- }
482
- });
483
- const customisationsWidth = fullCustomisations.width;
484
- const customisationsHeight = fullCustomisations.height;
485
- const boxWidth = box.width;
486
- const boxHeight = box.height;
487
- let width;
488
- let height;
489
- if (customisationsWidth === null) {
490
- height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
491
- width = calculateSize(height, boxWidth / boxHeight);
492
- } else {
493
- width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
494
- height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
495
- }
496
- const attributes = {};
497
- const setAttr = (prop, value) => {
498
- if (!isUnsetKeyword(value)) {
499
- attributes[prop] = value.toString();
500
- }
501
- };
502
- setAttr("width", width);
503
- setAttr("height", height);
504
- const viewBox = [box.left, box.top, boxWidth, boxHeight];
505
- attributes.viewBox = viewBox.join(" ");
506
- return {
507
- attributes,
508
- viewBox,
509
- body
510
- };
511
- }
512
-
513
- const regex = /\sid="(\S+)"/g;
514
- const randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
515
- let counter = 0;
516
- function replaceIDs(body, prefix = randomPrefix) {
517
- const ids = [];
518
- let match;
519
- while (match = regex.exec(body)) {
520
- ids.push(match[1]);
521
- }
522
- if (!ids.length) {
523
- return body;
524
- }
525
- const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
526
- ids.forEach((id) => {
527
- const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
528
- const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
529
- body = body.replace(
530
- // Allowed characters before id: [#;"]
531
- // Allowed characters after id: [)"], .[a-z]
532
- new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"),
533
- "$1" + newID + suffix + "$3"
534
- );
535
- });
536
- body = body.replace(new RegExp(suffix, "g"), "");
537
- return body;
538
- }
539
-
540
- const storage = /* @__PURE__ */ Object.create(null);
541
- function setAPIModule(provider, item) {
542
- storage[provider] = item;
543
- }
544
- function getAPIModule(provider) {
545
- return storage[provider] || storage[""];
546
- }
547
-
548
- function createAPIConfig(source) {
549
- let resources;
550
- if (typeof source.resources === "string") {
551
- resources = [source.resources];
552
- } else {
553
- resources = source.resources;
554
- if (!(resources instanceof Array) || !resources.length) {
555
- return null;
556
- }
557
- }
558
- const result = {
559
- // API hosts
560
- resources,
561
- // Root path
562
- path: source.path || "/",
563
- // URL length limit
564
- maxURL: source.maxURL || 500,
565
- // Timeout before next host is used.
566
- rotate: source.rotate || 750,
567
- // Timeout before failing query.
568
- timeout: source.timeout || 5e3,
569
- // Randomise default API end point.
570
- random: source.random === true,
571
- // Start index
572
- index: source.index || 0,
573
- // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
574
- dataAfterTimeout: source.dataAfterTimeout !== false
575
- };
576
- return result;
577
- }
578
- const configStorage = /* @__PURE__ */ Object.create(null);
579
- const fallBackAPISources = [
580
- "https://api.simplesvg.com",
581
- "https://api.unisvg.com"
582
- ];
583
- const fallBackAPI = [];
584
- while (fallBackAPISources.length > 0) {
585
- if (fallBackAPISources.length === 1) {
586
- fallBackAPI.push(fallBackAPISources.shift());
587
- } else {
588
- if (Math.random() > 0.5) {
589
- fallBackAPI.push(fallBackAPISources.shift());
590
- } else {
591
- fallBackAPI.push(fallBackAPISources.pop());
592
- }
593
- }
594
- }
595
- configStorage[""] = createAPIConfig({
596
- resources: ["https://api.iconify.design"].concat(fallBackAPI)
597
- });
598
- function addAPIProvider(provider, customConfig) {
599
- const config = createAPIConfig(customConfig);
600
- if (config === null) {
601
- return false;
602
- }
603
- configStorage[provider] = config;
604
- return true;
605
- }
606
- function getAPIConfig(provider) {
607
- return configStorage[provider];
608
- }
609
-
610
- const detectFetch = () => {
611
- let callback;
612
- try {
613
- callback = fetch;
614
- if (typeof callback === "function") {
615
- return callback;
616
- }
617
- } catch (err) {
618
- }
619
- };
620
- let fetchModule = detectFetch();
621
- function calculateMaxLength(provider, prefix) {
622
- const config = getAPIConfig(provider);
623
- if (!config) {
624
- return 0;
625
- }
626
- let result;
627
- if (!config.maxURL) {
628
- result = 0;
629
- } else {
630
- let maxHostLength = 0;
631
- config.resources.forEach((item) => {
632
- const host = item;
633
- maxHostLength = Math.max(maxHostLength, host.length);
634
- });
635
- const url = prefix + ".json?icons=";
636
- result = config.maxURL - maxHostLength - config.path.length - url.length;
637
- }
638
- return result;
639
- }
640
- function shouldAbort(status) {
641
- return status === 404;
642
- }
643
- const prepare = (provider, prefix, icons) => {
644
- const results = [];
645
- const maxLength = calculateMaxLength(provider, prefix);
646
- const type = "icons";
647
- let item = {
648
- type,
649
- provider,
650
- prefix,
651
- icons: []
652
- };
653
- let length = 0;
654
- icons.forEach((name, index) => {
655
- length += name.length + 1;
656
- if (length >= maxLength && index > 0) {
657
- results.push(item);
658
- item = {
659
- type,
660
- provider,
661
- prefix,
662
- icons: []
663
- };
664
- length = name.length;
665
- }
666
- item.icons.push(name);
667
- });
668
- results.push(item);
669
- return results;
670
- };
671
- function getPath(provider) {
672
- if (typeof provider === "string") {
673
- const config = getAPIConfig(provider);
674
- if (config) {
675
- return config.path;
676
- }
677
- }
678
- return "/";
679
- }
680
- const send = (host, params, callback) => {
681
- if (!fetchModule) {
682
- callback("abort", 424);
683
- return;
684
- }
685
- let path = getPath(params.provider);
686
- switch (params.type) {
687
- case "icons": {
688
- const prefix = params.prefix;
689
- const icons = params.icons;
690
- const iconsList = icons.join(",");
691
- const urlParams = new URLSearchParams({
692
- icons: iconsList
693
- });
694
- path += prefix + ".json?" + urlParams.toString();
695
- break;
696
- }
697
- case "custom": {
698
- const uri = params.uri;
699
- path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
700
- break;
701
- }
702
- default:
703
- callback("abort", 400);
704
- return;
705
- }
706
- let defaultError = 503;
707
- fetchModule(host + path).then((response) => {
708
- const status = response.status;
709
- if (status !== 200) {
710
- setTimeout(() => {
711
- callback(shouldAbort(status) ? "abort" : "next", status);
712
- });
713
- return;
714
- }
715
- defaultError = 501;
716
- return response.json();
717
- }).then((data) => {
718
- if (typeof data !== "object" || data === null) {
719
- setTimeout(() => {
720
- if (data === 404) {
721
- callback("abort", data);
722
- } else {
723
- callback("next", defaultError);
724
- }
725
- });
726
- return;
727
- }
728
- setTimeout(() => {
729
- callback("success", data);
730
- });
731
- }).catch(() => {
732
- callback("next", defaultError);
733
- });
734
- };
735
- const fetchAPIModule = {
736
- prepare,
737
- send
738
- };
739
-
740
- function sortIcons(icons) {
741
- const result = {
742
- loaded: [],
743
- missing: [],
744
- pending: []
745
- };
746
- const storage = /* @__PURE__ */ Object.create(null);
747
- icons.sort((a, b) => {
748
- if (a.provider !== b.provider) {
749
- return a.provider.localeCompare(b.provider);
750
- }
751
- if (a.prefix !== b.prefix) {
752
- return a.prefix.localeCompare(b.prefix);
753
- }
754
- return a.name.localeCompare(b.name);
755
- });
756
- let lastIcon = {
757
- provider: "",
758
- prefix: "",
759
- name: ""
760
- };
761
- icons.forEach((icon) => {
762
- if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {
763
- return;
764
- }
765
- lastIcon = icon;
766
- const provider = icon.provider;
767
- const prefix = icon.prefix;
768
- const name = icon.name;
769
- const providerStorage = storage[provider] || (storage[provider] = /* @__PURE__ */ Object.create(null));
770
- const localStorage = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
771
- let list;
772
- if (name in localStorage.icons) {
773
- list = result.loaded;
774
- } else if (prefix === "" || localStorage.missing.has(name)) {
775
- list = result.missing;
776
- } else {
777
- list = result.pending;
778
- }
779
- const item = {
780
- provider,
781
- prefix,
782
- name
783
- };
784
- list.push(item);
785
- });
786
- return result;
787
- }
788
-
789
- function removeCallback(storages, id) {
790
- storages.forEach((storage) => {
791
- const items = storage.loaderCallbacks;
792
- if (items) {
793
- storage.loaderCallbacks = items.filter((row) => row.id !== id);
794
- }
795
- });
796
- }
797
- function updateCallbacks(storage) {
798
- if (!storage.pendingCallbacksFlag) {
799
- storage.pendingCallbacksFlag = true;
800
- setTimeout(() => {
801
- storage.pendingCallbacksFlag = false;
802
- const items = storage.loaderCallbacks ? storage.loaderCallbacks.slice(0) : [];
803
- if (!items.length) {
804
- return;
805
- }
806
- let hasPending = false;
807
- const provider = storage.provider;
808
- const prefix = storage.prefix;
809
- items.forEach((item) => {
810
- const icons = item.icons;
811
- const oldLength = icons.pending.length;
812
- icons.pending = icons.pending.filter((icon) => {
813
- if (icon.prefix !== prefix) {
814
- return true;
815
- }
816
- const name = icon.name;
817
- if (storage.icons[name]) {
818
- icons.loaded.push({
819
- provider,
820
- prefix,
821
- name
822
- });
823
- } else if (storage.missing.has(name)) {
824
- icons.missing.push({
825
- provider,
826
- prefix,
827
- name
828
- });
829
- } else {
830
- hasPending = true;
831
- return true;
832
- }
833
- return false;
834
- });
835
- if (icons.pending.length !== oldLength) {
836
- if (!hasPending) {
837
- removeCallback([storage], item.id);
838
- }
839
- item.callback(
840
- icons.loaded.slice(0),
841
- icons.missing.slice(0),
842
- icons.pending.slice(0),
843
- item.abort
844
- );
845
- }
846
- });
847
- });
848
- }
849
- }
850
- let idCounter = 0;
851
- function storeCallback(callback, icons, pendingSources) {
852
- const id = idCounter++;
853
- const abort = removeCallback.bind(null, pendingSources, id);
854
- if (!icons.pending.length) {
855
- return abort;
856
- }
857
- const item = {
858
- id,
859
- icons,
860
- callback,
861
- abort
862
- };
863
- pendingSources.forEach((storage) => {
864
- (storage.loaderCallbacks || (storage.loaderCallbacks = [])).push(item);
865
- });
866
- return abort;
867
- }
868
-
869
- function listToIcons(list, validate = true, simpleNames = false) {
870
- const result = [];
871
- list.forEach((item) => {
872
- const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames) : item;
873
- if (icon) {
874
- result.push(icon);
875
- }
876
- });
877
- return result;
878
- }
879
-
880
- // src/config.ts
881
- var defaultConfig = {
882
- resources: [],
883
- index: 0,
884
- timeout: 2e3,
885
- rotate: 750,
886
- random: false,
887
- dataAfterTimeout: false
888
- };
889
-
890
- // src/query.ts
891
- function sendQuery(config, payload, query, done) {
892
- const resourcesCount = config.resources.length;
893
- const startIndex = config.random ? Math.floor(Math.random() * resourcesCount) : config.index;
894
- let resources;
895
- if (config.random) {
896
- let list = config.resources.slice(0);
897
- resources = [];
898
- while (list.length > 1) {
899
- const nextIndex = Math.floor(Math.random() * list.length);
900
- resources.push(list[nextIndex]);
901
- list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
902
- }
903
- resources = resources.concat(list);
904
- } else {
905
- resources = config.resources.slice(startIndex).concat(config.resources.slice(0, startIndex));
906
- }
907
- const startTime = Date.now();
908
- let status = "pending";
909
- let queriesSent = 0;
910
- let lastError;
911
- let timer = null;
912
- let queue = [];
913
- let doneCallbacks = [];
914
- if (typeof done === "function") {
915
- doneCallbacks.push(done);
916
- }
917
- function resetTimer() {
918
- if (timer) {
919
- clearTimeout(timer);
920
- timer = null;
921
- }
922
- }
923
- function abort() {
924
- if (status === "pending") {
925
- status = "aborted";
926
- }
927
- resetTimer();
928
- queue.forEach((item) => {
929
- if (item.status === "pending") {
930
- item.status = "aborted";
931
- }
932
- });
933
- queue = [];
934
- }
935
- function subscribe(callback, overwrite) {
936
- if (overwrite) {
937
- doneCallbacks = [];
938
- }
939
- if (typeof callback === "function") {
940
- doneCallbacks.push(callback);
941
- }
942
- }
943
- function getQueryStatus() {
944
- return {
945
- startTime,
946
- payload,
947
- status,
948
- queriesSent,
949
- queriesPending: queue.length,
950
- subscribe,
951
- abort
952
- };
953
- }
954
- function failQuery() {
955
- status = "failed";
956
- doneCallbacks.forEach((callback) => {
957
- callback(void 0, lastError);
958
- });
959
- }
960
- function clearQueue() {
961
- queue.forEach((item) => {
962
- if (item.status === "pending") {
963
- item.status = "aborted";
964
- }
965
- });
966
- queue = [];
967
- }
968
- function moduleResponse(item, response, data) {
969
- const isError = response !== "success";
970
- queue = queue.filter((queued) => queued !== item);
971
- switch (status) {
972
- case "pending":
973
- break;
974
- case "failed":
975
- if (isError || !config.dataAfterTimeout) {
976
- return;
977
- }
978
- break;
979
- default:
980
- return;
981
- }
982
- if (response === "abort") {
983
- lastError = data;
984
- failQuery();
985
- return;
986
- }
987
- if (isError) {
988
- lastError = data;
989
- if (!queue.length) {
990
- if (!resources.length) {
991
- failQuery();
992
- } else {
993
- execNext();
994
- }
995
- }
996
- return;
997
- }
998
- resetTimer();
999
- clearQueue();
1000
- if (!config.random) {
1001
- const index = config.resources.indexOf(item.resource);
1002
- if (index !== -1 && index !== config.index) {
1003
- config.index = index;
1004
- }
1005
- }
1006
- status = "completed";
1007
- doneCallbacks.forEach((callback) => {
1008
- callback(data);
1009
- });
1010
- }
1011
- function execNext() {
1012
- if (status !== "pending") {
1013
- return;
1014
- }
1015
- resetTimer();
1016
- const resource = resources.shift();
1017
- if (resource === void 0) {
1018
- if (queue.length) {
1019
- timer = setTimeout(() => {
1020
- resetTimer();
1021
- if (status === "pending") {
1022
- clearQueue();
1023
- failQuery();
1024
- }
1025
- }, config.timeout);
1026
- return;
1027
- }
1028
- failQuery();
1029
- return;
1030
- }
1031
- const item = {
1032
- status: "pending",
1033
- resource,
1034
- callback: (status2, data) => {
1035
- moduleResponse(item, status2, data);
1036
- }
1037
- };
1038
- queue.push(item);
1039
- queriesSent++;
1040
- timer = setTimeout(execNext, config.rotate);
1041
- query(resource, payload, item.callback);
1042
- }
1043
- setTimeout(execNext);
1044
- return getQueryStatus;
1045
- }
1046
-
1047
- // src/index.ts
1048
- function initRedundancy(cfg) {
1049
- const config = {
1050
- ...defaultConfig,
1051
- ...cfg
1052
- };
1053
- let queries = [];
1054
- function cleanup() {
1055
- queries = queries.filter((item) => item().status === "pending");
1056
- }
1057
- function query(payload, queryCallback, doneCallback) {
1058
- const query2 = sendQuery(
1059
- config,
1060
- payload,
1061
- queryCallback,
1062
- (data, error) => {
1063
- cleanup();
1064
- if (doneCallback) {
1065
- doneCallback(data, error);
1066
- }
1067
- }
1068
- );
1069
- queries.push(query2);
1070
- return query2;
1071
- }
1072
- function find(callback) {
1073
- return queries.find((value) => {
1074
- return callback(value);
1075
- }) || null;
1076
- }
1077
- const instance = {
1078
- query,
1079
- find,
1080
- setIndex: (index) => {
1081
- config.index = index;
1082
- },
1083
- getIndex: () => config.index,
1084
- cleanup
1085
- };
1086
- return instance;
1087
- }
1088
-
1089
- function emptyCallback$1() {
1090
- }
1091
- const redundancyCache = /* @__PURE__ */ Object.create(null);
1092
- function getRedundancyCache(provider) {
1093
- if (!redundancyCache[provider]) {
1094
- const config = getAPIConfig(provider);
1095
- if (!config) {
1096
- return;
1097
- }
1098
- const redundancy = initRedundancy(config);
1099
- const cachedReundancy = {
1100
- config,
1101
- redundancy
1102
- };
1103
- redundancyCache[provider] = cachedReundancy;
1104
- }
1105
- return redundancyCache[provider];
1106
- }
1107
- function sendAPIQuery(target, query, callback) {
1108
- let redundancy;
1109
- let send;
1110
- if (typeof target === "string") {
1111
- const api = getAPIModule(target);
1112
- if (!api) {
1113
- callback(void 0, 424);
1114
- return emptyCallback$1;
1115
- }
1116
- send = api.send;
1117
- const cached = getRedundancyCache(target);
1118
- if (cached) {
1119
- redundancy = cached.redundancy;
1120
- }
1121
- } else {
1122
- const config = createAPIConfig(target);
1123
- if (config) {
1124
- redundancy = initRedundancy(config);
1125
- const moduleKey = target.resources ? target.resources[0] : "";
1126
- const api = getAPIModule(moduleKey);
1127
- if (api) {
1128
- send = api.send;
1129
- }
1130
- }
1131
- }
1132
- if (!redundancy || !send) {
1133
- callback(void 0, 424);
1134
- return emptyCallback$1;
1135
- }
1136
- return redundancy.query(query, send, callback)().abort;
1137
- }
1138
-
1139
- function emptyCallback() {
1140
- }
1141
- function loadedNewIcons(storage) {
1142
- if (!storage.iconsLoaderFlag) {
1143
- storage.iconsLoaderFlag = true;
1144
- setTimeout(() => {
1145
- storage.iconsLoaderFlag = false;
1146
- updateCallbacks(storage);
1147
- });
1148
- }
1149
- }
1150
- function checkIconNamesForAPI(icons) {
1151
- const valid = [];
1152
- const invalid = [];
1153
- icons.forEach((name) => {
1154
- (name.match(matchIconName) ? valid : invalid).push(name);
1155
- });
1156
- return {
1157
- valid,
1158
- invalid
1159
- };
1160
- }
1161
- function parseLoaderResponse(storage, icons, data) {
1162
- function checkMissing() {
1163
- const pending = storage.pendingIcons;
1164
- icons.forEach((name) => {
1165
- if (pending) {
1166
- pending.delete(name);
1167
- }
1168
- if (!storage.icons[name]) {
1169
- storage.missing.add(name);
1170
- }
1171
- });
1172
- }
1173
- if (data && typeof data === "object") {
1174
- try {
1175
- const parsed = addIconSet(storage, data);
1176
- if (!parsed.length) {
1177
- checkMissing();
1178
- return;
1179
- }
1180
- } catch (err) {
1181
- console.error(err);
1182
- }
1183
- }
1184
- checkMissing();
1185
- loadedNewIcons(storage);
1186
- }
1187
- function parsePossiblyAsyncResponse(response, callback) {
1188
- if (response instanceof Promise) {
1189
- response.then((data) => {
1190
- callback(data);
1191
- }).catch(() => {
1192
- callback(null);
1193
- });
1194
- } else {
1195
- callback(response);
1196
- }
1197
- }
1198
- function loadNewIcons(storage, icons) {
1199
- if (!storage.iconsToLoad) {
1200
- storage.iconsToLoad = icons;
1201
- } else {
1202
- storage.iconsToLoad = storage.iconsToLoad.concat(icons).sort();
1203
- }
1204
- if (!storage.iconsQueueFlag) {
1205
- storage.iconsQueueFlag = true;
1206
- setTimeout(() => {
1207
- storage.iconsQueueFlag = false;
1208
- const { provider, prefix } = storage;
1209
- const icons2 = storage.iconsToLoad;
1210
- delete storage.iconsToLoad;
1211
- if (!icons2 || !icons2.length) {
1212
- return;
1213
- }
1214
- const customIconLoader = storage.loadIcon;
1215
- if (storage.loadIcons && (icons2.length > 1 || !customIconLoader)) {
1216
- parsePossiblyAsyncResponse(
1217
- storage.loadIcons(icons2, prefix, provider),
1218
- (data) => {
1219
- parseLoaderResponse(storage, icons2, data);
1220
- }
1221
- );
1222
- return;
1223
- }
1224
- if (customIconLoader) {
1225
- icons2.forEach((name) => {
1226
- const response = customIconLoader(name, prefix, provider);
1227
- parsePossiblyAsyncResponse(response, (data) => {
1228
- const iconSet = data ? {
1229
- prefix,
1230
- icons: {
1231
- [name]: data
1232
- }
1233
- } : null;
1234
- parseLoaderResponse(storage, [name], iconSet);
1235
- });
1236
- });
1237
- return;
1238
- }
1239
- const { valid, invalid } = checkIconNamesForAPI(icons2);
1240
- if (invalid.length) {
1241
- parseLoaderResponse(storage, invalid, null);
1242
- }
1243
- if (!valid.length) {
1244
- return;
1245
- }
1246
- const api = prefix.match(matchIconName) ? getAPIModule(provider) : null;
1247
- if (!api) {
1248
- parseLoaderResponse(storage, valid, null);
1249
- return;
1250
- }
1251
- const params = api.prepare(provider, prefix, valid);
1252
- params.forEach((item) => {
1253
- sendAPIQuery(provider, item, (data) => {
1254
- parseLoaderResponse(storage, item.icons, data);
1255
- });
1256
- });
1257
- });
1258
- }
1259
- }
1260
- const loadIcons = (icons, callback) => {
1261
- const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
1262
- const sortedIcons = sortIcons(cleanedIcons);
1263
- if (!sortedIcons.pending.length) {
1264
- let callCallback = true;
1265
- if (callback) {
1266
- setTimeout(() => {
1267
- if (callCallback) {
1268
- callback(
1269
- sortedIcons.loaded,
1270
- sortedIcons.missing,
1271
- sortedIcons.pending,
1272
- emptyCallback
1273
- );
1274
- }
1275
- });
1276
- }
1277
- return () => {
1278
- callCallback = false;
1279
- };
1280
- }
1281
- const newIcons = /* @__PURE__ */ Object.create(null);
1282
- const sources = [];
1283
- let lastProvider, lastPrefix;
1284
- sortedIcons.pending.forEach((icon) => {
1285
- const { provider, prefix } = icon;
1286
- if (prefix === lastPrefix && provider === lastProvider) {
1287
- return;
1288
- }
1289
- lastProvider = provider;
1290
- lastPrefix = prefix;
1291
- sources.push(getStorage(provider, prefix));
1292
- const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
1293
- if (!providerNewIcons[prefix]) {
1294
- providerNewIcons[prefix] = [];
1295
- }
1296
- });
1297
- sortedIcons.pending.forEach((icon) => {
1298
- const { provider, prefix, name } = icon;
1299
- const storage = getStorage(provider, prefix);
1300
- const pendingQueue = storage.pendingIcons || (storage.pendingIcons = /* @__PURE__ */ new Set());
1301
- if (!pendingQueue.has(name)) {
1302
- pendingQueue.add(name);
1303
- newIcons[provider][prefix].push(name);
1304
- }
1305
- });
1306
- sources.forEach((storage) => {
1307
- const list = newIcons[storage.provider][storage.prefix];
1308
- if (list.length) {
1309
- loadNewIcons(storage, list);
1310
- }
1311
- });
1312
- return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
1313
- };
1314
- const loadIcon = (icon) => {
1315
- return new Promise((fulfill, reject) => {
1316
- const iconObj = typeof icon === "string" ? stringToIcon(icon, true) : icon;
1317
- if (!iconObj) {
1318
- reject(icon);
1319
- return;
1320
- }
1321
- loadIcons([iconObj || icon], (loaded) => {
1322
- if (loaded.length && iconObj) {
1323
- const data = getIconData(iconObj);
1324
- if (data) {
1325
- fulfill({
1326
- ...defaultIconProps,
1327
- ...data
1328
- });
1329
- return;
1330
- }
1331
- }
1332
- reject(icon);
1333
- });
1334
- });
1335
- };
1336
-
1337
- function mergeCustomisations(defaults, item) {
1338
- const result = {
1339
- ...defaults
1340
- };
1341
- for (const key in item) {
1342
- const value = item[key];
1343
- const valueType = typeof value;
1344
- if (key in defaultIconSizeCustomisations) {
1345
- if (value === null || value && (valueType === "string" || valueType === "number")) {
1346
- result[key] = value;
1347
- }
1348
- } else if (valueType === typeof result[key]) {
1349
- result[key] = key === "rotate" ? value % 4 : value;
1350
- }
1351
- }
1352
- return result;
1353
- }
1354
-
1355
- const separator = /[\s,]+/;
1356
- function flipFromString(custom, flip) {
1357
- flip.split(separator).forEach((str) => {
1358
- const value = str.trim();
1359
- switch (value) {
1360
- case "horizontal":
1361
- custom.hFlip = true;
1362
- break;
1363
- case "vertical":
1364
- custom.vFlip = true;
1365
- break;
1366
- }
1367
- });
1368
- }
1369
-
1370
- function rotateFromString(value, defaultValue = 0) {
1371
- const units = value.replace(/^-?[0-9.]*/, "");
1372
- function cleanup(value2) {
1373
- while (value2 < 0) {
1374
- value2 += 4;
1375
- }
1376
- return value2 % 4;
1377
- }
1378
- if (units === "") {
1379
- const num = parseInt(value);
1380
- return isNaN(num) ? 0 : cleanup(num);
1381
- } else if (units !== value) {
1382
- let split = 0;
1383
- switch (units) {
1384
- case "%":
1385
- split = 25;
1386
- break;
1387
- case "deg":
1388
- split = 90;
1389
- }
1390
- if (split) {
1391
- let num = parseFloat(value.slice(0, value.length - units.length));
1392
- if (isNaN(num)) {
1393
- return 0;
1394
- }
1395
- num = num / split;
1396
- return num % 1 === 0 ? cleanup(num) : 0;
1397
- }
1398
- }
1399
- return defaultValue;
1400
- }
1401
-
1402
- function iconToHTML(body, attributes) {
1403
- let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
1404
- for (const attr in attributes) {
1405
- renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
1406
- }
1407
- return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
1408
- }
1409
-
1410
- function encodeSVGforURL(svg) {
1411
- return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
1412
- }
1413
- function svgToData(svg) {
1414
- return "data:image/svg+xml," + encodeSVGforURL(svg);
1415
- }
1416
- function svgToURL(svg) {
1417
- return 'url("' + svgToData(svg) + '")';
1418
- }
1419
-
1420
- const defaultExtendedIconCustomisations = {
1421
- ...defaultIconCustomisations,
1422
- inline: false,
1423
- };
1424
-
1425
- /**
1426
- * Default SVG attributes
1427
- */
1428
- const svgDefaults = {
1429
- 'xmlns': 'http://www.w3.org/2000/svg',
1430
- 'xmlns:xlink': 'http://www.w3.org/1999/xlink',
1431
- 'aria-hidden': true,
1432
- 'role': 'img',
1433
- };
1434
- /**
1435
- * Style modes
1436
- */
1437
- const commonProps = {
1438
- display: 'inline-block',
1439
- };
1440
- const monotoneProps = {
1441
- backgroundColor: 'currentColor',
1442
- };
1443
- const coloredProps = {
1444
- backgroundColor: 'transparent',
1445
- };
1446
- // Dynamically add common props to variables above
1447
- const propsToAdd = {
1448
- Image: 'var(--svg)',
1449
- Repeat: 'no-repeat',
1450
- Size: '100% 100%',
1451
- };
1452
- const propsToAddTo = {
1453
- webkitMask: monotoneProps,
1454
- mask: monotoneProps,
1455
- background: coloredProps,
1456
- };
1457
- for (const prefix in propsToAddTo) {
1458
- const list = propsToAddTo[prefix];
1459
- for (const prop in propsToAdd) {
1460
- list[prefix + prop] = propsToAdd[prop];
1461
- }
1462
- }
1463
- /**
1464
- * Aliases for customisations.
1465
- * In Vue 'v-' properties are reserved, so v-flip must be renamed
1466
- */
1467
- const customisationAliases = {};
1468
- ['horizontal', 'vertical'].forEach((prefix) => {
1469
- const attr = prefix.slice(0, 1) + 'Flip';
1470
- // vertical-flip
1471
- customisationAliases[prefix + '-flip'] = attr;
1472
- // v-flip
1473
- customisationAliases[prefix.slice(0, 1) + '-flip'] = attr;
1474
- // verticalFlip
1475
- customisationAliases[prefix + 'Flip'] = attr;
1476
- });
1477
- /**
1478
- * Fix size: add 'px' to numbers
1479
- */
1480
- function fixSize(value) {
1481
- return value + (value.match(/^[-0-9.]+$/) ? 'px' : '');
1482
- }
1483
- /**
1484
- * Render icon
1485
- */
1486
- const render = (
1487
- // Icon must be validated before calling this function
1488
- icon,
1489
- // Partial properties
1490
- props) => {
1491
- // Split properties
1492
- const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props);
1493
- const componentProps = { ...svgDefaults };
1494
- // Check mode
1495
- const mode = props.mode || 'svg';
1496
- // Copy style
1497
- const style = {};
1498
- const propsStyle = props.style;
1499
- const customStyle = typeof propsStyle === 'object' && !(propsStyle instanceof Array)
1500
- ? propsStyle
1501
- : {};
1502
- // Get element properties
1503
- for (let key in props) {
1504
- const value = props[key];
1505
- if (value === void 0) {
1506
- continue;
1507
- }
1508
- switch (key) {
1509
- // Properties to ignore
1510
- case 'icon':
1511
- case 'style':
1512
- case 'onLoad':
1513
- case 'mode':
1514
- case 'ssr':
1515
- break;
1516
- // Boolean attributes
1517
- case 'inline':
1518
- case 'hFlip':
1519
- case 'vFlip':
1520
- customisations[key] =
1521
- value === true || value === 'true' || value === 1;
1522
- break;
1523
- // Flip as string: 'horizontal,vertical'
1524
- case 'flip':
1525
- if (typeof value === 'string') {
1526
- flipFromString(customisations, value);
1527
- }
1528
- break;
1529
- // Color: override style
1530
- case 'color':
1531
- style.color = value;
1532
- break;
1533
- // Rotation as string
1534
- case 'rotate':
1535
- if (typeof value === 'string') {
1536
- customisations[key] = rotateFromString(value);
1537
- }
1538
- else if (typeof value === 'number') {
1539
- customisations[key] = value;
1540
- }
1541
- break;
1542
- // Remove aria-hidden
1543
- case 'ariaHidden':
1544
- case 'aria-hidden':
1545
- // Vue transforms 'aria-hidden' property to 'ariaHidden'
1546
- if (value !== true && value !== 'true') {
1547
- delete componentProps['aria-hidden'];
1548
- }
1549
- break;
1550
- default: {
1551
- const alias = customisationAliases[key];
1552
- if (alias) {
1553
- // Aliases for boolean customisations
1554
- if (value === true || value === 'true' || value === 1) {
1555
- customisations[alias] = true;
1556
- }
1557
- }
1558
- else if (defaultExtendedIconCustomisations[key] === void 0) {
1559
- // Copy missing property if it does not exist in customisations
1560
- componentProps[key] = value;
1561
- }
1562
- }
1563
- }
1564
- }
1565
- // Generate icon
1566
- const item = iconToSVG(icon, customisations);
1567
- const renderAttribs = item.attributes;
1568
- // Inline display
1569
- if (customisations.inline) {
1570
- style.verticalAlign = '-0.125em';
1571
- }
1572
- if (mode === 'svg') {
1573
- // Add style
1574
- componentProps.style = {
1575
- ...style,
1576
- ...customStyle,
1577
- };
1578
- // Add icon stuff
1579
- Object.assign(componentProps, renderAttribs);
1580
- // Counter for ids based on "id" property to render icons consistently on server and client
1581
- let localCounter = 0;
1582
- let id = props.id;
1583
- if (typeof id === 'string') {
1584
- // Convert '-' to '_' to avoid errors in animations
1585
- id = id.replace(/-/g, '_');
1586
- }
1587
- // Add innerHTML and style to props
1588
- componentProps['innerHTML'] = replaceIDs(item.body, id ? () => id + 'ID' + localCounter++ : 'iconifyVue');
1589
- // Render icon
1590
- return h('svg', componentProps);
1591
- }
1592
- // Render <span> with style
1593
- const { body, width, height } = icon;
1594
- const useMask = mode === 'mask' ||
1595
- (mode === 'bg' ? false : body.indexOf('currentColor') !== -1);
1596
- // Generate SVG
1597
- const html = iconToHTML(body, {
1598
- ...renderAttribs,
1599
- width: width + '',
1600
- height: height + '',
1601
- });
1602
- // Generate style
1603
- componentProps.style = {
1604
- ...style,
1605
- '--svg': svgToURL(html),
1606
- 'width': fixSize(renderAttribs.width),
1607
- 'height': fixSize(renderAttribs.height),
1608
- ...commonProps,
1609
- ...(useMask ? monotoneProps : coloredProps),
1610
- ...customStyle,
1611
- };
1612
- return h('span', componentProps);
1613
- };
1614
-
1615
- /**
1616
- * Initialise stuff
1617
- */
1618
- // Enable short names
1619
- allowSimpleNames(true);
1620
- // Set API module
1621
- setAPIModule('', fetchAPIModule);
1622
- /**
1623
- * Browser stuff
1624
- */
1625
- if (typeof document !== 'undefined' && typeof window !== 'undefined') {
1626
- const _window = window;
1627
- // Load icons from global "IconifyPreload"
1628
- if (_window.IconifyPreload !== void 0) {
1629
- const preload = _window.IconifyPreload;
1630
- const err = 'Invalid IconifyPreload syntax.';
1631
- if (typeof preload === 'object' && preload !== null) {
1632
- (preload instanceof Array ? preload : [preload]).forEach((item) => {
1633
- try {
1634
- if (
1635
- // Check if item is an object and not null/array
1636
- typeof item !== 'object' ||
1637
- item === null ||
1638
- item instanceof Array ||
1639
- // Check for 'icons' and 'prefix'
1640
- typeof item.icons !== 'object' ||
1641
- typeof item.prefix !== 'string' ||
1642
- // Add icon set
1643
- !addCollection(item)) {
1644
- console.error(err);
1645
- }
1646
- }
1647
- catch (e) {
1648
- console.error(err);
1649
- }
1650
- });
1651
- }
1652
- }
1653
- // Set API from global "IconifyProviders"
1654
- if (_window.IconifyProviders !== void 0) {
1655
- const providers = _window.IconifyProviders;
1656
- if (typeof providers === 'object' && providers !== null) {
1657
- for (let key in providers) {
1658
- const err = 'IconifyProviders[' + key + '] is invalid.';
1659
- try {
1660
- const value = providers[key];
1661
- if (typeof value !== 'object' ||
1662
- !value ||
1663
- value.resources === void 0) {
1664
- continue;
1665
- }
1666
- if (!addAPIProvider(key, value)) {
1667
- console.error(err);
1668
- }
1669
- }
1670
- catch (e) {
1671
- console.error(err);
1672
- }
1673
- }
1674
- }
1675
- }
1676
- }
1677
- /**
1678
- * Empty icon data, rendered when icon is not available
1679
- */
1680
- const emptyIcon = {
1681
- ...defaultIconProps,
1682
- body: '',
1683
- };
1684
- /**
1685
- * Component
1686
- */
1687
- const Icon = defineComponent((props, { emit }) => {
1688
- const loader = ref(null);
1689
- function abortLoading() {
1690
- if (loader.value) {
1691
- loader.value.abort?.();
1692
- loader.value = null;
1693
- }
1694
- }
1695
- // Render state
1696
- const rendering = ref(!!props.ssr);
1697
- const lastRenderedIconName = ref('');
1698
- const iconData = shallowRef(null);
1699
- // Update icon data
1700
- function getIcon() {
1701
- const icon = props.icon;
1702
- // Icon is an object
1703
- if (typeof icon === 'object' &&
1704
- icon !== null &&
1705
- typeof icon.body === 'string') {
1706
- lastRenderedIconName.value = '';
1707
- return {
1708
- data: icon,
1709
- };
1710
- }
1711
- // Check for valid icon name
1712
- let iconName;
1713
- if (typeof icon !== 'string' ||
1714
- (iconName = stringToIcon(icon, false, true)) === null) {
1715
- return null;
1716
- }
1717
- // Load icon
1718
- let data = getIconData(iconName);
1719
- if (!data) {
1720
- // Icon data is not available
1721
- const oldState = loader.value;
1722
- if (!oldState || oldState.name !== icon) {
1723
- // Icon name does not match old loader state
1724
- if (data === null) {
1725
- // Failed to load
1726
- loader.value = {
1727
- name: icon,
1728
- };
1729
- }
1730
- else {
1731
- loader.value = {
1732
- name: icon,
1733
- abort: loadIcons([iconName], updateIconData),
1734
- };
1735
- }
1736
- }
1737
- return null;
1738
- }
1739
- // Icon data is available
1740
- abortLoading();
1741
- if (lastRenderedIconName.value !== icon) {
1742
- lastRenderedIconName.value = icon;
1743
- // Emit on next tick because render will be called on next tick
1744
- nextTick(() => {
1745
- emit('load', icon);
1746
- });
1747
- }
1748
- // Customise icon
1749
- const customise = props.customise;
1750
- if (customise) {
1751
- // Clone data and customise it
1752
- data = Object.assign({}, data);
1753
- const customised = customise(data.body, iconName.name, iconName.prefix, iconName.provider);
1754
- if (typeof customised === 'string') {
1755
- data.body = customised;
1756
- }
1757
- }
1758
- // Add classes
1759
- const classes = ['iconify'];
1760
- if (iconName.prefix !== '') {
1761
- classes.push('iconify--' + iconName.prefix);
1762
- }
1763
- if (iconName.provider !== '') {
1764
- classes.push('iconify--' + iconName.provider);
1765
- }
1766
- return { data, classes };
1767
- }
1768
- function updateIconData() {
1769
- const icon = getIcon();
1770
- if (!icon) {
1771
- iconData.value = null;
1772
- }
1773
- else if (icon.data !== iconData.value?.data) {
1774
- iconData.value = icon;
1775
- }
1776
- }
1777
- // Set icon data
1778
- if (rendering.value) {
1779
- updateIconData();
1780
- }
1781
- else {
1782
- onMounted(() => {
1783
- rendering.value = true;
1784
- updateIconData();
1785
- });
1786
- }
1787
- watch(() => props.icon, updateIconData);
1788
- // Abort loading on unmount
1789
- onUnmounted(abortLoading);
1790
- // Render function
1791
- return () => {
1792
- // Get icon data
1793
- const icon = iconData.value;
1794
- if (!icon) {
1795
- // Icon is not available
1796
- return render(emptyIcon, props);
1797
- }
1798
- // Add classes
1799
- let newProps = props;
1800
- if (icon.classes) {
1801
- newProps = {
1802
- ...props,
1803
- class: icon.classes.join(' '),
1804
- };
1805
- }
1806
- // Render icon
1807
- return render({
1808
- ...defaultIconProps,
1809
- ...icon.data,
1810
- }, newProps);
1811
- };
1812
- }, {
1813
- props: [
1814
- // Icon and render mode
1815
- 'icon',
1816
- 'mode',
1817
- 'ssr',
1818
- // Layout and style
1819
- 'width',
1820
- 'height',
1821
- 'style',
1822
- 'color',
1823
- 'inline',
1824
- // Transformations
1825
- 'rotate',
1826
- 'hFlip',
1827
- 'horizontalFlip',
1828
- 'vFlip',
1829
- 'verticalFlip',
1830
- 'flip',
1831
- // Misc
1832
- 'id',
1833
- 'ariaHidden',
1834
- 'customise',
1835
- 'title',
1836
- ],
1837
- emits: ['load'],
1838
- });
1839
-
1840
- export { Icon as I, loadIcon as l };