@elgap/edukaai 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/.output/nitro.json +15 -0
  2. package/.output/public/_nuxt/BHDzAs85.js +1 -0
  3. package/.output/public/_nuxt/BJzbfdL_.js +1 -0
  4. package/.output/public/_nuxt/BKGLlKXk.js +6 -0
  5. package/.output/public/_nuxt/BLuXzJk3.js +1 -0
  6. package/.output/public/_nuxt/BNOzzLI3.js +1 -0
  7. package/.output/public/_nuxt/BO5GMwXh.js +1 -0
  8. package/.output/public/_nuxt/BQRbsFGy.js +1 -0
  9. package/.output/public/_nuxt/Be4MVdOg.js +1 -0
  10. package/.output/public/_nuxt/Bu4d3Z1T.js +1 -0
  11. package/.output/public/_nuxt/BwpBBNv4.js +1 -0
  12. package/.output/public/_nuxt/C1Og9-6n.js +97 -0
  13. package/.output/public/_nuxt/C3CjAhtj.js +1 -0
  14. package/.output/public/_nuxt/C6E3Ty3z.js +1 -0
  15. package/.output/public/_nuxt/COct4B42.js +1 -0
  16. package/.output/public/_nuxt/CQ6g2dtj.js +1 -0
  17. package/.output/public/_nuxt/CURSW5TV.js +246 -0
  18. package/.output/public/_nuxt/CW57JW4s.js +1 -0
  19. package/.output/public/_nuxt/Cg2fM61o.js +18 -0
  20. package/.output/public/_nuxt/CgGOeWta.js +1 -0
  21. package/.output/public/_nuxt/CoyYbT7u.js +1 -0
  22. package/.output/public/_nuxt/D11MHbGc.js +133 -0
  23. package/.output/public/_nuxt/D24dz0S8.js +1 -0
  24. package/.output/public/_nuxt/D3EFPr8x.js +1 -0
  25. package/.output/public/_nuxt/Dvt4ZHil.js +1 -0
  26. package/.output/public/_nuxt/builds/latest.json +1 -0
  27. package/.output/public/_nuxt/builds/meta/ab87ba0e-6d0d-4466-8b12-00d44f8fb9d3.json +1 -0
  28. package/.output/public/_nuxt/default.C1K1-g4D.css +1 -0
  29. package/.output/public/_nuxt/entry.CH8k-Mga.css +1 -0
  30. package/.output/public/_nuxt/error-404.C-Ezrlz-.css +1 -0
  31. package/.output/public/_nuxt/error-500.DBWf9FGj.css +1 -0
  32. package/.output/public/_nuxt/first-training.wFDD65zm.css +1 -0
  33. package/.output/public/_nuxt/import.cUKYdCrq.css +1 -0
  34. package/.output/public/_nuxt/index.D-2VHyHA.css +1 -0
  35. package/.output/public/_nuxt/index.D4J_vHmL.css +1 -0
  36. package/.output/public/_nuxt/mPJeLIz7.js +1 -0
  37. package/.output/server/chunks/_/error-500.mjs +19 -0
  38. package/.output/server/chunks/_/error-500.mjs.map +1 -0
  39. package/.output/server/chunks/build/ExampleCard-styles.BUOJhEg0.mjs +8 -0
  40. package/.output/server/chunks/build/ExampleCard-styles.BUOJhEg0.mjs.map +1 -0
  41. package/.output/server/chunks/build/ExampleForm-Bcpl0CfL.mjs +238 -0
  42. package/.output/server/chunks/build/ExampleForm-Bcpl0CfL.mjs.map +1 -0
  43. package/.output/server/chunks/build/ImportPreview-styles.CFmMl5Ok.mjs +8 -0
  44. package/.output/server/chunks/build/ImportPreview-styles.CFmMl5Ok.mjs.map +1 -0
  45. package/.output/server/chunks/build/_id_-BUSGcL-H.mjs +113 -0
  46. package/.output/server/chunks/build/_id_-BUSGcL-H.mjs.map +1 -0
  47. package/.output/server/chunks/build/axolotl-C-EXGgM8.mjs +112 -0
  48. package/.output/server/chunks/build/axolotl-C-EXGgM8.mjs.map +1 -0
  49. package/.output/server/chunks/build/best-practices-DsadorHb.mjs +38 -0
  50. package/.output/server/chunks/build/best-practices-DsadorHb.mjs.map +1 -0
  51. package/.output/server/chunks/build/client.precomputed.mjs +4 -0
  52. package/.output/server/chunks/build/client.precomputed.mjs.map +1 -0
  53. package/.output/server/chunks/build/default-DPkqqHOE.mjs +354 -0
  54. package/.output/server/chunks/build/default-DPkqqHOE.mjs.map +1 -0
  55. package/.output/server/chunks/build/default-styles.DsqVVS7k.mjs +8 -0
  56. package/.output/server/chunks/build/default-styles.DsqVVS7k.mjs.map +1 -0
  57. package/.output/server/chunks/build/error-404-K4UfZNck.mjs +97 -0
  58. package/.output/server/chunks/build/error-404-K4UfZNck.mjs.map +1 -0
  59. package/.output/server/chunks/build/error-404-styles.DuDrf-v0.mjs +8 -0
  60. package/.output/server/chunks/build/error-404-styles.DuDrf-v0.mjs.map +1 -0
  61. package/.output/server/chunks/build/error-500-CA7TEPNg.mjs +79 -0
  62. package/.output/server/chunks/build/error-500-CA7TEPNg.mjs.map +1 -0
  63. package/.output/server/chunks/build/error-500-styles.8IYEHzz6.mjs +8 -0
  64. package/.output/server/chunks/build/error-500-styles.8IYEHzz6.mjs.map +1 -0
  65. package/.output/server/chunks/build/examples-BHK8MDrs.mjs +134 -0
  66. package/.output/server/chunks/build/examples-BHK8MDrs.mjs.map +1 -0
  67. package/.output/server/chunks/build/export-BzxFqqfP.mjs +233 -0
  68. package/.output/server/chunks/build/export-BzxFqqfP.mjs.map +1 -0
  69. package/.output/server/chunks/build/faq-DKch73dS.mjs +112 -0
  70. package/.output/server/chunks/build/faq-DKch73dS.mjs.map +1 -0
  71. package/.output/server/chunks/build/field-guide-qbukT8F0.mjs +38 -0
  72. package/.output/server/chunks/build/field-guide-qbukT8F0.mjs.map +1 -0
  73. package/.output/server/chunks/build/first-training-BbEOBcEW.mjs +343 -0
  74. package/.output/server/chunks/build/first-training-BbEOBcEW.mjs.map +1 -0
  75. package/.output/server/chunks/build/first-training-styles.BzOa_KRD.mjs +8 -0
  76. package/.output/server/chunks/build/first-training-styles.BzOa_KRD.mjs.map +1 -0
  77. package/.output/server/chunks/build/glossary-CxSGCJoH.mjs +397 -0
  78. package/.output/server/chunks/build/glossary-CxSGCJoH.mjs.map +1 -0
  79. package/.output/server/chunks/build/huggingface-TSmyUzZU.mjs +128 -0
  80. package/.output/server/chunks/build/huggingface-TSmyUzZU.mjs.map +1 -0
  81. package/.output/server/chunks/build/import-C0kYhRv9.mjs +247 -0
  82. package/.output/server/chunks/build/import-C0kYhRv9.mjs.map +1 -0
  83. package/.output/server/chunks/build/index-C1ntBEWd.mjs +235 -0
  84. package/.output/server/chunks/build/index-C1ntBEWd.mjs.map +1 -0
  85. package/.output/server/chunks/build/index-D3CxihcX.mjs +320 -0
  86. package/.output/server/chunks/build/index-D3CxihcX.mjs.map +1 -0
  87. package/.output/server/chunks/build/index-DgKa1cy0.mjs +360 -0
  88. package/.output/server/chunks/build/index-DgKa1cy0.mjs.map +1 -0
  89. package/.output/server/chunks/build/index-cG54gaKX.mjs +513 -0
  90. package/.output/server/chunks/build/index-cG54gaKX.mjs.map +1 -0
  91. package/.output/server/chunks/build/index-styles.BX2SZiiS.mjs +8 -0
  92. package/.output/server/chunks/build/index-styles.BX2SZiiS.mjs.map +1 -0
  93. package/.output/server/chunks/build/llm-training-DIqc0eiM.mjs +91 -0
  94. package/.output/server/chunks/build/llm-training-DIqc0eiM.mjs.map +1 -0
  95. package/.output/server/chunks/build/new-b3338aLF.mjs +92 -0
  96. package/.output/server/chunks/build/new-b3338aLF.mjs.map +1 -0
  97. package/.output/server/chunks/build/nuxt-link-Ceyd90PQ.mjs +290 -0
  98. package/.output/server/chunks/build/nuxt-link-Ceyd90PQ.mjs.map +1 -0
  99. package/.output/server/chunks/build/sample-datasets-CVLWMQUA.mjs +45 -0
  100. package/.output/server/chunks/build/sample-datasets-CVLWMQUA.mjs.map +1 -0
  101. package/.output/server/chunks/build/server.mjs +1979 -0
  102. package/.output/server/chunks/build/server.mjs.map +1 -0
  103. package/.output/server/chunks/build/styles.mjs +20 -0
  104. package/.output/server/chunks/build/styles.mjs.map +1 -0
  105. package/.output/server/chunks/build/test-router-BYM6Cpst.mjs +105 -0
  106. package/.output/server/chunks/build/test-router-BYM6Cpst.mjs.map +1 -0
  107. package/.output/server/chunks/nitro/nitro.mjs +5800 -0
  108. package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
  109. package/.output/server/chunks/routes/renderer.mjs +481 -0
  110. package/.output/server/chunks/routes/renderer.mjs.map +1 -0
  111. package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
  112. package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
  113. package/.output/server/index.mjs +12 -0
  114. package/.output/server/index.mjs.map +1 -0
  115. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/api.js +2 -0
  116. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/app.js +2 -0
  117. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/component.js +2 -0
  118. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/context.js +2 -0
  119. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/hooks.js +2 -0
  120. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/index.js +22 -0
  121. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/api/util.js +2 -0
  122. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/const.js +5 -0
  123. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/env.js +17 -0
  124. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/index.js +45 -0
  125. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/plugin.js +2 -0
  126. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/proxy.js +111 -0
  127. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/lib/cjs/time.js +28 -0
  128. package/.output/server/node_modules/.nitro/@vue/devtools-api@6.6.4/package.json +37 -0
  129. package/.output/server/node_modules/.nitro/@vue/devtools-api@7.7.9/dist/index.cjs +42 -0
  130. package/.output/server/node_modules/.nitro/@vue/devtools-api@7.7.9/package.json +32 -0
  131. package/.output/server/node_modules/.nitro/hookable@5.5.3/dist/index.cjs +299 -0
  132. package/.output/server/node_modules/.nitro/hookable@5.5.3/package.json +49 -0
  133. package/.output/server/node_modules/.nitro/hookable@6.0.1/dist/index.mjs +266 -0
  134. package/.output/server/node_modules/.nitro/hookable@6.0.1/package.json +52 -0
  135. package/.output/server/node_modules/.nitro/perfect-debounce@1.0.0/dist/index.cjs +59 -0
  136. package/.output/server/node_modules/.nitro/perfect-debounce@1.0.0/package.json +44 -0
  137. package/.output/server/node_modules/.nitro/perfect-debounce@2.1.0/dist/index.mjs +89 -0
  138. package/.output/server/node_modules/.nitro/perfect-debounce@2.1.0/package.json +41 -0
  139. package/.output/server/node_modules/@babel/parser/lib/index.js +14582 -0
  140. package/.output/server/node_modules/@babel/parser/package.json +50 -0
  141. package/.output/server/node_modules/@iconify/utils/lib/colors/index.js +292 -0
  142. package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.js +702 -0
  143. package/.output/server/node_modules/@iconify/utils/lib/css/common.js +76 -0
  144. package/.output/server/node_modules/@iconify/utils/lib/css/format.js +40 -0
  145. package/.output/server/node_modules/@iconify/utils/lib/css/icon.js +52 -0
  146. package/.output/server/node_modules/@iconify/utils/lib/css/icons.js +133 -0
  147. package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.js +20 -0
  148. package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.js +15 -0
  149. package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.js +18 -0
  150. package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.js +18 -0
  151. package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.js +31 -0
  152. package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +80 -0
  153. package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.js +102 -0
  154. package/.output/server/node_modules/@iconify/utils/lib/emoji/data.js +29 -0
  155. package/.output/server/node_modules/@iconify/utils/lib/emoji/format.js +60 -0
  156. package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.js +50 -0
  157. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +204 -0
  158. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +35 -0
  159. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +134 -0
  160. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +167 -0
  161. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +81 -0
  162. package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +94 -0
  163. package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +28 -0
  164. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.js +78 -0
  165. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +68 -0
  166. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.js +47 -0
  167. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +105 -0
  168. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +38 -0
  169. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +94 -0
  170. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +64 -0
  171. package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.js +26 -0
  172. package/.output/server/node_modules/@iconify/utils/lib/icon/merge.js +18 -0
  173. package/.output/server/node_modules/@iconify/utils/lib/icon/name.js +58 -0
  174. package/.output/server/node_modules/@iconify/utils/lib/icon/square.js +34 -0
  175. package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.js +13 -0
  176. package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +126 -0
  177. package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.js +21 -0
  178. package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +27 -0
  179. package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +38 -0
  180. package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.js +93 -0
  181. package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.js +48 -0
  182. package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.js +24 -0
  183. package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +44 -0
  184. package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.js +125 -0
  185. package/.output/server/node_modules/@iconify/utils/lib/index.js +53 -0
  186. package/.output/server/node_modules/@iconify/utils/lib/loader/custom.js +32 -0
  187. package/.output/server/node_modules/@iconify/utils/lib/loader/loader.js +28 -0
  188. package/.output/server/node_modules/@iconify/utils/lib/loader/modern.js +42 -0
  189. package/.output/server/node_modules/@iconify/utils/lib/loader/utils.js +63 -0
  190. package/.output/server/node_modules/@iconify/utils/lib/misc/objects.js +27 -0
  191. package/.output/server/node_modules/@iconify/utils/lib/misc/strings.js +27 -0
  192. package/.output/server/node_modules/@iconify/utils/lib/misc/title.js +10 -0
  193. package/.output/server/node_modules/@iconify/utils/lib/svg/build.js +115 -0
  194. package/.output/server/node_modules/@iconify/utils/lib/svg/defs.js +32 -0
  195. package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +15 -0
  196. package/.output/server/node_modules/@iconify/utils/lib/svg/html.js +10 -0
  197. package/.output/server/node_modules/@iconify/utils/lib/svg/id.js +42 -0
  198. package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.js +23 -0
  199. package/.output/server/node_modules/@iconify/utils/lib/svg/parse.js +69 -0
  200. package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.js +55 -0
  201. package/.output/server/node_modules/@iconify/utils/lib/svg/size.js +28 -0
  202. package/.output/server/node_modules/@iconify/utils/lib/svg/trim.js +8 -0
  203. package/.output/server/node_modules/@iconify/utils/lib/svg/url.js +23 -0
  204. package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.js +9 -0
  205. package/.output/server/node_modules/@iconify/utils/package.json +118 -0
  206. package/.output/server/node_modules/@iconify/vue/dist/iconify.mjs +1893 -0
  207. package/.output/server/node_modules/@iconify/vue/package.json +64 -0
  208. package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6763 -0
  209. package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
  210. package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +689 -0
  211. package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
  212. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1413 -0
  213. package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
  214. package/.output/server/node_modules/@vue/devtools-kit/dist/index.cjs +6850 -0
  215. package/.output/server/node_modules/@vue/devtools-kit/package.json +44 -0
  216. package/.output/server/node_modules/@vue/devtools-shared/dist/index.cjs +378 -0
  217. package/.output/server/node_modules/@vue/devtools-shared/package.json +34 -0
  218. package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1870 -0
  219. package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
  220. package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6810 -0
  221. package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
  222. package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1750 -0
  223. package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
  224. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +883 -0
  225. package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
  226. package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +604 -0
  227. package/.output/server/node_modules/@vue/shared/package.json +47 -0
  228. package/.output/server/node_modules/birpc/dist/index.cjs +296 -0
  229. package/.output/server/node_modules/birpc/package.json +57 -0
  230. package/.output/server/node_modules/consola/dist/chunks/prompt.mjs +280 -0
  231. package/.output/server/node_modules/consola/dist/core.mjs +512 -0
  232. package/.output/server/node_modules/consola/dist/index.mjs +651 -0
  233. package/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
  234. package/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
  235. package/.output/server/node_modules/consola/package.json +136 -0
  236. package/.output/server/node_modules/devalue/index.js +4 -0
  237. package/.output/server/node_modules/devalue/package.json +37 -0
  238. package/.output/server/node_modules/devalue/src/base64.js +110 -0
  239. package/.output/server/node_modules/devalue/src/constants.js +7 -0
  240. package/.output/server/node_modules/devalue/src/parse.js +246 -0
  241. package/.output/server/node_modules/devalue/src/stringify.js +350 -0
  242. package/.output/server/node_modules/devalue/src/uneval.js +490 -0
  243. package/.output/server/node_modules/devalue/src/utils.js +148 -0
  244. package/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
  245. package/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
  246. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
  247. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
  248. package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
  249. package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
  250. package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
  251. package/.output/server/node_modules/entities/package.json +120 -0
  252. package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
  253. package/.output/server/node_modules/estree-walker/package.json +37 -0
  254. package/.output/server/node_modules/pinia/dist/pinia.prod.cjs +719 -0
  255. package/.output/server/node_modules/pinia/package.json +94 -0
  256. package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
  257. package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  258. package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
  259. package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
  260. package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
  261. package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
  262. package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
  263. package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
  264. package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
  265. package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
  266. package/.output/server/node_modules/source-map-js/package.json +71 -0
  267. package/.output/server/node_modules/source-map-js/source-map.js +8 -0
  268. package/.output/server/node_modules/tailwindcss/dist/chunk-X4GG3EDV.mjs +1 -0
  269. package/.output/server/node_modules/tailwindcss/dist/colors.mjs +1 -0
  270. package/.output/server/node_modules/tailwindcss/package.json +89 -0
  271. package/.output/server/node_modules/ufo/dist/index.mjs +645 -0
  272. package/.output/server/node_modules/ufo/package.json +48 -0
  273. package/.output/server/node_modules/unhead/dist/index.mjs +9 -0
  274. package/.output/server/node_modules/unhead/dist/parser.mjs +508 -0
  275. package/.output/server/node_modules/unhead/dist/plugins.mjs +101 -0
  276. package/.output/server/node_modules/unhead/dist/scripts.mjs +30 -0
  277. package/.output/server/node_modules/unhead/dist/server.mjs +180 -0
  278. package/.output/server/node_modules/unhead/dist/shared/unhead.BPM0-cfG.mjs +44 -0
  279. package/.output/server/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs +43 -0
  280. package/.output/server/node_modules/unhead/dist/shared/unhead.BnoAbrHA.mjs +269 -0
  281. package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +148 -0
  282. package/.output/server/node_modules/unhead/dist/shared/unhead.CbpEuj3y.mjs +71 -0
  283. package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
  284. package/.output/server/node_modules/unhead/dist/shared/unhead.D_nrZZPH.mjs +182 -0
  285. package/.output/server/node_modules/unhead/dist/shared/unhead.ckV6dpEQ.mjs +166 -0
  286. package/.output/server/node_modules/unhead/dist/shared/unhead.fVVqDC1O.mjs +203 -0
  287. package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
  288. package/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
  289. package/.output/server/node_modules/unhead/package.json +105 -0
  290. package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
  291. package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
  292. package/.output/server/node_modules/vue/index.js +7 -0
  293. package/.output/server/node_modules/vue/index.mjs +1 -0
  294. package/.output/server/node_modules/vue/package.json +112 -0
  295. package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
  296. package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +301 -0
  297. package/.output/server/node_modules/vue-bundle-renderer/package.json +55 -0
  298. package/.output/server/node_modules/vue-router/dist/devtools-EWN81iOl.mjs +1220 -0
  299. package/.output/server/node_modules/vue-router/dist/vue-router.mjs +1557 -0
  300. package/.output/server/node_modules/vue-router/package.json +153 -0
  301. package/.output/server/node_modules/vue-router/vue-router.node.mjs +2 -0
  302. package/.output/server/package.json +37 -0
  303. package/LICENSE +21 -0
  304. package/README.md +132 -0
  305. package/bin/cli.js +75 -0
  306. package/package.json +71 -0
@@ -0,0 +1,1893 @@
1
+ import { h, defineComponent, ref, shallowRef, onMounted, watch, onUnmounted, 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
+ function listIcons(provider, prefix) {
263
+ let allIcons = [];
264
+ const providers = typeof provider === "string" ? [provider] : Object.keys(dataStorage);
265
+ providers.forEach((provider2) => {
266
+ const prefixes = typeof provider2 === "string" && typeof prefix === "string" ? [prefix] : Object.keys(dataStorage[provider2] || {});
267
+ prefixes.forEach((prefix2) => {
268
+ const storage = getStorage(provider2, prefix2);
269
+ allIcons = allIcons.concat(
270
+ Object.keys(storage.icons).map(
271
+ (name) => (provider2 !== "" ? "@" + provider2 + ":" : "") + prefix2 + ":" + name
272
+ )
273
+ );
274
+ });
275
+ });
276
+ return allIcons;
277
+ }
278
+
279
+ let simpleNames = false;
280
+ function allowSimpleNames(allow) {
281
+ if (typeof allow === "boolean") {
282
+ simpleNames = allow;
283
+ }
284
+ return simpleNames;
285
+ }
286
+ function getIconData(name) {
287
+ const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
288
+ if (icon) {
289
+ const storage = getStorage(icon.provider, icon.prefix);
290
+ const iconName = icon.name;
291
+ return storage.icons[iconName] || (storage.missing.has(iconName) ? null : void 0);
292
+ }
293
+ }
294
+ function addIcon(name, data) {
295
+ const icon = stringToIcon(name, true, simpleNames);
296
+ if (!icon) {
297
+ return false;
298
+ }
299
+ const storage = getStorage(icon.provider, icon.prefix);
300
+ if (data) {
301
+ return addIconToStorage(storage, icon.name, data);
302
+ } else {
303
+ storage.missing.add(icon.name);
304
+ return true;
305
+ }
306
+ }
307
+ function addCollection(data, provider) {
308
+ if (typeof data !== "object") {
309
+ return false;
310
+ }
311
+ if (typeof provider !== "string") {
312
+ provider = data.provider || "";
313
+ }
314
+ if (simpleNames && !provider && !data.prefix) {
315
+ let added = false;
316
+ if (quicklyValidateIconSet(data)) {
317
+ data.prefix = "";
318
+ parseIconSet(data, (name, icon) => {
319
+ if (addIcon(name, icon)) {
320
+ added = true;
321
+ }
322
+ });
323
+ }
324
+ return added;
325
+ }
326
+ const prefix = data.prefix;
327
+ if (!validateIconName({
328
+ prefix,
329
+ name: "a"
330
+ })) {
331
+ return false;
332
+ }
333
+ const storage = getStorage(provider, prefix);
334
+ return !!addIconSet(storage, data);
335
+ }
336
+ function iconLoaded(name) {
337
+ return !!getIconData(name);
338
+ }
339
+ function getIcon(name) {
340
+ const result = getIconData(name);
341
+ return result ? {
342
+ ...defaultIconProps,
343
+ ...result
344
+ } : result;
345
+ }
346
+
347
+ const defaultIconSizeCustomisations = Object.freeze({
348
+ width: null,
349
+ height: null
350
+ });
351
+ const defaultIconCustomisations = Object.freeze({
352
+ // Dimensions
353
+ ...defaultIconSizeCustomisations,
354
+ // Transformations
355
+ ...defaultIconTransformations
356
+ });
357
+
358
+ const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
359
+ const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
360
+ function calculateSize(size, ratio, precision) {
361
+ if (ratio === 1) {
362
+ return size;
363
+ }
364
+ precision = precision || 100;
365
+ if (typeof size === "number") {
366
+ return Math.ceil(size * ratio * precision) / precision;
367
+ }
368
+ if (typeof size !== "string") {
369
+ return size;
370
+ }
371
+ const oldParts = size.split(unitsSplit);
372
+ if (oldParts === null || !oldParts.length) {
373
+ return size;
374
+ }
375
+ const newParts = [];
376
+ let code = oldParts.shift();
377
+ let isNumber = unitsTest.test(code);
378
+ while (true) {
379
+ if (isNumber) {
380
+ const num = parseFloat(code);
381
+ if (isNaN(num)) {
382
+ newParts.push(code);
383
+ } else {
384
+ newParts.push(Math.ceil(num * ratio * precision) / precision);
385
+ }
386
+ } else {
387
+ newParts.push(code);
388
+ }
389
+ code = oldParts.shift();
390
+ if (code === void 0) {
391
+ return newParts.join("");
392
+ }
393
+ isNumber = !isNumber;
394
+ }
395
+ }
396
+
397
+ function splitSVGDefs(content, tag = "defs") {
398
+ let defs = "";
399
+ const index = content.indexOf("<" + tag);
400
+ while (index >= 0) {
401
+ const start = content.indexOf(">", index);
402
+ const end = content.indexOf("</" + tag);
403
+ if (start === -1 || end === -1) {
404
+ break;
405
+ }
406
+ const endEnd = content.indexOf(">", end);
407
+ if (endEnd === -1) {
408
+ break;
409
+ }
410
+ defs += content.slice(start + 1, end).trim();
411
+ content = content.slice(0, index).trim() + content.slice(endEnd + 1);
412
+ }
413
+ return {
414
+ defs,
415
+ content
416
+ };
417
+ }
418
+ function mergeDefsAndContent(defs, content) {
419
+ return defs ? "<defs>" + defs + "</defs>" + content : content;
420
+ }
421
+ function wrapSVGContent(body, start, end) {
422
+ const split = splitSVGDefs(body);
423
+ return mergeDefsAndContent(split.defs, start + split.content + end);
424
+ }
425
+
426
+ const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
427
+ function iconToSVG(icon, customisations) {
428
+ const fullIcon = {
429
+ ...defaultIconProps,
430
+ ...icon
431
+ };
432
+ const fullCustomisations = {
433
+ ...defaultIconCustomisations,
434
+ ...customisations
435
+ };
436
+ const box = {
437
+ left: fullIcon.left,
438
+ top: fullIcon.top,
439
+ width: fullIcon.width,
440
+ height: fullIcon.height
441
+ };
442
+ let body = fullIcon.body;
443
+ [fullIcon, fullCustomisations].forEach((props) => {
444
+ const transformations = [];
445
+ const hFlip = props.hFlip;
446
+ const vFlip = props.vFlip;
447
+ let rotation = props.rotate;
448
+ if (hFlip) {
449
+ if (vFlip) {
450
+ rotation += 2;
451
+ } else {
452
+ transformations.push(
453
+ "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
454
+ );
455
+ transformations.push("scale(-1 1)");
456
+ box.top = box.left = 0;
457
+ }
458
+ } else if (vFlip) {
459
+ transformations.push(
460
+ "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
461
+ );
462
+ transformations.push("scale(1 -1)");
463
+ box.top = box.left = 0;
464
+ }
465
+ let tempValue;
466
+ if (rotation < 0) {
467
+ rotation -= Math.floor(rotation / 4) * 4;
468
+ }
469
+ rotation = rotation % 4;
470
+ switch (rotation) {
471
+ case 1:
472
+ tempValue = box.height / 2 + box.top;
473
+ transformations.unshift(
474
+ "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
475
+ );
476
+ break;
477
+ case 2:
478
+ transformations.unshift(
479
+ "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
480
+ );
481
+ break;
482
+ case 3:
483
+ tempValue = box.width / 2 + box.left;
484
+ transformations.unshift(
485
+ "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
486
+ );
487
+ break;
488
+ }
489
+ if (rotation % 2 === 1) {
490
+ if (box.left !== box.top) {
491
+ tempValue = box.left;
492
+ box.left = box.top;
493
+ box.top = tempValue;
494
+ }
495
+ if (box.width !== box.height) {
496
+ tempValue = box.width;
497
+ box.width = box.height;
498
+ box.height = tempValue;
499
+ }
500
+ }
501
+ if (transformations.length) {
502
+ body = wrapSVGContent(
503
+ body,
504
+ '<g transform="' + transformations.join(" ") + '">',
505
+ "</g>"
506
+ );
507
+ }
508
+ });
509
+ const customisationsWidth = fullCustomisations.width;
510
+ const customisationsHeight = fullCustomisations.height;
511
+ const boxWidth = box.width;
512
+ const boxHeight = box.height;
513
+ let width;
514
+ let height;
515
+ if (customisationsWidth === null) {
516
+ height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
517
+ width = calculateSize(height, boxWidth / boxHeight);
518
+ } else {
519
+ width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
520
+ height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
521
+ }
522
+ const attributes = {};
523
+ const setAttr = (prop, value) => {
524
+ if (!isUnsetKeyword(value)) {
525
+ attributes[prop] = value.toString();
526
+ }
527
+ };
528
+ setAttr("width", width);
529
+ setAttr("height", height);
530
+ const viewBox = [box.left, box.top, boxWidth, boxHeight];
531
+ attributes.viewBox = viewBox.join(" ");
532
+ return {
533
+ attributes,
534
+ viewBox,
535
+ body
536
+ };
537
+ }
538
+
539
+ const regex = /\sid="(\S+)"/g;
540
+ const randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
541
+ let counter = 0;
542
+ function replaceIDs(body, prefix = randomPrefix) {
543
+ const ids = [];
544
+ let match;
545
+ while (match = regex.exec(body)) {
546
+ ids.push(match[1]);
547
+ }
548
+ if (!ids.length) {
549
+ return body;
550
+ }
551
+ const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
552
+ ids.forEach((id) => {
553
+ const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
554
+ const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
555
+ body = body.replace(
556
+ // Allowed characters before id: [#;"]
557
+ // Allowed characters after id: [)"], .[a-z]
558
+ new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"),
559
+ "$1" + newID + suffix + "$3"
560
+ );
561
+ });
562
+ body = body.replace(new RegExp(suffix, "g"), "");
563
+ return body;
564
+ }
565
+
566
+ const storage = /* @__PURE__ */ Object.create(null);
567
+ function setAPIModule(provider, item) {
568
+ storage[provider] = item;
569
+ }
570
+ function getAPIModule(provider) {
571
+ return storage[provider] || storage[""];
572
+ }
573
+
574
+ function createAPIConfig(source) {
575
+ let resources;
576
+ if (typeof source.resources === "string") {
577
+ resources = [source.resources];
578
+ } else {
579
+ resources = source.resources;
580
+ if (!(resources instanceof Array) || !resources.length) {
581
+ return null;
582
+ }
583
+ }
584
+ const result = {
585
+ // API hosts
586
+ resources,
587
+ // Root path
588
+ path: source.path || "/",
589
+ // URL length limit
590
+ maxURL: source.maxURL || 500,
591
+ // Timeout before next host is used.
592
+ rotate: source.rotate || 750,
593
+ // Timeout before failing query.
594
+ timeout: source.timeout || 5e3,
595
+ // Randomise default API end point.
596
+ random: source.random === true,
597
+ // Start index
598
+ index: source.index || 0,
599
+ // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
600
+ dataAfterTimeout: source.dataAfterTimeout !== false
601
+ };
602
+ return result;
603
+ }
604
+ const configStorage = /* @__PURE__ */ Object.create(null);
605
+ const fallBackAPISources = [
606
+ "https://api.simplesvg.com",
607
+ "https://api.unisvg.com"
608
+ ];
609
+ const fallBackAPI = [];
610
+ while (fallBackAPISources.length > 0) {
611
+ if (fallBackAPISources.length === 1) {
612
+ fallBackAPI.push(fallBackAPISources.shift());
613
+ } else {
614
+ if (Math.random() > 0.5) {
615
+ fallBackAPI.push(fallBackAPISources.shift());
616
+ } else {
617
+ fallBackAPI.push(fallBackAPISources.pop());
618
+ }
619
+ }
620
+ }
621
+ configStorage[""] = createAPIConfig({
622
+ resources: ["https://api.iconify.design"].concat(fallBackAPI)
623
+ });
624
+ function addAPIProvider(provider, customConfig) {
625
+ const config = createAPIConfig(customConfig);
626
+ if (config === null) {
627
+ return false;
628
+ }
629
+ configStorage[provider] = config;
630
+ return true;
631
+ }
632
+ function getAPIConfig(provider) {
633
+ return configStorage[provider];
634
+ }
635
+ function listAPIProviders() {
636
+ return Object.keys(configStorage);
637
+ }
638
+
639
+ const detectFetch = () => {
640
+ let callback;
641
+ try {
642
+ callback = fetch;
643
+ if (typeof callback === "function") {
644
+ return callback;
645
+ }
646
+ } catch (err) {
647
+ }
648
+ };
649
+ let fetchModule = detectFetch();
650
+ function setFetch(fetch2) {
651
+ fetchModule = fetch2;
652
+ }
653
+ function getFetch() {
654
+ return fetchModule;
655
+ }
656
+ function calculateMaxLength(provider, prefix) {
657
+ const config = getAPIConfig(provider);
658
+ if (!config) {
659
+ return 0;
660
+ }
661
+ let result;
662
+ if (!config.maxURL) {
663
+ result = 0;
664
+ } else {
665
+ let maxHostLength = 0;
666
+ config.resources.forEach((item) => {
667
+ const host = item;
668
+ maxHostLength = Math.max(maxHostLength, host.length);
669
+ });
670
+ const url = prefix + ".json?icons=";
671
+ result = config.maxURL - maxHostLength - config.path.length - url.length;
672
+ }
673
+ return result;
674
+ }
675
+ function shouldAbort(status) {
676
+ return status === 404;
677
+ }
678
+ const prepare = (provider, prefix, icons) => {
679
+ const results = [];
680
+ const maxLength = calculateMaxLength(provider, prefix);
681
+ const type = "icons";
682
+ let item = {
683
+ type,
684
+ provider,
685
+ prefix,
686
+ icons: []
687
+ };
688
+ let length = 0;
689
+ icons.forEach((name, index) => {
690
+ length += name.length + 1;
691
+ if (length >= maxLength && index > 0) {
692
+ results.push(item);
693
+ item = {
694
+ type,
695
+ provider,
696
+ prefix,
697
+ icons: []
698
+ };
699
+ length = name.length;
700
+ }
701
+ item.icons.push(name);
702
+ });
703
+ results.push(item);
704
+ return results;
705
+ };
706
+ function getPath(provider) {
707
+ if (typeof provider === "string") {
708
+ const config = getAPIConfig(provider);
709
+ if (config) {
710
+ return config.path;
711
+ }
712
+ }
713
+ return "/";
714
+ }
715
+ const send = (host, params, callback) => {
716
+ if (!fetchModule) {
717
+ callback("abort", 424);
718
+ return;
719
+ }
720
+ let path = getPath(params.provider);
721
+ switch (params.type) {
722
+ case "icons": {
723
+ const prefix = params.prefix;
724
+ const icons = params.icons;
725
+ const iconsList = icons.join(",");
726
+ const urlParams = new URLSearchParams({
727
+ icons: iconsList
728
+ });
729
+ path += prefix + ".json?" + urlParams.toString();
730
+ break;
731
+ }
732
+ case "custom": {
733
+ const uri = params.uri;
734
+ path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
735
+ break;
736
+ }
737
+ default:
738
+ callback("abort", 400);
739
+ return;
740
+ }
741
+ let defaultError = 503;
742
+ fetchModule(host + path).then((response) => {
743
+ const status = response.status;
744
+ if (status !== 200) {
745
+ setTimeout(() => {
746
+ callback(shouldAbort(status) ? "abort" : "next", status);
747
+ });
748
+ return;
749
+ }
750
+ defaultError = 501;
751
+ return response.json();
752
+ }).then((data) => {
753
+ if (typeof data !== "object" || data === null) {
754
+ setTimeout(() => {
755
+ if (data === 404) {
756
+ callback("abort", data);
757
+ } else {
758
+ callback("next", defaultError);
759
+ }
760
+ });
761
+ return;
762
+ }
763
+ setTimeout(() => {
764
+ callback("success", data);
765
+ });
766
+ }).catch(() => {
767
+ callback("next", defaultError);
768
+ });
769
+ };
770
+ const fetchAPIModule = {
771
+ prepare,
772
+ send
773
+ };
774
+
775
+ function sortIcons(icons) {
776
+ const result = {
777
+ loaded: [],
778
+ missing: [],
779
+ pending: []
780
+ };
781
+ const storage = /* @__PURE__ */ Object.create(null);
782
+ icons.sort((a, b) => {
783
+ if (a.provider !== b.provider) {
784
+ return a.provider.localeCompare(b.provider);
785
+ }
786
+ if (a.prefix !== b.prefix) {
787
+ return a.prefix.localeCompare(b.prefix);
788
+ }
789
+ return a.name.localeCompare(b.name);
790
+ });
791
+ let lastIcon = {
792
+ provider: "",
793
+ prefix: "",
794
+ name: ""
795
+ };
796
+ icons.forEach((icon) => {
797
+ if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {
798
+ return;
799
+ }
800
+ lastIcon = icon;
801
+ const provider = icon.provider;
802
+ const prefix = icon.prefix;
803
+ const name = icon.name;
804
+ const providerStorage = storage[provider] || (storage[provider] = /* @__PURE__ */ Object.create(null));
805
+ const localStorage = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
806
+ let list;
807
+ if (name in localStorage.icons) {
808
+ list = result.loaded;
809
+ } else if (prefix === "" || localStorage.missing.has(name)) {
810
+ list = result.missing;
811
+ } else {
812
+ list = result.pending;
813
+ }
814
+ const item = {
815
+ provider,
816
+ prefix,
817
+ name
818
+ };
819
+ list.push(item);
820
+ });
821
+ return result;
822
+ }
823
+
824
+ function removeCallback(storages, id) {
825
+ storages.forEach((storage) => {
826
+ const items = storage.loaderCallbacks;
827
+ if (items) {
828
+ storage.loaderCallbacks = items.filter((row) => row.id !== id);
829
+ }
830
+ });
831
+ }
832
+ function updateCallbacks(storage) {
833
+ if (!storage.pendingCallbacksFlag) {
834
+ storage.pendingCallbacksFlag = true;
835
+ setTimeout(() => {
836
+ storage.pendingCallbacksFlag = false;
837
+ const items = storage.loaderCallbacks ? storage.loaderCallbacks.slice(0) : [];
838
+ if (!items.length) {
839
+ return;
840
+ }
841
+ let hasPending = false;
842
+ const provider = storage.provider;
843
+ const prefix = storage.prefix;
844
+ items.forEach((item) => {
845
+ const icons = item.icons;
846
+ const oldLength = icons.pending.length;
847
+ icons.pending = icons.pending.filter((icon) => {
848
+ if (icon.prefix !== prefix) {
849
+ return true;
850
+ }
851
+ const name = icon.name;
852
+ if (storage.icons[name]) {
853
+ icons.loaded.push({
854
+ provider,
855
+ prefix,
856
+ name
857
+ });
858
+ } else if (storage.missing.has(name)) {
859
+ icons.missing.push({
860
+ provider,
861
+ prefix,
862
+ name
863
+ });
864
+ } else {
865
+ hasPending = true;
866
+ return true;
867
+ }
868
+ return false;
869
+ });
870
+ if (icons.pending.length !== oldLength) {
871
+ if (!hasPending) {
872
+ removeCallback([storage], item.id);
873
+ }
874
+ item.callback(
875
+ icons.loaded.slice(0),
876
+ icons.missing.slice(0),
877
+ icons.pending.slice(0),
878
+ item.abort
879
+ );
880
+ }
881
+ });
882
+ });
883
+ }
884
+ }
885
+ let idCounter = 0;
886
+ function storeCallback(callback, icons, pendingSources) {
887
+ const id = idCounter++;
888
+ const abort = removeCallback.bind(null, pendingSources, id);
889
+ if (!icons.pending.length) {
890
+ return abort;
891
+ }
892
+ const item = {
893
+ id,
894
+ icons,
895
+ callback,
896
+ abort
897
+ };
898
+ pendingSources.forEach((storage) => {
899
+ (storage.loaderCallbacks || (storage.loaderCallbacks = [])).push(item);
900
+ });
901
+ return abort;
902
+ }
903
+
904
+ function listToIcons(list, validate = true, simpleNames = false) {
905
+ const result = [];
906
+ list.forEach((item) => {
907
+ const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames) : item;
908
+ if (icon) {
909
+ result.push(icon);
910
+ }
911
+ });
912
+ return result;
913
+ }
914
+
915
+ // src/config.ts
916
+ var defaultConfig = {
917
+ resources: [],
918
+ index: 0,
919
+ timeout: 2e3,
920
+ rotate: 750,
921
+ random: false,
922
+ dataAfterTimeout: false
923
+ };
924
+
925
+ // src/query.ts
926
+ function sendQuery(config, payload, query, done) {
927
+ const resourcesCount = config.resources.length;
928
+ const startIndex = config.random ? Math.floor(Math.random() * resourcesCount) : config.index;
929
+ let resources;
930
+ if (config.random) {
931
+ let list = config.resources.slice(0);
932
+ resources = [];
933
+ while (list.length > 1) {
934
+ const nextIndex = Math.floor(Math.random() * list.length);
935
+ resources.push(list[nextIndex]);
936
+ list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
937
+ }
938
+ resources = resources.concat(list);
939
+ } else {
940
+ resources = config.resources.slice(startIndex).concat(config.resources.slice(0, startIndex));
941
+ }
942
+ const startTime = Date.now();
943
+ let status = "pending";
944
+ let queriesSent = 0;
945
+ let lastError;
946
+ let timer = null;
947
+ let queue = [];
948
+ let doneCallbacks = [];
949
+ if (typeof done === "function") {
950
+ doneCallbacks.push(done);
951
+ }
952
+ function resetTimer() {
953
+ if (timer) {
954
+ clearTimeout(timer);
955
+ timer = null;
956
+ }
957
+ }
958
+ function abort() {
959
+ if (status === "pending") {
960
+ status = "aborted";
961
+ }
962
+ resetTimer();
963
+ queue.forEach((item) => {
964
+ if (item.status === "pending") {
965
+ item.status = "aborted";
966
+ }
967
+ });
968
+ queue = [];
969
+ }
970
+ function subscribe(callback, overwrite) {
971
+ if (overwrite) {
972
+ doneCallbacks = [];
973
+ }
974
+ if (typeof callback === "function") {
975
+ doneCallbacks.push(callback);
976
+ }
977
+ }
978
+ function getQueryStatus() {
979
+ return {
980
+ startTime,
981
+ payload,
982
+ status,
983
+ queriesSent,
984
+ queriesPending: queue.length,
985
+ subscribe,
986
+ abort
987
+ };
988
+ }
989
+ function failQuery() {
990
+ status = "failed";
991
+ doneCallbacks.forEach((callback) => {
992
+ callback(void 0, lastError);
993
+ });
994
+ }
995
+ function clearQueue() {
996
+ queue.forEach((item) => {
997
+ if (item.status === "pending") {
998
+ item.status = "aborted";
999
+ }
1000
+ });
1001
+ queue = [];
1002
+ }
1003
+ function moduleResponse(item, response, data) {
1004
+ const isError = response !== "success";
1005
+ queue = queue.filter((queued) => queued !== item);
1006
+ switch (status) {
1007
+ case "pending":
1008
+ break;
1009
+ case "failed":
1010
+ if (isError || !config.dataAfterTimeout) {
1011
+ return;
1012
+ }
1013
+ break;
1014
+ default:
1015
+ return;
1016
+ }
1017
+ if (response === "abort") {
1018
+ lastError = data;
1019
+ failQuery();
1020
+ return;
1021
+ }
1022
+ if (isError) {
1023
+ lastError = data;
1024
+ if (!queue.length) {
1025
+ if (!resources.length) {
1026
+ failQuery();
1027
+ } else {
1028
+ execNext();
1029
+ }
1030
+ }
1031
+ return;
1032
+ }
1033
+ resetTimer();
1034
+ clearQueue();
1035
+ if (!config.random) {
1036
+ const index = config.resources.indexOf(item.resource);
1037
+ if (index !== -1 && index !== config.index) {
1038
+ config.index = index;
1039
+ }
1040
+ }
1041
+ status = "completed";
1042
+ doneCallbacks.forEach((callback) => {
1043
+ callback(data);
1044
+ });
1045
+ }
1046
+ function execNext() {
1047
+ if (status !== "pending") {
1048
+ return;
1049
+ }
1050
+ resetTimer();
1051
+ const resource = resources.shift();
1052
+ if (resource === void 0) {
1053
+ if (queue.length) {
1054
+ timer = setTimeout(() => {
1055
+ resetTimer();
1056
+ if (status === "pending") {
1057
+ clearQueue();
1058
+ failQuery();
1059
+ }
1060
+ }, config.timeout);
1061
+ return;
1062
+ }
1063
+ failQuery();
1064
+ return;
1065
+ }
1066
+ const item = {
1067
+ status: "pending",
1068
+ resource,
1069
+ callback: (status2, data) => {
1070
+ moduleResponse(item, status2, data);
1071
+ }
1072
+ };
1073
+ queue.push(item);
1074
+ queriesSent++;
1075
+ timer = setTimeout(execNext, config.rotate);
1076
+ query(resource, payload, item.callback);
1077
+ }
1078
+ setTimeout(execNext);
1079
+ return getQueryStatus;
1080
+ }
1081
+
1082
+ // src/index.ts
1083
+ function initRedundancy(cfg) {
1084
+ const config = {
1085
+ ...defaultConfig,
1086
+ ...cfg
1087
+ };
1088
+ let queries = [];
1089
+ function cleanup() {
1090
+ queries = queries.filter((item) => item().status === "pending");
1091
+ }
1092
+ function query(payload, queryCallback, doneCallback) {
1093
+ const query2 = sendQuery(
1094
+ config,
1095
+ payload,
1096
+ queryCallback,
1097
+ (data, error) => {
1098
+ cleanup();
1099
+ if (doneCallback) {
1100
+ doneCallback(data, error);
1101
+ }
1102
+ }
1103
+ );
1104
+ queries.push(query2);
1105
+ return query2;
1106
+ }
1107
+ function find(callback) {
1108
+ return queries.find((value) => {
1109
+ return callback(value);
1110
+ }) || null;
1111
+ }
1112
+ const instance = {
1113
+ query,
1114
+ find,
1115
+ setIndex: (index) => {
1116
+ config.index = index;
1117
+ },
1118
+ getIndex: () => config.index,
1119
+ cleanup
1120
+ };
1121
+ return instance;
1122
+ }
1123
+
1124
+ function emptyCallback$1() {
1125
+ }
1126
+ const redundancyCache = /* @__PURE__ */ Object.create(null);
1127
+ function getRedundancyCache(provider) {
1128
+ if (!redundancyCache[provider]) {
1129
+ const config = getAPIConfig(provider);
1130
+ if (!config) {
1131
+ return;
1132
+ }
1133
+ const redundancy = initRedundancy(config);
1134
+ const cachedReundancy = {
1135
+ config,
1136
+ redundancy
1137
+ };
1138
+ redundancyCache[provider] = cachedReundancy;
1139
+ }
1140
+ return redundancyCache[provider];
1141
+ }
1142
+ function sendAPIQuery(target, query, callback) {
1143
+ let redundancy;
1144
+ let send;
1145
+ if (typeof target === "string") {
1146
+ const api = getAPIModule(target);
1147
+ if (!api) {
1148
+ callback(void 0, 424);
1149
+ return emptyCallback$1;
1150
+ }
1151
+ send = api.send;
1152
+ const cached = getRedundancyCache(target);
1153
+ if (cached) {
1154
+ redundancy = cached.redundancy;
1155
+ }
1156
+ } else {
1157
+ const config = createAPIConfig(target);
1158
+ if (config) {
1159
+ redundancy = initRedundancy(config);
1160
+ const moduleKey = target.resources ? target.resources[0] : "";
1161
+ const api = getAPIModule(moduleKey);
1162
+ if (api) {
1163
+ send = api.send;
1164
+ }
1165
+ }
1166
+ }
1167
+ if (!redundancy || !send) {
1168
+ callback(void 0, 424);
1169
+ return emptyCallback$1;
1170
+ }
1171
+ return redundancy.query(query, send, callback)().abort;
1172
+ }
1173
+
1174
+ function emptyCallback() {
1175
+ }
1176
+ function loadedNewIcons(storage) {
1177
+ if (!storage.iconsLoaderFlag) {
1178
+ storage.iconsLoaderFlag = true;
1179
+ setTimeout(() => {
1180
+ storage.iconsLoaderFlag = false;
1181
+ updateCallbacks(storage);
1182
+ });
1183
+ }
1184
+ }
1185
+ function checkIconNamesForAPI(icons) {
1186
+ const valid = [];
1187
+ const invalid = [];
1188
+ icons.forEach((name) => {
1189
+ (name.match(matchIconName) ? valid : invalid).push(name);
1190
+ });
1191
+ return {
1192
+ valid,
1193
+ invalid
1194
+ };
1195
+ }
1196
+ function parseLoaderResponse(storage, icons, data) {
1197
+ function checkMissing() {
1198
+ const pending = storage.pendingIcons;
1199
+ icons.forEach((name) => {
1200
+ if (pending) {
1201
+ pending.delete(name);
1202
+ }
1203
+ if (!storage.icons[name]) {
1204
+ storage.missing.add(name);
1205
+ }
1206
+ });
1207
+ }
1208
+ if (data && typeof data === "object") {
1209
+ try {
1210
+ const parsed = addIconSet(storage, data);
1211
+ if (!parsed.length) {
1212
+ checkMissing();
1213
+ return;
1214
+ }
1215
+ } catch (err) {
1216
+ console.error(err);
1217
+ }
1218
+ }
1219
+ checkMissing();
1220
+ loadedNewIcons(storage);
1221
+ }
1222
+ function parsePossiblyAsyncResponse(response, callback) {
1223
+ if (response instanceof Promise) {
1224
+ response.then((data) => {
1225
+ callback(data);
1226
+ }).catch(() => {
1227
+ callback(null);
1228
+ });
1229
+ } else {
1230
+ callback(response);
1231
+ }
1232
+ }
1233
+ function loadNewIcons(storage, icons) {
1234
+ if (!storage.iconsToLoad) {
1235
+ storage.iconsToLoad = icons;
1236
+ } else {
1237
+ storage.iconsToLoad = storage.iconsToLoad.concat(icons).sort();
1238
+ }
1239
+ if (!storage.iconsQueueFlag) {
1240
+ storage.iconsQueueFlag = true;
1241
+ setTimeout(() => {
1242
+ storage.iconsQueueFlag = false;
1243
+ const { provider, prefix } = storage;
1244
+ const icons2 = storage.iconsToLoad;
1245
+ delete storage.iconsToLoad;
1246
+ if (!icons2 || !icons2.length) {
1247
+ return;
1248
+ }
1249
+ const customIconLoader = storage.loadIcon;
1250
+ if (storage.loadIcons && (icons2.length > 1 || !customIconLoader)) {
1251
+ parsePossiblyAsyncResponse(
1252
+ storage.loadIcons(icons2, prefix, provider),
1253
+ (data) => {
1254
+ parseLoaderResponse(storage, icons2, data);
1255
+ }
1256
+ );
1257
+ return;
1258
+ }
1259
+ if (customIconLoader) {
1260
+ icons2.forEach((name) => {
1261
+ const response = customIconLoader(name, prefix, provider);
1262
+ parsePossiblyAsyncResponse(response, (data) => {
1263
+ const iconSet = data ? {
1264
+ prefix,
1265
+ icons: {
1266
+ [name]: data
1267
+ }
1268
+ } : null;
1269
+ parseLoaderResponse(storage, [name], iconSet);
1270
+ });
1271
+ });
1272
+ return;
1273
+ }
1274
+ const { valid, invalid } = checkIconNamesForAPI(icons2);
1275
+ if (invalid.length) {
1276
+ parseLoaderResponse(storage, invalid, null);
1277
+ }
1278
+ if (!valid.length) {
1279
+ return;
1280
+ }
1281
+ const api = prefix.match(matchIconName) ? getAPIModule(provider) : null;
1282
+ if (!api) {
1283
+ parseLoaderResponse(storage, valid, null);
1284
+ return;
1285
+ }
1286
+ const params = api.prepare(provider, prefix, valid);
1287
+ params.forEach((item) => {
1288
+ sendAPIQuery(provider, item, (data) => {
1289
+ parseLoaderResponse(storage, item.icons, data);
1290
+ });
1291
+ });
1292
+ });
1293
+ }
1294
+ }
1295
+ const loadIcons = (icons, callback) => {
1296
+ const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
1297
+ const sortedIcons = sortIcons(cleanedIcons);
1298
+ if (!sortedIcons.pending.length) {
1299
+ let callCallback = true;
1300
+ if (callback) {
1301
+ setTimeout(() => {
1302
+ if (callCallback) {
1303
+ callback(
1304
+ sortedIcons.loaded,
1305
+ sortedIcons.missing,
1306
+ sortedIcons.pending,
1307
+ emptyCallback
1308
+ );
1309
+ }
1310
+ });
1311
+ }
1312
+ return () => {
1313
+ callCallback = false;
1314
+ };
1315
+ }
1316
+ const newIcons = /* @__PURE__ */ Object.create(null);
1317
+ const sources = [];
1318
+ let lastProvider, lastPrefix;
1319
+ sortedIcons.pending.forEach((icon) => {
1320
+ const { provider, prefix } = icon;
1321
+ if (prefix === lastPrefix && provider === lastProvider) {
1322
+ return;
1323
+ }
1324
+ lastProvider = provider;
1325
+ lastPrefix = prefix;
1326
+ sources.push(getStorage(provider, prefix));
1327
+ const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
1328
+ if (!providerNewIcons[prefix]) {
1329
+ providerNewIcons[prefix] = [];
1330
+ }
1331
+ });
1332
+ sortedIcons.pending.forEach((icon) => {
1333
+ const { provider, prefix, name } = icon;
1334
+ const storage = getStorage(provider, prefix);
1335
+ const pendingQueue = storage.pendingIcons || (storage.pendingIcons = /* @__PURE__ */ new Set());
1336
+ if (!pendingQueue.has(name)) {
1337
+ pendingQueue.add(name);
1338
+ newIcons[provider][prefix].push(name);
1339
+ }
1340
+ });
1341
+ sources.forEach((storage) => {
1342
+ const list = newIcons[storage.provider][storage.prefix];
1343
+ if (list.length) {
1344
+ loadNewIcons(storage, list);
1345
+ }
1346
+ });
1347
+ return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
1348
+ };
1349
+ const loadIcon = (icon) => {
1350
+ return new Promise((fulfill, reject) => {
1351
+ const iconObj = typeof icon === "string" ? stringToIcon(icon, true) : icon;
1352
+ if (!iconObj) {
1353
+ reject(icon);
1354
+ return;
1355
+ }
1356
+ loadIcons([iconObj || icon], (loaded) => {
1357
+ if (loaded.length && iconObj) {
1358
+ const data = getIconData(iconObj);
1359
+ if (data) {
1360
+ fulfill({
1361
+ ...defaultIconProps,
1362
+ ...data
1363
+ });
1364
+ return;
1365
+ }
1366
+ }
1367
+ reject(icon);
1368
+ });
1369
+ });
1370
+ };
1371
+
1372
+ function setCustomIconsLoader(loader, prefix, provider) {
1373
+ getStorage(provider || "", prefix).loadIcons = loader;
1374
+ }
1375
+ function setCustomIconLoader(loader, prefix, provider) {
1376
+ getStorage(provider || "", prefix).loadIcon = loader;
1377
+ }
1378
+
1379
+ function mergeCustomisations(defaults, item) {
1380
+ const result = {
1381
+ ...defaults
1382
+ };
1383
+ for (const key in item) {
1384
+ const value = item[key];
1385
+ const valueType = typeof value;
1386
+ if (key in defaultIconSizeCustomisations) {
1387
+ if (value === null || value && (valueType === "string" || valueType === "number")) {
1388
+ result[key] = value;
1389
+ }
1390
+ } else if (valueType === typeof result[key]) {
1391
+ result[key] = key === "rotate" ? value % 4 : value;
1392
+ }
1393
+ }
1394
+ return result;
1395
+ }
1396
+
1397
+ const separator = /[\s,]+/;
1398
+ function flipFromString(custom, flip) {
1399
+ flip.split(separator).forEach((str) => {
1400
+ const value = str.trim();
1401
+ switch (value) {
1402
+ case "horizontal":
1403
+ custom.hFlip = true;
1404
+ break;
1405
+ case "vertical":
1406
+ custom.vFlip = true;
1407
+ break;
1408
+ }
1409
+ });
1410
+ }
1411
+
1412
+ function rotateFromString(value, defaultValue = 0) {
1413
+ const units = value.replace(/^-?[0-9.]*/, "");
1414
+ function cleanup(value2) {
1415
+ while (value2 < 0) {
1416
+ value2 += 4;
1417
+ }
1418
+ return value2 % 4;
1419
+ }
1420
+ if (units === "") {
1421
+ const num = parseInt(value);
1422
+ return isNaN(num) ? 0 : cleanup(num);
1423
+ } else if (units !== value) {
1424
+ let split = 0;
1425
+ switch (units) {
1426
+ case "%":
1427
+ split = 25;
1428
+ break;
1429
+ case "deg":
1430
+ split = 90;
1431
+ }
1432
+ if (split) {
1433
+ let num = parseFloat(value.slice(0, value.length - units.length));
1434
+ if (isNaN(num)) {
1435
+ return 0;
1436
+ }
1437
+ num = num / split;
1438
+ return num % 1 === 0 ? cleanup(num) : 0;
1439
+ }
1440
+ }
1441
+ return defaultValue;
1442
+ }
1443
+
1444
+ function iconToHTML(body, attributes) {
1445
+ let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
1446
+ for (const attr in attributes) {
1447
+ renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
1448
+ }
1449
+ return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
1450
+ }
1451
+
1452
+ function encodeSVGforURL(svg) {
1453
+ return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
1454
+ }
1455
+ function svgToData(svg) {
1456
+ return "data:image/svg+xml," + encodeSVGforURL(svg);
1457
+ }
1458
+ function svgToURL(svg) {
1459
+ return 'url("' + svgToData(svg) + '")';
1460
+ }
1461
+
1462
+ const defaultExtendedIconCustomisations = {
1463
+ ...defaultIconCustomisations,
1464
+ inline: false,
1465
+ };
1466
+
1467
+ /**
1468
+ * Default SVG attributes
1469
+ */
1470
+ const svgDefaults = {
1471
+ 'xmlns': 'http://www.w3.org/2000/svg',
1472
+ 'xmlns:xlink': 'http://www.w3.org/1999/xlink',
1473
+ 'aria-hidden': true,
1474
+ 'role': 'img',
1475
+ };
1476
+ /**
1477
+ * Style modes
1478
+ */
1479
+ const commonProps = {
1480
+ display: 'inline-block',
1481
+ };
1482
+ const monotoneProps = {
1483
+ backgroundColor: 'currentColor',
1484
+ };
1485
+ const coloredProps = {
1486
+ backgroundColor: 'transparent',
1487
+ };
1488
+ // Dynamically add common props to variables above
1489
+ const propsToAdd = {
1490
+ Image: 'var(--svg)',
1491
+ Repeat: 'no-repeat',
1492
+ Size: '100% 100%',
1493
+ };
1494
+ const propsToAddTo = {
1495
+ webkitMask: monotoneProps,
1496
+ mask: monotoneProps,
1497
+ background: coloredProps,
1498
+ };
1499
+ for (const prefix in propsToAddTo) {
1500
+ const list = propsToAddTo[prefix];
1501
+ for (const prop in propsToAdd) {
1502
+ list[prefix + prop] = propsToAdd[prop];
1503
+ }
1504
+ }
1505
+ /**
1506
+ * Aliases for customisations.
1507
+ * In Vue 'v-' properties are reserved, so v-flip must be renamed
1508
+ */
1509
+ const customisationAliases = {};
1510
+ ['horizontal', 'vertical'].forEach((prefix) => {
1511
+ const attr = prefix.slice(0, 1) + 'Flip';
1512
+ // vertical-flip
1513
+ customisationAliases[prefix + '-flip'] = attr;
1514
+ // v-flip
1515
+ customisationAliases[prefix.slice(0, 1) + '-flip'] = attr;
1516
+ // verticalFlip
1517
+ customisationAliases[prefix + 'Flip'] = attr;
1518
+ });
1519
+ /**
1520
+ * Fix size: add 'px' to numbers
1521
+ */
1522
+ function fixSize(value) {
1523
+ return value + (value.match(/^[-0-9.]+$/) ? 'px' : '');
1524
+ }
1525
+ /**
1526
+ * Render icon
1527
+ */
1528
+ const render = (
1529
+ // Icon must be validated before calling this function
1530
+ icon,
1531
+ // Partial properties
1532
+ props) => {
1533
+ // Split properties
1534
+ const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props);
1535
+ const componentProps = { ...svgDefaults };
1536
+ // Check mode
1537
+ const mode = props.mode || 'svg';
1538
+ // Copy style
1539
+ const style = {};
1540
+ const propsStyle = props.style;
1541
+ const customStyle = typeof propsStyle === 'object' && !(propsStyle instanceof Array)
1542
+ ? propsStyle
1543
+ : {};
1544
+ // Get element properties
1545
+ for (let key in props) {
1546
+ const value = props[key];
1547
+ if (value === void 0) {
1548
+ continue;
1549
+ }
1550
+ switch (key) {
1551
+ // Properties to ignore
1552
+ case 'icon':
1553
+ case 'style':
1554
+ case 'onLoad':
1555
+ case 'mode':
1556
+ case 'ssr':
1557
+ break;
1558
+ // Boolean attributes
1559
+ case 'inline':
1560
+ case 'hFlip':
1561
+ case 'vFlip':
1562
+ customisations[key] =
1563
+ value === true || value === 'true' || value === 1;
1564
+ break;
1565
+ // Flip as string: 'horizontal,vertical'
1566
+ case 'flip':
1567
+ if (typeof value === 'string') {
1568
+ flipFromString(customisations, value);
1569
+ }
1570
+ break;
1571
+ // Color: override style
1572
+ case 'color':
1573
+ style.color = value;
1574
+ break;
1575
+ // Rotation as string
1576
+ case 'rotate':
1577
+ if (typeof value === 'string') {
1578
+ customisations[key] = rotateFromString(value);
1579
+ }
1580
+ else if (typeof value === 'number') {
1581
+ customisations[key] = value;
1582
+ }
1583
+ break;
1584
+ // Remove aria-hidden
1585
+ case 'ariaHidden':
1586
+ case 'aria-hidden':
1587
+ // Vue transforms 'aria-hidden' property to 'ariaHidden'
1588
+ if (value !== true && value !== 'true') {
1589
+ delete componentProps['aria-hidden'];
1590
+ }
1591
+ break;
1592
+ default: {
1593
+ const alias = customisationAliases[key];
1594
+ if (alias) {
1595
+ // Aliases for boolean customisations
1596
+ if (value === true || value === 'true' || value === 1) {
1597
+ customisations[alias] = true;
1598
+ }
1599
+ }
1600
+ else if (defaultExtendedIconCustomisations[key] === void 0) {
1601
+ // Copy missing property if it does not exist in customisations
1602
+ componentProps[key] = value;
1603
+ }
1604
+ }
1605
+ }
1606
+ }
1607
+ // Generate icon
1608
+ const item = iconToSVG(icon, customisations);
1609
+ const renderAttribs = item.attributes;
1610
+ // Inline display
1611
+ if (customisations.inline) {
1612
+ style.verticalAlign = '-0.125em';
1613
+ }
1614
+ if (mode === 'svg') {
1615
+ // Add style
1616
+ componentProps.style = {
1617
+ ...style,
1618
+ ...customStyle,
1619
+ };
1620
+ // Add icon stuff
1621
+ Object.assign(componentProps, renderAttribs);
1622
+ // Counter for ids based on "id" property to render icons consistently on server and client
1623
+ let localCounter = 0;
1624
+ let id = props.id;
1625
+ if (typeof id === 'string') {
1626
+ // Convert '-' to '_' to avoid errors in animations
1627
+ id = id.replace(/-/g, '_');
1628
+ }
1629
+ // Add innerHTML and style to props
1630
+ componentProps['innerHTML'] = replaceIDs(item.body, id ? () => id + 'ID' + localCounter++ : 'iconifyVue');
1631
+ // Render icon
1632
+ return h('svg', componentProps);
1633
+ }
1634
+ // Render <span> with style
1635
+ const { body, width, height } = icon;
1636
+ const useMask = mode === 'mask' ||
1637
+ (mode === 'bg' ? false : body.indexOf('currentColor') !== -1);
1638
+ // Generate SVG
1639
+ const html = iconToHTML(body, {
1640
+ ...renderAttribs,
1641
+ width: width + '',
1642
+ height: height + '',
1643
+ });
1644
+ // Generate style
1645
+ componentProps.style = {
1646
+ ...style,
1647
+ '--svg': svgToURL(html),
1648
+ 'width': fixSize(renderAttribs.width),
1649
+ 'height': fixSize(renderAttribs.height),
1650
+ ...commonProps,
1651
+ ...(useMask ? monotoneProps : coloredProps),
1652
+ ...customStyle,
1653
+ };
1654
+ return h('span', componentProps);
1655
+ };
1656
+
1657
+ /**
1658
+ * Initialise stuff
1659
+ */
1660
+ // Enable short names
1661
+ allowSimpleNames(true);
1662
+ // Set API module
1663
+ setAPIModule('', fetchAPIModule);
1664
+ /**
1665
+ * Browser stuff
1666
+ */
1667
+ if (typeof document !== 'undefined' && typeof window !== 'undefined') {
1668
+ const _window = window;
1669
+ // Load icons from global "IconifyPreload"
1670
+ if (_window.IconifyPreload !== void 0) {
1671
+ const preload = _window.IconifyPreload;
1672
+ const err = 'Invalid IconifyPreload syntax.';
1673
+ if (typeof preload === 'object' && preload !== null) {
1674
+ (preload instanceof Array ? preload : [preload]).forEach((item) => {
1675
+ try {
1676
+ if (
1677
+ // Check if item is an object and not null/array
1678
+ typeof item !== 'object' ||
1679
+ item === null ||
1680
+ item instanceof Array ||
1681
+ // Check for 'icons' and 'prefix'
1682
+ typeof item.icons !== 'object' ||
1683
+ typeof item.prefix !== 'string' ||
1684
+ // Add icon set
1685
+ !addCollection(item)) {
1686
+ console.error(err);
1687
+ }
1688
+ }
1689
+ catch (e) {
1690
+ console.error(err);
1691
+ }
1692
+ });
1693
+ }
1694
+ }
1695
+ // Set API from global "IconifyProviders"
1696
+ if (_window.IconifyProviders !== void 0) {
1697
+ const providers = _window.IconifyProviders;
1698
+ if (typeof providers === 'object' && providers !== null) {
1699
+ for (let key in providers) {
1700
+ const err = 'IconifyProviders[' + key + '] is invalid.';
1701
+ try {
1702
+ const value = providers[key];
1703
+ if (typeof value !== 'object' ||
1704
+ !value ||
1705
+ value.resources === void 0) {
1706
+ continue;
1707
+ }
1708
+ if (!addAPIProvider(key, value)) {
1709
+ console.error(err);
1710
+ }
1711
+ }
1712
+ catch (e) {
1713
+ console.error(err);
1714
+ }
1715
+ }
1716
+ }
1717
+ }
1718
+ }
1719
+ /**
1720
+ * Empty icon data, rendered when icon is not available
1721
+ */
1722
+ const emptyIcon = {
1723
+ ...defaultIconProps,
1724
+ body: '',
1725
+ };
1726
+ /**
1727
+ * Component
1728
+ */
1729
+ const Icon = defineComponent((props, { emit }) => {
1730
+ const loader = ref(null);
1731
+ function abortLoading() {
1732
+ if (loader.value) {
1733
+ loader.value.abort?.();
1734
+ loader.value = null;
1735
+ }
1736
+ }
1737
+ // Render state
1738
+ const rendering = ref(!!props.ssr);
1739
+ const lastRenderedIconName = ref('');
1740
+ const iconData = shallowRef(null);
1741
+ // Update icon data
1742
+ function getIcon() {
1743
+ const icon = props.icon;
1744
+ // Icon is an object
1745
+ if (typeof icon === 'object' &&
1746
+ icon !== null &&
1747
+ typeof icon.body === 'string') {
1748
+ lastRenderedIconName.value = '';
1749
+ return {
1750
+ data: icon,
1751
+ };
1752
+ }
1753
+ // Check for valid icon name
1754
+ let iconName;
1755
+ if (typeof icon !== 'string' ||
1756
+ (iconName = stringToIcon(icon, false, true)) === null) {
1757
+ return null;
1758
+ }
1759
+ // Load icon
1760
+ let data = getIconData(iconName);
1761
+ if (!data) {
1762
+ // Icon data is not available
1763
+ const oldState = loader.value;
1764
+ if (!oldState || oldState.name !== icon) {
1765
+ // Icon name does not match old loader state
1766
+ if (data === null) {
1767
+ // Failed to load
1768
+ loader.value = {
1769
+ name: icon,
1770
+ };
1771
+ }
1772
+ else {
1773
+ loader.value = {
1774
+ name: icon,
1775
+ abort: loadIcons([iconName], updateIconData),
1776
+ };
1777
+ }
1778
+ }
1779
+ return null;
1780
+ }
1781
+ // Icon data is available
1782
+ abortLoading();
1783
+ if (lastRenderedIconName.value !== icon) {
1784
+ lastRenderedIconName.value = icon;
1785
+ // Emit on next tick because render will be called on next tick
1786
+ nextTick(() => {
1787
+ emit('load', icon);
1788
+ });
1789
+ }
1790
+ // Customise icon
1791
+ const customise = props.customise;
1792
+ if (customise) {
1793
+ // Clone data and customise it
1794
+ data = Object.assign({}, data);
1795
+ const customised = customise(data.body, iconName.name, iconName.prefix, iconName.provider);
1796
+ if (typeof customised === 'string') {
1797
+ data.body = customised;
1798
+ }
1799
+ }
1800
+ // Add classes
1801
+ const classes = ['iconify'];
1802
+ if (iconName.prefix !== '') {
1803
+ classes.push('iconify--' + iconName.prefix);
1804
+ }
1805
+ if (iconName.provider !== '') {
1806
+ classes.push('iconify--' + iconName.provider);
1807
+ }
1808
+ return { data, classes };
1809
+ }
1810
+ function updateIconData() {
1811
+ const icon = getIcon();
1812
+ if (!icon) {
1813
+ iconData.value = null;
1814
+ }
1815
+ else if (icon.data !== iconData.value?.data) {
1816
+ iconData.value = icon;
1817
+ }
1818
+ }
1819
+ // Set icon data
1820
+ if (rendering.value) {
1821
+ updateIconData();
1822
+ }
1823
+ else {
1824
+ onMounted(() => {
1825
+ rendering.value = true;
1826
+ updateIconData();
1827
+ });
1828
+ }
1829
+ watch(() => props.icon, updateIconData);
1830
+ // Abort loading on unmount
1831
+ onUnmounted(abortLoading);
1832
+ // Render function
1833
+ return () => {
1834
+ // Get icon data
1835
+ const icon = iconData.value;
1836
+ if (!icon) {
1837
+ // Icon is not available
1838
+ return render(emptyIcon, props);
1839
+ }
1840
+ // Add classes
1841
+ let newProps = props;
1842
+ if (icon.classes) {
1843
+ newProps = {
1844
+ ...props,
1845
+ class: icon.classes.join(' '),
1846
+ };
1847
+ }
1848
+ // Render icon
1849
+ return render({
1850
+ ...defaultIconProps,
1851
+ ...icon.data,
1852
+ }, newProps);
1853
+ };
1854
+ }, {
1855
+ props: [
1856
+ // Icon and render mode
1857
+ 'icon',
1858
+ 'mode',
1859
+ 'ssr',
1860
+ // Layout and style
1861
+ 'width',
1862
+ 'height',
1863
+ 'style',
1864
+ 'color',
1865
+ 'inline',
1866
+ // Transformations
1867
+ 'rotate',
1868
+ 'hFlip',
1869
+ 'horizontalFlip',
1870
+ 'vFlip',
1871
+ 'verticalFlip',
1872
+ 'flip',
1873
+ // Misc
1874
+ 'id',
1875
+ 'ariaHidden',
1876
+ 'customise',
1877
+ 'title',
1878
+ ],
1879
+ emits: ['load'],
1880
+ });
1881
+ /**
1882
+ * Internal API
1883
+ */
1884
+ const _api = {
1885
+ getAPIConfig,
1886
+ setAPIModule,
1887
+ sendAPIQuery,
1888
+ setFetch,
1889
+ getFetch,
1890
+ listAPIProviders,
1891
+ };
1892
+
1893
+ export { Icon, _api, addAPIProvider, addCollection, addIcon, iconToSVG as buildIcon, calculateSize, getIcon, iconLoaded, listIcons, loadIcon, loadIcons, replaceIDs, setCustomIconLoader, setCustomIconsLoader };