@charde/core 0.0.1 → 0.0.3

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 (538) hide show
  1. package/package.json +54 -55
  2. package/readme.md +12 -38
  3. package/dist/charde/charde.css +0 -1775
  4. package/dist/charde/charde.esm.js +0 -50
  5. package/dist/charde/charde.esm.js.map +0 -1
  6. package/dist/charde/chardes-alert-close-button.entry.js +0 -24
  7. package/dist/charde/chardes-alert-close-button.entry.js.map +0 -1
  8. package/dist/charde/chardes-alert-content.entry.js +0 -23
  9. package/dist/charde/chardes-alert-content.entry.js.map +0 -1
  10. package/dist/charde/chardes-alert-error.entry.js +0 -22
  11. package/dist/charde/chardes-alert-error.entry.js.map +0 -1
  12. package/dist/charde/chardes-alert-header.entry.js +0 -22
  13. package/dist/charde/chardes-alert-header.entry.js.map +0 -1
  14. package/dist/charde/chardes-alert-icon.entry.js +0 -23
  15. package/dist/charde/chardes-alert-icon.entry.js.map +0 -1
  16. package/dist/charde/chardes-alert-success.entry.js +0 -22
  17. package/dist/charde/chardes-alert-success.entry.js.map +0 -1
  18. package/dist/charde/chardes-alert-title-container.entry.js +0 -22
  19. package/dist/charde/chardes-alert-title-container.entry.js.map +0 -1
  20. package/dist/charde/chardes-alert-title.entry.js +0 -23
  21. package/dist/charde/chardes-alert-title.entry.js.map +0 -1
  22. package/dist/charde/chardes-alert-warning.entry.js +0 -22
  23. package/dist/charde/chardes-alert-warning.entry.js.map +0 -1
  24. package/dist/charde/chardes-alerts.entry.js +0 -22
  25. package/dist/charde/chardes-alerts.entry.js.map +0 -1
  26. package/dist/charde/chardes-badge-close-button.entry.js +0 -24
  27. package/dist/charde/chardes-badge-close-button.entry.js.map +0 -1
  28. package/dist/charde/chardes-badge-error.entry.js +0 -23
  29. package/dist/charde/chardes-badge-error.entry.js.map +0 -1
  30. package/dist/charde/chardes-badge-group.entry.js +0 -22
  31. package/dist/charde/chardes-badge-group.entry.js.map +0 -1
  32. package/dist/charde/chardes-badge-icon.entry.js +0 -23
  33. package/dist/charde/chardes-badge-icon.entry.js.map +0 -1
  34. package/dist/charde/chardes-badge-interactive-text.entry.js +0 -23
  35. package/dist/charde/chardes-badge-interactive-text.entry.js.map +0 -1
  36. package/dist/charde/chardes-badge-interactive.entry.js +0 -22
  37. package/dist/charde/chardes-badge-interactive.entry.js.map +0 -1
  38. package/dist/charde/chardes-badge-outline.entry.js +0 -23
  39. package/dist/charde/chardes-badge-outline.entry.js.map +0 -1
  40. package/dist/charde/chardes-badge-primary.entry.js +0 -23
  41. package/dist/charde/chardes-badge-primary.entry.js.map +0 -1
  42. package/dist/charde/chardes-badge-secondary.entry.js +0 -23
  43. package/dist/charde/chardes-badge-secondary.entry.js.map +0 -1
  44. package/dist/charde/chardes-badge-success.entry.js +0 -23
  45. package/dist/charde/chardes-badge-success.entry.js.map +0 -1
  46. package/dist/charde/chardes-badge-text.entry.js +0 -23
  47. package/dist/charde/chardes-badge-text.entry.js.map +0 -1
  48. package/dist/charde/chardes-badge-warning.entry.js +0 -23
  49. package/dist/charde/chardes-badge-warning.entry.js.map +0 -1
  50. package/dist/charde/chardes-badge-with-icon.entry.js +0 -22
  51. package/dist/charde/chardes-badge-with-icon.entry.js.map +0 -1
  52. package/dist/charde/chardes-badge.entry.js +0 -22
  53. package/dist/charde/chardes-badge.entry.js.map +0 -1
  54. package/dist/charde/chardes-button.entry.js +0 -25
  55. package/dist/charde/chardes-button.entry.js.map +0 -1
  56. package/dist/charde/chardes-card-body-action-button-1.entry.js +0 -24
  57. package/dist/charde/chardes-card-body-action-button-1.entry.js.map +0 -1
  58. package/dist/charde/chardes-card-body-action-button-2.entry.js +0 -24
  59. package/dist/charde/chardes-card-body-action-button-2.entry.js.map +0 -1
  60. package/dist/charde/chardes-card-body-action-icon-1.entry.js +0 -23
  61. package/dist/charde/chardes-card-body-action-icon-1.entry.js.map +0 -1
  62. package/dist/charde/chardes-card-body-action-icon-2.entry.js +0 -23
  63. package/dist/charde/chardes-card-body-action-icon-2.entry.js.map +0 -1
  64. package/dist/charde/chardes-card-body-actions.entry.js +0 -22
  65. package/dist/charde/chardes-card-body-actions.entry.js.map +0 -1
  66. package/dist/charde/chardes-card-body-driver.entry.js +0 -22
  67. package/dist/charde/chardes-card-body-driver.entry.js.map +0 -1
  68. package/dist/charde/chardes-card-body-img.entry.js +0 -24
  69. package/dist/charde/chardes-card-body-img.entry.js.map +0 -1
  70. package/dist/charde/chardes-card-body-info.entry.js +0 -22
  71. package/dist/charde/chardes-card-body-info.entry.js.map +0 -1
  72. package/dist/charde/chardes-card-body-name.entry.js +0 -23
  73. package/dist/charde/chardes-card-body-name.entry.js.map +0 -1
  74. package/dist/charde/chardes-card-body-span.entry.js +0 -23
  75. package/dist/charde/chardes-card-body-span.entry.js.map +0 -1
  76. package/dist/charde/chardes-card-body.entry.js +0 -22
  77. package/dist/charde/chardes-card-body.entry.js.map +0 -1
  78. package/dist/charde/chardes-card-container.entry.js +0 -22
  79. package/dist/charde/chardes-card-container.entry.js.map +0 -1
  80. package/dist/charde/chardes-card-header-content.entry.js +0 -22
  81. package/dist/charde/chardes-card-header-content.entry.js.map +0 -1
  82. package/dist/charde/chardes-card-header-timer.entry.js +0 -23
  83. package/dist/charde/chardes-card-header-timer.entry.js.map +0 -1
  84. package/dist/charde/chardes-card-header-title.entry.js +0 -23
  85. package/dist/charde/chardes-card-header-title.entry.js.map +0 -1
  86. package/dist/charde/chardes-card-header.entry.js +0 -22
  87. package/dist/charde/chardes-card-header.entry.js.map +0 -1
  88. package/dist/charde/chardes-card-icon-container.entry.js +0 -22
  89. package/dist/charde/chardes-card-icon-container.entry.js.map +0 -1
  90. package/dist/charde/chardes-card-number.entry.js +0 -23
  91. package/dist/charde/chardes-card-number.entry.js.map +0 -1
  92. package/dist/charde/chardes-card-payment-container.entry.js +0 -22
  93. package/dist/charde/chardes-card-payment-container.entry.js.map +0 -1
  94. package/dist/charde/chardes-card-payment-content.entry.js +0 -22
  95. package/dist/charde/chardes-card-payment-content.entry.js.map +0 -1
  96. package/dist/charde/chardes-card-payment-details.entry.js +0 -22
  97. package/dist/charde/chardes-card-payment-details.entry.js.map +0 -1
  98. package/dist/charde/chardes-card-payment-icon-container.entry.js +0 -22
  99. package/dist/charde/chardes-card-payment-icon-container.entry.js.map +0 -1
  100. package/dist/charde/chardes-card-payment.entry.js +0 -22
  101. package/dist/charde/chardes-card-payment.entry.js.map +0 -1
  102. package/dist/charde/chardes-card-route-container.entry.js +0 -22
  103. package/dist/charde/chardes-card-route-container.entry.js.map +0 -1
  104. package/dist/charde/chardes-card-route-destination-address.entry.js +0 -23
  105. package/dist/charde/chardes-card-route-destination-address.entry.js.map +0 -1
  106. package/dist/charde/chardes-card-route-destination-details.entry.js +0 -22
  107. package/dist/charde/chardes-card-route-destination-details.entry.js.map +0 -1
  108. package/dist/charde/chardes-card-route-destination-icon-container.entry.js +0 -22
  109. package/dist/charde/chardes-card-route-destination-icon-container.entry.js.map +0 -1
  110. package/dist/charde/chardes-card-route-destination-icon.entry.js +0 -22
  111. package/dist/charde/chardes-card-route-destination-icon.entry.js.map +0 -1
  112. package/dist/charde/chardes-card-route-destination-label.entry.js +0 -23
  113. package/dist/charde/chardes-card-route-destination-label.entry.js.map +0 -1
  114. package/dist/charde/chardes-card-route-destination.entry.js +0 -22
  115. package/dist/charde/chardes-card-route-destination.entry.js.map +0 -1
  116. package/dist/charde/chardes-card-route-pickup-address.entry.js +0 -23
  117. package/dist/charde/chardes-card-route-pickup-address.entry.js.map +0 -1
  118. package/dist/charde/chardes-card-route-pickup-details.entry.js +0 -22
  119. package/dist/charde/chardes-card-route-pickup-details.entry.js.map +0 -1
  120. package/dist/charde/chardes-card-route-pickup-icon.entry.js +0 -22
  121. package/dist/charde/chardes-card-route-pickup-icon.entry.js.map +0 -1
  122. package/dist/charde/chardes-card-route-pickup-label.entry.js +0 -23
  123. package/dist/charde/chardes-card-route-pickup-label.entry.js.map +0 -1
  124. package/dist/charde/chardes-card-route-pickup.entry.js +0 -22
  125. package/dist/charde/chardes-card-route-pickup.entry.js.map +0 -1
  126. package/dist/charde/chardes-card-route.entry.js +0 -22
  127. package/dist/charde/chardes-card-route.entry.js.map +0 -1
  128. package/dist/charde/chardes-card-total-amount.entry.js +0 -23
  129. package/dist/charde/chardes-card-total-amount.entry.js.map +0 -1
  130. package/dist/charde/chardes-card-total-content.entry.js +0 -22
  131. package/dist/charde/chardes-card-total-content.entry.js.map +0 -1
  132. package/dist/charde/chardes-card-total-label.entry.js +0 -23
  133. package/dist/charde/chardes-card-total-label.entry.js.map +0 -1
  134. package/dist/charde/chardes-card-total-section.entry.js +0 -22
  135. package/dist/charde/chardes-card-total-section.entry.js.map +0 -1
  136. package/dist/charde/chardes-card-type.entry.js +0 -23
  137. package/dist/charde/chardes-card-type.entry.js.map +0 -1
  138. package/dist/charde/chardes-card.entry.js +0 -22
  139. package/dist/charde/chardes-card.entry.js.map +0 -1
  140. package/dist/charde/chardes-checkbox-checkmark.entry.js +0 -22
  141. package/dist/charde/chardes-checkbox-checkmark.entry.js.map +0 -1
  142. package/dist/charde/chardes-checkbox-input-wrapper.entry.js +0 -22
  143. package/dist/charde/chardes-checkbox-input-wrapper.entry.js.map +0 -1
  144. package/dist/charde/chardes-checkbox-input.entry.js +0 -26
  145. package/dist/charde/chardes-checkbox-input.entry.js.map +0 -1
  146. package/dist/charde/chardes-checkbox-label.entry.js +0 -23
  147. package/dist/charde/chardes-checkbox-label.entry.js.map +0 -1
  148. package/dist/charde/chardes-checkbox.entry.js +0 -23
  149. package/dist/charde/chardes-checkbox.entry.js.map +0 -1
  150. package/dist/charde/chardes-checkmark-svg.entry.js +0 -22
  151. package/dist/charde/chardes-checkmark-svg.entry.js.map +0 -1
  152. package/dist/charde/chardes-close-icon.entry.js +0 -23
  153. package/dist/charde/chardes-close-icon.entry.js.map +0 -1
  154. package/dist/charde/chardes-error-icon-svg.entry.js +0 -23
  155. package/dist/charde/chardes-error-icon-svg.entry.js.map +0 -1
  156. package/dist/charde/chardes-error-input-icon.entry.js +0 -22
  157. package/dist/charde/chardes-error-input-icon.entry.js.map +0 -1
  158. package/dist/charde/chardes-error-input-wrapper.entry.js +0 -22
  159. package/dist/charde/chardes-error-input-wrapper.entry.js.map +0 -1
  160. package/dist/charde/chardes-error-input.entry.js +0 -27
  161. package/dist/charde/chardes-error-input.entry.js.map +0 -1
  162. package/dist/charde/chardes-error-label.entry.js +0 -24
  163. package/dist/charde/chardes-error-label.entry.js.map +0 -1
  164. package/dist/charde/chardes-error-message.entry.js +0 -23
  165. package/dist/charde/chardes-error-message.entry.js.map +0 -1
  166. package/dist/charde/chardes-error-state.entry.js +0 -22
  167. package/dist/charde/chardes-error-state.entry.js.map +0 -1
  168. package/dist/charde/chardes-form-group.entry.js +0 -22
  169. package/dist/charde/chardes-form-group.entry.js.map +0 -1
  170. package/dist/charde/chardes-form-input.entry.js +0 -26
  171. package/dist/charde/chardes-form-input.entry.js.map +0 -1
  172. package/dist/charde/chardes-form-label.entry.js +0 -24
  173. package/dist/charde/chardes-form-label.entry.js.map +0 -1
  174. package/dist/charde/chardes-group-badge-1.entry.js +0 -23
  175. package/dist/charde/chardes-group-badge-1.entry.js.map +0 -1
  176. package/dist/charde/chardes-group-badge-2.entry.js +0 -23
  177. package/dist/charde/chardes-group-badge-2.entry.js.map +0 -1
  178. package/dist/charde/chardes-group-badge-3.entry.js +0 -23
  179. package/dist/charde/chardes-group-badge-3.entry.js.map +0 -1
  180. package/dist/charde/chardes-group-badge-4.entry.js +0 -23
  181. package/dist/charde/chardes-group-badge-4.entry.js.map +0 -1
  182. package/dist/charde/chardes-icon-svg-destination.entry.js +0 -23
  183. package/dist/charde/chardes-icon-svg-destination.entry.js.map +0 -1
  184. package/dist/charde/chardes-icon-svg-pickup.entry.js +0 -23
  185. package/dist/charde/chardes-icon-svg-pickup.entry.js.map +0 -1
  186. package/dist/charde/chardes-icon-svg.entry.js +0 -23
  187. package/dist/charde/chardes-icon-svg.entry.js.map +0 -1
  188. package/dist/charde/chardes-input-element.entry.js +0 -27
  189. package/dist/charde/chardes-input-element.entry.js.map +0 -1
  190. package/dist/charde/chardes-input-field-wrapper.entry.js +0 -22
  191. package/dist/charde/chardes-input-field-wrapper.entry.js.map +0 -1
  192. package/dist/charde/chardes-input-helper.entry.js +0 -23
  193. package/dist/charde/chardes-input-helper.entry.js.map +0 -1
  194. package/dist/charde/chardes-input-icon.entry.js +0 -22
  195. package/dist/charde/chardes-input-icon.entry.js.map +0 -1
  196. package/dist/charde/chardes-input-label.entry.js +0 -24
  197. package/dist/charde/chardes-input-label.entry.js.map +0 -1
  198. package/dist/charde/chardes-input-states.entry.js +0 -22
  199. package/dist/charde/chardes-input-states.entry.js.map +0 -1
  200. package/dist/charde/chardes-input-wrapper.entry.js +0 -22
  201. package/dist/charde/chardes-input-wrapper.entry.js.map +0 -1
  202. package/dist/charde/chardes-input.entry.js +0 -22
  203. package/dist/charde/chardes-input.entry.js.map +0 -1
  204. package/dist/charde/chardes-modal-body.entry.js +0 -22
  205. package/dist/charde/chardes-modal-body.entry.js.map +0 -1
  206. package/dist/charde/chardes-modal-cancel-button.entry.js +0 -25
  207. package/dist/charde/chardes-modal-cancel-button.entry.js.map +0 -1
  208. package/dist/charde/chardes-modal-close-button.entry.js +0 -24
  209. package/dist/charde/chardes-modal-close-button.entry.js.map +0 -1
  210. package/dist/charde/chardes-modal-confirm-button.entry.js +0 -25
  211. package/dist/charde/chardes-modal-confirm-button.entry.js.map +0 -1
  212. package/dist/charde/chardes-modal-container.entry.js +0 -22
  213. package/dist/charde/chardes-modal-container.entry.js.map +0 -1
  214. package/dist/charde/chardes-modal-content.entry.js +0 -23
  215. package/dist/charde/chardes-modal-content.entry.js.map +0 -1
  216. package/dist/charde/chardes-modal-footer.entry.js +0 -22
  217. package/dist/charde/chardes-modal-footer.entry.js.map +0 -1
  218. package/dist/charde/chardes-modal-form.entry.js +0 -22
  219. package/dist/charde/chardes-modal-form.entry.js.map +0 -1
  220. package/dist/charde/chardes-modal-header.entry.js +0 -22
  221. package/dist/charde/chardes-modal-header.entry.js.map +0 -1
  222. package/dist/charde/chardes-modal-title.entry.js +0 -23
  223. package/dist/charde/chardes-modal-title.entry.js.map +0 -1
  224. package/dist/charde/chardes-modal.entry.js +0 -22
  225. package/dist/charde/chardes-modal.entry.js.map +0 -1
  226. package/dist/charde/chardes-muzingo-primary-button.entry.js +0 -22
  227. package/dist/charde/chardes-muzingo-primary-button.entry.js.map +0 -1
  228. package/dist/charde/chardes-muzingo.entry.js +0 -26
  229. package/dist/charde/chardes-muzingo.entry.js.map +0 -1
  230. package/dist/charde/chardes-notification-toast.entry.js +0 -22
  231. package/dist/charde/chardes-notification-toast.entry.js.map +0 -1
  232. package/dist/charde/chardes-payment-icon.entry.js +0 -23
  233. package/dist/charde/chardes-payment-icon.entry.js.map +0 -1
  234. package/dist/charde/chardes-success-icon-svg.entry.js +0 -23
  235. package/dist/charde/chardes-success-icon-svg.entry.js.map +0 -1
  236. package/dist/charde/chardes-success-input-icon.entry.js +0 -22
  237. package/dist/charde/chardes-success-input-icon.entry.js.map +0 -1
  238. package/dist/charde/chardes-success-input-wrapper.entry.js +0 -22
  239. package/dist/charde/chardes-success-input-wrapper.entry.js.map +0 -1
  240. package/dist/charde/chardes-success-input.entry.js +0 -27
  241. package/dist/charde/chardes-success-input.entry.js.map +0 -1
  242. package/dist/charde/chardes-success-label.entry.js +0 -24
  243. package/dist/charde/chardes-success-label.entry.js.map +0 -1
  244. package/dist/charde/chardes-success-message.entry.js +0 -23
  245. package/dist/charde/chardes-success-message.entry.js.map +0 -1
  246. package/dist/charde/chardes-success-state.entry.js +0 -22
  247. package/dist/charde/chardes-success-state.entry.js.map +0 -1
  248. package/dist/charde/chardes-toast-action-button.entry.js +0 -25
  249. package/dist/charde/chardes-toast-action-button.entry.js.map +0 -1
  250. package/dist/charde/chardes-toast-actions.entry.js +0 -22
  251. package/dist/charde/chardes-toast-actions.entry.js.map +0 -1
  252. package/dist/charde/chardes-toast-content.entry.js +0 -23
  253. package/dist/charde/chardes-toast-content.entry.js.map +0 -1
  254. package/dist/charde/chardes-toast-dismiss-button.entry.js +0 -25
  255. package/dist/charde/chardes-toast-dismiss-button.entry.js.map +0 -1
  256. package/dist/charde/chardes-toast-header.entry.js +0 -22
  257. package/dist/charde/chardes-toast-header.entry.js.map +0 -1
  258. package/dist/charde/chardes-toast-icon.entry.js +0 -23
  259. package/dist/charde/chardes-toast-icon.entry.js.map +0 -1
  260. package/dist/charde/chardes-toast-timestamp.entry.js +0 -23
  261. package/dist/charde/chardes-toast-timestamp.entry.js.map +0 -1
  262. package/dist/charde/chardes-toast-title-container.entry.js +0 -22
  263. package/dist/charde/chardes-toast-title-container.entry.js.map +0 -1
  264. package/dist/charde/chardes-toast-title.entry.js +0 -23
  265. package/dist/charde/chardes-toast-title.entry.js.map +0 -1
  266. package/dist/charde/charisol-alert-close-button.entry.js +0 -24
  267. package/dist/charde/charisol-alert-close-button.entry.js.map +0 -1
  268. package/dist/charde/charisol-alert-content.entry.js +0 -23
  269. package/dist/charde/charisol-alert-content.entry.js.map +0 -1
  270. package/dist/charde/charisol-alert-error.entry.js +0 -22
  271. package/dist/charde/charisol-alert-error.entry.js.map +0 -1
  272. package/dist/charde/charisol-alert-header.entry.js +0 -22
  273. package/dist/charde/charisol-alert-header.entry.js.map +0 -1
  274. package/dist/charde/charisol-alert-icon.entry.js +0 -23
  275. package/dist/charde/charisol-alert-icon.entry.js.map +0 -1
  276. package/dist/charde/charisol-alert-success.entry.js +0 -22
  277. package/dist/charde/charisol-alert-success.entry.js.map +0 -1
  278. package/dist/charde/charisol-alert-title-container.entry.js +0 -22
  279. package/dist/charde/charisol-alert-title-container.entry.js.map +0 -1
  280. package/dist/charde/charisol-alert-title.entry.js +0 -23
  281. package/dist/charde/charisol-alert-title.entry.js.map +0 -1
  282. package/dist/charde/charisol-alert-warning.entry.js +0 -22
  283. package/dist/charde/charisol-alert-warning.entry.js.map +0 -1
  284. package/dist/charde/charisol-alerts.entry.js +0 -22
  285. package/dist/charde/charisol-alerts.entry.js.map +0 -1
  286. package/dist/charde/charisol-badge-close-button.entry.js +0 -24
  287. package/dist/charde/charisol-badge-close-button.entry.js.map +0 -1
  288. package/dist/charde/charisol-badge-error.entry.js +0 -23
  289. package/dist/charde/charisol-badge-error.entry.js.map +0 -1
  290. package/dist/charde/charisol-badge-group.entry.js +0 -22
  291. package/dist/charde/charisol-badge-group.entry.js.map +0 -1
  292. package/dist/charde/charisol-badge-icon.entry.js +0 -23
  293. package/dist/charde/charisol-badge-icon.entry.js.map +0 -1
  294. package/dist/charde/charisol-badge-interactive-text.entry.js +0 -23
  295. package/dist/charde/charisol-badge-interactive-text.entry.js.map +0 -1
  296. package/dist/charde/charisol-badge-interactive.entry.js +0 -22
  297. package/dist/charde/charisol-badge-interactive.entry.js.map +0 -1
  298. package/dist/charde/charisol-badge-outline.entry.js +0 -23
  299. package/dist/charde/charisol-badge-outline.entry.js.map +0 -1
  300. package/dist/charde/charisol-badge-primary.entry.js +0 -23
  301. package/dist/charde/charisol-badge-primary.entry.js.map +0 -1
  302. package/dist/charde/charisol-badge-secondary.entry.js +0 -23
  303. package/dist/charde/charisol-badge-secondary.entry.js.map +0 -1
  304. package/dist/charde/charisol-badge-success.entry.js +0 -23
  305. package/dist/charde/charisol-badge-success.entry.js.map +0 -1
  306. package/dist/charde/charisol-badge-text.entry.js +0 -23
  307. package/dist/charde/charisol-badge-text.entry.js.map +0 -1
  308. package/dist/charde/charisol-badge-warning.entry.js +0 -23
  309. package/dist/charde/charisol-badge-warning.entry.js.map +0 -1
  310. package/dist/charde/charisol-badge-with-icon.entry.js +0 -22
  311. package/dist/charde/charisol-badge-with-icon.entry.js.map +0 -1
  312. package/dist/charde/charisol-badge.entry.js +0 -22
  313. package/dist/charde/charisol-badge.entry.js.map +0 -1
  314. package/dist/charde/charisol-button.entry.js +0 -25
  315. package/dist/charde/charisol-button.entry.js.map +0 -1
  316. package/dist/charde/charisol-card-body-action-button-1.entry.js +0 -24
  317. package/dist/charde/charisol-card-body-action-button-1.entry.js.map +0 -1
  318. package/dist/charde/charisol-card-body-action-button-2.entry.js +0 -24
  319. package/dist/charde/charisol-card-body-action-button-2.entry.js.map +0 -1
  320. package/dist/charde/charisol-card-body-action-icon-1.entry.js +0 -23
  321. package/dist/charde/charisol-card-body-action-icon-1.entry.js.map +0 -1
  322. package/dist/charde/charisol-card-body-action-icon-2.entry.js +0 -23
  323. package/dist/charde/charisol-card-body-action-icon-2.entry.js.map +0 -1
  324. package/dist/charde/charisol-card-body-actions.entry.js +0 -22
  325. package/dist/charde/charisol-card-body-actions.entry.js.map +0 -1
  326. package/dist/charde/charisol-card-body-driver.entry.js +0 -22
  327. package/dist/charde/charisol-card-body-driver.entry.js.map +0 -1
  328. package/dist/charde/charisol-card-body-img.entry.js +0 -24
  329. package/dist/charde/charisol-card-body-img.entry.js.map +0 -1
  330. package/dist/charde/charisol-card-body-info.entry.js +0 -22
  331. package/dist/charde/charisol-card-body-info.entry.js.map +0 -1
  332. package/dist/charde/charisol-card-body-name.entry.js +0 -23
  333. package/dist/charde/charisol-card-body-name.entry.js.map +0 -1
  334. package/dist/charde/charisol-card-body-span.entry.js +0 -23
  335. package/dist/charde/charisol-card-body-span.entry.js.map +0 -1
  336. package/dist/charde/charisol-card-body.entry.js +0 -22
  337. package/dist/charde/charisol-card-body.entry.js.map +0 -1
  338. package/dist/charde/charisol-card-container.entry.js +0 -22
  339. package/dist/charde/charisol-card-container.entry.js.map +0 -1
  340. package/dist/charde/charisol-card-header-content.entry.js +0 -22
  341. package/dist/charde/charisol-card-header-content.entry.js.map +0 -1
  342. package/dist/charde/charisol-card-header-timer.entry.js +0 -23
  343. package/dist/charde/charisol-card-header-timer.entry.js.map +0 -1
  344. package/dist/charde/charisol-card-header-title.entry.js +0 -23
  345. package/dist/charde/charisol-card-header-title.entry.js.map +0 -1
  346. package/dist/charde/charisol-card-header.entry.js +0 -22
  347. package/dist/charde/charisol-card-header.entry.js.map +0 -1
  348. package/dist/charde/charisol-card-icon-container.entry.js +0 -22
  349. package/dist/charde/charisol-card-icon-container.entry.js.map +0 -1
  350. package/dist/charde/charisol-card-number.entry.js +0 -23
  351. package/dist/charde/charisol-card-number.entry.js.map +0 -1
  352. package/dist/charde/charisol-card-payment-container.entry.js +0 -22
  353. package/dist/charde/charisol-card-payment-container.entry.js.map +0 -1
  354. package/dist/charde/charisol-card-payment-content.entry.js +0 -22
  355. package/dist/charde/charisol-card-payment-content.entry.js.map +0 -1
  356. package/dist/charde/charisol-card-payment-details.entry.js +0 -22
  357. package/dist/charde/charisol-card-payment-details.entry.js.map +0 -1
  358. package/dist/charde/charisol-card-payment-icon-container.entry.js +0 -22
  359. package/dist/charde/charisol-card-payment-icon-container.entry.js.map +0 -1
  360. package/dist/charde/charisol-card-payment.entry.js +0 -22
  361. package/dist/charde/charisol-card-payment.entry.js.map +0 -1
  362. package/dist/charde/charisol-card-route-container.entry.js +0 -22
  363. package/dist/charde/charisol-card-route-container.entry.js.map +0 -1
  364. package/dist/charde/charisol-card-route-destination-address.entry.js +0 -23
  365. package/dist/charde/charisol-card-route-destination-address.entry.js.map +0 -1
  366. package/dist/charde/charisol-card-route-destination-details.entry.js +0 -22
  367. package/dist/charde/charisol-card-route-destination-details.entry.js.map +0 -1
  368. package/dist/charde/charisol-card-route-destination-icon-container.entry.js +0 -22
  369. package/dist/charde/charisol-card-route-destination-icon-container.entry.js.map +0 -1
  370. package/dist/charde/charisol-card-route-destination-icon.entry.js +0 -22
  371. package/dist/charde/charisol-card-route-destination-icon.entry.js.map +0 -1
  372. package/dist/charde/charisol-card-route-destination-label.entry.js +0 -23
  373. package/dist/charde/charisol-card-route-destination-label.entry.js.map +0 -1
  374. package/dist/charde/charisol-card-route-destination.entry.js +0 -22
  375. package/dist/charde/charisol-card-route-destination.entry.js.map +0 -1
  376. package/dist/charde/charisol-card-route-pickup-address.entry.js +0 -23
  377. package/dist/charde/charisol-card-route-pickup-address.entry.js.map +0 -1
  378. package/dist/charde/charisol-card-route-pickup-details.entry.js +0 -22
  379. package/dist/charde/charisol-card-route-pickup-details.entry.js.map +0 -1
  380. package/dist/charde/charisol-card-route-pickup-icon.entry.js +0 -22
  381. package/dist/charde/charisol-card-route-pickup-icon.entry.js.map +0 -1
  382. package/dist/charde/charisol-card-route-pickup-label.entry.js +0 -23
  383. package/dist/charde/charisol-card-route-pickup-label.entry.js.map +0 -1
  384. package/dist/charde/charisol-card-route-pickup.entry.js +0 -22
  385. package/dist/charde/charisol-card-route-pickup.entry.js.map +0 -1
  386. package/dist/charde/charisol-card-route.entry.js +0 -22
  387. package/dist/charde/charisol-card-route.entry.js.map +0 -1
  388. package/dist/charde/charisol-card-total-amount.entry.js +0 -23
  389. package/dist/charde/charisol-card-total-amount.entry.js.map +0 -1
  390. package/dist/charde/charisol-card-total-content.entry.js +0 -22
  391. package/dist/charde/charisol-card-total-content.entry.js.map +0 -1
  392. package/dist/charde/charisol-card-total-label.entry.js +0 -23
  393. package/dist/charde/charisol-card-total-label.entry.js.map +0 -1
  394. package/dist/charde/charisol-card-total-section.entry.js +0 -22
  395. package/dist/charde/charisol-card-total-section.entry.js.map +0 -1
  396. package/dist/charde/charisol-card-type.entry.js +0 -23
  397. package/dist/charde/charisol-card-type.entry.js.map +0 -1
  398. package/dist/charde/charisol-card.entry.js +0 -22
  399. package/dist/charde/charisol-card.entry.js.map +0 -1
  400. package/dist/charde/charisol-checkbox-checkmark.entry.js +0 -22
  401. package/dist/charde/charisol-checkbox-checkmark.entry.js.map +0 -1
  402. package/dist/charde/charisol-checkbox-input-wrapper.entry.js +0 -22
  403. package/dist/charde/charisol-checkbox-input-wrapper.entry.js.map +0 -1
  404. package/dist/charde/charisol-checkbox-input.entry.js +0 -26
  405. package/dist/charde/charisol-checkbox-input.entry.js.map +0 -1
  406. package/dist/charde/charisol-checkbox-label.entry.js +0 -23
  407. package/dist/charde/charisol-checkbox-label.entry.js.map +0 -1
  408. package/dist/charde/charisol-checkbox.entry.js +0 -23
  409. package/dist/charde/charisol-checkbox.entry.js.map +0 -1
  410. package/dist/charde/charisol-checkmark-svg.entry.js +0 -22
  411. package/dist/charde/charisol-checkmark-svg.entry.js.map +0 -1
  412. package/dist/charde/charisol-close-icon.entry.js +0 -23
  413. package/dist/charde/charisol-close-icon.entry.js.map +0 -1
  414. package/dist/charde/charisol-error-icon-svg.entry.js +0 -23
  415. package/dist/charde/charisol-error-icon-svg.entry.js.map +0 -1
  416. package/dist/charde/charisol-error-input-icon.entry.js +0 -22
  417. package/dist/charde/charisol-error-input-icon.entry.js.map +0 -1
  418. package/dist/charde/charisol-error-input-wrapper.entry.js +0 -22
  419. package/dist/charde/charisol-error-input-wrapper.entry.js.map +0 -1
  420. package/dist/charde/charisol-error-input.entry.js +0 -27
  421. package/dist/charde/charisol-error-input.entry.js.map +0 -1
  422. package/dist/charde/charisol-error-label.entry.js +0 -24
  423. package/dist/charde/charisol-error-label.entry.js.map +0 -1
  424. package/dist/charde/charisol-error-message.entry.js +0 -23
  425. package/dist/charde/charisol-error-message.entry.js.map +0 -1
  426. package/dist/charde/charisol-error-state.entry.js +0 -22
  427. package/dist/charde/charisol-error-state.entry.js.map +0 -1
  428. package/dist/charde/charisol-form-group.entry.js +0 -22
  429. package/dist/charde/charisol-form-group.entry.js.map +0 -1
  430. package/dist/charde/charisol-form-input.entry.js +0 -26
  431. package/dist/charde/charisol-form-input.entry.js.map +0 -1
  432. package/dist/charde/charisol-form-label.entry.js +0 -24
  433. package/dist/charde/charisol-form-label.entry.js.map +0 -1
  434. package/dist/charde/charisol-group-badge-1.entry.js +0 -23
  435. package/dist/charde/charisol-group-badge-1.entry.js.map +0 -1
  436. package/dist/charde/charisol-group-badge-2.entry.js +0 -23
  437. package/dist/charde/charisol-group-badge-2.entry.js.map +0 -1
  438. package/dist/charde/charisol-group-badge-3.entry.js +0 -23
  439. package/dist/charde/charisol-group-badge-3.entry.js.map +0 -1
  440. package/dist/charde/charisol-group-badge-4.entry.js +0 -23
  441. package/dist/charde/charisol-group-badge-4.entry.js.map +0 -1
  442. package/dist/charde/charisol-icon-svg-destination.entry.js +0 -23
  443. package/dist/charde/charisol-icon-svg-destination.entry.js.map +0 -1
  444. package/dist/charde/charisol-icon-svg-pickup.entry.js +0 -23
  445. package/dist/charde/charisol-icon-svg-pickup.entry.js.map +0 -1
  446. package/dist/charde/charisol-icon-svg.entry.js +0 -23
  447. package/dist/charde/charisol-icon-svg.entry.js.map +0 -1
  448. package/dist/charde/charisol-input-element.entry.js +0 -27
  449. package/dist/charde/charisol-input-element.entry.js.map +0 -1
  450. package/dist/charde/charisol-input-field-wrapper.entry.js +0 -22
  451. package/dist/charde/charisol-input-field-wrapper.entry.js.map +0 -1
  452. package/dist/charde/charisol-input-helper.entry.js +0 -23
  453. package/dist/charde/charisol-input-helper.entry.js.map +0 -1
  454. package/dist/charde/charisol-input-icon.entry.js +0 -22
  455. package/dist/charde/charisol-input-icon.entry.js.map +0 -1
  456. package/dist/charde/charisol-input-label.entry.js +0 -24
  457. package/dist/charde/charisol-input-label.entry.js.map +0 -1
  458. package/dist/charde/charisol-input-states.entry.js +0 -22
  459. package/dist/charde/charisol-input-states.entry.js.map +0 -1
  460. package/dist/charde/charisol-input-wrapper.entry.js +0 -22
  461. package/dist/charde/charisol-input-wrapper.entry.js.map +0 -1
  462. package/dist/charde/charisol-input.entry.js +0 -22
  463. package/dist/charde/charisol-input.entry.js.map +0 -1
  464. package/dist/charde/charisol-modal-body.entry.js +0 -22
  465. package/dist/charde/charisol-modal-body.entry.js.map +0 -1
  466. package/dist/charde/charisol-modal-cancel-button.entry.js +0 -25
  467. package/dist/charde/charisol-modal-cancel-button.entry.js.map +0 -1
  468. package/dist/charde/charisol-modal-close-button.entry.js +0 -24
  469. package/dist/charde/charisol-modal-close-button.entry.js.map +0 -1
  470. package/dist/charde/charisol-modal-confirm-button.entry.js +0 -25
  471. package/dist/charde/charisol-modal-confirm-button.entry.js.map +0 -1
  472. package/dist/charde/charisol-modal-container.entry.js +0 -22
  473. package/dist/charde/charisol-modal-container.entry.js.map +0 -1
  474. package/dist/charde/charisol-modal-content.entry.js +0 -23
  475. package/dist/charde/charisol-modal-content.entry.js.map +0 -1
  476. package/dist/charde/charisol-modal-footer.entry.js +0 -22
  477. package/dist/charde/charisol-modal-footer.entry.js.map +0 -1
  478. package/dist/charde/charisol-modal-form.entry.js +0 -22
  479. package/dist/charde/charisol-modal-form.entry.js.map +0 -1
  480. package/dist/charde/charisol-modal-header.entry.js +0 -22
  481. package/dist/charde/charisol-modal-header.entry.js.map +0 -1
  482. package/dist/charde/charisol-modal-title.entry.js +0 -23
  483. package/dist/charde/charisol-modal-title.entry.js.map +0 -1
  484. package/dist/charde/charisol-modal.entry.js +0 -22
  485. package/dist/charde/charisol-modal.entry.js.map +0 -1
  486. package/dist/charde/charisol-muzingo-primary-button.entry.js +0 -22
  487. package/dist/charde/charisol-muzingo-primary-button.entry.js.map +0 -1
  488. package/dist/charde/charisol-muzingo.entry.js +0 -26
  489. package/dist/charde/charisol-muzingo.entry.js.map +0 -1
  490. package/dist/charde/charisol-notification-toast.entry.js +0 -22
  491. package/dist/charde/charisol-notification-toast.entry.js.map +0 -1
  492. package/dist/charde/charisol-payment-icon.entry.js +0 -23
  493. package/dist/charde/charisol-payment-icon.entry.js.map +0 -1
  494. package/dist/charde/charisol-success-icon-svg.entry.js +0 -23
  495. package/dist/charde/charisol-success-icon-svg.entry.js.map +0 -1
  496. package/dist/charde/charisol-success-input-icon.entry.js +0 -22
  497. package/dist/charde/charisol-success-input-icon.entry.js.map +0 -1
  498. package/dist/charde/charisol-success-input-wrapper.entry.js +0 -22
  499. package/dist/charde/charisol-success-input-wrapper.entry.js.map +0 -1
  500. package/dist/charde/charisol-success-input.entry.js +0 -27
  501. package/dist/charde/charisol-success-input.entry.js.map +0 -1
  502. package/dist/charde/charisol-success-label.entry.js +0 -24
  503. package/dist/charde/charisol-success-label.entry.js.map +0 -1
  504. package/dist/charde/charisol-success-message.entry.js +0 -23
  505. package/dist/charde/charisol-success-message.entry.js.map +0 -1
  506. package/dist/charde/charisol-success-state.entry.js +0 -22
  507. package/dist/charde/charisol-success-state.entry.js.map +0 -1
  508. package/dist/charde/charisol-toast-action-button.entry.js +0 -25
  509. package/dist/charde/charisol-toast-action-button.entry.js.map +0 -1
  510. package/dist/charde/charisol-toast-actions.entry.js +0 -22
  511. package/dist/charde/charisol-toast-actions.entry.js.map +0 -1
  512. package/dist/charde/charisol-toast-content.entry.js +0 -23
  513. package/dist/charde/charisol-toast-content.entry.js.map +0 -1
  514. package/dist/charde/charisol-toast-dismiss-button.entry.js +0 -25
  515. package/dist/charde/charisol-toast-dismiss-button.entry.js.map +0 -1
  516. package/dist/charde/charisol-toast-header.entry.js +0 -22
  517. package/dist/charde/charisol-toast-header.entry.js.map +0 -1
  518. package/dist/charde/charisol-toast-icon.entry.js +0 -23
  519. package/dist/charde/charisol-toast-icon.entry.js.map +0 -1
  520. package/dist/charde/charisol-toast-timestamp.entry.js +0 -23
  521. package/dist/charde/charisol-toast-timestamp.entry.js.map +0 -1
  522. package/dist/charde/charisol-toast-title-container.entry.js +0 -22
  523. package/dist/charde/charisol-toast-title-container.entry.js.map +0 -1
  524. package/dist/charde/charisol-toast-title.entry.js +0 -23
  525. package/dist/charde/charisol-toast-title.entry.js.map +0 -1
  526. package/dist/charde/index-C9gbKL_s.js +0 -4576
  527. package/dist/charde/index-C9gbKL_s.js.map +0 -1
  528. package/dist/charde/index.esm.js +0 -4906
  529. package/dist/charde/index.esm.js.map +0 -1
  530. package/dist/charde/my-component.entry.js +0 -34
  531. package/dist/charde/my-component.entry.js.map +0 -1
  532. package/dist/charde/utils-DhW431pq.js +0 -8
  533. package/dist/charde/utils-DhW431pq.js.map +0 -1
  534. package/loader/cdn.js +0 -1
  535. package/loader/index.cjs.js +0 -1
  536. package/loader/index.d.ts +0 -24
  537. package/loader/index.es2017.js +0 -1
  538. package/loader/index.js +0 -2
@@ -1,4906 +0,0 @@
1
- export { f as format } from './utils-DhW431pq.js';
2
- import * as fs from 'fs';
3
- import * as path from 'path';
4
-
5
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
-
7
- function getDefaultExportFromCjs (x) {
8
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
9
- }
10
-
11
- function getDefaultExportFromNamespaceIfPresent (n) {
12
- return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
13
- }
14
-
15
- function getDefaultExportFromNamespaceIfNotNamed (n) {
16
- return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
17
- }
18
-
19
- function getAugmentedNamespace(n) {
20
- if (n.__esModule) return n;
21
- var f = n.default;
22
- if (typeof f == "function") {
23
- var a = function a () {
24
- if (this instanceof a) {
25
- return Reflect.construct(f, arguments, this.constructor);
26
- }
27
- return f.apply(this, arguments);
28
- };
29
- a.prototype = f.prototype;
30
- } else a = {};
31
- Object.defineProperty(a, '__esModule', {value: true});
32
- Object.keys(n).forEach(function (k) {
33
- var d = Object.getOwnPropertyDescriptor(n, k);
34
- Object.defineProperty(a, k, d.get ? d : {
35
- enumerable: true,
36
- get: function () {
37
- return n[k];
38
- }
39
- });
40
- });
41
- return a;
42
- }
43
-
44
- /*! Axios v1.13.5 Copyright (c) 2026 Matt Zabriskie and contributors */
45
-
46
- var axios_1;
47
- var hasRequiredAxios;
48
-
49
- function requireAxios () {
50
- if (hasRequiredAxios) return axios_1;
51
- hasRequiredAxios = 1;
52
- 'use strict';
53
-
54
- /**
55
- * Create a bound version of a function with a specified `this` context
56
- *
57
- * @param {Function} fn - The function to bind
58
- * @param {*} thisArg - The value to be passed as the `this` parameter
59
- * @returns {Function} A new function that will call the original function with the specified `this` context
60
- */
61
- function bind(fn, thisArg) {
62
- return function wrap() {
63
- return fn.apply(thisArg, arguments);
64
- };
65
- }
66
-
67
- // utils is a library of generic helper functions non-specific to axios
68
-
69
- const { toString } = Object.prototype;
70
- const { getPrototypeOf } = Object;
71
- const { iterator, toStringTag } = Symbol;
72
-
73
- const kindOf = ((cache) => (thing) => {
74
- const str = toString.call(thing);
75
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
76
- })(Object.create(null));
77
-
78
- const kindOfTest = (type) => {
79
- type = type.toLowerCase();
80
- return (thing) => kindOf(thing) === type;
81
- };
82
-
83
- const typeOfTest = (type) => (thing) => typeof thing === type;
84
-
85
- /**
86
- * Determine if a value is a non-null object
87
- *
88
- * @param {Object} val The value to test
89
- *
90
- * @returns {boolean} True if value is an Array, otherwise false
91
- */
92
- const { isArray } = Array;
93
-
94
- /**
95
- * Determine if a value is undefined
96
- *
97
- * @param {*} val The value to test
98
- *
99
- * @returns {boolean} True if the value is undefined, otherwise false
100
- */
101
- const isUndefined = typeOfTest("undefined");
102
-
103
- /**
104
- * Determine if a value is a Buffer
105
- *
106
- * @param {*} val The value to test
107
- *
108
- * @returns {boolean} True if value is a Buffer, otherwise false
109
- */
110
- function isBuffer(val) {
111
- return (
112
- val !== null &&
113
- !isUndefined(val) &&
114
- val.constructor !== null &&
115
- !isUndefined(val.constructor) &&
116
- isFunction$1(val.constructor.isBuffer) &&
117
- val.constructor.isBuffer(val)
118
- );
119
- }
120
-
121
- /**
122
- * Determine if a value is an ArrayBuffer
123
- *
124
- * @param {*} val The value to test
125
- *
126
- * @returns {boolean} True if value is an ArrayBuffer, otherwise false
127
- */
128
- const isArrayBuffer = kindOfTest("ArrayBuffer");
129
-
130
- /**
131
- * Determine if a value is a view on an ArrayBuffer
132
- *
133
- * @param {*} val The value to test
134
- *
135
- * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
136
- */
137
- function isArrayBufferView(val) {
138
- let result;
139
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
140
- result = ArrayBuffer.isView(val);
141
- } else {
142
- result = val && val.buffer && isArrayBuffer(val.buffer);
143
- }
144
- return result;
145
- }
146
-
147
- /**
148
- * Determine if a value is a String
149
- *
150
- * @param {*} val The value to test
151
- *
152
- * @returns {boolean} True if value is a String, otherwise false
153
- */
154
- const isString = typeOfTest("string");
155
-
156
- /**
157
- * Determine if a value is a Function
158
- *
159
- * @param {*} val The value to test
160
- * @returns {boolean} True if value is a Function, otherwise false
161
- */
162
- const isFunction$1 = typeOfTest("function");
163
-
164
- /**
165
- * Determine if a value is a Number
166
- *
167
- * @param {*} val The value to test
168
- *
169
- * @returns {boolean} True if value is a Number, otherwise false
170
- */
171
- const isNumber = typeOfTest("number");
172
-
173
- /**
174
- * Determine if a value is an Object
175
- *
176
- * @param {*} thing The value to test
177
- *
178
- * @returns {boolean} True if value is an Object, otherwise false
179
- */
180
- const isObject = (thing) => thing !== null && typeof thing === "object";
181
-
182
- /**
183
- * Determine if a value is a Boolean
184
- *
185
- * @param {*} thing The value to test
186
- * @returns {boolean} True if value is a Boolean, otherwise false
187
- */
188
- const isBoolean = (thing) => thing === true || thing === false;
189
-
190
- /**
191
- * Determine if a value is a plain Object
192
- *
193
- * @param {*} val The value to test
194
- *
195
- * @returns {boolean} True if value is a plain Object, otherwise false
196
- */
197
- const isPlainObject = (val) => {
198
- if (kindOf(val) !== "object") {
199
- return false;
200
- }
201
-
202
- const prototype = getPrototypeOf(val);
203
- return (
204
- (prototype === null ||
205
- prototype === Object.prototype ||
206
- Object.getPrototypeOf(prototype) === null) &&
207
- !(toStringTag in val) &&
208
- !(iterator in val)
209
- );
210
- };
211
-
212
- /**
213
- * Determine if a value is an empty object (safely handles Buffers)
214
- *
215
- * @param {*} val The value to test
216
- *
217
- * @returns {boolean} True if value is an empty object, otherwise false
218
- */
219
- const isEmptyObject = (val) => {
220
- // Early return for non-objects or Buffers to prevent RangeError
221
- if (!isObject(val) || isBuffer(val)) {
222
- return false;
223
- }
224
-
225
- try {
226
- return (
227
- Object.keys(val).length === 0 &&
228
- Object.getPrototypeOf(val) === Object.prototype
229
- );
230
- } catch (e) {
231
- // Fallback for any other objects that might cause RangeError with Object.keys()
232
- return false;
233
- }
234
- };
235
-
236
- /**
237
- * Determine if a value is a Date
238
- *
239
- * @param {*} val The value to test
240
- *
241
- * @returns {boolean} True if value is a Date, otherwise false
242
- */
243
- const isDate = kindOfTest("Date");
244
-
245
- /**
246
- * Determine if a value is a File
247
- *
248
- * @param {*} val The value to test
249
- *
250
- * @returns {boolean} True if value is a File, otherwise false
251
- */
252
- const isFile = kindOfTest("File");
253
-
254
- /**
255
- * Determine if a value is a Blob
256
- *
257
- * @param {*} val The value to test
258
- *
259
- * @returns {boolean} True if value is a Blob, otherwise false
260
- */
261
- const isBlob = kindOfTest("Blob");
262
-
263
- /**
264
- * Determine if a value is a FileList
265
- *
266
- * @param {*} val The value to test
267
- *
268
- * @returns {boolean} True if value is a File, otherwise false
269
- */
270
- const isFileList = kindOfTest("FileList");
271
-
272
- /**
273
- * Determine if a value is a Stream
274
- *
275
- * @param {*} val The value to test
276
- *
277
- * @returns {boolean} True if value is a Stream, otherwise false
278
- */
279
- const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
280
-
281
- /**
282
- * Determine if a value is a FormData
283
- *
284
- * @param {*} thing The value to test
285
- *
286
- * @returns {boolean} True if value is an FormData, otherwise false
287
- */
288
- const isFormData = (thing) => {
289
- let kind;
290
- return (
291
- thing &&
292
- ((typeof FormData === "function" && thing instanceof FormData) ||
293
- (isFunction$1(thing.append) &&
294
- ((kind = kindOf(thing)) === "formdata" ||
295
- // detect form-data instance
296
- (kind === "object" &&
297
- isFunction$1(thing.toString) &&
298
- thing.toString() === "[object FormData]"))))
299
- );
300
- };
301
-
302
- /**
303
- * Determine if a value is a URLSearchParams object
304
- *
305
- * @param {*} val The value to test
306
- *
307
- * @returns {boolean} True if value is a URLSearchParams object, otherwise false
308
- */
309
- const isURLSearchParams = kindOfTest("URLSearchParams");
310
-
311
- const [isReadableStream, isRequest, isResponse, isHeaders] = [
312
- "ReadableStream",
313
- "Request",
314
- "Response",
315
- "Headers",
316
- ].map(kindOfTest);
317
-
318
- /**
319
- * Trim excess whitespace off the beginning and end of a string
320
- *
321
- * @param {String} str The String to trim
322
- *
323
- * @returns {String} The String freed of excess whitespace
324
- */
325
- const trim = (str) =>
326
- str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
327
-
328
- /**
329
- * Iterate over an Array or an Object invoking a function for each item.
330
- *
331
- * If `obj` is an Array callback will be called passing
332
- * the value, index, and complete array for each item.
333
- *
334
- * If 'obj' is an Object callback will be called passing
335
- * the value, key, and complete object for each property.
336
- *
337
- * @param {Object|Array<unknown>} obj The object to iterate
338
- * @param {Function} fn The callback to invoke for each item
339
- *
340
- * @param {Object} [options]
341
- * @param {Boolean} [options.allOwnKeys = false]
342
- * @returns {any}
343
- */
344
- function forEach(obj, fn, { allOwnKeys = false } = {}) {
345
- // Don't bother if no value provided
346
- if (obj === null || typeof obj === "undefined") {
347
- return;
348
- }
349
-
350
- let i;
351
- let l;
352
-
353
- // Force an array if not already something iterable
354
- if (typeof obj !== "object") {
355
- /*eslint no-param-reassign:0*/
356
- obj = [obj];
357
- }
358
-
359
- if (isArray(obj)) {
360
- // Iterate over array values
361
- for (i = 0, l = obj.length; i < l; i++) {
362
- fn.call(null, obj[i], i, obj);
363
- }
364
- } else {
365
- // Buffer check
366
- if (isBuffer(obj)) {
367
- return;
368
- }
369
-
370
- // Iterate over object keys
371
- const keys = allOwnKeys
372
- ? Object.getOwnPropertyNames(obj)
373
- : Object.keys(obj);
374
- const len = keys.length;
375
- let key;
376
-
377
- for (i = 0; i < len; i++) {
378
- key = keys[i];
379
- fn.call(null, obj[key], key, obj);
380
- }
381
- }
382
- }
383
-
384
- function findKey(obj, key) {
385
- if (isBuffer(obj)) {
386
- return null;
387
- }
388
-
389
- key = key.toLowerCase();
390
- const keys = Object.keys(obj);
391
- let i = keys.length;
392
- let _key;
393
- while (i-- > 0) {
394
- _key = keys[i];
395
- if (key === _key.toLowerCase()) {
396
- return _key;
397
- }
398
- }
399
- return null;
400
- }
401
-
402
- const _global = (() => {
403
- /*eslint no-undef:0*/
404
- if (typeof globalThis !== "undefined") return globalThis;
405
- return typeof self !== "undefined"
406
- ? self
407
- : typeof window !== "undefined"
408
- ? window
409
- : commonjsGlobal;
410
- })();
411
-
412
- const isContextDefined = (context) =>
413
- !isUndefined(context) && context !== _global;
414
-
415
- /**
416
- * Accepts varargs expecting each argument to be an object, then
417
- * immutably merges the properties of each object and returns result.
418
- *
419
- * When multiple objects contain the same key the later object in
420
- * the arguments list will take precedence.
421
- *
422
- * Example:
423
- *
424
- * ```js
425
- * const result = merge({foo: 123}, {foo: 456});
426
- * console.log(result.foo); // outputs 456
427
- * ```
428
- *
429
- * @param {Object} obj1 Object to merge
430
- *
431
- * @returns {Object} Result of all merge properties
432
- */
433
- function merge(/* obj1, obj2, obj3, ... */) {
434
- const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
435
- const result = {};
436
- const assignValue = (val, key) => {
437
- // Skip dangerous property names to prevent prototype pollution
438
- if (key === "__proto__" || key === "constructor" || key === "prototype") {
439
- return;
440
- }
441
-
442
- const targetKey = (caseless && findKey(result, key)) || key;
443
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
444
- result[targetKey] = merge(result[targetKey], val);
445
- } else if (isPlainObject(val)) {
446
- result[targetKey] = merge({}, val);
447
- } else if (isArray(val)) {
448
- result[targetKey] = val.slice();
449
- } else if (!skipUndefined || !isUndefined(val)) {
450
- result[targetKey] = val;
451
- }
452
- };
453
-
454
- for (let i = 0, l = arguments.length; i < l; i++) {
455
- arguments[i] && forEach(arguments[i], assignValue);
456
- }
457
- return result;
458
- }
459
-
460
- /**
461
- * Extends object a by mutably adding to it the properties of object b.
462
- *
463
- * @param {Object} a The object to be extended
464
- * @param {Object} b The object to copy properties from
465
- * @param {Object} thisArg The object to bind function to
466
- *
467
- * @param {Object} [options]
468
- * @param {Boolean} [options.allOwnKeys]
469
- * @returns {Object} The resulting value of object a
470
- */
471
- const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
472
- forEach(
473
- b,
474
- (val, key) => {
475
- if (thisArg && isFunction$1(val)) {
476
- Object.defineProperty(a, key, {
477
- value: bind(val, thisArg),
478
- writable: true,
479
- enumerable: true,
480
- configurable: true,
481
- });
482
- } else {
483
- Object.defineProperty(a, key, {
484
- value: val,
485
- writable: true,
486
- enumerable: true,
487
- configurable: true,
488
- });
489
- }
490
- },
491
- { allOwnKeys },
492
- );
493
- return a;
494
- };
495
-
496
- /**
497
- * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
498
- *
499
- * @param {string} content with BOM
500
- *
501
- * @returns {string} content value without BOM
502
- */
503
- const stripBOM = (content) => {
504
- if (content.charCodeAt(0) === 0xfeff) {
505
- content = content.slice(1);
506
- }
507
- return content;
508
- };
509
-
510
- /**
511
- * Inherit the prototype methods from one constructor into another
512
- * @param {function} constructor
513
- * @param {function} superConstructor
514
- * @param {object} [props]
515
- * @param {object} [descriptors]
516
- *
517
- * @returns {void}
518
- */
519
- const inherits = (constructor, superConstructor, props, descriptors) => {
520
- constructor.prototype = Object.create(
521
- superConstructor.prototype,
522
- descriptors,
523
- );
524
- Object.defineProperty(constructor.prototype, "constructor", {
525
- value: constructor,
526
- writable: true,
527
- enumerable: false,
528
- configurable: true,
529
- });
530
- Object.defineProperty(constructor, "super", {
531
- value: superConstructor.prototype,
532
- });
533
- props && Object.assign(constructor.prototype, props);
534
- };
535
-
536
- /**
537
- * Resolve object with deep prototype chain to a flat object
538
- * @param {Object} sourceObj source object
539
- * @param {Object} [destObj]
540
- * @param {Function|Boolean} [filter]
541
- * @param {Function} [propFilter]
542
- *
543
- * @returns {Object}
544
- */
545
- const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
546
- let props;
547
- let i;
548
- let prop;
549
- const merged = {};
550
-
551
- destObj = destObj || {};
552
- // eslint-disable-next-line no-eq-null,eqeqeq
553
- if (sourceObj == null) return destObj;
554
-
555
- do {
556
- props = Object.getOwnPropertyNames(sourceObj);
557
- i = props.length;
558
- while (i-- > 0) {
559
- prop = props[i];
560
- if (
561
- (!propFilter || propFilter(prop, sourceObj, destObj)) &&
562
- !merged[prop]
563
- ) {
564
- destObj[prop] = sourceObj[prop];
565
- merged[prop] = true;
566
- }
567
- }
568
- sourceObj = filter !== false && getPrototypeOf(sourceObj);
569
- } while (
570
- sourceObj &&
571
- (!filter || filter(sourceObj, destObj)) &&
572
- sourceObj !== Object.prototype
573
- );
574
-
575
- return destObj;
576
- };
577
-
578
- /**
579
- * Determines whether a string ends with the characters of a specified string
580
- *
581
- * @param {String} str
582
- * @param {String} searchString
583
- * @param {Number} [position= 0]
584
- *
585
- * @returns {boolean}
586
- */
587
- const endsWith = (str, searchString, position) => {
588
- str = String(str);
589
- if (position === undefined || position > str.length) {
590
- position = str.length;
591
- }
592
- position -= searchString.length;
593
- const lastIndex = str.indexOf(searchString, position);
594
- return lastIndex !== -1 && lastIndex === position;
595
- };
596
-
597
- /**
598
- * Returns new array from array like object or null if failed
599
- *
600
- * @param {*} [thing]
601
- *
602
- * @returns {?Array}
603
- */
604
- const toArray = (thing) => {
605
- if (!thing) return null;
606
- if (isArray(thing)) return thing;
607
- let i = thing.length;
608
- if (!isNumber(i)) return null;
609
- const arr = new Array(i);
610
- while (i-- > 0) {
611
- arr[i] = thing[i];
612
- }
613
- return arr;
614
- };
615
-
616
- /**
617
- * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
618
- * thing passed in is an instance of Uint8Array
619
- *
620
- * @param {TypedArray}
621
- *
622
- * @returns {Array}
623
- */
624
- // eslint-disable-next-line func-names
625
- const isTypedArray = ((TypedArray) => {
626
- // eslint-disable-next-line func-names
627
- return (thing) => {
628
- return TypedArray && thing instanceof TypedArray;
629
- };
630
- })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
631
-
632
- /**
633
- * For each entry in the object, call the function with the key and value.
634
- *
635
- * @param {Object<any, any>} obj - The object to iterate over.
636
- * @param {Function} fn - The function to call for each entry.
637
- *
638
- * @returns {void}
639
- */
640
- const forEachEntry = (obj, fn) => {
641
- const generator = obj && obj[iterator];
642
-
643
- const _iterator = generator.call(obj);
644
-
645
- let result;
646
-
647
- while ((result = _iterator.next()) && !result.done) {
648
- const pair = result.value;
649
- fn.call(obj, pair[0], pair[1]);
650
- }
651
- };
652
-
653
- /**
654
- * It takes a regular expression and a string, and returns an array of all the matches
655
- *
656
- * @param {string} regExp - The regular expression to match against.
657
- * @param {string} str - The string to search.
658
- *
659
- * @returns {Array<boolean>}
660
- */
661
- const matchAll = (regExp, str) => {
662
- let matches;
663
- const arr = [];
664
-
665
- while ((matches = regExp.exec(str)) !== null) {
666
- arr.push(matches);
667
- }
668
-
669
- return arr;
670
- };
671
-
672
- /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
673
- const isHTMLForm = kindOfTest("HTMLFormElement");
674
-
675
- const toCamelCase = (str) => {
676
- return str
677
- .toLowerCase()
678
- .replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
679
- return p1.toUpperCase() + p2;
680
- });
681
- };
682
-
683
- /* Creating a function that will check if an object has a property. */
684
- const hasOwnProperty = (
685
- ({ hasOwnProperty }) =>
686
- (obj, prop) =>
687
- hasOwnProperty.call(obj, prop)
688
- )(Object.prototype);
689
-
690
- /**
691
- * Determine if a value is a RegExp object
692
- *
693
- * @param {*} val The value to test
694
- *
695
- * @returns {boolean} True if value is a RegExp object, otherwise false
696
- */
697
- const isRegExp = kindOfTest("RegExp");
698
-
699
- const reduceDescriptors = (obj, reducer) => {
700
- const descriptors = Object.getOwnPropertyDescriptors(obj);
701
- const reducedDescriptors = {};
702
-
703
- forEach(descriptors, (descriptor, name) => {
704
- let ret;
705
- if ((ret = reducer(descriptor, name, obj)) !== false) {
706
- reducedDescriptors[name] = ret || descriptor;
707
- }
708
- });
709
-
710
- Object.defineProperties(obj, reducedDescriptors);
711
- };
712
-
713
- /**
714
- * Makes all methods read-only
715
- * @param {Object} obj
716
- */
717
-
718
- const freezeMethods = (obj) => {
719
- reduceDescriptors(obj, (descriptor, name) => {
720
- // skip restricted props in strict mode
721
- if (
722
- isFunction$1(obj) &&
723
- ["arguments", "caller", "callee"].indexOf(name) !== -1
724
- ) {
725
- return false;
726
- }
727
-
728
- const value = obj[name];
729
-
730
- if (!isFunction$1(value)) return;
731
-
732
- descriptor.enumerable = false;
733
-
734
- if ("writable" in descriptor) {
735
- descriptor.writable = false;
736
- return;
737
- }
738
-
739
- if (!descriptor.set) {
740
- descriptor.set = () => {
741
- throw Error("Can not rewrite read-only method '" + name + "'");
742
- };
743
- }
744
- });
745
- };
746
-
747
- const toObjectSet = (arrayOrString, delimiter) => {
748
- const obj = {};
749
-
750
- const define = (arr) => {
751
- arr.forEach((value) => {
752
- obj[value] = true;
753
- });
754
- };
755
-
756
- isArray(arrayOrString)
757
- ? define(arrayOrString)
758
- : define(String(arrayOrString).split(delimiter));
759
-
760
- return obj;
761
- };
762
-
763
- const noop = () => {};
764
-
765
- const toFiniteNumber = (value, defaultValue) => {
766
- return value != null && Number.isFinite((value = +value))
767
- ? value
768
- : defaultValue;
769
- };
770
-
771
- /**
772
- * If the thing is a FormData object, return true, otherwise return false.
773
- *
774
- * @param {unknown} thing - The thing to check.
775
- *
776
- * @returns {boolean}
777
- */
778
- function isSpecCompliantForm(thing) {
779
- return !!(
780
- thing &&
781
- isFunction$1(thing.append) &&
782
- thing[toStringTag] === "FormData" &&
783
- thing[iterator]
784
- );
785
- }
786
-
787
- const toJSONObject = (obj) => {
788
- const stack = new Array(10);
789
-
790
- const visit = (source, i) => {
791
- if (isObject(source)) {
792
- if (stack.indexOf(source) >= 0) {
793
- return;
794
- }
795
-
796
- //Buffer check
797
- if (isBuffer(source)) {
798
- return source;
799
- }
800
-
801
- if (!("toJSON" in source)) {
802
- stack[i] = source;
803
- const target = isArray(source) ? [] : {};
804
-
805
- forEach(source, (value, key) => {
806
- const reducedValue = visit(value, i + 1);
807
- !isUndefined(reducedValue) && (target[key] = reducedValue);
808
- });
809
-
810
- stack[i] = undefined;
811
-
812
- return target;
813
- }
814
- }
815
-
816
- return source;
817
- };
818
-
819
- return visit(obj, 0);
820
- };
821
-
822
- const isAsyncFn = kindOfTest("AsyncFunction");
823
-
824
- const isThenable = (thing) =>
825
- thing &&
826
- (isObject(thing) || isFunction$1(thing)) &&
827
- isFunction$1(thing.then) &&
828
- isFunction$1(thing.catch);
829
-
830
- // original code
831
- // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
832
-
833
- const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
834
- if (setImmediateSupported) {
835
- return setImmediate;
836
- }
837
-
838
- return postMessageSupported
839
- ? ((token, callbacks) => {
840
- _global.addEventListener(
841
- "message",
842
- ({ source, data }) => {
843
- if (source === _global && data === token) {
844
- callbacks.length && callbacks.shift()();
845
- }
846
- },
847
- false,
848
- );
849
-
850
- return (cb) => {
851
- callbacks.push(cb);
852
- _global.postMessage(token, "*");
853
- };
854
- })(`axios@${Math.random()}`, [])
855
- : (cb) => setTimeout(cb);
856
- })(typeof setImmediate === "function", isFunction$1(_global.postMessage));
857
-
858
- const asap =
859
- typeof queueMicrotask !== "undefined"
860
- ? queueMicrotask.bind(_global)
861
- : (typeof process !== "undefined" && process.nextTick) || _setImmediate;
862
-
863
- // *********************
864
-
865
- const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
866
-
867
- var utils$1 = {
868
- isArray,
869
- isArrayBuffer,
870
- isBuffer,
871
- isFormData,
872
- isArrayBufferView,
873
- isString,
874
- isNumber,
875
- isBoolean,
876
- isObject,
877
- isPlainObject,
878
- isEmptyObject,
879
- isReadableStream,
880
- isRequest,
881
- isResponse,
882
- isHeaders,
883
- isUndefined,
884
- isDate,
885
- isFile,
886
- isBlob,
887
- isRegExp,
888
- isFunction: isFunction$1,
889
- isStream,
890
- isURLSearchParams,
891
- isTypedArray,
892
- isFileList,
893
- forEach,
894
- merge,
895
- extend,
896
- trim,
897
- stripBOM,
898
- inherits,
899
- toFlatObject,
900
- kindOf,
901
- kindOfTest,
902
- endsWith,
903
- toArray,
904
- forEachEntry,
905
- matchAll,
906
- isHTMLForm,
907
- hasOwnProperty,
908
- hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
909
- reduceDescriptors,
910
- freezeMethods,
911
- toObjectSet,
912
- toCamelCase,
913
- noop,
914
- toFiniteNumber,
915
- findKey,
916
- global: _global,
917
- isContextDefined,
918
- isSpecCompliantForm,
919
- toJSONObject,
920
- isAsyncFn,
921
- isThenable,
922
- setImmediate: _setImmediate,
923
- asap,
924
- isIterable,
925
- };
926
-
927
- class AxiosError extends Error {
928
- static from(error, code, config, request, response, customProps) {
929
- const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
930
- axiosError.cause = error;
931
- axiosError.name = error.name;
932
- customProps && Object.assign(axiosError, customProps);
933
- return axiosError;
934
- }
935
-
936
- /**
937
- * Create an Error with the specified message, config, error code, request and response.
938
- *
939
- * @param {string} message The error message.
940
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
941
- * @param {Object} [config] The config.
942
- * @param {Object} [request] The request.
943
- * @param {Object} [response] The response.
944
- *
945
- * @returns {Error} The created error.
946
- */
947
- constructor(message, code, config, request, response) {
948
- super(message);
949
- this.name = 'AxiosError';
950
- this.isAxiosError = true;
951
- code && (this.code = code);
952
- config && (this.config = config);
953
- request && (this.request = request);
954
- if (response) {
955
- this.response = response;
956
- this.status = response.status;
957
- }
958
- }
959
-
960
- toJSON() {
961
- return {
962
- // Standard
963
- message: this.message,
964
- name: this.name,
965
- // Microsoft
966
- description: this.description,
967
- number: this.number,
968
- // Mozilla
969
- fileName: this.fileName,
970
- lineNumber: this.lineNumber,
971
- columnNumber: this.columnNumber,
972
- stack: this.stack,
973
- // Axios
974
- config: utils$1.toJSONObject(this.config),
975
- code: this.code,
976
- status: this.status,
977
- };
978
- }
979
- }
980
-
981
- // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
982
- AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
983
- AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
984
- AxiosError.ECONNABORTED = 'ECONNABORTED';
985
- AxiosError.ETIMEDOUT = 'ETIMEDOUT';
986
- AxiosError.ERR_NETWORK = 'ERR_NETWORK';
987
- AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
988
- AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
989
- AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
990
- AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
991
- AxiosError.ERR_CANCELED = 'ERR_CANCELED';
992
- AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
993
- AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
994
-
995
- var AxiosError$1 = AxiosError;
996
-
997
- // eslint-disable-next-line strict
998
- var httpAdapter = null;
999
-
1000
- /**
1001
- * Determines if the given thing is a array or js object.
1002
- *
1003
- * @param {string} thing - The object or array to be visited.
1004
- *
1005
- * @returns {boolean}
1006
- */
1007
- function isVisitable(thing) {
1008
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
1009
- }
1010
-
1011
- /**
1012
- * It removes the brackets from the end of a string
1013
- *
1014
- * @param {string} key - The key of the parameter.
1015
- *
1016
- * @returns {string} the key without the brackets.
1017
- */
1018
- function removeBrackets(key) {
1019
- return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
1020
- }
1021
-
1022
- /**
1023
- * It takes a path, a key, and a boolean, and returns a string
1024
- *
1025
- * @param {string} path - The path to the current key.
1026
- * @param {string} key - The key of the current object being iterated over.
1027
- * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
1028
- *
1029
- * @returns {string} The path to the current key.
1030
- */
1031
- function renderKey(path, key, dots) {
1032
- if (!path) return key;
1033
- return path.concat(key).map(function each(token, i) {
1034
- // eslint-disable-next-line no-param-reassign
1035
- token = removeBrackets(token);
1036
- return !dots && i ? '[' + token + ']' : token;
1037
- }).join(dots ? '.' : '');
1038
- }
1039
-
1040
- /**
1041
- * If the array is an array and none of its elements are visitable, then it's a flat array.
1042
- *
1043
- * @param {Array<any>} arr - The array to check
1044
- *
1045
- * @returns {boolean}
1046
- */
1047
- function isFlatArray(arr) {
1048
- return utils$1.isArray(arr) && !arr.some(isVisitable);
1049
- }
1050
-
1051
- const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
1052
- return /^is[A-Z]/.test(prop);
1053
- });
1054
-
1055
- /**
1056
- * Convert a data object to FormData
1057
- *
1058
- * @param {Object} obj
1059
- * @param {?Object} [formData]
1060
- * @param {?Object} [options]
1061
- * @param {Function} [options.visitor]
1062
- * @param {Boolean} [options.metaTokens = true]
1063
- * @param {Boolean} [options.dots = false]
1064
- * @param {?Boolean} [options.indexes = false]
1065
- *
1066
- * @returns {Object}
1067
- **/
1068
-
1069
- /**
1070
- * It converts an object into a FormData object
1071
- *
1072
- * @param {Object<any, any>} obj - The object to convert to form data.
1073
- * @param {string} formData - The FormData object to append to.
1074
- * @param {Object<string, any>} options
1075
- *
1076
- * @returns
1077
- */
1078
- function toFormData(obj, formData, options) {
1079
- if (!utils$1.isObject(obj)) {
1080
- throw new TypeError('target must be an object');
1081
- }
1082
-
1083
- // eslint-disable-next-line no-param-reassign
1084
- formData = formData || new (FormData)();
1085
-
1086
- // eslint-disable-next-line no-param-reassign
1087
- options = utils$1.toFlatObject(options, {
1088
- metaTokens: true,
1089
- dots: false,
1090
- indexes: false
1091
- }, false, function defined(option, source) {
1092
- // eslint-disable-next-line no-eq-null,eqeqeq
1093
- return !utils$1.isUndefined(source[option]);
1094
- });
1095
-
1096
- const metaTokens = options.metaTokens;
1097
- // eslint-disable-next-line no-use-before-define
1098
- const visitor = options.visitor || defaultVisitor;
1099
- const dots = options.dots;
1100
- const indexes = options.indexes;
1101
- const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
1102
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
1103
-
1104
- if (!utils$1.isFunction(visitor)) {
1105
- throw new TypeError('visitor must be a function');
1106
- }
1107
-
1108
- function convertValue(value) {
1109
- if (value === null) return '';
1110
-
1111
- if (utils$1.isDate(value)) {
1112
- return value.toISOString();
1113
- }
1114
-
1115
- if (utils$1.isBoolean(value)) {
1116
- return value.toString();
1117
- }
1118
-
1119
- if (!useBlob && utils$1.isBlob(value)) {
1120
- throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
1121
- }
1122
-
1123
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
1124
- return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
1125
- }
1126
-
1127
- return value;
1128
- }
1129
-
1130
- /**
1131
- * Default visitor.
1132
- *
1133
- * @param {*} value
1134
- * @param {String|Number} key
1135
- * @param {Array<String|Number>} path
1136
- * @this {FormData}
1137
- *
1138
- * @returns {boolean} return true to visit the each prop of the value recursively
1139
- */
1140
- function defaultVisitor(value, key, path) {
1141
- let arr = value;
1142
-
1143
- if (value && !path && typeof value === 'object') {
1144
- if (utils$1.endsWith(key, '{}')) {
1145
- // eslint-disable-next-line no-param-reassign
1146
- key = metaTokens ? key : key.slice(0, -2);
1147
- // eslint-disable-next-line no-param-reassign
1148
- value = JSON.stringify(value);
1149
- } else if (
1150
- (utils$1.isArray(value) && isFlatArray(value)) ||
1151
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
1152
- )) {
1153
- // eslint-disable-next-line no-param-reassign
1154
- key = removeBrackets(key);
1155
-
1156
- arr.forEach(function each(el, index) {
1157
- !(utils$1.isUndefined(el) || el === null) && formData.append(
1158
- // eslint-disable-next-line no-nested-ternary
1159
- indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
1160
- convertValue(el)
1161
- );
1162
- });
1163
- return false;
1164
- }
1165
- }
1166
-
1167
- if (isVisitable(value)) {
1168
- return true;
1169
- }
1170
-
1171
- formData.append(renderKey(path, key, dots), convertValue(value));
1172
-
1173
- return false;
1174
- }
1175
-
1176
- const stack = [];
1177
-
1178
- const exposedHelpers = Object.assign(predicates, {
1179
- defaultVisitor,
1180
- convertValue,
1181
- isVisitable
1182
- });
1183
-
1184
- function build(value, path) {
1185
- if (utils$1.isUndefined(value)) return;
1186
-
1187
- if (stack.indexOf(value) !== -1) {
1188
- throw Error('Circular reference detected in ' + path.join('.'));
1189
- }
1190
-
1191
- stack.push(value);
1192
-
1193
- utils$1.forEach(value, function each(el, key) {
1194
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
1195
- formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
1196
- );
1197
-
1198
- if (result === true) {
1199
- build(el, path ? path.concat(key) : [key]);
1200
- }
1201
- });
1202
-
1203
- stack.pop();
1204
- }
1205
-
1206
- if (!utils$1.isObject(obj)) {
1207
- throw new TypeError('data must be an object');
1208
- }
1209
-
1210
- build(obj);
1211
-
1212
- return formData;
1213
- }
1214
-
1215
- /**
1216
- * It encodes a string by replacing all characters that are not in the unreserved set with
1217
- * their percent-encoded equivalents
1218
- *
1219
- * @param {string} str - The string to encode.
1220
- *
1221
- * @returns {string} The encoded string.
1222
- */
1223
- function encode$1(str) {
1224
- const charMap = {
1225
- '!': '%21',
1226
- "'": '%27',
1227
- '(': '%28',
1228
- ')': '%29',
1229
- '~': '%7E',
1230
- '%20': '+',
1231
- '%00': '\x00'
1232
- };
1233
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
1234
- return charMap[match];
1235
- });
1236
- }
1237
-
1238
- /**
1239
- * It takes a params object and converts it to a FormData object
1240
- *
1241
- * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
1242
- * @param {Object<string, any>} options - The options object passed to the Axios constructor.
1243
- *
1244
- * @returns {void}
1245
- */
1246
- function AxiosURLSearchParams(params, options) {
1247
- this._pairs = [];
1248
-
1249
- params && toFormData(params, this, options);
1250
- }
1251
-
1252
- const prototype = AxiosURLSearchParams.prototype;
1253
-
1254
- prototype.append = function append(name, value) {
1255
- this._pairs.push([name, value]);
1256
- };
1257
-
1258
- prototype.toString = function toString(encoder) {
1259
- const _encode = encoder ? function(value) {
1260
- return encoder.call(this, value, encode$1);
1261
- } : encode$1;
1262
-
1263
- return this._pairs.map(function each(pair) {
1264
- return _encode(pair[0]) + '=' + _encode(pair[1]);
1265
- }, '').join('&');
1266
- };
1267
-
1268
- /**
1269
- * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
1270
- * URI encoded counterparts
1271
- *
1272
- * @param {string} val The value to be encoded.
1273
- *
1274
- * @returns {string} The encoded value.
1275
- */
1276
- function encode(val) {
1277
- return encodeURIComponent(val).
1278
- replace(/%3A/gi, ':').
1279
- replace(/%24/g, '$').
1280
- replace(/%2C/gi, ',').
1281
- replace(/%20/g, '+');
1282
- }
1283
-
1284
- /**
1285
- * Build a URL by appending params to the end
1286
- *
1287
- * @param {string} url The base of the url (e.g., http://www.google.com)
1288
- * @param {object} [params] The params to be appended
1289
- * @param {?(object|Function)} options
1290
- *
1291
- * @returns {string} The formatted url
1292
- */
1293
- function buildURL(url, params, options) {
1294
- if (!params) {
1295
- return url;
1296
- }
1297
-
1298
- const _encode = options && options.encode || encode;
1299
-
1300
- const _options = utils$1.isFunction(options) ? {
1301
- serialize: options
1302
- } : options;
1303
-
1304
- const serializeFn = _options && _options.serialize;
1305
-
1306
- let serializedParams;
1307
-
1308
- if (serializeFn) {
1309
- serializedParams = serializeFn(params, _options);
1310
- } else {
1311
- serializedParams = utils$1.isURLSearchParams(params) ?
1312
- params.toString() :
1313
- new AxiosURLSearchParams(params, _options).toString(_encode);
1314
- }
1315
-
1316
- if (serializedParams) {
1317
- const hashmarkIndex = url.indexOf("#");
1318
-
1319
- if (hashmarkIndex !== -1) {
1320
- url = url.slice(0, hashmarkIndex);
1321
- }
1322
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1323
- }
1324
-
1325
- return url;
1326
- }
1327
-
1328
- class InterceptorManager {
1329
- constructor() {
1330
- this.handlers = [];
1331
- }
1332
-
1333
- /**
1334
- * Add a new interceptor to the stack
1335
- *
1336
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
1337
- * @param {Function} rejected The function to handle `reject` for a `Promise`
1338
- * @param {Object} options The options for the interceptor, synchronous and runWhen
1339
- *
1340
- * @return {Number} An ID used to remove interceptor later
1341
- */
1342
- use(fulfilled, rejected, options) {
1343
- this.handlers.push({
1344
- fulfilled,
1345
- rejected,
1346
- synchronous: options ? options.synchronous : false,
1347
- runWhen: options ? options.runWhen : null
1348
- });
1349
- return this.handlers.length - 1;
1350
- }
1351
-
1352
- /**
1353
- * Remove an interceptor from the stack
1354
- *
1355
- * @param {Number} id The ID that was returned by `use`
1356
- *
1357
- * @returns {void}
1358
- */
1359
- eject(id) {
1360
- if (this.handlers[id]) {
1361
- this.handlers[id] = null;
1362
- }
1363
- }
1364
-
1365
- /**
1366
- * Clear all interceptors from the stack
1367
- *
1368
- * @returns {void}
1369
- */
1370
- clear() {
1371
- if (this.handlers) {
1372
- this.handlers = [];
1373
- }
1374
- }
1375
-
1376
- /**
1377
- * Iterate over all the registered interceptors
1378
- *
1379
- * This method is particularly useful for skipping over any
1380
- * interceptors that may have become `null` calling `eject`.
1381
- *
1382
- * @param {Function} fn The function to call for each interceptor
1383
- *
1384
- * @returns {void}
1385
- */
1386
- forEach(fn) {
1387
- utils$1.forEach(this.handlers, function forEachHandler(h) {
1388
- if (h !== null) {
1389
- fn(h);
1390
- }
1391
- });
1392
- }
1393
- }
1394
-
1395
- var InterceptorManager$1 = InterceptorManager;
1396
-
1397
- var transitionalDefaults = {
1398
- silentJSONParsing: true,
1399
- forcedJSONParsing: true,
1400
- clarifyTimeoutError: false,
1401
- legacyInterceptorReqResOrdering: true
1402
- };
1403
-
1404
- var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
1405
-
1406
- var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
1407
-
1408
- var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
1409
-
1410
- var platform$1 = {
1411
- isBrowser: true,
1412
- classes: {
1413
- URLSearchParams: URLSearchParams$1,
1414
- FormData: FormData$1,
1415
- Blob: Blob$1
1416
- },
1417
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
1418
- };
1419
-
1420
- const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
1421
-
1422
- const _navigator = typeof navigator === 'object' && navigator || undefined;
1423
-
1424
- /**
1425
- * Determine if we're running in a standard browser environment
1426
- *
1427
- * This allows axios to run in a web worker, and react-native.
1428
- * Both environments support XMLHttpRequest, but not fully standard globals.
1429
- *
1430
- * web workers:
1431
- * typeof window -> undefined
1432
- * typeof document -> undefined
1433
- *
1434
- * react-native:
1435
- * navigator.product -> 'ReactNative'
1436
- * nativescript
1437
- * navigator.product -> 'NativeScript' or 'NS'
1438
- *
1439
- * @returns {boolean}
1440
- */
1441
- const hasStandardBrowserEnv = hasBrowserEnv &&
1442
- (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
1443
-
1444
- /**
1445
- * Determine if we're running in a standard browser webWorker environment
1446
- *
1447
- * Although the `isStandardBrowserEnv` method indicates that
1448
- * `allows axios to run in a web worker`, the WebWorker will still be
1449
- * filtered out due to its judgment standard
1450
- * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
1451
- * This leads to a problem when axios post `FormData` in webWorker
1452
- */
1453
- const hasStandardBrowserWebWorkerEnv = (() => {
1454
- return (
1455
- typeof WorkerGlobalScope !== 'undefined' &&
1456
- // eslint-disable-next-line no-undef
1457
- self instanceof WorkerGlobalScope &&
1458
- typeof self.importScripts === 'function'
1459
- );
1460
- })();
1461
-
1462
- const origin = hasBrowserEnv && window.location.href || 'http://localhost';
1463
-
1464
- var utils = /*#__PURE__*/Object.freeze({
1465
- __proto__: null,
1466
- hasBrowserEnv: hasBrowserEnv,
1467
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1468
- hasStandardBrowserEnv: hasStandardBrowserEnv,
1469
- navigator: _navigator,
1470
- origin: origin
1471
- });
1472
-
1473
- var platform = {
1474
- ...utils,
1475
- ...platform$1
1476
- };
1477
-
1478
- function toURLEncodedForm(data, options) {
1479
- return toFormData(data, new platform.classes.URLSearchParams(), {
1480
- visitor: function(value, key, path, helpers) {
1481
- if (platform.isNode && utils$1.isBuffer(value)) {
1482
- this.append(key, value.toString('base64'));
1483
- return false;
1484
- }
1485
-
1486
- return helpers.defaultVisitor.apply(this, arguments);
1487
- },
1488
- ...options
1489
- });
1490
- }
1491
-
1492
- /**
1493
- * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
1494
- *
1495
- * @param {string} name - The name of the property to get.
1496
- *
1497
- * @returns An array of strings.
1498
- */
1499
- function parsePropPath(name) {
1500
- // foo[x][y][z]
1501
- // foo.x.y.z
1502
- // foo-x-y-z
1503
- // foo x y z
1504
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
1505
- return match[0] === '[]' ? '' : match[1] || match[0];
1506
- });
1507
- }
1508
-
1509
- /**
1510
- * Convert an array to an object.
1511
- *
1512
- * @param {Array<any>} arr - The array to convert to an object.
1513
- *
1514
- * @returns An object with the same keys and values as the array.
1515
- */
1516
- function arrayToObject(arr) {
1517
- const obj = {};
1518
- const keys = Object.keys(arr);
1519
- let i;
1520
- const len = keys.length;
1521
- let key;
1522
- for (i = 0; i < len; i++) {
1523
- key = keys[i];
1524
- obj[key] = arr[key];
1525
- }
1526
- return obj;
1527
- }
1528
-
1529
- /**
1530
- * It takes a FormData object and returns a JavaScript object
1531
- *
1532
- * @param {string} formData The FormData object to convert to JSON.
1533
- *
1534
- * @returns {Object<string, any> | null} The converted object.
1535
- */
1536
- function formDataToJSON(formData) {
1537
- function buildPath(path, value, target, index) {
1538
- let name = path[index++];
1539
-
1540
- if (name === '__proto__') return true;
1541
-
1542
- const isNumericKey = Number.isFinite(+name);
1543
- const isLast = index >= path.length;
1544
- name = !name && utils$1.isArray(target) ? target.length : name;
1545
-
1546
- if (isLast) {
1547
- if (utils$1.hasOwnProp(target, name)) {
1548
- target[name] = [target[name], value];
1549
- } else {
1550
- target[name] = value;
1551
- }
1552
-
1553
- return !isNumericKey;
1554
- }
1555
-
1556
- if (!target[name] || !utils$1.isObject(target[name])) {
1557
- target[name] = [];
1558
- }
1559
-
1560
- const result = buildPath(path, value, target[name], index);
1561
-
1562
- if (result && utils$1.isArray(target[name])) {
1563
- target[name] = arrayToObject(target[name]);
1564
- }
1565
-
1566
- return !isNumericKey;
1567
- }
1568
-
1569
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
1570
- const obj = {};
1571
-
1572
- utils$1.forEachEntry(formData, (name, value) => {
1573
- buildPath(parsePropPath(name), value, obj, 0);
1574
- });
1575
-
1576
- return obj;
1577
- }
1578
-
1579
- return null;
1580
- }
1581
-
1582
- /**
1583
- * It takes a string, tries to parse it, and if it fails, it returns the stringified version
1584
- * of the input
1585
- *
1586
- * @param {any} rawValue - The value to be stringified.
1587
- * @param {Function} parser - A function that parses a string into a JavaScript object.
1588
- * @param {Function} encoder - A function that takes a value and returns a string.
1589
- *
1590
- * @returns {string} A stringified version of the rawValue.
1591
- */
1592
- function stringifySafely(rawValue, parser, encoder) {
1593
- if (utils$1.isString(rawValue)) {
1594
- try {
1595
- (parser || JSON.parse)(rawValue);
1596
- return utils$1.trim(rawValue);
1597
- } catch (e) {
1598
- if (e.name !== 'SyntaxError') {
1599
- throw e;
1600
- }
1601
- }
1602
- }
1603
-
1604
- return (encoder || JSON.stringify)(rawValue);
1605
- }
1606
-
1607
- const defaults = {
1608
-
1609
- transitional: transitionalDefaults,
1610
-
1611
- adapter: ['xhr', 'http', 'fetch'],
1612
-
1613
- transformRequest: [function transformRequest(data, headers) {
1614
- const contentType = headers.getContentType() || '';
1615
- const hasJSONContentType = contentType.indexOf('application/json') > -1;
1616
- const isObjectPayload = utils$1.isObject(data);
1617
-
1618
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
1619
- data = new FormData(data);
1620
- }
1621
-
1622
- const isFormData = utils$1.isFormData(data);
1623
-
1624
- if (isFormData) {
1625
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
1626
- }
1627
-
1628
- if (utils$1.isArrayBuffer(data) ||
1629
- utils$1.isBuffer(data) ||
1630
- utils$1.isStream(data) ||
1631
- utils$1.isFile(data) ||
1632
- utils$1.isBlob(data) ||
1633
- utils$1.isReadableStream(data)
1634
- ) {
1635
- return data;
1636
- }
1637
- if (utils$1.isArrayBufferView(data)) {
1638
- return data.buffer;
1639
- }
1640
- if (utils$1.isURLSearchParams(data)) {
1641
- headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
1642
- return data.toString();
1643
- }
1644
-
1645
- let isFileList;
1646
-
1647
- if (isObjectPayload) {
1648
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
1649
- return toURLEncodedForm(data, this.formSerializer).toString();
1650
- }
1651
-
1652
- if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
1653
- const _FormData = this.env && this.env.FormData;
1654
-
1655
- return toFormData(
1656
- isFileList ? {'files[]': data} : data,
1657
- _FormData && new _FormData(),
1658
- this.formSerializer
1659
- );
1660
- }
1661
- }
1662
-
1663
- if (isObjectPayload || hasJSONContentType ) {
1664
- headers.setContentType('application/json', false);
1665
- return stringifySafely(data);
1666
- }
1667
-
1668
- return data;
1669
- }],
1670
-
1671
- transformResponse: [function transformResponse(data) {
1672
- const transitional = this.transitional || defaults.transitional;
1673
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
1674
- const JSONRequested = this.responseType === 'json';
1675
-
1676
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
1677
- return data;
1678
- }
1679
-
1680
- if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
1681
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
1682
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
1683
-
1684
- try {
1685
- return JSON.parse(data, this.parseReviver);
1686
- } catch (e) {
1687
- if (strictJSONParsing) {
1688
- if (e.name === 'SyntaxError') {
1689
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
1690
- }
1691
- throw e;
1692
- }
1693
- }
1694
- }
1695
-
1696
- return data;
1697
- }],
1698
-
1699
- /**
1700
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
1701
- * timeout is not created.
1702
- */
1703
- timeout: 0,
1704
-
1705
- xsrfCookieName: 'XSRF-TOKEN',
1706
- xsrfHeaderName: 'X-XSRF-TOKEN',
1707
-
1708
- maxContentLength: -1,
1709
- maxBodyLength: -1,
1710
-
1711
- env: {
1712
- FormData: platform.classes.FormData,
1713
- Blob: platform.classes.Blob
1714
- },
1715
-
1716
- validateStatus: function validateStatus(status) {
1717
- return status >= 200 && status < 300;
1718
- },
1719
-
1720
- headers: {
1721
- common: {
1722
- 'Accept': 'application/json, text/plain, */*',
1723
- 'Content-Type': undefined
1724
- }
1725
- }
1726
- };
1727
-
1728
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
1729
- defaults.headers[method] = {};
1730
- });
1731
-
1732
- var defaults$1 = defaults;
1733
-
1734
- // RawAxiosHeaders whose duplicates are ignored by node
1735
- // c.f. https://nodejs.org/api/http.html#http_message_headers
1736
- const ignoreDuplicateOf = utils$1.toObjectSet([
1737
- 'age', 'authorization', 'content-length', 'content-type', 'etag',
1738
- 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
1739
- 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
1740
- 'referer', 'retry-after', 'user-agent'
1741
- ]);
1742
-
1743
- /**
1744
- * Parse headers into an object
1745
- *
1746
- * ```
1747
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
1748
- * Content-Type: application/json
1749
- * Connection: keep-alive
1750
- * Transfer-Encoding: chunked
1751
- * ```
1752
- *
1753
- * @param {String} rawHeaders Headers needing to be parsed
1754
- *
1755
- * @returns {Object} Headers parsed into an object
1756
- */
1757
- var parseHeaders = rawHeaders => {
1758
- const parsed = {};
1759
- let key;
1760
- let val;
1761
- let i;
1762
-
1763
- rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
1764
- i = line.indexOf(':');
1765
- key = line.substring(0, i).trim().toLowerCase();
1766
- val = line.substring(i + 1).trim();
1767
-
1768
- if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
1769
- return;
1770
- }
1771
-
1772
- if (key === 'set-cookie') {
1773
- if (parsed[key]) {
1774
- parsed[key].push(val);
1775
- } else {
1776
- parsed[key] = [val];
1777
- }
1778
- } else {
1779
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1780
- }
1781
- });
1782
-
1783
- return parsed;
1784
- };
1785
-
1786
- const $internals = Symbol('internals');
1787
-
1788
- function normalizeHeader(header) {
1789
- return header && String(header).trim().toLowerCase();
1790
- }
1791
-
1792
- function normalizeValue(value) {
1793
- if (value === false || value == null) {
1794
- return value;
1795
- }
1796
-
1797
- return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
1798
- }
1799
-
1800
- function parseTokens(str) {
1801
- const tokens = Object.create(null);
1802
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1803
- let match;
1804
-
1805
- while ((match = tokensRE.exec(str))) {
1806
- tokens[match[1]] = match[2];
1807
- }
1808
-
1809
- return tokens;
1810
- }
1811
-
1812
- const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1813
-
1814
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1815
- if (utils$1.isFunction(filter)) {
1816
- return filter.call(this, value, header);
1817
- }
1818
-
1819
- if (isHeaderNameFilter) {
1820
- value = header;
1821
- }
1822
-
1823
- if (!utils$1.isString(value)) return;
1824
-
1825
- if (utils$1.isString(filter)) {
1826
- return value.indexOf(filter) !== -1;
1827
- }
1828
-
1829
- if (utils$1.isRegExp(filter)) {
1830
- return filter.test(value);
1831
- }
1832
- }
1833
-
1834
- function formatHeader(header) {
1835
- return header.trim()
1836
- .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1837
- return char.toUpperCase() + str;
1838
- });
1839
- }
1840
-
1841
- function buildAccessors(obj, header) {
1842
- const accessorName = utils$1.toCamelCase(' ' + header);
1843
-
1844
- ['get', 'set', 'has'].forEach(methodName => {
1845
- Object.defineProperty(obj, methodName + accessorName, {
1846
- value: function(arg1, arg2, arg3) {
1847
- return this[methodName].call(this, header, arg1, arg2, arg3);
1848
- },
1849
- configurable: true
1850
- });
1851
- });
1852
- }
1853
-
1854
- class AxiosHeaders {
1855
- constructor(headers) {
1856
- headers && this.set(headers);
1857
- }
1858
-
1859
- set(header, valueOrRewrite, rewrite) {
1860
- const self = this;
1861
-
1862
- function setHeader(_value, _header, _rewrite) {
1863
- const lHeader = normalizeHeader(_header);
1864
-
1865
- if (!lHeader) {
1866
- throw new Error('header name must be a non-empty string');
1867
- }
1868
-
1869
- const key = utils$1.findKey(self, lHeader);
1870
-
1871
- if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
1872
- self[key || _header] = normalizeValue(_value);
1873
- }
1874
- }
1875
-
1876
- const setHeaders = (headers, _rewrite) =>
1877
- utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1878
-
1879
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
1880
- setHeaders(header, valueOrRewrite);
1881
- } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1882
- setHeaders(parseHeaders(header), valueOrRewrite);
1883
- } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
1884
- let obj = {}, dest, key;
1885
- for (const entry of header) {
1886
- if (!utils$1.isArray(entry)) {
1887
- throw TypeError('Object iterator must return a key-value pair');
1888
- }
1889
-
1890
- obj[key = entry[0]] = (dest = obj[key]) ?
1891
- (utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
1892
- }
1893
-
1894
- setHeaders(obj, valueOrRewrite);
1895
- } else {
1896
- header != null && setHeader(valueOrRewrite, header, rewrite);
1897
- }
1898
-
1899
- return this;
1900
- }
1901
-
1902
- get(header, parser) {
1903
- header = normalizeHeader(header);
1904
-
1905
- if (header) {
1906
- const key = utils$1.findKey(this, header);
1907
-
1908
- if (key) {
1909
- const value = this[key];
1910
-
1911
- if (!parser) {
1912
- return value;
1913
- }
1914
-
1915
- if (parser === true) {
1916
- return parseTokens(value);
1917
- }
1918
-
1919
- if (utils$1.isFunction(parser)) {
1920
- return parser.call(this, value, key);
1921
- }
1922
-
1923
- if (utils$1.isRegExp(parser)) {
1924
- return parser.exec(value);
1925
- }
1926
-
1927
- throw new TypeError('parser must be boolean|regexp|function');
1928
- }
1929
- }
1930
- }
1931
-
1932
- has(header, matcher) {
1933
- header = normalizeHeader(header);
1934
-
1935
- if (header) {
1936
- const key = utils$1.findKey(this, header);
1937
-
1938
- return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1939
- }
1940
-
1941
- return false;
1942
- }
1943
-
1944
- delete(header, matcher) {
1945
- const self = this;
1946
- let deleted = false;
1947
-
1948
- function deleteHeader(_header) {
1949
- _header = normalizeHeader(_header);
1950
-
1951
- if (_header) {
1952
- const key = utils$1.findKey(self, _header);
1953
-
1954
- if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
1955
- delete self[key];
1956
-
1957
- deleted = true;
1958
- }
1959
- }
1960
- }
1961
-
1962
- if (utils$1.isArray(header)) {
1963
- header.forEach(deleteHeader);
1964
- } else {
1965
- deleteHeader(header);
1966
- }
1967
-
1968
- return deleted;
1969
- }
1970
-
1971
- clear(matcher) {
1972
- const keys = Object.keys(this);
1973
- let i = keys.length;
1974
- let deleted = false;
1975
-
1976
- while (i--) {
1977
- const key = keys[i];
1978
- if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1979
- delete this[key];
1980
- deleted = true;
1981
- }
1982
- }
1983
-
1984
- return deleted;
1985
- }
1986
-
1987
- normalize(format) {
1988
- const self = this;
1989
- const headers = {};
1990
-
1991
- utils$1.forEach(this, (value, header) => {
1992
- const key = utils$1.findKey(headers, header);
1993
-
1994
- if (key) {
1995
- self[key] = normalizeValue(value);
1996
- delete self[header];
1997
- return;
1998
- }
1999
-
2000
- const normalized = format ? formatHeader(header) : String(header).trim();
2001
-
2002
- if (normalized !== header) {
2003
- delete self[header];
2004
- }
2005
-
2006
- self[normalized] = normalizeValue(value);
2007
-
2008
- headers[normalized] = true;
2009
- });
2010
-
2011
- return this;
2012
- }
2013
-
2014
- concat(...targets) {
2015
- return this.constructor.concat(this, ...targets);
2016
- }
2017
-
2018
- toJSON(asStrings) {
2019
- const obj = Object.create(null);
2020
-
2021
- utils$1.forEach(this, (value, header) => {
2022
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
2023
- });
2024
-
2025
- return obj;
2026
- }
2027
-
2028
- [Symbol.iterator]() {
2029
- return Object.entries(this.toJSON())[Symbol.iterator]();
2030
- }
2031
-
2032
- toString() {
2033
- return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
2034
- }
2035
-
2036
- getSetCookie() {
2037
- return this.get("set-cookie") || [];
2038
- }
2039
-
2040
- get [Symbol.toStringTag]() {
2041
- return 'AxiosHeaders';
2042
- }
2043
-
2044
- static from(thing) {
2045
- return thing instanceof this ? thing : new this(thing);
2046
- }
2047
-
2048
- static concat(first, ...targets) {
2049
- const computed = new this(first);
2050
-
2051
- targets.forEach((target) => computed.set(target));
2052
-
2053
- return computed;
2054
- }
2055
-
2056
- static accessor(header) {
2057
- const internals = this[$internals] = (this[$internals] = {
2058
- accessors: {}
2059
- });
2060
-
2061
- const accessors = internals.accessors;
2062
- const prototype = this.prototype;
2063
-
2064
- function defineAccessor(_header) {
2065
- const lHeader = normalizeHeader(_header);
2066
-
2067
- if (!accessors[lHeader]) {
2068
- buildAccessors(prototype, _header);
2069
- accessors[lHeader] = true;
2070
- }
2071
- }
2072
-
2073
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
2074
-
2075
- return this;
2076
- }
2077
- }
2078
-
2079
- AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
2080
-
2081
- // reserved names hotfix
2082
- utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2083
- let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
2084
- return {
2085
- get: () => value,
2086
- set(headerValue) {
2087
- this[mapped] = headerValue;
2088
- }
2089
- }
2090
- });
2091
-
2092
- utils$1.freezeMethods(AxiosHeaders);
2093
-
2094
- var AxiosHeaders$1 = AxiosHeaders;
2095
-
2096
- /**
2097
- * Transform the data for a request or a response
2098
- *
2099
- * @param {Array|Function} fns A single function or Array of functions
2100
- * @param {?Object} response The response object
2101
- *
2102
- * @returns {*} The resulting transformed data
2103
- */
2104
- function transformData(fns, response) {
2105
- const config = this || defaults$1;
2106
- const context = response || config;
2107
- const headers = AxiosHeaders$1.from(context.headers);
2108
- let data = context.data;
2109
-
2110
- utils$1.forEach(fns, function transform(fn) {
2111
- data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
2112
- });
2113
-
2114
- headers.normalize();
2115
-
2116
- return data;
2117
- }
2118
-
2119
- function isCancel(value) {
2120
- return !!(value && value.__CANCEL__);
2121
- }
2122
-
2123
- class CanceledError extends AxiosError$1 {
2124
- /**
2125
- * A `CanceledError` is an object that is thrown when an operation is canceled.
2126
- *
2127
- * @param {string=} message The message.
2128
- * @param {Object=} config The config.
2129
- * @param {Object=} request The request.
2130
- *
2131
- * @returns {CanceledError} The created error.
2132
- */
2133
- constructor(message, config, request) {
2134
- super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
2135
- this.name = 'CanceledError';
2136
- this.__CANCEL__ = true;
2137
- }
2138
- }
2139
-
2140
- var CanceledError$1 = CanceledError;
2141
-
2142
- /**
2143
- * Resolve or reject a Promise based on response status.
2144
- *
2145
- * @param {Function} resolve A function that resolves the promise.
2146
- * @param {Function} reject A function that rejects the promise.
2147
- * @param {object} response The response.
2148
- *
2149
- * @returns {object} The response.
2150
- */
2151
- function settle(resolve, reject, response) {
2152
- const validateStatus = response.config.validateStatus;
2153
- if (!response.status || !validateStatus || validateStatus(response.status)) {
2154
- resolve(response);
2155
- } else {
2156
- reject(new AxiosError$1(
2157
- 'Request failed with status code ' + response.status,
2158
- [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2159
- response.config,
2160
- response.request,
2161
- response
2162
- ));
2163
- }
2164
- }
2165
-
2166
- function parseProtocol(url) {
2167
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
2168
- return match && match[1] || '';
2169
- }
2170
-
2171
- /**
2172
- * Calculate data maxRate
2173
- * @param {Number} [samplesCount= 10]
2174
- * @param {Number} [min= 1000]
2175
- * @returns {Function}
2176
- */
2177
- function speedometer(samplesCount, min) {
2178
- samplesCount = samplesCount || 10;
2179
- const bytes = new Array(samplesCount);
2180
- const timestamps = new Array(samplesCount);
2181
- let head = 0;
2182
- let tail = 0;
2183
- let firstSampleTS;
2184
-
2185
- min = min !== undefined ? min : 1000;
2186
-
2187
- return function push(chunkLength) {
2188
- const now = Date.now();
2189
-
2190
- const startedAt = timestamps[tail];
2191
-
2192
- if (!firstSampleTS) {
2193
- firstSampleTS = now;
2194
- }
2195
-
2196
- bytes[head] = chunkLength;
2197
- timestamps[head] = now;
2198
-
2199
- let i = tail;
2200
- let bytesCount = 0;
2201
-
2202
- while (i !== head) {
2203
- bytesCount += bytes[i++];
2204
- i = i % samplesCount;
2205
- }
2206
-
2207
- head = (head + 1) % samplesCount;
2208
-
2209
- if (head === tail) {
2210
- tail = (tail + 1) % samplesCount;
2211
- }
2212
-
2213
- if (now - firstSampleTS < min) {
2214
- return;
2215
- }
2216
-
2217
- const passed = startedAt && now - startedAt;
2218
-
2219
- return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
2220
- };
2221
- }
2222
-
2223
- /**
2224
- * Throttle decorator
2225
- * @param {Function} fn
2226
- * @param {Number} freq
2227
- * @return {Function}
2228
- */
2229
- function throttle(fn, freq) {
2230
- let timestamp = 0;
2231
- let threshold = 1000 / freq;
2232
- let lastArgs;
2233
- let timer;
2234
-
2235
- const invoke = (args, now = Date.now()) => {
2236
- timestamp = now;
2237
- lastArgs = null;
2238
- if (timer) {
2239
- clearTimeout(timer);
2240
- timer = null;
2241
- }
2242
- fn(...args);
2243
- };
2244
-
2245
- const throttled = (...args) => {
2246
- const now = Date.now();
2247
- const passed = now - timestamp;
2248
- if ( passed >= threshold) {
2249
- invoke(args, now);
2250
- } else {
2251
- lastArgs = args;
2252
- if (!timer) {
2253
- timer = setTimeout(() => {
2254
- timer = null;
2255
- invoke(lastArgs);
2256
- }, threshold - passed);
2257
- }
2258
- }
2259
- };
2260
-
2261
- const flush = () => lastArgs && invoke(lastArgs);
2262
-
2263
- return [throttled, flush];
2264
- }
2265
-
2266
- const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
2267
- let bytesNotified = 0;
2268
- const _speedometer = speedometer(50, 250);
2269
-
2270
- return throttle(e => {
2271
- const loaded = e.loaded;
2272
- const total = e.lengthComputable ? e.total : undefined;
2273
- const progressBytes = loaded - bytesNotified;
2274
- const rate = _speedometer(progressBytes);
2275
- const inRange = loaded <= total;
2276
-
2277
- bytesNotified = loaded;
2278
-
2279
- const data = {
2280
- loaded,
2281
- total,
2282
- progress: total ? (loaded / total) : undefined,
2283
- bytes: progressBytes,
2284
- rate: rate ? rate : undefined,
2285
- estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
2286
- event: e,
2287
- lengthComputable: total != null,
2288
- [isDownloadStream ? 'download' : 'upload']: true
2289
- };
2290
-
2291
- listener(data);
2292
- }, freq);
2293
- };
2294
-
2295
- const progressEventDecorator = (total, throttled) => {
2296
- const lengthComputable = total != null;
2297
-
2298
- return [(loaded) => throttled[0]({
2299
- lengthComputable,
2300
- total,
2301
- loaded
2302
- }), throttled[1]];
2303
- };
2304
-
2305
- const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
2306
-
2307
- var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
2308
- url = new URL(url, platform.origin);
2309
-
2310
- return (
2311
- origin.protocol === url.protocol &&
2312
- origin.host === url.host &&
2313
- (isMSIE || origin.port === url.port)
2314
- );
2315
- })(
2316
- new URL(platform.origin),
2317
- platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
2318
- ) : () => true;
2319
-
2320
- var cookies = platform.hasStandardBrowserEnv ?
2321
-
2322
- // Standard browser envs support document.cookie
2323
- {
2324
- write(name, value, expires, path, domain, secure, sameSite) {
2325
- if (typeof document === 'undefined') return;
2326
-
2327
- const cookie = [`${name}=${encodeURIComponent(value)}`];
2328
-
2329
- if (utils$1.isNumber(expires)) {
2330
- cookie.push(`expires=${new Date(expires).toUTCString()}`);
2331
- }
2332
- if (utils$1.isString(path)) {
2333
- cookie.push(`path=${path}`);
2334
- }
2335
- if (utils$1.isString(domain)) {
2336
- cookie.push(`domain=${domain}`);
2337
- }
2338
- if (secure === true) {
2339
- cookie.push('secure');
2340
- }
2341
- if (utils$1.isString(sameSite)) {
2342
- cookie.push(`SameSite=${sameSite}`);
2343
- }
2344
-
2345
- document.cookie = cookie.join('; ');
2346
- },
2347
-
2348
- read(name) {
2349
- if (typeof document === 'undefined') return null;
2350
- const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
2351
- return match ? decodeURIComponent(match[1]) : null;
2352
- },
2353
-
2354
- remove(name) {
2355
- this.write(name, '', Date.now() - 86400000, '/');
2356
- }
2357
- }
2358
-
2359
- :
2360
-
2361
- // Non-standard browser env (web workers, react-native) lack needed support.
2362
- {
2363
- write() {},
2364
- read() {
2365
- return null;
2366
- },
2367
- remove() {}
2368
- };
2369
-
2370
- /**
2371
- * Determines whether the specified URL is absolute
2372
- *
2373
- * @param {string} url The URL to test
2374
- *
2375
- * @returns {boolean} True if the specified URL is absolute, otherwise false
2376
- */
2377
- function isAbsoluteURL(url) {
2378
- // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2379
- // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2380
- // by any combination of letters, digits, plus, period, or hyphen.
2381
- if (typeof url !== 'string') {
2382
- return false;
2383
- }
2384
-
2385
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2386
- }
2387
-
2388
- /**
2389
- * Creates a new URL by combining the specified URLs
2390
- *
2391
- * @param {string} baseURL The base URL
2392
- * @param {string} relativeURL The relative URL
2393
- *
2394
- * @returns {string} The combined URL
2395
- */
2396
- function combineURLs(baseURL, relativeURL) {
2397
- return relativeURL
2398
- ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
2399
- : baseURL;
2400
- }
2401
-
2402
- /**
2403
- * Creates a new URL by combining the baseURL with the requestedURL,
2404
- * only when the requestedURL is not already an absolute URL.
2405
- * If the requestURL is absolute, this function returns the requestedURL untouched.
2406
- *
2407
- * @param {string} baseURL The base URL
2408
- * @param {string} requestedURL Absolute or relative URL to combine
2409
- *
2410
- * @returns {string} The combined full path
2411
- */
2412
- function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
2413
- let isRelativeUrl = !isAbsoluteURL(requestedURL);
2414
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
2415
- return combineURLs(baseURL, requestedURL);
2416
- }
2417
- return requestedURL;
2418
- }
2419
-
2420
- const headersToObject = (thing) =>
2421
- thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
2422
-
2423
- /**
2424
- * Config-specific merge-function which creates a new config-object
2425
- * by merging two configuration objects together.
2426
- *
2427
- * @param {Object} config1
2428
- * @param {Object} config2
2429
- *
2430
- * @returns {Object} New object resulting from merging config2 to config1
2431
- */
2432
- function mergeConfig(config1, config2) {
2433
- // eslint-disable-next-line no-param-reassign
2434
- config2 = config2 || {};
2435
- const config = {};
2436
-
2437
- function getMergedValue(target, source, prop, caseless) {
2438
- if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
2439
- return utils$1.merge.call({ caseless }, target, source);
2440
- } else if (utils$1.isPlainObject(source)) {
2441
- return utils$1.merge({}, source);
2442
- } else if (utils$1.isArray(source)) {
2443
- return source.slice();
2444
- }
2445
- return source;
2446
- }
2447
-
2448
- function mergeDeepProperties(a, b, prop, caseless) {
2449
- if (!utils$1.isUndefined(b)) {
2450
- return getMergedValue(a, b, prop, caseless);
2451
- } else if (!utils$1.isUndefined(a)) {
2452
- return getMergedValue(undefined, a, prop, caseless);
2453
- }
2454
- }
2455
-
2456
- // eslint-disable-next-line consistent-return
2457
- function valueFromConfig2(a, b) {
2458
- if (!utils$1.isUndefined(b)) {
2459
- return getMergedValue(undefined, b);
2460
- }
2461
- }
2462
-
2463
- // eslint-disable-next-line consistent-return
2464
- function defaultToConfig2(a, b) {
2465
- if (!utils$1.isUndefined(b)) {
2466
- return getMergedValue(undefined, b);
2467
- } else if (!utils$1.isUndefined(a)) {
2468
- return getMergedValue(undefined, a);
2469
- }
2470
- }
2471
-
2472
- // eslint-disable-next-line consistent-return
2473
- function mergeDirectKeys(a, b, prop) {
2474
- if (prop in config2) {
2475
- return getMergedValue(a, b);
2476
- } else if (prop in config1) {
2477
- return getMergedValue(undefined, a);
2478
- }
2479
- }
2480
-
2481
- const mergeMap = {
2482
- url: valueFromConfig2,
2483
- method: valueFromConfig2,
2484
- data: valueFromConfig2,
2485
- baseURL: defaultToConfig2,
2486
- transformRequest: defaultToConfig2,
2487
- transformResponse: defaultToConfig2,
2488
- paramsSerializer: defaultToConfig2,
2489
- timeout: defaultToConfig2,
2490
- timeoutMessage: defaultToConfig2,
2491
- withCredentials: defaultToConfig2,
2492
- withXSRFToken: defaultToConfig2,
2493
- adapter: defaultToConfig2,
2494
- responseType: defaultToConfig2,
2495
- xsrfCookieName: defaultToConfig2,
2496
- xsrfHeaderName: defaultToConfig2,
2497
- onUploadProgress: defaultToConfig2,
2498
- onDownloadProgress: defaultToConfig2,
2499
- decompress: defaultToConfig2,
2500
- maxContentLength: defaultToConfig2,
2501
- maxBodyLength: defaultToConfig2,
2502
- beforeRedirect: defaultToConfig2,
2503
- transport: defaultToConfig2,
2504
- httpAgent: defaultToConfig2,
2505
- httpsAgent: defaultToConfig2,
2506
- cancelToken: defaultToConfig2,
2507
- socketPath: defaultToConfig2,
2508
- responseEncoding: defaultToConfig2,
2509
- validateStatus: mergeDirectKeys,
2510
- headers: (a, b, prop) =>
2511
- mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
2512
- };
2513
-
2514
- utils$1.forEach(
2515
- Object.keys({ ...config1, ...config2 }),
2516
- function computeConfigValue(prop) {
2517
- if (
2518
- prop === "__proto__" ||
2519
- prop === "constructor" ||
2520
- prop === "prototype"
2521
- )
2522
- return;
2523
- const merge = utils$1.hasOwnProp(mergeMap, prop)
2524
- ? mergeMap[prop]
2525
- : mergeDeepProperties;
2526
- const configValue = merge(config1[prop], config2[prop], prop);
2527
- (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) ||
2528
- (config[prop] = configValue);
2529
- },
2530
- );
2531
-
2532
- return config;
2533
- }
2534
-
2535
- var resolveConfig = (config) => {
2536
- const newConfig = mergeConfig({}, config);
2537
-
2538
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
2539
-
2540
- newConfig.headers = headers = AxiosHeaders$1.from(headers);
2541
-
2542
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
2543
-
2544
- // HTTP basic authentication
2545
- if (auth) {
2546
- headers.set('Authorization', 'Basic ' +
2547
- btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
2548
- );
2549
- }
2550
-
2551
- if (utils$1.isFormData(data)) {
2552
- if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
2553
- headers.setContentType(undefined); // browser handles it
2554
- } else if (utils$1.isFunction(data.getHeaders)) {
2555
- // Node.js FormData (like form-data package)
2556
- const formHeaders = data.getHeaders();
2557
- // Only set safe headers to avoid overwriting security headers
2558
- const allowedHeaders = ['content-type', 'content-length'];
2559
- Object.entries(formHeaders).forEach(([key, val]) => {
2560
- if (allowedHeaders.includes(key.toLowerCase())) {
2561
- headers.set(key, val);
2562
- }
2563
- });
2564
- }
2565
- }
2566
-
2567
- // Add xsrf header
2568
- // This is only done if running in a standard browser environment.
2569
- // Specifically not if we're in a web worker, or react-native.
2570
-
2571
- if (platform.hasStandardBrowserEnv) {
2572
- withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
2573
-
2574
- if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
2575
- // Add xsrf header
2576
- const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
2577
-
2578
- if (xsrfValue) {
2579
- headers.set(xsrfHeaderName, xsrfValue);
2580
- }
2581
- }
2582
- }
2583
-
2584
- return newConfig;
2585
- };
2586
-
2587
- const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
2588
-
2589
- var xhrAdapter = isXHRAdapterSupported && function (config) {
2590
- return new Promise(function dispatchXhrRequest(resolve, reject) {
2591
- const _config = resolveConfig(config);
2592
- let requestData = _config.data;
2593
- const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
2594
- let {responseType, onUploadProgress, onDownloadProgress} = _config;
2595
- let onCanceled;
2596
- let uploadThrottled, downloadThrottled;
2597
- let flushUpload, flushDownload;
2598
-
2599
- function done() {
2600
- flushUpload && flushUpload(); // flush events
2601
- flushDownload && flushDownload(); // flush events
2602
-
2603
- _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
2604
-
2605
- _config.signal && _config.signal.removeEventListener('abort', onCanceled);
2606
- }
2607
-
2608
- let request = new XMLHttpRequest();
2609
-
2610
- request.open(_config.method.toUpperCase(), _config.url, true);
2611
-
2612
- // Set the request timeout in MS
2613
- request.timeout = _config.timeout;
2614
-
2615
- function onloadend() {
2616
- if (!request) {
2617
- return;
2618
- }
2619
- // Prepare the response
2620
- const responseHeaders = AxiosHeaders$1.from(
2621
- 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
2622
- );
2623
- const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
2624
- request.responseText : request.response;
2625
- const response = {
2626
- data: responseData,
2627
- status: request.status,
2628
- statusText: request.statusText,
2629
- headers: responseHeaders,
2630
- config,
2631
- request
2632
- };
2633
-
2634
- settle(function _resolve(value) {
2635
- resolve(value);
2636
- done();
2637
- }, function _reject(err) {
2638
- reject(err);
2639
- done();
2640
- }, response);
2641
-
2642
- // Clean up request
2643
- request = null;
2644
- }
2645
-
2646
- if ('onloadend' in request) {
2647
- // Use onloadend if available
2648
- request.onloadend = onloadend;
2649
- } else {
2650
- // Listen for ready state to emulate onloadend
2651
- request.onreadystatechange = function handleLoad() {
2652
- if (!request || request.readyState !== 4) {
2653
- return;
2654
- }
2655
-
2656
- // The request errored out and we didn't get a response, this will be
2657
- // handled by onerror instead
2658
- // With one exception: request that using file: protocol, most browsers
2659
- // will return status as 0 even though it's a successful request
2660
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
2661
- return;
2662
- }
2663
- // readystate handler is calling before onerror or ontimeout handlers,
2664
- // so we should call onloadend on the next 'tick'
2665
- setTimeout(onloadend);
2666
- };
2667
- }
2668
-
2669
- // Handle browser request cancellation (as opposed to a manual cancellation)
2670
- request.onabort = function handleAbort() {
2671
- if (!request) {
2672
- return;
2673
- }
2674
-
2675
- reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
2676
-
2677
- // Clean up request
2678
- request = null;
2679
- };
2680
-
2681
- // Handle low level network errors
2682
- request.onerror = function handleError(event) {
2683
- // Browsers deliver a ProgressEvent in XHR onerror
2684
- // (message may be empty; when present, surface it)
2685
- // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
2686
- const msg = event && event.message ? event.message : 'Network Error';
2687
- const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
2688
- // attach the underlying event for consumers who want details
2689
- err.event = event || null;
2690
- reject(err);
2691
- request = null;
2692
- };
2693
-
2694
- // Handle timeout
2695
- request.ontimeout = function handleTimeout() {
2696
- let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
2697
- const transitional = _config.transitional || transitionalDefaults;
2698
- if (_config.timeoutErrorMessage) {
2699
- timeoutErrorMessage = _config.timeoutErrorMessage;
2700
- }
2701
- reject(new AxiosError$1(
2702
- timeoutErrorMessage,
2703
- transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
2704
- config,
2705
- request));
2706
-
2707
- // Clean up request
2708
- request = null;
2709
- };
2710
-
2711
- // Remove Content-Type if data is undefined
2712
- requestData === undefined && requestHeaders.setContentType(null);
2713
-
2714
- // Add headers to the request
2715
- if ('setRequestHeader' in request) {
2716
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
2717
- request.setRequestHeader(key, val);
2718
- });
2719
- }
2720
-
2721
- // Add withCredentials to request if needed
2722
- if (!utils$1.isUndefined(_config.withCredentials)) {
2723
- request.withCredentials = !!_config.withCredentials;
2724
- }
2725
-
2726
- // Add responseType to request if needed
2727
- if (responseType && responseType !== 'json') {
2728
- request.responseType = _config.responseType;
2729
- }
2730
-
2731
- // Handle progress if needed
2732
- if (onDownloadProgress) {
2733
- ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
2734
- request.addEventListener('progress', downloadThrottled);
2735
- }
2736
-
2737
- // Not all browsers support upload events
2738
- if (onUploadProgress && request.upload) {
2739
- ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
2740
-
2741
- request.upload.addEventListener('progress', uploadThrottled);
2742
-
2743
- request.upload.addEventListener('loadend', flushUpload);
2744
- }
2745
-
2746
- if (_config.cancelToken || _config.signal) {
2747
- // Handle cancellation
2748
- // eslint-disable-next-line func-names
2749
- onCanceled = cancel => {
2750
- if (!request) {
2751
- return;
2752
- }
2753
- reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
2754
- request.abort();
2755
- request = null;
2756
- };
2757
-
2758
- _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
2759
- if (_config.signal) {
2760
- _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
2761
- }
2762
- }
2763
-
2764
- const protocol = parseProtocol(_config.url);
2765
-
2766
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
2767
- reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
2768
- return;
2769
- }
2770
-
2771
-
2772
- // Send the request
2773
- request.send(requestData || null);
2774
- });
2775
- };
2776
-
2777
- const composeSignals = (signals, timeout) => {
2778
- const {length} = (signals = signals ? signals.filter(Boolean) : []);
2779
-
2780
- if (timeout || length) {
2781
- let controller = new AbortController();
2782
-
2783
- let aborted;
2784
-
2785
- const onabort = function (reason) {
2786
- if (!aborted) {
2787
- aborted = true;
2788
- unsubscribe();
2789
- const err = reason instanceof Error ? reason : this.reason;
2790
- controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
2791
- }
2792
- };
2793
-
2794
- let timer = timeout && setTimeout(() => {
2795
- timer = null;
2796
- onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
2797
- }, timeout);
2798
-
2799
- const unsubscribe = () => {
2800
- if (signals) {
2801
- timer && clearTimeout(timer);
2802
- timer = null;
2803
- signals.forEach(signal => {
2804
- signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
2805
- });
2806
- signals = null;
2807
- }
2808
- };
2809
-
2810
- signals.forEach((signal) => signal.addEventListener('abort', onabort));
2811
-
2812
- const {signal} = controller;
2813
-
2814
- signal.unsubscribe = () => utils$1.asap(unsubscribe);
2815
-
2816
- return signal;
2817
- }
2818
- };
2819
-
2820
- var composeSignals$1 = composeSignals;
2821
-
2822
- const streamChunk = function* (chunk, chunkSize) {
2823
- let len = chunk.byteLength;
2824
-
2825
- if (!chunkSize || len < chunkSize) {
2826
- yield chunk;
2827
- return;
2828
- }
2829
-
2830
- let pos = 0;
2831
- let end;
2832
-
2833
- while (pos < len) {
2834
- end = pos + chunkSize;
2835
- yield chunk.slice(pos, end);
2836
- pos = end;
2837
- }
2838
- };
2839
-
2840
- const readBytes = async function* (iterable, chunkSize) {
2841
- for await (const chunk of readStream(iterable)) {
2842
- yield* streamChunk(chunk, chunkSize);
2843
- }
2844
- };
2845
-
2846
- const readStream = async function* (stream) {
2847
- if (stream[Symbol.asyncIterator]) {
2848
- yield* stream;
2849
- return;
2850
- }
2851
-
2852
- const reader = stream.getReader();
2853
- try {
2854
- for (;;) {
2855
- const {done, value} = await reader.read();
2856
- if (done) {
2857
- break;
2858
- }
2859
- yield value;
2860
- }
2861
- } finally {
2862
- await reader.cancel();
2863
- }
2864
- };
2865
-
2866
- const trackStream = (stream, chunkSize, onProgress, onFinish) => {
2867
- const iterator = readBytes(stream, chunkSize);
2868
-
2869
- let bytes = 0;
2870
- let done;
2871
- let _onFinish = (e) => {
2872
- if (!done) {
2873
- done = true;
2874
- onFinish && onFinish(e);
2875
- }
2876
- };
2877
-
2878
- return new ReadableStream({
2879
- async pull(controller) {
2880
- try {
2881
- const {done, value} = await iterator.next();
2882
-
2883
- if (done) {
2884
- _onFinish();
2885
- controller.close();
2886
- return;
2887
- }
2888
-
2889
- let len = value.byteLength;
2890
- if (onProgress) {
2891
- let loadedBytes = bytes += len;
2892
- onProgress(loadedBytes);
2893
- }
2894
- controller.enqueue(new Uint8Array(value));
2895
- } catch (err) {
2896
- _onFinish(err);
2897
- throw err;
2898
- }
2899
- },
2900
- cancel(reason) {
2901
- _onFinish(reason);
2902
- return iterator.return();
2903
- }
2904
- }, {
2905
- highWaterMark: 2
2906
- })
2907
- };
2908
-
2909
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
2910
-
2911
- const {isFunction} = utils$1;
2912
-
2913
- const globalFetchAPI = (({Request, Response}) => ({
2914
- Request, Response
2915
- }))(utils$1.global);
2916
-
2917
- const {
2918
- ReadableStream: ReadableStream$1, TextEncoder
2919
- } = utils$1.global;
2920
-
2921
-
2922
- const test = (fn, ...args) => {
2923
- try {
2924
- return !!fn(...args);
2925
- } catch (e) {
2926
- return false
2927
- }
2928
- };
2929
-
2930
- const factory = (env) => {
2931
- env = utils$1.merge.call({
2932
- skipUndefined: true
2933
- }, globalFetchAPI, env);
2934
-
2935
- const {fetch: envFetch, Request, Response} = env;
2936
- const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
2937
- const isRequestSupported = isFunction(Request);
2938
- const isResponseSupported = isFunction(Response);
2939
-
2940
- if (!isFetchSupported) {
2941
- return false;
2942
- }
2943
-
2944
- const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
2945
-
2946
- const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
2947
- ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
2948
- async (str) => new Uint8Array(await new Request(str).arrayBuffer())
2949
- );
2950
-
2951
- const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
2952
- let duplexAccessed = false;
2953
-
2954
- const hasContentType = new Request(platform.origin, {
2955
- body: new ReadableStream$1(),
2956
- method: 'POST',
2957
- get duplex() {
2958
- duplexAccessed = true;
2959
- return 'half';
2960
- },
2961
- }).headers.has('Content-Type');
2962
-
2963
- return duplexAccessed && !hasContentType;
2964
- });
2965
-
2966
- const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
2967
- test(() => utils$1.isReadableStream(new Response('').body));
2968
-
2969
- const resolvers = {
2970
- stream: supportsResponseStream && ((res) => res.body)
2971
- };
2972
-
2973
- isFetchSupported && ((() => {
2974
- ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
2975
- !resolvers[type] && (resolvers[type] = (res, config) => {
2976
- let method = res && res[type];
2977
-
2978
- if (method) {
2979
- return method.call(res);
2980
- }
2981
-
2982
- throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
2983
- });
2984
- });
2985
- })());
2986
-
2987
- const getBodyLength = async (body) => {
2988
- if (body == null) {
2989
- return 0;
2990
- }
2991
-
2992
- if (utils$1.isBlob(body)) {
2993
- return body.size;
2994
- }
2995
-
2996
- if (utils$1.isSpecCompliantForm(body)) {
2997
- const _request = new Request(platform.origin, {
2998
- method: 'POST',
2999
- body,
3000
- });
3001
- return (await _request.arrayBuffer()).byteLength;
3002
- }
3003
-
3004
- if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
3005
- return body.byteLength;
3006
- }
3007
-
3008
- if (utils$1.isURLSearchParams(body)) {
3009
- body = body + '';
3010
- }
3011
-
3012
- if (utils$1.isString(body)) {
3013
- return (await encodeText(body)).byteLength;
3014
- }
3015
- };
3016
-
3017
- const resolveBodyLength = async (headers, body) => {
3018
- const length = utils$1.toFiniteNumber(headers.getContentLength());
3019
-
3020
- return length == null ? getBodyLength(body) : length;
3021
- };
3022
-
3023
- return async (config) => {
3024
- let {
3025
- url,
3026
- method,
3027
- data,
3028
- signal,
3029
- cancelToken,
3030
- timeout,
3031
- onDownloadProgress,
3032
- onUploadProgress,
3033
- responseType,
3034
- headers,
3035
- withCredentials = 'same-origin',
3036
- fetchOptions
3037
- } = resolveConfig(config);
3038
-
3039
- let _fetch = envFetch || fetch;
3040
-
3041
- responseType = responseType ? (responseType + '').toLowerCase() : 'text';
3042
-
3043
- let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
3044
-
3045
- let request = null;
3046
-
3047
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
3048
- composedSignal.unsubscribe();
3049
- });
3050
-
3051
- let requestContentLength;
3052
-
3053
- try {
3054
- if (
3055
- onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
3056
- (requestContentLength = await resolveBodyLength(headers, data)) !== 0
3057
- ) {
3058
- let _request = new Request(url, {
3059
- method: 'POST',
3060
- body: data,
3061
- duplex: "half"
3062
- });
3063
-
3064
- let contentTypeHeader;
3065
-
3066
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
3067
- headers.setContentType(contentTypeHeader);
3068
- }
3069
-
3070
- if (_request.body) {
3071
- const [onProgress, flush] = progressEventDecorator(
3072
- requestContentLength,
3073
- progressEventReducer(asyncDecorator(onUploadProgress))
3074
- );
3075
-
3076
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
3077
- }
3078
- }
3079
-
3080
- if (!utils$1.isString(withCredentials)) {
3081
- withCredentials = withCredentials ? 'include' : 'omit';
3082
- }
3083
-
3084
- // Cloudflare Workers throws when credentials are defined
3085
- // see https://github.com/cloudflare/workerd/issues/902
3086
- const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
3087
-
3088
- const resolvedOptions = {
3089
- ...fetchOptions,
3090
- signal: composedSignal,
3091
- method: method.toUpperCase(),
3092
- headers: headers.normalize().toJSON(),
3093
- body: data,
3094
- duplex: "half",
3095
- credentials: isCredentialsSupported ? withCredentials : undefined
3096
- };
3097
-
3098
- request = isRequestSupported && new Request(url, resolvedOptions);
3099
-
3100
- let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
3101
-
3102
- const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
3103
-
3104
- if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
3105
- const options = {};
3106
-
3107
- ['status', 'statusText', 'headers'].forEach(prop => {
3108
- options[prop] = response[prop];
3109
- });
3110
-
3111
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
3112
-
3113
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
3114
- responseContentLength,
3115
- progressEventReducer(asyncDecorator(onDownloadProgress), true)
3116
- ) || [];
3117
-
3118
- response = new Response(
3119
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
3120
- flush && flush();
3121
- unsubscribe && unsubscribe();
3122
- }),
3123
- options
3124
- );
3125
- }
3126
-
3127
- responseType = responseType || 'text';
3128
-
3129
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
3130
-
3131
- !isStreamResponse && unsubscribe && unsubscribe();
3132
-
3133
- return await new Promise((resolve, reject) => {
3134
- settle(resolve, reject, {
3135
- data: responseData,
3136
- headers: AxiosHeaders$1.from(response.headers),
3137
- status: response.status,
3138
- statusText: response.statusText,
3139
- config,
3140
- request
3141
- });
3142
- })
3143
- } catch (err) {
3144
- unsubscribe && unsubscribe();
3145
-
3146
- if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
3147
- throw Object.assign(
3148
- new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request, err && err.response),
3149
- {
3150
- cause: err.cause || err
3151
- }
3152
- )
3153
- }
3154
-
3155
- throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
3156
- }
3157
- }
3158
- };
3159
-
3160
- const seedCache = new Map();
3161
-
3162
- const getFetch = (config) => {
3163
- let env = (config && config.env) || {};
3164
- const {fetch, Request, Response} = env;
3165
- const seeds = [
3166
- Request, Response, fetch
3167
- ];
3168
-
3169
- let len = seeds.length, i = len,
3170
- seed, target, map = seedCache;
3171
-
3172
- while (i--) {
3173
- seed = seeds[i];
3174
- target = map.get(seed);
3175
-
3176
- target === undefined && map.set(seed, target = (i ? new Map() : factory(env)));
3177
-
3178
- map = target;
3179
- }
3180
-
3181
- return target;
3182
- };
3183
-
3184
- getFetch();
3185
-
3186
- /**
3187
- * Known adapters mapping.
3188
- * Provides environment-specific adapters for Axios:
3189
- * - `http` for Node.js
3190
- * - `xhr` for browsers
3191
- * - `fetch` for fetch API-based requests
3192
- *
3193
- * @type {Object<string, Function|Object>}
3194
- */
3195
- const knownAdapters = {
3196
- http: httpAdapter,
3197
- xhr: xhrAdapter,
3198
- fetch: {
3199
- get: getFetch,
3200
- }
3201
- };
3202
-
3203
- // Assign adapter names for easier debugging and identification
3204
- utils$1.forEach(knownAdapters, (fn, value) => {
3205
- if (fn) {
3206
- try {
3207
- Object.defineProperty(fn, 'name', { value });
3208
- } catch (e) {
3209
- // eslint-disable-next-line no-empty
3210
- }
3211
- Object.defineProperty(fn, 'adapterName', { value });
3212
- }
3213
- });
3214
-
3215
- /**
3216
- * Render a rejection reason string for unknown or unsupported adapters
3217
- *
3218
- * @param {string} reason
3219
- * @returns {string}
3220
- */
3221
- const renderReason = (reason) => `- ${reason}`;
3222
-
3223
- /**
3224
- * Check if the adapter is resolved (function, null, or false)
3225
- *
3226
- * @param {Function|null|false} adapter
3227
- * @returns {boolean}
3228
- */
3229
- const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
3230
-
3231
- /**
3232
- * Get the first suitable adapter from the provided list.
3233
- * Tries each adapter in order until a supported one is found.
3234
- * Throws an AxiosError if no adapter is suitable.
3235
- *
3236
- * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
3237
- * @param {Object} config - Axios request configuration
3238
- * @throws {AxiosError} If no suitable adapter is available
3239
- * @returns {Function} The resolved adapter function
3240
- */
3241
- function getAdapter(adapters, config) {
3242
- adapters = utils$1.isArray(adapters) ? adapters : [adapters];
3243
-
3244
- const { length } = adapters;
3245
- let nameOrAdapter;
3246
- let adapter;
3247
-
3248
- const rejectedReasons = {};
3249
-
3250
- for (let i = 0; i < length; i++) {
3251
- nameOrAdapter = adapters[i];
3252
- let id;
3253
-
3254
- adapter = nameOrAdapter;
3255
-
3256
- if (!isResolvedHandle(nameOrAdapter)) {
3257
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3258
-
3259
- if (adapter === undefined) {
3260
- throw new AxiosError$1(`Unknown adapter '${id}'`);
3261
- }
3262
- }
3263
-
3264
- if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
3265
- break;
3266
- }
3267
-
3268
- rejectedReasons[id || '#' + i] = adapter;
3269
- }
3270
-
3271
- if (!adapter) {
3272
- const reasons = Object.entries(rejectedReasons)
3273
- .map(([id, state]) => `adapter ${id} ` +
3274
- (state === false ? 'is not supported by the environment' : 'is not available in the build')
3275
- );
3276
-
3277
- let s = length ?
3278
- (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
3279
- 'as no adapter specified';
3280
-
3281
- throw new AxiosError$1(
3282
- `There is no suitable adapter to dispatch the request ` + s,
3283
- 'ERR_NOT_SUPPORT'
3284
- );
3285
- }
3286
-
3287
- return adapter;
3288
- }
3289
-
3290
- /**
3291
- * Exports Axios adapters and utility to resolve an adapter
3292
- */
3293
- var adapters = {
3294
- /**
3295
- * Resolve an adapter from a list of adapter names or functions.
3296
- * @type {Function}
3297
- */
3298
- getAdapter,
3299
-
3300
- /**
3301
- * Exposes all known adapters
3302
- * @type {Object<string, Function|Object>}
3303
- */
3304
- adapters: knownAdapters
3305
- };
3306
-
3307
- /**
3308
- * Throws a `CanceledError` if cancellation has been requested.
3309
- *
3310
- * @param {Object} config The config that is to be used for the request
3311
- *
3312
- * @returns {void}
3313
- */
3314
- function throwIfCancellationRequested(config) {
3315
- if (config.cancelToken) {
3316
- config.cancelToken.throwIfRequested();
3317
- }
3318
-
3319
- if (config.signal && config.signal.aborted) {
3320
- throw new CanceledError$1(null, config);
3321
- }
3322
- }
3323
-
3324
- /**
3325
- * Dispatch a request to the server using the configured adapter.
3326
- *
3327
- * @param {object} config The config that is to be used for the request
3328
- *
3329
- * @returns {Promise} The Promise to be fulfilled
3330
- */
3331
- function dispatchRequest(config) {
3332
- throwIfCancellationRequested(config);
3333
-
3334
- config.headers = AxiosHeaders$1.from(config.headers);
3335
-
3336
- // Transform request data
3337
- config.data = transformData.call(
3338
- config,
3339
- config.transformRequest
3340
- );
3341
-
3342
- if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
3343
- config.headers.setContentType('application/x-www-form-urlencoded', false);
3344
- }
3345
-
3346
- const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
3347
-
3348
- return adapter(config).then(function onAdapterResolution(response) {
3349
- throwIfCancellationRequested(config);
3350
-
3351
- // Transform response data
3352
- response.data = transformData.call(
3353
- config,
3354
- config.transformResponse,
3355
- response
3356
- );
3357
-
3358
- response.headers = AxiosHeaders$1.from(response.headers);
3359
-
3360
- return response;
3361
- }, function onAdapterRejection(reason) {
3362
- if (!isCancel(reason)) {
3363
- throwIfCancellationRequested(config);
3364
-
3365
- // Transform response data
3366
- if (reason && reason.response) {
3367
- reason.response.data = transformData.call(
3368
- config,
3369
- config.transformResponse,
3370
- reason.response
3371
- );
3372
- reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
3373
- }
3374
- }
3375
-
3376
- return Promise.reject(reason);
3377
- });
3378
- }
3379
-
3380
- const VERSION = "1.13.5";
3381
-
3382
- const validators$1 = {};
3383
-
3384
- // eslint-disable-next-line func-names
3385
- ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
3386
- validators$1[type] = function validator(thing) {
3387
- return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
3388
- };
3389
- });
3390
-
3391
- const deprecatedWarnings = {};
3392
-
3393
- /**
3394
- * Transitional option validator
3395
- *
3396
- * @param {function|boolean?} validator - set to false if the transitional option has been removed
3397
- * @param {string?} version - deprecated version / removed since version
3398
- * @param {string?} message - some message with additional info
3399
- *
3400
- * @returns {function}
3401
- */
3402
- validators$1.transitional = function transitional(validator, version, message) {
3403
- function formatMessage(opt, desc) {
3404
- return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
3405
- }
3406
-
3407
- // eslint-disable-next-line func-names
3408
- return (value, opt, opts) => {
3409
- if (validator === false) {
3410
- throw new AxiosError$1(
3411
- formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
3412
- AxiosError$1.ERR_DEPRECATED
3413
- );
3414
- }
3415
-
3416
- if (version && !deprecatedWarnings[opt]) {
3417
- deprecatedWarnings[opt] = true;
3418
- // eslint-disable-next-line no-console
3419
- console.warn(
3420
- formatMessage(
3421
- opt,
3422
- ' has been deprecated since v' + version + ' and will be removed in the near future'
3423
- )
3424
- );
3425
- }
3426
-
3427
- return validator ? validator(value, opt, opts) : true;
3428
- };
3429
- };
3430
-
3431
- validators$1.spelling = function spelling(correctSpelling) {
3432
- return (value, opt) => {
3433
- // eslint-disable-next-line no-console
3434
- console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
3435
- return true;
3436
- }
3437
- };
3438
-
3439
- /**
3440
- * Assert object's properties type
3441
- *
3442
- * @param {object} options
3443
- * @param {object} schema
3444
- * @param {boolean?} allowUnknown
3445
- *
3446
- * @returns {object}
3447
- */
3448
-
3449
- function assertOptions(options, schema, allowUnknown) {
3450
- if (typeof options !== 'object') {
3451
- throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
3452
- }
3453
- const keys = Object.keys(options);
3454
- let i = keys.length;
3455
- while (i-- > 0) {
3456
- const opt = keys[i];
3457
- const validator = schema[opt];
3458
- if (validator) {
3459
- const value = options[opt];
3460
- const result = value === undefined || validator(value, opt, options);
3461
- if (result !== true) {
3462
- throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
3463
- }
3464
- continue;
3465
- }
3466
- if (allowUnknown !== true) {
3467
- throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
3468
- }
3469
- }
3470
- }
3471
-
3472
- var validator = {
3473
- assertOptions,
3474
- validators: validators$1
3475
- };
3476
-
3477
- const validators = validator.validators;
3478
-
3479
- /**
3480
- * Create a new instance of Axios
3481
- *
3482
- * @param {Object} instanceConfig The default config for the instance
3483
- *
3484
- * @return {Axios} A new instance of Axios
3485
- */
3486
- class Axios {
3487
- constructor(instanceConfig) {
3488
- this.defaults = instanceConfig || {};
3489
- this.interceptors = {
3490
- request: new InterceptorManager$1(),
3491
- response: new InterceptorManager$1()
3492
- };
3493
- }
3494
-
3495
- /**
3496
- * Dispatch a request
3497
- *
3498
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
3499
- * @param {?Object} config
3500
- *
3501
- * @returns {Promise} The Promise to be fulfilled
3502
- */
3503
- async request(configOrUrl, config) {
3504
- try {
3505
- return await this._request(configOrUrl, config);
3506
- } catch (err) {
3507
- if (err instanceof Error) {
3508
- let dummy = {};
3509
-
3510
- Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
3511
-
3512
- // slice off the Error: ... line
3513
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
3514
- try {
3515
- if (!err.stack) {
3516
- err.stack = stack;
3517
- // match without the 2 top stack lines
3518
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
3519
- err.stack += '\n' + stack;
3520
- }
3521
- } catch (e) {
3522
- // ignore the case where "stack" is an un-writable property
3523
- }
3524
- }
3525
-
3526
- throw err;
3527
- }
3528
- }
3529
-
3530
- _request(configOrUrl, config) {
3531
- /*eslint no-param-reassign:0*/
3532
- // Allow for axios('example/url'[, config]) a la fetch API
3533
- if (typeof configOrUrl === 'string') {
3534
- config = config || {};
3535
- config.url = configOrUrl;
3536
- } else {
3537
- config = configOrUrl || {};
3538
- }
3539
-
3540
- config = mergeConfig(this.defaults, config);
3541
-
3542
- const {transitional, paramsSerializer, headers} = config;
3543
-
3544
- if (transitional !== undefined) {
3545
- validator.assertOptions(transitional, {
3546
- silentJSONParsing: validators.transitional(validators.boolean),
3547
- forcedJSONParsing: validators.transitional(validators.boolean),
3548
- clarifyTimeoutError: validators.transitional(validators.boolean),
3549
- legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
3550
- }, false);
3551
- }
3552
-
3553
- if (paramsSerializer != null) {
3554
- if (utils$1.isFunction(paramsSerializer)) {
3555
- config.paramsSerializer = {
3556
- serialize: paramsSerializer
3557
- };
3558
- } else {
3559
- validator.assertOptions(paramsSerializer, {
3560
- encode: validators.function,
3561
- serialize: validators.function
3562
- }, true);
3563
- }
3564
- }
3565
-
3566
- // Set config.allowAbsoluteUrls
3567
- if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
3568
- config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
3569
- } else {
3570
- config.allowAbsoluteUrls = true;
3571
- }
3572
-
3573
- validator.assertOptions(config, {
3574
- baseUrl: validators.spelling('baseURL'),
3575
- withXsrfToken: validators.spelling('withXSRFToken')
3576
- }, true);
3577
-
3578
- // Set config.method
3579
- config.method = (config.method || this.defaults.method || 'get').toLowerCase();
3580
-
3581
- // Flatten headers
3582
- let contextHeaders = headers && utils$1.merge(
3583
- headers.common,
3584
- headers[config.method]
3585
- );
3586
-
3587
- headers && utils$1.forEach(
3588
- ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
3589
- (method) => {
3590
- delete headers[method];
3591
- }
3592
- );
3593
-
3594
- config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
3595
-
3596
- // filter out skipped interceptors
3597
- const requestInterceptorChain = [];
3598
- let synchronousRequestInterceptors = true;
3599
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
3600
- if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
3601
- return;
3602
- }
3603
-
3604
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
3605
-
3606
- const transitional = config.transitional || transitionalDefaults;
3607
- const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
3608
-
3609
- if (legacyInterceptorReqResOrdering) {
3610
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
3611
- } else {
3612
- requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
3613
- }
3614
- });
3615
-
3616
- const responseInterceptorChain = [];
3617
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
3618
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
3619
- });
3620
-
3621
- let promise;
3622
- let i = 0;
3623
- let len;
3624
-
3625
- if (!synchronousRequestInterceptors) {
3626
- const chain = [dispatchRequest.bind(this), undefined];
3627
- chain.unshift(...requestInterceptorChain);
3628
- chain.push(...responseInterceptorChain);
3629
- len = chain.length;
3630
-
3631
- promise = Promise.resolve(config);
3632
-
3633
- while (i < len) {
3634
- promise = promise.then(chain[i++], chain[i++]);
3635
- }
3636
-
3637
- return promise;
3638
- }
3639
-
3640
- len = requestInterceptorChain.length;
3641
-
3642
- let newConfig = config;
3643
-
3644
- while (i < len) {
3645
- const onFulfilled = requestInterceptorChain[i++];
3646
- const onRejected = requestInterceptorChain[i++];
3647
- try {
3648
- newConfig = onFulfilled(newConfig);
3649
- } catch (error) {
3650
- onRejected.call(this, error);
3651
- break;
3652
- }
3653
- }
3654
-
3655
- try {
3656
- promise = dispatchRequest.call(this, newConfig);
3657
- } catch (error) {
3658
- return Promise.reject(error);
3659
- }
3660
-
3661
- i = 0;
3662
- len = responseInterceptorChain.length;
3663
-
3664
- while (i < len) {
3665
- promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
3666
- }
3667
-
3668
- return promise;
3669
- }
3670
-
3671
- getUri(config) {
3672
- config = mergeConfig(this.defaults, config);
3673
- const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
3674
- return buildURL(fullPath, config.params, config.paramsSerializer);
3675
- }
3676
- }
3677
-
3678
- // Provide aliases for supported request methods
3679
- utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
3680
- /*eslint func-names:0*/
3681
- Axios.prototype[method] = function(url, config) {
3682
- return this.request(mergeConfig(config || {}, {
3683
- method,
3684
- url,
3685
- data: (config || {}).data
3686
- }));
3687
- };
3688
- });
3689
-
3690
- utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
3691
- /*eslint func-names:0*/
3692
-
3693
- function generateHTTPMethod(isForm) {
3694
- return function httpMethod(url, data, config) {
3695
- return this.request(mergeConfig(config || {}, {
3696
- method,
3697
- headers: isForm ? {
3698
- 'Content-Type': 'multipart/form-data'
3699
- } : {},
3700
- url,
3701
- data
3702
- }));
3703
- };
3704
- }
3705
-
3706
- Axios.prototype[method] = generateHTTPMethod();
3707
-
3708
- Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
3709
- });
3710
-
3711
- var Axios$1 = Axios;
3712
-
3713
- /**
3714
- * A `CancelToken` is an object that can be used to request cancellation of an operation.
3715
- *
3716
- * @param {Function} executor The executor function.
3717
- *
3718
- * @returns {CancelToken}
3719
- */
3720
- class CancelToken {
3721
- constructor(executor) {
3722
- if (typeof executor !== 'function') {
3723
- throw new TypeError('executor must be a function.');
3724
- }
3725
-
3726
- let resolvePromise;
3727
-
3728
- this.promise = new Promise(function promiseExecutor(resolve) {
3729
- resolvePromise = resolve;
3730
- });
3731
-
3732
- const token = this;
3733
-
3734
- // eslint-disable-next-line func-names
3735
- this.promise.then(cancel => {
3736
- if (!token._listeners) return;
3737
-
3738
- let i = token._listeners.length;
3739
-
3740
- while (i-- > 0) {
3741
- token._listeners[i](cancel);
3742
- }
3743
- token._listeners = null;
3744
- });
3745
-
3746
- // eslint-disable-next-line func-names
3747
- this.promise.then = onfulfilled => {
3748
- let _resolve;
3749
- // eslint-disable-next-line func-names
3750
- const promise = new Promise(resolve => {
3751
- token.subscribe(resolve);
3752
- _resolve = resolve;
3753
- }).then(onfulfilled);
3754
-
3755
- promise.cancel = function reject() {
3756
- token.unsubscribe(_resolve);
3757
- };
3758
-
3759
- return promise;
3760
- };
3761
-
3762
- executor(function cancel(message, config, request) {
3763
- if (token.reason) {
3764
- // Cancellation has already been requested
3765
- return;
3766
- }
3767
-
3768
- token.reason = new CanceledError$1(message, config, request);
3769
- resolvePromise(token.reason);
3770
- });
3771
- }
3772
-
3773
- /**
3774
- * Throws a `CanceledError` if cancellation has been requested.
3775
- */
3776
- throwIfRequested() {
3777
- if (this.reason) {
3778
- throw this.reason;
3779
- }
3780
- }
3781
-
3782
- /**
3783
- * Subscribe to the cancel signal
3784
- */
3785
-
3786
- subscribe(listener) {
3787
- if (this.reason) {
3788
- listener(this.reason);
3789
- return;
3790
- }
3791
-
3792
- if (this._listeners) {
3793
- this._listeners.push(listener);
3794
- } else {
3795
- this._listeners = [listener];
3796
- }
3797
- }
3798
-
3799
- /**
3800
- * Unsubscribe from the cancel signal
3801
- */
3802
-
3803
- unsubscribe(listener) {
3804
- if (!this._listeners) {
3805
- return;
3806
- }
3807
- const index = this._listeners.indexOf(listener);
3808
- if (index !== -1) {
3809
- this._listeners.splice(index, 1);
3810
- }
3811
- }
3812
-
3813
- toAbortSignal() {
3814
- const controller = new AbortController();
3815
-
3816
- const abort = (err) => {
3817
- controller.abort(err);
3818
- };
3819
-
3820
- this.subscribe(abort);
3821
-
3822
- controller.signal.unsubscribe = () => this.unsubscribe(abort);
3823
-
3824
- return controller.signal;
3825
- }
3826
-
3827
- /**
3828
- * Returns an object that contains a new `CancelToken` and a function that, when called,
3829
- * cancels the `CancelToken`.
3830
- */
3831
- static source() {
3832
- let cancel;
3833
- const token = new CancelToken(function executor(c) {
3834
- cancel = c;
3835
- });
3836
- return {
3837
- token,
3838
- cancel
3839
- };
3840
- }
3841
- }
3842
-
3843
- var CancelToken$1 = CancelToken;
3844
-
3845
- /**
3846
- * Syntactic sugar for invoking a function and expanding an array for arguments.
3847
- *
3848
- * Common use case would be to use `Function.prototype.apply`.
3849
- *
3850
- * ```js
3851
- * function f(x, y, z) {}
3852
- * const args = [1, 2, 3];
3853
- * f.apply(null, args);
3854
- * ```
3855
- *
3856
- * With `spread` this example can be re-written.
3857
- *
3858
- * ```js
3859
- * spread(function(x, y, z) {})([1, 2, 3]);
3860
- * ```
3861
- *
3862
- * @param {Function} callback
3863
- *
3864
- * @returns {Function}
3865
- */
3866
- function spread(callback) {
3867
- return function wrap(arr) {
3868
- return callback.apply(null, arr);
3869
- };
3870
- }
3871
-
3872
- /**
3873
- * Determines whether the payload is an error thrown by Axios
3874
- *
3875
- * @param {*} payload The value to test
3876
- *
3877
- * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
3878
- */
3879
- function isAxiosError(payload) {
3880
- return utils$1.isObject(payload) && (payload.isAxiosError === true);
3881
- }
3882
-
3883
- const HttpStatusCode = {
3884
- Continue: 100,
3885
- SwitchingProtocols: 101,
3886
- Processing: 102,
3887
- EarlyHints: 103,
3888
- Ok: 200,
3889
- Created: 201,
3890
- Accepted: 202,
3891
- NonAuthoritativeInformation: 203,
3892
- NoContent: 204,
3893
- ResetContent: 205,
3894
- PartialContent: 206,
3895
- MultiStatus: 207,
3896
- AlreadyReported: 208,
3897
- ImUsed: 226,
3898
- MultipleChoices: 300,
3899
- MovedPermanently: 301,
3900
- Found: 302,
3901
- SeeOther: 303,
3902
- NotModified: 304,
3903
- UseProxy: 305,
3904
- Unused: 306,
3905
- TemporaryRedirect: 307,
3906
- PermanentRedirect: 308,
3907
- BadRequest: 400,
3908
- Unauthorized: 401,
3909
- PaymentRequired: 402,
3910
- Forbidden: 403,
3911
- NotFound: 404,
3912
- MethodNotAllowed: 405,
3913
- NotAcceptable: 406,
3914
- ProxyAuthenticationRequired: 407,
3915
- RequestTimeout: 408,
3916
- Conflict: 409,
3917
- Gone: 410,
3918
- LengthRequired: 411,
3919
- PreconditionFailed: 412,
3920
- PayloadTooLarge: 413,
3921
- UriTooLong: 414,
3922
- UnsupportedMediaType: 415,
3923
- RangeNotSatisfiable: 416,
3924
- ExpectationFailed: 417,
3925
- ImATeapot: 418,
3926
- MisdirectedRequest: 421,
3927
- UnprocessableEntity: 422,
3928
- Locked: 423,
3929
- FailedDependency: 424,
3930
- TooEarly: 425,
3931
- UpgradeRequired: 426,
3932
- PreconditionRequired: 428,
3933
- TooManyRequests: 429,
3934
- RequestHeaderFieldsTooLarge: 431,
3935
- UnavailableForLegalReasons: 451,
3936
- InternalServerError: 500,
3937
- NotImplemented: 501,
3938
- BadGateway: 502,
3939
- ServiceUnavailable: 503,
3940
- GatewayTimeout: 504,
3941
- HttpVersionNotSupported: 505,
3942
- VariantAlsoNegotiates: 506,
3943
- InsufficientStorage: 507,
3944
- LoopDetected: 508,
3945
- NotExtended: 510,
3946
- NetworkAuthenticationRequired: 511,
3947
- WebServerIsDown: 521,
3948
- ConnectionTimedOut: 522,
3949
- OriginIsUnreachable: 523,
3950
- TimeoutOccurred: 524,
3951
- SslHandshakeFailed: 525,
3952
- InvalidSslCertificate: 526,
3953
- };
3954
-
3955
- Object.entries(HttpStatusCode).forEach(([key, value]) => {
3956
- HttpStatusCode[value] = key;
3957
- });
3958
-
3959
- var HttpStatusCode$1 = HttpStatusCode;
3960
-
3961
- /**
3962
- * Create an instance of Axios
3963
- *
3964
- * @param {Object} defaultConfig The default config for the instance
3965
- *
3966
- * @returns {Axios} A new instance of Axios
3967
- */
3968
- function createInstance(defaultConfig) {
3969
- const context = new Axios$1(defaultConfig);
3970
- const instance = bind(Axios$1.prototype.request, context);
3971
-
3972
- // Copy axios.prototype to instance
3973
- utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
3974
-
3975
- // Copy context to instance
3976
- utils$1.extend(instance, context, null, {allOwnKeys: true});
3977
-
3978
- // Factory for creating new instances
3979
- instance.create = function create(instanceConfig) {
3980
- return createInstance(mergeConfig(defaultConfig, instanceConfig));
3981
- };
3982
-
3983
- return instance;
3984
- }
3985
-
3986
- // Create the default instance to be exported
3987
- const axios = createInstance(defaults$1);
3988
-
3989
- // Expose Axios class to allow class inheritance
3990
- axios.Axios = Axios$1;
3991
-
3992
- // Expose Cancel & CancelToken
3993
- axios.CanceledError = CanceledError$1;
3994
- axios.CancelToken = CancelToken$1;
3995
- axios.isCancel = isCancel;
3996
- axios.VERSION = VERSION;
3997
- axios.toFormData = toFormData;
3998
-
3999
- // Expose AxiosError class
4000
- axios.AxiosError = AxiosError$1;
4001
-
4002
- // alias for CanceledError for backward compatibility
4003
- axios.Cancel = axios.CanceledError;
4004
-
4005
- // Expose all/spread
4006
- axios.all = function all(promises) {
4007
- return Promise.all(promises);
4008
- };
4009
-
4010
- axios.spread = spread;
4011
-
4012
- // Expose isAxiosError
4013
- axios.isAxiosError = isAxiosError;
4014
-
4015
- // Expose mergeConfig
4016
- axios.mergeConfig = mergeConfig;
4017
-
4018
- axios.AxiosHeaders = AxiosHeaders$1;
4019
-
4020
- axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
4021
-
4022
- axios.getAdapter = adapters.getAdapter;
4023
-
4024
- axios.HttpStatusCode = HttpStatusCode$1;
4025
-
4026
- axios.default = axios;
4027
-
4028
- axios_1 = axios;
4029
-
4030
- return axios_1;
4031
- }
4032
-
4033
- var axiosExports = /*@__PURE__*/ requireAxios();
4034
- var axios = /*@__PURE__*/getDefaultExportFromCjs(axiosExports);
4035
-
4036
- // import axios from 'axios';
4037
- // const API_BASE_URL = 'http://localhost:4000';
4038
- // export interface FetchDesignSystemResponse {
4039
- // variables: Record<string, any>;
4040
- // components: Record<string, any>;
4041
- // metadata?: {
4042
- // name?: string;
4043
- // version?: string;
4044
- // lastUpdated?: string;
4045
- // };
4046
- // }
4047
- // export class DesignSystemApiClient {
4048
- // async fetchVariables(): Promise<Record<string, any>> {
4049
- // try {
4050
- // const response = await axios.get(`${API_BASE_URL}/variables`);
4051
- // return response.data;
4052
- // } catch (error) {
4053
- // console.error('Error fetching variables:', error);
4054
- // return {};
4055
- // }
4056
- // }
4057
- // async fetchComponents(): Promise<Record<string, any>> {
4058
- // try {
4059
- // const response = await axios.get(`${API_BASE_URL}/components`);
4060
- // return response.data;
4061
- // } catch (error) {
4062
- // console.error('Error fetching components:', error);
4063
- // return {};
4064
- // }
4065
- // }
4066
- // async fetchDesignSystem(): Promise<FetchDesignSystemResponse> {
4067
- // const [variables, components] = await Promise.all([
4068
- // this.fetchVariables(),
4069
- // this.fetchComponents()
4070
- // ]);
4071
- // return {
4072
- // variables,
4073
- // components,
4074
- // metadata: {
4075
- // name: 'Charisol Design System',
4076
- // lastUpdated: new Date().toISOString()
4077
- // }
4078
- // };
4079
- // }
4080
- // }
4081
- //// new from dataaaaa
4082
- const API_BASE_URL = 'http://localhost:4000';
4083
- class DesignSystemApiClient {
4084
- async fetchVariables() {
4085
- try {
4086
- const response = await axios.get(`${API_BASE_URL}/variables`);
4087
- return response.data;
4088
- }
4089
- catch (error) {
4090
- console.error('Error fetching variables:', error);
4091
- return {};
4092
- }
4093
- }
4094
- async fetchComponents() {
4095
- try {
4096
- const response = await axios.get(`${API_BASE_URL}/components`);
4097
- return response.data;
4098
- }
4099
- catch (error) {
4100
- console.error('Error fetching components:', error);
4101
- return {};
4102
- }
4103
- }
4104
- async fetchDesignSystem() {
4105
- const [variables, components] = await Promise.all([
4106
- this.fetchVariables(),
4107
- this.fetchComponents()
4108
- ]);
4109
- return {
4110
- variables,
4111
- components,
4112
- metadata: {
4113
- name: 'Charisol Design System',
4114
- lastUpdated: new Date().toISOString()
4115
- }
4116
- };
4117
- }
4118
- }
4119
-
4120
- class ComponentGeneratorUtils {
4121
- static toKebabCase(str) {
4122
- return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
4123
- }
4124
- static isSVGContent(content) {
4125
- if (!content)
4126
- return false;
4127
- return content.includes('<svg') && content.includes('</svg>');
4128
- }
4129
- static toCamelCase(str) {
4130
- return str.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
4131
- }
4132
- static toPascalCase(str) {
4133
- return str
4134
- .replace(/(?:^\w|[A-Z]|\b\w)/g, (word) => word.toUpperCase())
4135
- .replace(/[-_]/g, '');
4136
- }
4137
- static resolveTokenValue(value, variables) {
4138
- if (!value)
4139
- return '';
4140
- if (value.startsWith('var(--')) {
4141
- return value;
4142
- }
4143
- if (value.startsWith('--') && variables && variables[value]) {
4144
- return `var(${value})`;
4145
- }
4146
- return value;
4147
- }
4148
- static extractPropsFromProperties(properties = {}) {
4149
- return Object.keys(properties).map(key => this.toCamelCase(key));
4150
- }
4151
- }
4152
-
4153
- class StencilComponentGenerator {
4154
- apiClient;
4155
- outputDir;
4156
- stylesDir;
4157
- componentPrefix = 'chardes';
4158
- variables = {};
4159
- // tagName -> className for the index
4160
- generatedComponents = new Map();
4161
- constructor() {
4162
- this.apiClient = new DesignSystemApiClient();
4163
- this.outputDir = path.join(process.cwd(), 'src', 'components', 'generated');
4164
- this.stylesDir = path.join(process.cwd(), 'src', 'styles');
4165
- }
4166
- async generateAllComponents() {
4167
- try {
4168
- console.log('Fetching design system data...');
4169
- const designSystem = await this.apiClient.fetchDesignSystem();
4170
- this.variables = designSystem.variables;
4171
- console.log('Generating design tokens CSS...');
4172
- await this.generateDesignTokensCSS(designSystem.variables);
4173
- console.log('Generating utility classes CSS...');
4174
- await this.generateUtilityClassesCSS(designSystem.components, designSystem.variables);
4175
- console.log('Generating Stencil components...');
4176
- await this.generateComponents(designSystem.components, designSystem.variables);
4177
- console.log('Updating component index...');
4178
- await this.updateComponentIndex();
4179
- console.log('All components generated successfully!');
4180
- }
4181
- catch (error) {
4182
- console.error('Error generating components:', error);
4183
- process.exit(1);
4184
- }
4185
- }
4186
- // ─── Design Tokens CSS ──────────────────────────────────────────────────────
4187
- async generateDesignTokensCSS(variables) {
4188
- const cssLines = [':root {'];
4189
- for (const [varName, token] of Object.entries(variables)) {
4190
- const value = this.resolveTokenValue(token.value, variables);
4191
- const comment = token.comment ? `\n /* ${token.comment} */` : '';
4192
- cssLines.push(`${comment}\n ${varName}: ${value};`);
4193
- }
4194
- cssLines.push('}');
4195
- if (!fs.existsSync(this.stylesDir)) {
4196
- fs.mkdirSync(this.stylesDir, { recursive: true });
4197
- }
4198
- fs.writeFileSync(path.join(this.stylesDir, 'design-tokens.css'), cssLines.join('\n'));
4199
- }
4200
- resolveTokenValue(value, variables) {
4201
- if (!value)
4202
- return '';
4203
- const varMatch = value.match(/var\(--([^)]+)\)/);
4204
- if (varMatch) {
4205
- const tokenName = `--${varMatch[1]}`;
4206
- const token = variables[tokenName];
4207
- if (token)
4208
- return this.resolveTokenValue(token.value, variables);
4209
- return value;
4210
- }
4211
- if (value.startsWith('--')) {
4212
- const token = variables[value];
4213
- if (token)
4214
- return this.resolveTokenValue(token.value, variables);
4215
- }
4216
- const token = Object.values(variables).find(t => t.value === value);
4217
- if (token?.unit && token.type === 'dimension' && !value.includes(token.unit)) {
4218
- return `${value}${token.unit}`;
4219
- }
4220
- return value;
4221
- }
4222
- // ─── Utility Classes CSS ────────────────────────────────────────────────────
4223
- async generateUtilityClassesCSS(components, variables) {
4224
- const allUtilityClasses = this.extractAllUtilityClassesFromComponents(components);
4225
- const cssLines = [
4226
- '/* Auto-generated Utility Classes from Design System */',
4227
- '/* DO NOT EDIT - Generated from your design system API */',
4228
- '',
4229
- ':host, :root {',
4230
- ' display: block;',
4231
- ' box-sizing: border-box;',
4232
- '}',
4233
- '',
4234
- '*, *::before, *::after {',
4235
- ' box-sizing: inherit;',
4236
- '}',
4237
- ''
4238
- ];
4239
- const escapeClassName = (className) => {
4240
- if (!className)
4241
- return className;
4242
- let escaped = className.replace(/\//g, '\\/');
4243
- escaped = escaped.replace(/[!#$%&()*+,.<=>?@[\]^`{|}~]/g, (match) => {
4244
- if (match === '-' || match === '_')
4245
- return match;
4246
- return '\\' + match;
4247
- });
4248
- return escaped;
4249
- };
4250
- const getTokenValue = (tokenName, defaultValue) => {
4251
- const token = variables[tokenName];
4252
- if (!token)
4253
- return defaultValue;
4254
- let value = token.value;
4255
- if (value.startsWith('--'))
4256
- return `var(${value})`;
4257
- if (token.unit && token.type === 'dimension' && !value.includes(token.unit))
4258
- value = `${value}${token.unit}`;
4259
- return `var(${tokenName}, ${value})`;
4260
- };
4261
- allUtilityClasses.forEach(className => {
4262
- if (!className || className.includes(':'))
4263
- return;
4264
- const cssProperties = this.getUtilityClassProperties(className, variables, getTokenValue);
4265
- if (cssProperties.length > 0) {
4266
- const escapedClassName = escapeClassName(className);
4267
- cssLines.push(`.${escapedClassName} {`);
4268
- cssProperties.forEach(prop => cssLines.push(` ${prop};`));
4269
- cssLines.push('}');
4270
- cssLines.push('');
4271
- }
4272
- });
4273
- const stateClasses = this.extractStateClassesFromComponents(components);
4274
- stateClasses.forEach(stateClass => {
4275
- const [state, baseClass] = stateClass.split(':');
4276
- const cssProperties = this.getUtilityClassProperties(baseClass, variables, getTokenValue);
4277
- if (cssProperties.length > 0) {
4278
- const escapedBaseClass = escapeClassName(baseClass);
4279
- cssLines.push(`.${escapedBaseClass}:${state} {`);
4280
- cssProperties.forEach(prop => cssLines.push(` ${prop};`));
4281
- cssLines.push('}');
4282
- cssLines.push('');
4283
- }
4284
- });
4285
- fs.writeFileSync(path.join(this.stylesDir, 'utilities.css'), cssLines.join('\n'));
4286
- }
4287
- extractAllUtilityClassesFromComponents(components) {
4288
- const classes = new Set();
4289
- const walk = (node) => {
4290
- if (node.linkedElement?.attributes?.class) {
4291
- this.resolveClassReferences(node.linkedElement.attributes.class)
4292
- .split(' ')
4293
- .forEach(cls => {
4294
- if (cls && !cls.includes(':'))
4295
- classes.add(cls);
4296
- });
4297
- }
4298
- if (node.children)
4299
- Object.values(node.children).forEach(child => walk(child));
4300
- };
4301
- Object.values(components).forEach(component => walk(component));
4302
- return classes;
4303
- }
4304
- extractStateClassesFromComponents(components) {
4305
- const stateClasses = new Set();
4306
- const walk = (node) => {
4307
- if (node.linkedElement?.attributes?.class) {
4308
- this.resolveClassReferences(node.linkedElement.attributes.class)
4309
- .split(' ')
4310
- .forEach(cls => {
4311
- if (cls.includes(':'))
4312
- stateClasses.add(cls);
4313
- });
4314
- }
4315
- if (node.children)
4316
- Object.values(node.children).forEach(child => walk(child));
4317
- };
4318
- Object.values(components).forEach(component => walk(component));
4319
- return stateClasses;
4320
- }
4321
- resolveClassReferences(classString) {
4322
- if (!classString)
4323
- return '';
4324
- const parts = classString.split(' ').filter(p => p.trim());
4325
- const resolvedParts = parts.map(part => {
4326
- const varMatch = part.match(/var\(--([^)]+)\)/);
4327
- if (varMatch) {
4328
- const tokenName = `--${varMatch[1]}`;
4329
- const token = this.variables[tokenName];
4330
- if (token) {
4331
- if (token.value.startsWith('var(--') || token.value.startsWith('--'))
4332
- return this.resolveClassReferences(token.value);
4333
- return token.value;
4334
- }
4335
- return varMatch[1].replace(/^--/, '');
4336
- }
4337
- if (part.startsWith('--')) {
4338
- const token = this.variables[part];
4339
- if (token) {
4340
- if (token.value.startsWith('var(--') || token.value.startsWith('--'))
4341
- return this.resolveClassReferences(token.value);
4342
- return token.value;
4343
- }
4344
- return part.replace(/^--/, '');
4345
- }
4346
- return part;
4347
- });
4348
- return resolvedParts.filter(p => p && p.trim()).join(' ');
4349
- }
4350
- getUtilityClassProperties(className, variables, getTokenValue) {
4351
- const utilityMap = {
4352
- 'flex': () => ['display: flex'],
4353
- 'flex-1': () => ['flex: 1 1 0%'],
4354
- 'flex-shrink-0': () => ['flex-shrink: 0'],
4355
- 'flex-col': () => ['flex-direction: column'],
4356
- 'items-center': () => ['align-items: center'],
4357
- 'items-start': () => ['align-items: flex-start'],
4358
- 'justify-between': () => ['justify-content: space-between'],
4359
- 'justify-center': () => ['justify-content: center'],
4360
- 'w-full': () => [`width: ${getTokenValue('--width', '100%')}`],
4361
- 'h-full': () => [`height: ${getTokenValue('--height', '100%')}`],
4362
- 'max-w-md': () => [`max-width: ${getTokenValue('--max-width', '300rem')}`],
4363
- 'mx-auto': () => ['margin-left: auto', 'margin-right: auto'],
4364
- 'overflow-hidden': () => ['overflow: hidden'],
4365
- 'object-cover': () => ['object-fit: cover'],
4366
- 'relative': () => ['position: relative'],
4367
- 'absolute': () => ['position: absolute'],
4368
- 'fixed': () => ['position: fixed'],
4369
- 'inset-0': () => ['top: 0', 'right: 0', 'bottom: 0', 'left: 0'],
4370
- 'top-0': () => ['top: 0'],
4371
- 'left-0': () => ['left: 0'],
4372
- 'top-1/2': () => ['top: 50%'],
4373
- 'left-1/2': () => ['left: 50%'],
4374
- '-translate-x-1/2': () => ['transform: translateX(-50%)'],
4375
- '-translate-y-1/2': () => ['transform: translateY(-50%)'],
4376
- 'grid': () => ['display: grid'],
4377
- 'grid-cols-2': () => ['grid-template-columns: repeat(2, minmax(0, 1fr))'],
4378
- 'p-1': () => [`padding: ${getTokenValue('--spacing-1', '0.25rem')}`],
4379
- 'p-2': () => [`padding: ${getTokenValue('--spacing-2', '0.5rem')}`],
4380
- 'p-4': () => [`padding: ${getTokenValue('--spacing-4', '1rem')}`],
4381
- 'p-6': () => [`padding: ${getTokenValue('--spacing-6', '2.5rem')}`],
4382
- 'px-2': () => [`padding-left: ${getTokenValue('--spacing-2', '0.5rem')}`, `padding-right: ${getTokenValue('--spacing-2', '0.5rem')}`],
4383
- 'px-3': () => [`padding-left: ${getTokenValue('--spacing-3', '0.75rem')}`, `padding-right: ${getTokenValue('--spacing-3', '0.75rem')}`],
4384
- 'px-4': () => [`padding-left: ${getTokenValue('--spacing-4', '1rem')}`, `padding-right: ${getTokenValue('--spacing-4', '1rem')}`],
4385
- 'px-6': () => [`padding-left: ${getTokenValue('--spacing-6', '2.5rem')}`, `padding-right: ${getTokenValue('--spacing-6', '2.5rem')}`],
4386
- 'py-1': () => [`padding-top: ${getTokenValue('--spacing-1', '0.25rem')}`, `padding-bottom: ${getTokenValue('--spacing-1', '0.25rem')}`],
4387
- 'py-2': () => [`padding-top: ${getTokenValue('--spacing-2', '0.5rem')}`, `padding-bottom: ${getTokenValue('--spacing-2', '0.5rem')}`],
4388
- 'py-3': () => [`padding-top: ${getTokenValue('--spacing-3', '0.75rem')}`, `padding-bottom: ${getTokenValue('--spacing-3', '0.75rem')}`],
4389
- 'py-4': () => [`padding-top: ${getTokenValue('--spacing-4', '1rem')}`, `padding-bottom: ${getTokenValue('--spacing-4', '1rem')}`],
4390
- 'py-6': () => [`padding-top: ${getTokenValue('--spacing-6', '2.5rem')}`, `padding-bottom: ${getTokenValue('--spacing-6', '2.5rem')}`],
4391
- 'pb-6': () => [`padding-bottom: ${getTokenValue('--spacing-6', '2.5rem')}`],
4392
- 'mt-1': () => [`margin-top: ${getTokenValue('--spacing-1', '0.25rem')}`],
4393
- 'mt-6': () => [`margin-top: ${getTokenValue('--spacing-6', '2.5rem')}`],
4394
- 'mb-1': () => [`margin-bottom: ${getTokenValue('--spacing-1', '0.25rem')}`],
4395
- 'mb-2': () => [`margin-bottom: ${getTokenValue('--spacing-2', '0.5rem')}`],
4396
- 'mb-3': () => [`margin-bottom: ${getTokenValue('--spacing-3', '0.75rem')}`],
4397
- 'ml-3': () => [`margin-left: ${getTokenValue('--spacing-3', '0.75rem')}`],
4398
- 'pl-12': () => ['padding-left: 3rem'],
4399
- 'space-x-2': () => [`> * + * { margin-left: ${getTokenValue('--spacing-2', '0.5rem')}; }`],
4400
- 'space-x-3': () => [`> * + * { margin-left: ${getTokenValue('--spacing-3', '0.75rem')}; }`],
4401
- 'space-x-4': () => [`> * + * { margin-left: ${getTokenValue('--spacing-4', '1rem')}; }`],
4402
- 'space-y-2': () => [`> * + * { margin-top: ${getTokenValue('--spacing-2', '0.5rem')}; }`],
4403
- 'space-y-4': () => [`> * + * { margin-top: ${getTokenValue('--spacing-4', '1rem')}; }`],
4404
- 'space-y-6': () => [`> * + * { margin-top: ${getTokenValue('--spacing-6', '2.5rem')}; }`],
4405
- 'w-3': () => ['width: 0.75rem'],
4406
- 'h-3': () => ['height: 0.75rem'],
4407
- 'w-4': () => ['width: 1rem'],
4408
- 'h-4': () => ['height: 1rem'],
4409
- 'w-5': () => ['width: 1.25rem'],
4410
- 'h-5': () => ['height: 1.25rem'],
4411
- 'w-6': () => ['width: 1.5rem'],
4412
- 'h-6': () => ['height: 1.5rem'],
4413
- 'w-8': () => [`width: ${getTokenValue('--spacing-8', '2rem')}`],
4414
- 'h-8': () => [`height: ${getTokenValue('--spacing-8', '2rem')}`],
4415
- 'w-12': () => [`width: ${getTokenValue('--spacing-12', '3rem')}`],
4416
- 'h-12': () => [`height: ${getTokenValue('--spacing-12', '3rem')}`],
4417
- 'w-14': () => [`width: ${getTokenValue('--spacing-14', '3.5rem')}`],
4418
- 'h-14': () => [`height: ${getTokenValue('--spacing-14', '3.5rem')}`],
4419
- 'bg-white': () => [`background-color: ${getTokenValue('--white', '#ffffff')}`],
4420
- 'bg-black': () => [`background-color: ${getTokenValue('--black', '#000000')}`],
4421
- 'bg-gray-50': () => [`background-color: ${getTokenValue('--gray-50', '#f9f9f9')}`],
4422
- 'bg-gray-100': () => [`background-color: ${getTokenValue('--gray-100', '#f3f4f6')}`],
4423
- 'bg-gray-300': () => [`background-color: ${getTokenValue('--gray-300', '#d5d8dc')}`],
4424
- 'bg-gray-800': () => [`background-color: ${getTokenValue('--gray-800', '#122be2')}`],
4425
- 'bg-gray-900': () => [`background-color: ${getTokenValue('--gray-900', '#f976f5')}`],
4426
- 'bg-blue-50': () => [`background-color: ${getTokenValue('--blue-50', '#eff6ff')}`],
4427
- 'bg-blue-600': () => [`background-color: ${getTokenValue('--blue-600', '#2563eb')}`],
4428
- 'bg-blue-700': () => ['background-color: #1d4ed8'],
4429
- 'bg-green-600': () => ['background-color: #16a34a'],
4430
- 'bg-red-600': () => ['background-color: #dc2626'],
4431
- 'bg-success-50': () => [`background-color: ${getTokenValue('--success-50', '#f0fdf4')}`],
4432
- 'bg-warning-50': () => [`background-color: ${getTokenValue('--warning-50', '#fffbeb')}`],
4433
- 'bg-error-50': () => [`background-color: ${getTokenValue('--error-50', '#fef2f2')}`],
4434
- 'bg-info-50': () => [`background-color: ${getTokenValue('--info-50', '#eff6ff')}`],
4435
- 'bg-transparent': () => ['background-color: transparent'],
4436
- 'text-white': () => [`color: ${getTokenValue('--white', '#ffffff')}`],
4437
- 'text-black': () => [`color: ${getTokenValue('--black', '#000000')}`],
4438
- 'text-gray-300': () => [`color: ${getTokenValue('--gray-300', '#d5d8dc')}`],
4439
- 'text-gray-500': () => [`color: ${getTokenValue('--gray-500', '#7af202')}`],
4440
- 'text-gray-600': () => [`color: ${getTokenValue('--gray-600', '#4b5563')}`],
4441
- 'text-gray-700': () => [`color: ${getTokenValue('--gray-700', '#374151')}`],
4442
- 'text-gray-800': () => [`color: ${getTokenValue('--gray-800', '#122be2')}`],
4443
- 'text-gray-900': () => [`color: ${getTokenValue('--gray-900', '#f976f5')}`],
4444
- 'text-blue-600': () => [`color: ${getTokenValue('--blue-600', '#2563eb')}`],
4445
- 'text-red-600': () => ['color: #dc2626'],
4446
- 'text-green-600': () => ['color: #16a34a'],
4447
- 'text-success-700': () => [`color: ${getTokenValue('--success-700', '#15803d')}`],
4448
- 'text-warning-700': () => [`color: ${getTokenValue('--warning-700', '#b45309')}`],
4449
- 'text-error-700': () => [`color: ${getTokenValue('--error-700', '#b91c1c')}`],
4450
- 'text-info-700': () => [`color: ${getTokenValue('--info-700', '#1d4ed8')}`],
4451
- 'rounded': () => [`border-radius: ${getTokenValue('--border-radius-md', '0.25rem')}`],
4452
- 'rounded-md': () => [`border-radius: ${getTokenValue('--border-radius-md', '0.375rem')}`],
4453
- 'rounded-lg': () => [`border-radius: ${getTokenValue('--border-radius-lg', '8px')}`],
4454
- 'rounded-xl': () => [`border-radius: ${getTokenValue('--border-radius-xl', '2px')}`],
4455
- 'rounded-2xl': () => [`border-radius: ${getTokenValue('--border-radius-2xl', '16px')}`],
4456
- 'rounded-3xl': () => [`border-radius: ${getTokenValue('--border-radius-3xl', '20px')}`],
4457
- 'rounded-full': () => [`border-radius: ${getTokenValue('--border-radius-full', '50%')}`],
4458
- 'border': () => [`border-width: ${getTokenValue('--border-width-1', '1px')}`, `border-style: ${getTokenValue('--border-style-solid', 'solid')}`, `border-color: ${getTokenValue('--gray-200', '#e5e7eb')}`],
4459
- 'border-2': () => ['border-width: 2px', 'border-style: solid', 'border-color: inherit'],
4460
- 'border-b': () => [`border-bottom-width: ${getTokenValue('--border-width-1', '1px')}`, `border-bottom-style: ${getTokenValue('--border-style-solid', 'solid')}`, `border-bottom-color: ${getTokenValue('--gray-200', '#e5e7eb')}`],
4461
- 'border-t': () => [`border-top-width: ${getTokenValue('--border-width-1', '1px')}`, `border-top-style: ${getTokenValue('--border-style-solid', 'solid')}`, `border-top-color: ${getTokenValue('--gray-200', '#e5e7eb')}`],
4462
- 'border-solid': () => ['border-style: solid'],
4463
- 'border-gray-200': () => [`border-color: ${getTokenValue('--gray-200', '#e5e7eb')}`],
4464
- 'border-gray-300': () => [`border-color: ${getTokenValue('--gray-300', '#d1d5db')}`],
4465
- 'border-gray-400': () => [`border-color: ${getTokenValue('--gray-400', '#9ca3af')}`],
4466
- 'border-blue-600': () => [`border-color: ${getTokenValue('--blue-600', '#2563eb')}`],
4467
- 'border-blue-700': () => ['border-color: #1d4ed8'],
4468
- 'border-red-500': () => ['border-color: #ef4444'],
4469
- 'border-green-600': () => ['border-color: #16a34a'],
4470
- 'border-success-200': () => [`border-color: ${getTokenValue('--success-200', '#bbf7d0')}`],
4471
- 'border-warning-200': () => [`border-color: ${getTokenValue('--warning-200', '#fed7aa')}`],
4472
- 'border-error-200': () => [`border-color: ${getTokenValue('--error-200', '#fecaca')}`],
4473
- 'border-info-200': () => [`border-color: ${getTokenValue('--info-200', '#bfdbfe')}`],
4474
- 'font-sans': () => [`font-family: ${getTokenValue('--font-family-sans', 'Inter, system-ui, sans-serif')}`],
4475
- 'font-mono': () => [`font-family: ${getTokenValue('--font-family-mono', 'ui-monospace, monospace')}`],
4476
- 'font-medium': () => ['font-weight: 500'],
4477
- 'font-semibold': () => [`font-weight: ${getTokenValue('--font-weight-semibold', '600')}`],
4478
- 'font-bold': () => ['font-weight: 700'],
4479
- 'text-xs': () => [`font-size: ${getTokenValue('--font-size-xs', '0.75rem')}`, 'line-height: 1rem'],
4480
- 'text-sm': () => [`font-size: ${getTokenValue('--font-size-sm', '0.875rem')}`, 'line-height: 1.25rem'],
4481
- 'text-base': () => [`font-size: ${getTokenValue('--font-size-base', '1rem')}`, 'line-height: 1.5rem'],
4482
- 'text-lg': () => [`font-size: ${getTokenValue('--font-size-lg', '1.125rem')}`, 'line-height: 1.75rem'],
4483
- 'text-xl': () => ['font-size: 1.25rem', 'line-height: 1.75rem'],
4484
- 'leading-relaxed': () => ['line-height: 1.625'],
4485
- 'shadow-lg': () => [`box-shadow: ${getTokenValue('--shadow-lg', '0 10px 15px -3px rgba(0,0,0,0.1)')}`],
4486
- 'shadow-sm': () => [`box-shadow: ${getTokenValue('--shadow-sm', '0 1px 2px 0 rgba(0,0,0,0.05)')}`],
4487
- 'shadow-soft': () => [`box-shadow: ${getTokenValue('--shadow-soft', '0 4px 20px rgba(0,0,0,0.08)')}`],
4488
- 'shadow-subtle': () => [`box-shadow: ${getTokenValue('--shadow-subtle', '0 2px 10px rgba(0,0,0,0.04)')}`],
4489
- 'transition-colors': () => [`transition-property: color, background-color, border-color, box-shadow`, `transition-duration: ${getTokenValue('--duration-200', '0.2s')}`, `transition-timing-function: ease-in-out`],
4490
- 'transition-all': () => ['transition-property: all', `transition-duration: ${getTokenValue('--duration-200', '0.2s')}`, 'transition-timing-function: ease-in-out'],
4491
- 'transition-opacity': () => ['transition-property: opacity', `transition-duration: ${getTokenValue('--duration-200', '0.2s')}`, 'transition-timing-function: ease-in-out'],
4492
- 'duration-200': () => [`transition-duration: ${getTokenValue('--duration-200', '0.2s')}`],
4493
- 'duration-300': () => ['transition-duration: 0.3s'],
4494
- 'ease-out': () => ['transition-timing-function: cubic-bezier(0, 0, 0.2, 1)'],
4495
- 'transform': () => ['transform: translateX(0) translateY(0) rotate(0) scale(1)'],
4496
- 'cursor-pointer': () => ['cursor: pointer'],
4497
- 'cursor-not-allowed': () => ['cursor: not-allowed'],
4498
- 'pointer-events-none': () => ['pointer-events: none'],
4499
- 'opacity-0': () => ['opacity: 0'],
4500
- 'opacity-100': () => ['opacity: 1'],
4501
- 'outline-none': () => ['outline: 2px solid transparent', 'outline-offset: 2px'],
4502
- 'appearance-none': () => ['appearance: none'],
4503
- 'select-none': () => ['user-select: none'],
4504
- };
4505
- const generator = utilityMap[className];
4506
- return generator ? generator() : [];
4507
- }
4508
- // ─── Component Generation ───────────────────────────────────────────────────
4509
- async generateComponents(components, variables) {
4510
- if (!fs.existsSync(this.outputDir)) {
4511
- fs.mkdirSync(this.outputDir, { recursive: true });
4512
- }
4513
- for (const [componentName, componentData] of Object.entries(components)) {
4514
- await this.generateCompoundComponents(componentName, componentData, variables);
4515
- }
4516
- }
4517
- async generateCompoundComponents(componentName, componentData, variables) {
4518
- // Root: charisol-card, charisol-button, charisol-input …
4519
- await this.generateSingleComponent(componentName, componentData, variables, true);
4520
- // Children: tag is simply charisol-{childNodeKey}
4521
- // e.g. child key "card-container" → charisol-card-container
4522
- // child key "card-header" → charisol-card-header
4523
- // No double-prefixing of the parent name.
4524
- if (componentData.children) {
4525
- for (const [childName, childNode] of Object.entries(componentData.children)) {
4526
- await this.generateSubComponentsRecursive(childName, childNode, variables);
4527
- }
4528
- }
4529
- }
4530
- /**
4531
- * Recursively generate one Stencil component per named node.
4532
- *
4533
- * TAG NAMING:
4534
- * The child node key already carries its full descriptive name, e.g.
4535
- * "card-container", "card-header", "card-header-title".
4536
- * We just prepend the library prefix: charisol-{nodeName}.
4537
- * This prevents the double-name bug (charisol-card-card-container).
4538
- */
4539
- async generateSubComponentsRecursive(nodeName, node, variables) {
4540
- await this.generateSingleComponent(nodeName, node, variables, false);
4541
- if (node.children) {
4542
- for (const [childName, childNode] of Object.entries(node.children)) {
4543
- await this.generateSubComponentsRecursive(childName, childNode, variables);
4544
- }
4545
- }
4546
- }
4547
- /**
4548
- * Core component writer.
4549
- *
4550
- * PURE HTML — every component renders its subtree as real HTML elements.
4551
- * No <charisol-*> tags anywhere in the output TSX.
4552
- *
4553
- * Props exposed on the root element only (text, svgIcon, src, alt, etc.)
4554
- * so users can override defaults. Child nodes always use their design-system
4555
- * defaults since they are rendered inline — users customise via props on the
4556
- * parent or via customStyle/customClass on the parent.
4557
- *
4558
- * TEXT SAFETY — JSON.stringify handles apostrophes and quotes.
4559
- */
4560
- async generateSingleComponent(nodeName, node, variables, isRoot) {
4561
- const kebabTag = `${this.componentPrefix}-${ComponentGeneratorUtils.toKebabCase(nodeName)}`;
4562
- const pascalName = ComponentGeneratorUtils.toPascalCase(nodeName);
4563
- const filePath = path.join(this.outputDir, `${kebabTag}.tsx`);
4564
- const cssPath = path.join(this.outputDir, `${kebabTag}.css`);
4565
- const tag = node.linkedElement?.htmlTag || 'div';
4566
- const attrs = this.processAttributes(node.linkedElement?.attributes || {}, variables);
4567
- const resolvedCls = attrs['class'] || '';
4568
- const SELF_CLOSING = ['img', 'input', 'br', 'hr', 'meta', 'link'];
4569
- const isSelfClosing = SELF_CLOSING.includes(tag);
4570
- const hasChildren = !!(node.children && Object.keys(node.children).length > 0);
4571
- const rawText = node.textContent || '';
4572
- const hasSvg = rawText.includes('<svg');
4573
- const hasText = !!rawText && !hasSvg;
4574
- // Safe strings
4575
- const safeDefaultText = hasText ? JSON.stringify(rawText) : '""';
4576
- const safeSvgLiteral = hasSvg
4577
- ? rawText.replace(/\\/g, '\\\\').replace(/`/g, '\\`').replace(/\$\{/g, '\\${')
4578
- : '';
4579
- // ── Props (on the root element of this component only) ───────────────────
4580
- const propLines = [
4581
- ` @Prop() customClass?: string;`,
4582
- ` @Prop() customStyle?: string;`,
4583
- ];
4584
- if (hasText)
4585
- propLines.push(` @Prop() text?: string;`);
4586
- if (hasSvg)
4587
- propLines.push(` @Prop() svgIcon?: string;`);
4588
- if (tag === 'img') {
4589
- propLines.push(` @Prop() src?: string;`);
4590
- propLines.push(` @Prop() alt?: string;`);
4591
- }
4592
- if (tag === 'input') {
4593
- propLines.push(` @Prop() type?: string;`);
4594
- propLines.push(` @Prop() placeholder?: string;`);
4595
- propLines.push(` @Prop() value?: string;`);
4596
- propLines.push(` @Prop() inputId?: string;`);
4597
- }
4598
- if (tag === 'label')
4599
- propLines.push(` @Prop() htmlFor?: string;`);
4600
- if (tag === 'button') {
4601
- propLines.push(` @Prop() btnType?: string;`);
4602
- propLines.push(` @Prop() ariaLabel?: string;`);
4603
- }
4604
- // ── Children rendered as pure HTML ───────────────────────────────────────
4605
- // Indented at level 4 (inside render → return → root element)
4606
- const childrenHtml = hasChildren
4607
- ? this.buildChildrenJsx(node.children, 4)
4608
- : '';
4609
- // ── Render body ──────────────────────────────────────────────────────────
4610
- const classLine = ` const cls = [${JSON.stringify(resolvedCls)}, this.customClass].filter(Boolean).join(' ');`;
4611
- const styleLine = ` const sty = this.customStyle as any || undefined;`;
4612
- let renderReturn = '';
4613
- if (isSelfClosing) {
4614
- if (tag === 'img') {
4615
- const defSrc = this.safeJsString(attrs['src'] || '');
4616
- const defAlt = this.safeJsString(attrs['alt'] || '');
4617
- renderReturn =
4618
- ` <img
4619
- class={cls}
4620
- src={this.src || ${defSrc}}
4621
- alt={this.alt || ${defAlt}}
4622
- style={sty}
4623
- />`;
4624
- }
4625
- else if (tag === 'input') {
4626
- const defType = this.safeJsString(attrs['type'] || 'text');
4627
- const defPh = this.safeJsString(attrs['placeholder'] || '');
4628
- const defId = this.safeJsString(attrs['id'] || '');
4629
- renderReturn =
4630
- ` <input
4631
- class={cls}
4632
- type={this.type || ${defType}}
4633
- id={this.inputId || ${defId}}
4634
- placeholder={this.placeholder || ${defPh}}
4635
- value={this.value}
4636
- style={sty}
4637
- />`;
4638
- }
4639
- else {
4640
- renderReturn = ` <${tag} class={cls} style={sty} />`;
4641
- }
4642
- }
4643
- else if (hasSvg) {
4644
- // SVG holder — uses innerHTML; user overrides via svgIcon prop
4645
- renderReturn =
4646
- ` <${tag}
4647
- class={cls}
4648
- style={sty}
4649
- innerHTML={this.svgIcon || \`${safeSvgLiteral}\`}
4650
- />`;
4651
- }
4652
- else if (tag === 'label') {
4653
- const defFor = this.safeJsString(attrs['htmlFor'] || attrs['for'] || '');
4654
- const inner = hasText
4655
- ? `{this.text || ${safeDefaultText}}`
4656
- : childrenHtml;
4657
- renderReturn =
4658
- ` <label
4659
- class={cls}
4660
- htmlFor={this.htmlFor || ${defFor}}
4661
- style={sty}
4662
- >
4663
- ${inner}
4664
- </label>`;
4665
- }
4666
- else if (tag === 'button') {
4667
- const defBtnType = this.safeJsString(attrs['type'] || 'button');
4668
- const defAria = this.safeJsString(attrs['aria-label'] || '');
4669
- const inner = hasText
4670
- ? `{this.text || ${safeDefaultText}}`
4671
- : childrenHtml;
4672
- renderReturn =
4673
- ` <button
4674
- class={cls}
4675
- type={this.btnType || ${defBtnType}}
4676
- aria-label={this.ariaLabel || ${defAria}}
4677
- style={sty}
4678
- >
4679
- ${inner}
4680
- </button>`;
4681
- }
4682
- else {
4683
- // div, h1, h2, h3, p, span, section, etc.
4684
- const inner = hasText
4685
- ? `{this.text || ${safeDefaultText}}`
4686
- : childrenHtml;
4687
- renderReturn =
4688
- ` <${tag}
4689
- class={cls}
4690
- style={sty}
4691
- >
4692
- ${inner}
4693
- </${tag}>`;
4694
- }
4695
- // ── Emit file ────────────────────────────────────────────────────────────
4696
- const componentCode = `import { Component, Prop, h } from '@stencil/core';
4697
-
4698
- /**
4699
- * ${node.displayName || nodeName}
4700
- * Auto-generated from Charisol Design System
4701
- */
4702
- @Component({
4703
- tag: '${kebabTag}',
4704
- styleUrl: '${kebabTag}.css',
4705
- shadow: true,
4706
- })
4707
- export class ${pascalName} {
4708
- ${propLines.join('\n')}
4709
-
4710
- render() {
4711
- ${classLine}
4712
- ${styleLine}
4713
- return (
4714
- ${renderReturn}
4715
- );
4716
- }
4717
- }
4718
- `;
4719
- fs.writeFileSync(cssPath, '/* Styles from global utilities.css */\n');
4720
- fs.writeFileSync(filePath, componentCode);
4721
- this.generatedComponents.set(kebabTag, pascalName);
4722
- console.log(`✅ Generated: ${kebabTag}.tsx`);
4723
- }
4724
- /**
4725
- * Recursively render a node tree as PURE HTML JSX.
4726
- * No <charisol-*> tags — only real HTML elements: <div>, <span>, <button>, <img>, etc.
4727
- *
4728
- * Each node is rendered using its own htmlTag and resolved CSS classes.
4729
- * SVG content is emitted via innerHTML. Text is emitted as a JSX expression.
4730
- * Children are recursed inline.
4731
- */
4732
- renderNodeAsHtml(node, indentLevel) {
4733
- const pad = ' '.repeat(indentLevel);
4734
- const tag = node.linkedElement?.htmlTag || 'div';
4735
- const attrs = this.processAttributes(node.linkedElement?.attributes || {}, this.variables);
4736
- const cls = attrs['class'] || '';
4737
- const SELF_CLOSING = ['img', 'input', 'br', 'hr', 'meta', 'link'];
4738
- const isSC = SELF_CLOSING.includes(tag);
4739
- const rawText = node.textContent || '';
4740
- const hasSvg = rawText.includes('<svg');
4741
- const hasText = !!rawText && !hasSvg;
4742
- const hasChildren = !!(node.children && Object.keys(node.children).length > 0);
4743
- // Build attribute string for this node's HTML tag
4744
- const attrParts = [];
4745
- if (cls)
4746
- attrParts.push(`class="${cls}"`);
4747
- if (tag === 'img') {
4748
- if (attrs['src'])
4749
- attrParts.push(`src="${this.escapeAttrVal(attrs['src'])}"`);
4750
- if (attrs['alt'])
4751
- attrParts.push(`alt="${this.escapeAttrVal(attrs['alt'])}"`);
4752
- }
4753
- if (tag === 'input') {
4754
- if (attrs['type'])
4755
- attrParts.push(`type="${this.escapeAttrVal(attrs['type'])}"`);
4756
- if (attrs['placeholder'])
4757
- attrParts.push(`placeholder="${this.escapeAttrVal(attrs['placeholder'])}"`);
4758
- if (attrs['id'])
4759
- attrParts.push(`id="${this.escapeAttrVal(attrs['id'])}"`);
4760
- }
4761
- if (tag === 'label') {
4762
- const forVal = attrs['htmlFor'] || attrs['for'];
4763
- if (forVal)
4764
- attrParts.push(`htmlFor="${this.escapeAttrVal(forVal)}"`);
4765
- }
4766
- if (tag === 'button') {
4767
- attrParts.push(`type="${this.escapeAttrVal(attrs['type'] || 'button')}"`);
4768
- if (attrs['aria-label'])
4769
- attrParts.push(`aria-label="${this.escapeAttrVal(attrs['aria-label'])}"`);
4770
- }
4771
- if (hasSvg) {
4772
- // innerHTML will be set; no extra attrs needed
4773
- }
4774
- const attrStr = attrParts.length > 0 ? ' ' + attrParts.join(' ') : '';
4775
- // ── Self-closing ──────────────────────────────────────────────────────────
4776
- if (isSC) {
4777
- return `${pad}<${tag}${attrStr} />`;
4778
- }
4779
- // ── SVG holder — use innerHTML ────────────────────────────────────────────
4780
- if (hasSvg) {
4781
- const safeSvg = rawText.replace(/\\/g, '\\\\').replace(/`/g, '\\`').replace(/\$\{/g, '\\${');
4782
- return `${pad}<${tag}${attrStr} innerHTML={\`${safeSvg}\`} />`;
4783
- }
4784
- // ── Open tag ──────────────────────────────────────────────────────────────
4785
- const lines = [];
4786
- lines.push(`${pad}<${tag}${attrStr}>`);
4787
- // ── Text content ──────────────────────────────────────────────────────────
4788
- if (hasText) {
4789
- lines.push(`${pad} {${JSON.stringify(rawText)}}`);
4790
- }
4791
- // ── Children ──────────────────────────────────────────────────────────────
4792
- if (hasChildren) {
4793
- for (const childNode of Object.values(node.children)) {
4794
- lines.push(this.renderNodeAsHtml(childNode, indentLevel + 1));
4795
- }
4796
- }
4797
- lines.push(`${pad}</${tag}>`);
4798
- return lines.join('\n');
4799
- }
4800
- /**
4801
- * Build children JSX by rendering each child node as pure HTML.
4802
- * Called from generateSingleComponent for container nodes.
4803
- */
4804
- buildChildrenJsx(children, indentLevel) {
4805
- return Object.values(children)
4806
- .map(child => this.renderNodeAsHtml(child, indentLevel))
4807
- .join('\n');
4808
- }
4809
- // ─── String helpers ──────────────────────────────────────────────────────────
4810
- /**
4811
- * Produce a safe JS string literal using JSON.stringify.
4812
- * Used inside JSX expressions: src={this.src || "default"}
4813
- */
4814
- safeJsString(value) {
4815
- return JSON.stringify(value);
4816
- }
4817
- /**
4818
- * Escape a value for embedding inside a JSX attribute double-quoted string.
4819
- * e.g. class="foo &amp; bar"
4820
- */
4821
- escapeAttrVal(value) {
4822
- return (value || '')
4823
- .replace(/&/g, '&amp;')
4824
- .replace(/"/g, '&quot;');
4825
- }
4826
- processAttributes(attributes = {}, variables) {
4827
- const processed = {};
4828
- for (const [key, value] of Object.entries(attributes)) {
4829
- if (key === 'class') {
4830
- processed[key] = this.resolveClassReferences(value);
4831
- }
4832
- else if (key === 'style') {
4833
- processed[key] = this.resolveStyleValue(value, variables);
4834
- }
4835
- else {
4836
- processed[key] = this.resolveAttributeValue(value, variables);
4837
- }
4838
- }
4839
- return processed;
4840
- }
4841
- resolveStyleValue(value, variables) {
4842
- if (!value)
4843
- return '';
4844
- const varMatch = value.match(/var\(--([^)]+)\)/);
4845
- if (varMatch) {
4846
- const tokenName = `--${varMatch[1]}`;
4847
- const token = variables[tokenName];
4848
- if (token) {
4849
- let v = token.value;
4850
- if (token.unit && token.type === 'dimension' && !v.includes(token.unit))
4851
- v = `${v}${token.unit}`;
4852
- return v;
4853
- }
4854
- }
4855
- return value;
4856
- }
4857
- resolveAttributeValue(value, variables) {
4858
- if (!value)
4859
- return '';
4860
- const varMatch = value.match(/var\(--([^)]+)\)/);
4861
- if (varMatch) {
4862
- const tokenName = `--${varMatch[1]}`;
4863
- const token = variables[tokenName];
4864
- if (token)
4865
- return token.value;
4866
- }
4867
- return value;
4868
- }
4869
- buildAttributeString(attributes) {
4870
- return Object.entries(attributes)
4871
- .filter(([, v]) => v && v.trim() !== '')
4872
- .map(([k, v]) => ` ${k}="${v}"`)
4873
- .join('');
4874
- }
4875
- // ─── Index ───────────────────────────────────────────────────────────────────
4876
- async updateComponentIndex() {
4877
- const exportLines = [];
4878
- for (const [tagName, className] of this.generatedComponents.entries()) {
4879
- exportLines.push(`export { ${className} } from './${tagName}';`);
4880
- }
4881
- const generatedIndexPath = path.join(this.outputDir, 'index.ts');
4882
- fs.writeFileSync(generatedIndexPath, exportLines.join('\n') + '\n');
4883
- const mainIndexPath = path.join(process.cwd(), 'src', 'components', 'index.ts');
4884
- fs.mkdirSync(path.dirname(mainIndexPath), { recursive: true });
4885
- fs.writeFileSync(mainIndexPath, `// Auto-generated component index\nexport * from './generated/index';\n`);
4886
- }
4887
- }
4888
- if (require.main === module) {
4889
- const generator = new StencilComponentGenerator();
4890
- generator.generateAllComponents().catch(console.error);
4891
- }
4892
-
4893
- /**
4894
- * @fileoverview entry point for your component library
4895
- *
4896
- * This is the entry point for your component library. Use this file to export utilities,
4897
- * constants or data structure that accompany your components.
4898
- *
4899
- * DO NOT use this file to export your components. Instead, use the recommended approaches
4900
- * to consume components of this package as outlined in the `README.md`.
4901
- */
4902
-
4903
- export { DesignSystemApiClient, StencilComponentGenerator };
4904
- //# sourceMappingURL=index.esm.js.map
4905
-
4906
- //# sourceMappingURL=index.esm.js.map