@verdocs/web-sdk 6.9.13 → 6.10.1

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