@bynder/compact-view 5.2.2 → 5.2.4

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 (241) hide show
  1. package/AccessToken2.js +1 -1
  2. package/ActiveFilters.js +49 -50
  3. package/AddMedia.js +19 -18
  4. package/Advanced.js +13 -13
  5. package/App.js +60 -59
  6. package/Arrow.js +1 -1
  7. package/AssetFilter.js +38 -38
  8. package/AssetItem.js +10 -17
  9. package/AssetList.js +5 -5
  10. package/AssetTypeItem.js +21 -21
  11. package/AssetsView.js +13 -13
  12. package/Axios2.js +82 -76
  13. package/AxiosError.js +36 -35
  14. package/ButtonAction.js +1 -1
  15. package/CanceledError.js +15 -8
  16. package/Card.js +1 -1
  17. package/Chip.js +1 -1
  18. package/CollectionCard.js +22 -22
  19. package/CollectionItem.js +9 -9
  20. package/CollectionList.js +5 -5
  21. package/CollectionView.js +11 -11
  22. package/ColorPicker.js +1 -1
  23. package/ColorPickerSolid.js +3 -3
  24. package/ColorPickerWithOpacity.js +3 -3
  25. package/Component.js +158 -0
  26. package/Component2.js +4 -0
  27. package/ConfigContext.js +7 -8
  28. package/Container.js +1 -1
  29. package/ContextAction.js +1 -1
  30. package/ControlGroup.js +6 -6
  31. package/Dat.js +33 -32
  32. package/DatDropdownItem.js +1 -1
  33. package/DesignSystemProvider.js +7 -7
  34. package/DirectionSelect.js +11 -10
  35. package/DomainInput.js +19 -11
  36. package/Draggable.js +337 -0
  37. package/Draggable2.js +4 -0
  38. package/DraggableCore.js +312 -0
  39. package/DraggableCore2.js +4 -0
  40. package/Dropdown.js +37 -37
  41. package/Dropdown2.js +1 -1
  42. package/DropdownListItem.js +1 -1
  43. package/FieldSelect.js +19 -17
  44. package/FileSelector.js +38 -37
  45. package/FontPicker.js +1 -1
  46. package/Form.js +1 -1
  47. package/Header.js +5 -4
  48. package/HttpStatusCode.js +7 -1
  49. package/InfiniteScroll.js +1 -1
  50. package/InlineBanner.js +1 -1
  51. package/Input.js +1 -1
  52. package/InterceptorManager.js +2 -1
  53. package/Item.js +8 -8
  54. package/Item4.js +2 -2
  55. package/LeftArrow.js +1 -1
  56. package/ListItem2.js +1 -1
  57. package/ModalBase.js +15 -15
  58. package/NoResults.js +1 -1
  59. package/Option_new.js +36 -29
  60. package/ReactPropTypesSecret.js +10 -0
  61. package/RightArrow.js +1 -1
  62. package/SearchInput.js +1 -1
  63. package/SearchInput2.js +1 -1
  64. package/SelectionFooter.js +41 -31
  65. package/Shield.js +2 -2
  66. package/Smartfilters_new.js +107 -98
  67. package/StatefulAssetList.js +50 -50
  68. package/StoreInitializer.js +32 -16
  69. package/SwitchNLS.js +1 -1
  70. package/TagItem.js +15 -15
  71. package/Tags.js +1 -1
  72. package/Toolbar.js +23 -20
  73. package/Tooltip2.js +1 -1
  74. package/ViewSwitch.js +17 -15
  75. package/_commonjsHelpers.js +28 -3
  76. package/adapters.js +54 -42
  77. package/api/filterAssets.d.ts +1 -1
  78. package/api/getAssets.d.ts +1 -1
  79. package/api/getFilters.d.ts +1 -1
  80. package/api/rest/index.d.ts +1 -1
  81. package/api/rest/types.d.ts +1 -1
  82. package/api2.js +1 -1
  83. package/asset.type.js +1 -1
  84. package/axios.js +1 -1
  85. package/bodyScrollLock.esm.js +68 -0
  86. package/buildURL.js +13 -15
  87. package/checkGlobals.js +1 -1
  88. package/cjs.js +7 -0
  89. package/cjs2.js +15 -0
  90. package/cjs3.js +4 -0
  91. package/clsx.m.js +6 -0
  92. package/clsx.m2.js +15 -0
  93. package/combineMetaproperties.js +3 -1
  94. package/composeSignals.js +1 -1
  95. package/cookieStore.js +1 -1
  96. package/cookies.js +13 -11
  97. package/currentScopes.js +1 -1
  98. package/data.js +1 -1
  99. package/devUtils.js +1 -1
  100. package/dispatchRequest.js +5 -5
  101. package/domFns.js +151 -0
  102. package/domFns2.js +4 -0
  103. package/factoryWithThrowingShims.js +52 -0
  104. package/fetch2.js +156 -128
  105. package/filter/AssetFilterContext.d.ts +3 -3
  106. package/getPrefix.js +35 -0
  107. package/getPrefix2.js +4 -0
  108. package/goober.modern.js +75 -0
  109. package/handlers.js +1 -1
  110. package/iconBase.js +56 -0
  111. package/iconContext.js +12 -0
  112. package/iconsManifest.js +222 -0
  113. package/index-esm.js +1 -4
  114. package/index.browser.js +1 -1
  115. package/index.m.js +9 -0
  116. package/index.m2.js +17 -0
  117. package/index10.js +1 -1
  118. package/index11.js +181 -15
  119. package/index112.js +1 -1
  120. package/index12.js +313 -36
  121. package/index13.js +5 -2430
  122. package/index14.js +3 -557
  123. package/index15.js +15 -55
  124. package/index16.js +3 -2
  125. package/index17.js +3 -87
  126. package/index18.js +36 -7
  127. package/index19.js +3 -60
  128. package/index20.js +2429 -12
  129. package/index21.js +557 -10
  130. package/index22.js +1 -1
  131. package/index23.js +119 -6
  132. package/index24.js +39 -7
  133. package/index25.js +2 -5
  134. package/index26.js +86 -9
  135. package/index27.js +55 -8
  136. package/index28.js +6 -636
  137. package/index29.js +8692 -74
  138. package/index3.js +1684 -5
  139. package/index30.js +2 -5
  140. package/index31.js +4 -20
  141. package/index310.js +2 -0
  142. package/index32.js +11 -2
  143. package/index33.js +5083 -4
  144. package/index34.js +2 -18
  145. package/index35.js +59 -5
  146. package/index36.js +2 -2
  147. package/index37.js +13 -11
  148. package/index38.js +46 -10
  149. package/index39.js +6 -12
  150. package/index4.js +5 -1684
  151. package/index40.js +8 -11
  152. package/index41.js +26 -18
  153. package/index42.js +2 -64
  154. package/index43.js +63 -5
  155. package/index44.js +9 -55
  156. package/index45.js +7 -67
  157. package/index46.js +8 -31
  158. package/index47.js +5 -11
  159. package/index48.js +10 -121
  160. package/index49.js +9 -86
  161. package/index5.js +215 -23
  162. package/index50.js +636 -7
  163. package/index51.js +74 -11
  164. package/index52.js +4 -13
  165. package/index53.js +19 -13
  166. package/index54.js +4 -6
  167. package/index55.js +18 -7
  168. package/index56.js +5 -14
  169. package/index57.js +10 -28
  170. package/index58.js +10 -15
  171. package/index59.js +15 -0
  172. package/index6.js +250 -299
  173. package/index60.js +13 -0
  174. package/index61.js +21 -0
  175. package/index62.js +8 -0
  176. package/index63.js +57 -0
  177. package/index64.js +4 -0
  178. package/index65.js +69 -0
  179. package/index66.js +33 -0
  180. package/index67.js +13 -0
  181. package/index68.js +123 -0
  182. package/index69.js +88 -0
  183. package/index7.js +25 -2
  184. package/index70.js +10 -0
  185. package/index71.js +13 -0
  186. package/index72.js +13 -225
  187. package/index73.js +16 -0
  188. package/index74.js +9 -0
  189. package/index75.js +228 -0
  190. package/index76.js +9 -0
  191. package/index77.js +17 -0
  192. package/index78.js +31 -0
  193. package/index79.js +18 -0
  194. package/index8.js +1537 -1536
  195. package/index9.js +1 -1
  196. package/isAbsoluteURL.js +1 -1
  197. package/isURLSameOrigin.js +1 -1
  198. package/localization.js +15 -15
  199. package/log.js +14 -0
  200. package/log2.js +4 -0
  201. package/matchRequestUrl.js +1 -1
  202. package/mergeConfig.js +37 -32
  203. package/notify.js +2 -2
  204. package/package.json +1 -1
  205. package/positionFns.js +101 -0
  206. package/positionFns2.js +4 -0
  207. package/react-laag.esm.js +957 -0
  208. package/react.js +8 -8
  209. package/react2.js +9 -9
  210. package/resolveConfig.js +23 -23
  211. package/select/add-media/AddMedia.d.ts +3 -1
  212. package/select/current-selection/SelectedItems.d.ts +1 -1
  213. package/shims.js +29 -0
  214. package/shims2.js +4 -0
  215. package/store/StoreInitializer.d.ts +5 -1
  216. package/store/useAssetFilterStore.d.ts +55 -0
  217. package/store/useSelectionStore.d.ts +47 -0
  218. package/styled-components.browser.esm.js +2 -2
  219. package/throttle.js +1 -1
  220. package/toURLEncodedForm.js +11 -10
  221. package/tokenExpirationHelper.js +1 -1
  222. package/transformData.js +1 -1
  223. package/transitional.js +4 -3
  224. package/useAssetFilterStore.js +152 -0
  225. package/useDatStore.js +1 -1
  226. package/useEffectEvent.js +7 -7
  227. package/useFonts.js +1 -1
  228. package/useOrderingStore.js +1 -1
  229. package/useRouterStore.js +1 -1
  230. package/useSearchStore.js +1 -1
  231. package/useSelectionStore.js +131 -0
  232. package/useSimilaritySearchStore.js +1 -1
  233. package/useTranslate.js +1 -1
  234. package/utils/combineMetaproperties.d.ts +2 -0
  235. package/utils6.js +160 -118
  236. package/xhr.js +47 -46
  237. package/AssetFilterContext.js +0 -161
  238. package/Middleware.js +0 -49
  239. package/SelectionContext.js +0 -143
  240. package/middleware2.js +0 -177
  241. package/select/SelectionContext.d.ts +0 -30
@@ -0,0 +1,131 @@
1
+ import { useState as v, useEffect as S } from "react";
2
+ import { devtools as g } from "./middleware.js";
3
+ import { useConfig as I, useSelectionMode as y } from "./ConfigContext.js";
4
+ import { useAuth as M } from "./LoginContext.js";
5
+ import { getAssetsByMediaId as P } from "./filterAssets.js";
6
+ import { isErr as h } from "./result.type.js";
7
+ import { convertAssetIdToBase64 as C } from "./base64Converter.js";
8
+ import { create as T } from "./react.js";
9
+ function a(t, o) {
10
+ return t.some((e) => e.value.id === o.id);
11
+ }
12
+ const f = T()(
13
+ g(
14
+ (t, o) => ({
15
+ selection: [],
16
+ preselectedAssetIds: [],
17
+ allAssetsStore: [],
18
+ setPreselectedAssetIds: (e) => t({ preselectedAssetIds: e }),
19
+ clear: () => t({ selection: [] }),
20
+ setAllAssets: (e) => {
21
+ e.tag === "Loaded" && e.value && t({ allAssetsStore: e.value });
22
+ },
23
+ selectAll: () => {
24
+ const { selection: e, allAssetsStore: s } = o(), c = s.filter(
25
+ (l) => !e.some((n) => n.value.id === l.id)
26
+ );
27
+ t({
28
+ selection: [
29
+ ...e,
30
+ ...c.map((l) => ({
31
+ type: "asset",
32
+ value: l
33
+ }))
34
+ ]
35
+ });
36
+ },
37
+ selectAssets: (e) => {
38
+ const s = o().selection, c = e.filter(
39
+ (l) => !a(s, l)
40
+ );
41
+ t({
42
+ selection: [
43
+ ...s,
44
+ ...c.map((l) => ({
45
+ type: "asset",
46
+ value: l
47
+ }))
48
+ ]
49
+ });
50
+ },
51
+ toggleAssets: (e) => {
52
+ const s = o().selection, c = e.filter(
53
+ (i) => !a(s, i)
54
+ ), l = e.filter(
55
+ (i) => a(s, i)
56
+ ), n = s.filter(
57
+ (i) => !l.some(
58
+ (d) => d.id === i.value.id
59
+ )
60
+ );
61
+ t({
62
+ selection: [
63
+ ...n,
64
+ ...c.map((i) => ({
65
+ type: "asset",
66
+ value: i
67
+ }))
68
+ ]
69
+ });
70
+ },
71
+ toggleCollection: (e) => {
72
+ const s = o().selection;
73
+ a(s, e) ? t({
74
+ selection: s.filter(
75
+ (c) => c.value.id !== e.id
76
+ )
77
+ }) : t({
78
+ selection: [
79
+ ...s,
80
+ {
81
+ type: "collection",
82
+ value: e
83
+ }
84
+ ]
85
+ });
86
+ },
87
+ setSelection: (e) => t({ selection: e })
88
+ }),
89
+ { name: "SelectionStore", enabled: !1 }
90
+ )
91
+ ), q = () => {
92
+ const t = y(), { toggleAssets: o, selection: e, setSelection: s } = f(), c = (n) => {
93
+ e.some((i) => i.value.id === n.id) ? s([]) : s([{ type: "asset", value: n }]);
94
+ };
95
+ return {
96
+ assetToggleHandler: (n) => {
97
+ t !== "MultiSelect" ? c(n[0]) : o(n);
98
+ }
99
+ };
100
+ };
101
+ function L(t) {
102
+ const [o, e] = v([]), { selectionMode: s, language: c, noCache: l } = I(), n = M();
103
+ let i = !1;
104
+ const d = t?.filter((r) => !!r).map(C), m = async (r) => {
105
+ if (r.length) {
106
+ const u = await P({ ids: r, auth: n, language: c, noCache: l });
107
+ i || h(u) || (u.value?.sort(
108
+ (p, A) => (t?.indexOf(p.id) ?? 0) - (t?.indexOf(A.id) ?? 0)
109
+ ), e(u.value ?? []));
110
+ }
111
+ };
112
+ return S(() => {
113
+ if (d) {
114
+ let r = d ?? [];
115
+ s !== "MultiSelect" && (r = r[0] ? [r[0]] : []), m(r);
116
+ }
117
+ return () => {
118
+ i = !0;
119
+ };
120
+ }, [d]), o;
121
+ }
122
+ function j() {
123
+ const { selection: t } = f();
124
+ return t.filter((o) => o.type === "collection").map((o) => o.value.id);
125
+ }
126
+ export {
127
+ L as usePreselectedAssets,
128
+ j as useSelectedCollectionIds,
129
+ q as useSelectionModeHandler,
130
+ f as useSelectionStore
131
+ };
@@ -1,4 +1,4 @@
1
- import { devtools as s } from "./middleware2.js";
1
+ import { devtools as s } from "./middleware.js";
2
2
  import { createSelectors as i } from "./createSelectors.js";
3
3
  import { create as l } from "./react.js";
4
4
  const r = l()(
package/useTranslate.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useContext as o } from "react";
2
- import { Localization as t } from "./index6.js";
2
+ import { Localization as t } from "./index12.js";
3
3
  import { LocalizationContext as a } from "./localization.js";
4
4
  import n from "./en_US.json.js";
5
5
  const i = new t(n);
@@ -5,5 +5,7 @@ interface ReturnType {
5
5
  value: string;
6
6
  zIndex: number;
7
7
  }
8
+ export declare const sortMetaproperties: (first: ReturnType, second: ReturnType) => number;
9
+ export declare const normalizeDate: (date: string) => string;
8
10
  export declare const combineMetaproperties: (metaproperties?: MetapropertyType[], textMetaproperties?: TextMetapropertiesType[]) => ReturnType[];
9
11
  export {};
package/utils6.js CHANGED
@@ -1,41 +1,58 @@
1
- import D from "./bind.js";
2
- const { toString: R } = Object.prototype, { getPrototypeOf: h } = Object, { iterator: y, toStringTag: x } = Symbol, w = /* @__PURE__ */ ((e) => (t) => {
3
- const r = R.call(t);
1
+ import R from "./bind.js";
2
+ const { toString: T } = Object.prototype, { getPrototypeOf: h } = Object, { iterator: g, toStringTag: x } = Symbol, b = /* @__PURE__ */ ((e) => (t) => {
3
+ const r = T.call(t);
4
4
  return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
5
- })(/* @__PURE__ */ Object.create(null)), l = (e) => (e = e.toLowerCase(), (t) => w(t) === e), F = (e) => (t) => typeof t === e, { isArray: a } = Array, p = F("undefined");
6
- function T(e) {
7
- return e !== null && !p(e) && e.constructor !== null && !p(e.constructor) && i(e.constructor.isBuffer) && e.constructor.isBuffer(e);
5
+ })(/* @__PURE__ */ Object.create(null)), f = (e) => (e = e.toLowerCase(), (t) => b(t) === e), O = (e) => (t) => typeof t === e, { isArray: p } = Array, a = O("undefined");
6
+ function d(e) {
7
+ return e !== null && !a(e) && e.constructor !== null && !a(e.constructor) && c(e.constructor.isBuffer) && e.constructor.isBuffer(e);
8
8
  }
9
- const S = l("ArrayBuffer");
9
+ const S = f("ArrayBuffer");
10
10
  function M(e) {
11
11
  let t;
12
12
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && S(e.buffer), t;
13
13
  }
14
- const N = F("string"), i = F("function"), B = F("number"), g = (e) => e !== null && typeof e == "object", k = (e) => e === !0 || e === !1, m = (e) => {
15
- if (w(e) !== "object")
14
+ const _ = O("string"), c = O("function"), B = O("number"), y = (e) => e !== null && typeof e == "object", N = (e) => e === !0 || e === !1, w = (e) => {
15
+ if (b(e) !== "object")
16
16
  return !1;
17
17
  const t = h(e);
18
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(x in e) && !(y in e);
19
- }, I = l("Date"), U = l("File"), V = l("Blob"), _ = l("FileList"), q = (e) => g(e) && i(e.pipe), H = (e) => {
18
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(x in e) && !(g in e);
19
+ }, U = (e) => {
20
+ if (!y(e) || d(e))
21
+ return !1;
22
+ try {
23
+ return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
24
+ } catch {
25
+ return !1;
26
+ }
27
+ }, I = f("Date"), k = f("File"), V = f("Blob"), q = f("FileList"), H = (e) => y(e) && c(e.pipe), z = (e) => {
20
28
  let t;
21
- return e && (typeof FormData == "function" && e instanceof FormData || i(e.append) && ((t = w(e)) === "formdata" || // detect form-data instance
22
- t === "object" && i(e.toString) && e.toString() === "[object FormData]"));
23
- }, z = l("URLSearchParams"), [J, K, $, W] = ["ReadableStream", "Request", "Response", "Headers"].map(l), G = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
24
- function d(e, t, { allOwnKeys: r = !1 } = {}) {
29
+ return e && (typeof FormData == "function" && e instanceof FormData || c(e.append) && ((t = b(e)) === "formdata" || // detect form-data instance
30
+ t === "object" && c(e.toString) && e.toString() === "[object FormData]"));
31
+ }, J = f("URLSearchParams"), [K, $, W, G] = [
32
+ "ReadableStream",
33
+ "Request",
34
+ "Response",
35
+ "Headers"
36
+ ].map(f), Q = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
37
+ function m(e, t, { allOwnKeys: r = !1 } = {}) {
25
38
  if (e === null || typeof e > "u")
26
39
  return;
27
40
  let n, s;
28
- if (typeof e != "object" && (e = [e]), a(e))
41
+ if (typeof e != "object" && (e = [e]), p(e))
29
42
  for (n = 0, s = e.length; n < s; n++)
30
43
  t.call(null, e[n], n, e);
31
44
  else {
32
- const o = r ? Object.getOwnPropertyNames(e) : Object.keys(e), c = o.length;
33
- let f;
34
- for (n = 0; n < c; n++)
35
- f = o[n], t.call(null, e[f], f, e);
45
+ if (d(e))
46
+ return;
47
+ const o = r ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
48
+ let l;
49
+ for (n = 0; n < i; n++)
50
+ l = o[n], t.call(null, e[l], l, e);
36
51
  }
37
52
  }
38
53
  function E(e, t) {
54
+ if (d(e))
55
+ return null;
39
56
  t = t.toLowerCase();
40
57
  const r = Object.keys(e);
41
58
  let n = r.length, s;
@@ -44,47 +61,71 @@ function E(e, t) {
44
61
  return s;
45
62
  return null;
46
63
  }
47
- const u = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, L = (e) => !p(e) && e !== u;
48
- function O() {
49
- const { caseless: e } = L(this) && this || {}, t = {}, r = (n, s) => {
50
- const o = e && E(t, s) || s;
51
- m(t[o]) && m(n) ? t[o] = O(t[o], n) : m(n) ? t[o] = O({}, n) : a(n) ? t[o] = n.slice() : t[o] = n;
64
+ const u = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, L = (e) => !a(e) && e !== u;
65
+ function F() {
66
+ const { caseless: e, skipUndefined: t } = L(this) && this || {}, r = {}, n = (s, o) => {
67
+ if (o === "__proto__" || o === "constructor" || o === "prototype")
68
+ return;
69
+ const i = e && E(r, o) || o;
70
+ w(r[i]) && w(s) ? r[i] = F(r[i], s) : w(s) ? r[i] = F({}, s) : p(s) ? r[i] = s.slice() : (!t || !a(s)) && (r[i] = s);
52
71
  };
53
- for (let n = 0, s = arguments.length; n < s; n++)
54
- arguments[n] && d(arguments[n], r);
55
- return t;
72
+ for (let s = 0, o = arguments.length; s < o; s++)
73
+ arguments[s] && m(arguments[s], n);
74
+ return r;
56
75
  }
57
- const Q = (e, t, r, { allOwnKeys: n } = {}) => (d(t, (s, o) => {
58
- r && i(s) ? e[o] = D(s, r) : e[o] = s;
59
- }, { allOwnKeys: n }), e), X = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Y = (e, t, r, n) => {
60
- e.prototype = Object.create(t.prototype, n), e.prototype.constructor = e, Object.defineProperty(e, "super", {
76
+ const X = (e, t, r, { allOwnKeys: n } = {}) => (m(
77
+ t,
78
+ (s, o) => {
79
+ r && c(s) ? Object.defineProperty(e, o, {
80
+ value: R(s, r),
81
+ writable: !0,
82
+ enumerable: !0,
83
+ configurable: !0
84
+ }) : Object.defineProperty(e, o, {
85
+ value: s,
86
+ writable: !0,
87
+ enumerable: !0,
88
+ configurable: !0
89
+ });
90
+ },
91
+ { allOwnKeys: n }
92
+ ), e), Y = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Z = (e, t, r, n) => {
93
+ e.prototype = Object.create(
94
+ t.prototype,
95
+ n
96
+ ), Object.defineProperty(e.prototype, "constructor", {
97
+ value: e,
98
+ writable: !0,
99
+ enumerable: !1,
100
+ configurable: !0
101
+ }), Object.defineProperty(e, "super", {
61
102
  value: t.prototype
62
103
  }), r && Object.assign(e.prototype, r);
63
- }, Z = (e, t, r, n) => {
64
- let s, o, c;
65
- const f = {};
104
+ }, j = (e, t, r, n) => {
105
+ let s, o, i;
106
+ const l = {};
66
107
  if (t = t || {}, e == null) return t;
67
108
  do {
68
109
  for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
69
- c = s[o], (!n || n(c, e, t)) && !f[c] && (t[c] = e[c], f[c] = !0);
110
+ i = s[o], (!n || n(i, e, t)) && !l[i] && (t[i] = e[i], l[i] = !0);
70
111
  e = r !== !1 && h(e);
71
112
  } while (e && (!r || r(e, t)) && e !== Object.prototype);
72
113
  return t;
73
- }, j = (e, t, r) => {
114
+ }, v = (e, t, r) => {
74
115
  e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
75
116
  const n = e.indexOf(t, r);
76
117
  return n !== -1 && n === r;
77
- }, v = (e) => {
118
+ }, ee = (e) => {
78
119
  if (!e) return null;
79
- if (a(e)) return e;
120
+ if (p(e)) return e;
80
121
  let t = e.length;
81
122
  if (!B(t)) return null;
82
123
  const r = new Array(t);
83
124
  for (; t-- > 0; )
84
125
  r[t] = e[t];
85
126
  return r;
86
- }, ee = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && h(Uint8Array)), te = (e, t) => {
87
- const n = (e && e[y]).call(e);
127
+ }, te = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && h(Uint8Array)), re = (e, t) => {
128
+ const n = (e && e[g]).call(e);
88
129
  let s;
89
130
  for (; (s = n.next()) && !s.done; ) {
90
131
  const o = s.value;
@@ -96,23 +137,20 @@ const Q = (e, t, r, { allOwnKeys: n } = {}) => (d(t, (s, o) => {
96
137
  for (; (r = e.exec(t)) !== null; )
97
138
  n.push(r);
98
139
  return n;
99
- }, re = l("HTMLFormElement"), se = (e) => e.toLowerCase().replace(
100
- /[-_\s]([a-z\d])(\w*)/g,
101
- function(r, n, s) {
102
- return n.toUpperCase() + s;
103
- }
104
- ), b = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), oe = l("RegExp"), P = (e, t) => {
140
+ }, se = f("HTMLFormElement"), oe = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(r, n, s) {
141
+ return n.toUpperCase() + s;
142
+ }), P = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), ie = f("RegExp"), C = (e, t) => {
105
143
  const r = Object.getOwnPropertyDescriptors(e), n = {};
106
- d(r, (s, o) => {
107
- let c;
108
- (c = t(s, o, e)) !== !1 && (n[o] = c || s);
144
+ m(r, (s, o) => {
145
+ let i;
146
+ (i = t(s, o, e)) !== !1 && (n[o] = i || s);
109
147
  }), Object.defineProperties(e, n);
110
- }, ie = (e) => {
111
- P(e, (t, r) => {
112
- if (i(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
148
+ }, ce = (e) => {
149
+ C(e, (t, r) => {
150
+ if (c(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
113
151
  return !1;
114
152
  const n = e[r];
115
- if (i(n)) {
153
+ if (c(n)) {
116
154
  if (t.enumerable = !1, "writable" in t) {
117
155
  t.writable = !1;
118
156
  return;
@@ -122,101 +160,105 @@ const Q = (e, t, r, { allOwnKeys: n } = {}) => (d(t, (s, o) => {
122
160
  });
123
161
  }
124
162
  });
125
- }, ce = (e, t) => {
163
+ }, fe = (e, t) => {
126
164
  const r = {}, n = (s) => {
127
165
  s.forEach((o) => {
128
166
  r[o] = !0;
129
167
  });
130
168
  };
131
- return a(e) ? n(e) : n(String(e).split(t)), r;
169
+ return p(e) ? n(e) : n(String(e).split(t)), r;
132
170
  }, le = () => {
133
- }, fe = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
134
- function ue(e) {
135
- return !!(e && i(e.append) && e[x] === "FormData" && e[y]);
171
+ }, ue = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
172
+ function ae(e) {
173
+ return !!(e && c(e.append) && e[x] === "FormData" && e[g]);
136
174
  }
137
- const ae = (e) => {
175
+ const pe = (e) => {
138
176
  const t = new Array(10), r = (n, s) => {
139
- if (g(n)) {
177
+ if (y(n)) {
140
178
  if (t.indexOf(n) >= 0)
141
179
  return;
180
+ if (d(n))
181
+ return n;
142
182
  if (!("toJSON" in n)) {
143
183
  t[s] = n;
144
- const o = a(n) ? [] : {};
145
- return d(n, (c, f) => {
146
- const A = r(c, s + 1);
147
- !p(A) && (o[f] = A);
184
+ const o = p(n) ? [] : {};
185
+ return m(n, (i, l) => {
186
+ const A = r(i, s + 1);
187
+ !a(A) && (o[l] = A);
148
188
  }), t[s] = void 0, o;
149
189
  }
150
190
  }
151
191
  return n;
152
192
  };
153
193
  return r(e, 0);
154
- }, pe = l("AsyncFunction"), de = (e) => e && (g(e) || i(e)) && i(e.then) && i(e.catch), C = ((e, t) => e ? setImmediate : t ? ((r, n) => (u.addEventListener("message", ({ source: s, data: o }) => {
155
- s === u && o === r && n.length && n.shift()();
156
- }, !1), (s) => {
194
+ }, de = f("AsyncFunction"), ye = (e) => e && (y(e) || c(e)) && c(e.then) && c(e.catch), D = ((e, t) => e ? setImmediate : t ? ((r, n) => (u.addEventListener(
195
+ "message",
196
+ ({ source: s, data: o }) => {
197
+ s === u && o === r && n.length && n.shift()();
198
+ },
199
+ !1
200
+ ), (s) => {
157
201
  n.push(s), u.postMessage(r, "*");
158
- }))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
159
- typeof setImmediate == "function",
160
- i(u.postMessage)
161
- ), me = typeof queueMicrotask < "u" ? queueMicrotask.bind(u) : typeof process < "u" && process.nextTick || C, ye = (e) => e != null && i(e[y]), Fe = {
162
- isArray: a,
202
+ }))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(typeof setImmediate == "function", c(u.postMessage)), me = typeof queueMicrotask < "u" ? queueMicrotask.bind(u) : typeof process < "u" && process.nextTick || D, we = (e) => e != null && c(e[g]), be = {
203
+ isArray: p,
163
204
  isArrayBuffer: S,
164
- isBuffer: T,
165
- isFormData: H,
205
+ isBuffer: d,
206
+ isFormData: z,
166
207
  isArrayBufferView: M,
167
- isString: N,
208
+ isString: _,
168
209
  isNumber: B,
169
- isBoolean: k,
170
- isObject: g,
171
- isPlainObject: m,
172
- isReadableStream: J,
173
- isRequest: K,
174
- isResponse: $,
175
- isHeaders: W,
176
- isUndefined: p,
210
+ isBoolean: N,
211
+ isObject: y,
212
+ isPlainObject: w,
213
+ isEmptyObject: U,
214
+ isReadableStream: K,
215
+ isRequest: $,
216
+ isResponse: W,
217
+ isHeaders: G,
218
+ isUndefined: a,
177
219
  isDate: I,
178
- isFile: U,
220
+ isFile: k,
179
221
  isBlob: V,
180
- isRegExp: oe,
181
- isFunction: i,
182
- isStream: q,
183
- isURLSearchParams: z,
184
- isTypedArray: ee,
185
- isFileList: _,
186
- forEach: d,
187
- merge: O,
188
- extend: Q,
189
- trim: G,
190
- stripBOM: X,
191
- inherits: Y,
192
- toFlatObject: Z,
193
- kindOf: w,
194
- kindOfTest: l,
195
- endsWith: j,
196
- toArray: v,
197
- forEachEntry: te,
222
+ isRegExp: ie,
223
+ isFunction: c,
224
+ isStream: H,
225
+ isURLSearchParams: J,
226
+ isTypedArray: te,
227
+ isFileList: q,
228
+ forEach: m,
229
+ merge: F,
230
+ extend: X,
231
+ trim: Q,
232
+ stripBOM: Y,
233
+ inherits: Z,
234
+ toFlatObject: j,
235
+ kindOf: b,
236
+ kindOfTest: f,
237
+ endsWith: v,
238
+ toArray: ee,
239
+ forEachEntry: re,
198
240
  matchAll: ne,
199
- isHTMLForm: re,
200
- hasOwnProperty: b,
201
- hasOwnProp: b,
241
+ isHTMLForm: se,
242
+ hasOwnProperty: P,
243
+ hasOwnProp: P,
202
244
  // an alias to avoid ESLint no-prototype-builtins detection
203
- reduceDescriptors: P,
204
- freezeMethods: ie,
205
- toObjectSet: ce,
206
- toCamelCase: se,
245
+ reduceDescriptors: C,
246
+ freezeMethods: ce,
247
+ toObjectSet: fe,
248
+ toCamelCase: oe,
207
249
  noop: le,
208
- toFiniteNumber: fe,
250
+ toFiniteNumber: ue,
209
251
  findKey: E,
210
252
  global: u,
211
253
  isContextDefined: L,
212
- isSpecCompliantForm: ue,
213
- toJSONObject: ae,
214
- isAsyncFn: pe,
215
- isThenable: de,
216
- setImmediate: C,
254
+ isSpecCompliantForm: ae,
255
+ toJSONObject: pe,
256
+ isAsyncFn: de,
257
+ isThenable: ye,
258
+ setImmediate: D,
217
259
  asap: me,
218
- isIterable: ye
260
+ isIterable: we
219
261
  };
220
262
  export {
221
- Fe as default
263
+ be as default
222
264
  };
package/xhr.js CHANGED
@@ -1,69 +1,70 @@
1
- import b from "./utils6.js";
1
+ import H from "./utils6.js";
2
2
  import D from "./settle.js";
3
3
  import L from "./transitional.js";
4
- import r from "./AxiosError.js";
5
- import v from "./CanceledError.js";
6
- import y from "./parseProtocol.js";
7
- import O from "./index18.js";
8
- import H from "./AxiosHeaders.js";
9
- import { progressEventReducer as q } from "./progressEventReducer.js";
10
- import U from "./resolveConfig.js";
11
- const N = typeof XMLHttpRequest < "u", Q = N && function(n) {
12
- return new Promise(function(A, s) {
13
- const t = U(n);
14
- let c = t.data;
15
- const E = H.from(t.headers).normalize();
16
- let { responseType: i, onUploadProgress: T, onDownloadProgress: R } = t, a, h, w, u, p;
17
- function g() {
18
- u && u(), p && p(), t.cancelToken && t.cancelToken.unsubscribe(a), t.signal && t.signal.removeEventListener("abort", a);
4
+ import n from "./AxiosError.js";
5
+ import y from "./CanceledError.js";
6
+ import O from "./parseProtocol.js";
7
+ import U from "./index28.js";
8
+ import q from "./AxiosHeaders.js";
9
+ import { progressEventReducer as A } from "./progressEventReducer.js";
10
+ import v from "./resolveConfig.js";
11
+ const N = typeof XMLHttpRequest < "u", Q = N && function(s) {
12
+ return new Promise(function(C, i) {
13
+ const t = v(s);
14
+ let E = t.data;
15
+ const T = q.from(t.headers).normalize();
16
+ let { responseType: d, onUploadProgress: R, onDownloadProgress: h } = t, l, g, w, u, f;
17
+ function x() {
18
+ u && u(), f && f(), t.cancelToken && t.cancelToken.unsubscribe(l), t.signal && t.signal.removeEventListener("abort", l);
19
19
  }
20
20
  let e = new XMLHttpRequest();
21
21
  e.open(t.method.toUpperCase(), t.url, !0), e.timeout = t.timeout;
22
- function x() {
22
+ function b() {
23
23
  if (!e)
24
24
  return;
25
- const o = H.from(
25
+ const o = q.from(
26
26
  "getAllResponseHeaders" in e && e.getAllResponseHeaders()
27
- ), d = {
28
- data: !i || i === "text" || i === "json" ? e.responseText : e.response,
27
+ ), a = {
28
+ data: !d || d === "text" || d === "json" ? e.responseText : e.response,
29
29
  status: e.status,
30
30
  statusText: e.statusText,
31
31
  headers: o,
32
- config: n,
32
+ config: s,
33
33
  request: e
34
34
  };
35
- D(function(m) {
36
- A(m), g();
37
- }, function(m) {
38
- s(m), g();
39
- }, d), e = null;
35
+ D(function(c) {
36
+ C(c), x();
37
+ }, function(c) {
38
+ i(c), x();
39
+ }, a), e = null;
40
40
  }
41
- "onloadend" in e ? e.onloadend = x : e.onreadystatechange = function() {
42
- !e || e.readyState !== 4 || e.status === 0 && !(e.responseURL && e.responseURL.indexOf("file:") === 0) || setTimeout(x);
41
+ "onloadend" in e ? e.onloadend = b : e.onreadystatechange = function() {
42
+ !e || e.readyState !== 4 || e.status === 0 && !(e.responseURL && e.responseURL.indexOf("file:") === 0) || setTimeout(b);
43
43
  }, e.onabort = function() {
44
- e && (s(new r("Request aborted", r.ECONNABORTED, n, e)), e = null);
45
- }, e.onerror = function() {
46
- s(new r("Network Error", r.ERR_NETWORK, n, e)), e = null;
44
+ e && (i(new n("Request aborted", n.ECONNABORTED, s, e)), e = null);
45
+ }, e.onerror = function(r) {
46
+ const a = r && r.message ? r.message : "Network Error", p = new n(a, n.ERR_NETWORK, s, e);
47
+ p.event = r || null, i(p), e = null;
47
48
  }, e.ontimeout = function() {
48
- let l = t.timeout ? "timeout of " + t.timeout + "ms exceeded" : "timeout exceeded";
49
- const d = t.transitional || L;
50
- t.timeoutErrorMessage && (l = t.timeoutErrorMessage), s(new r(
51
- l,
52
- d.clarifyTimeoutError ? r.ETIMEDOUT : r.ECONNABORTED,
53
- n,
49
+ let r = t.timeout ? "timeout of " + t.timeout + "ms exceeded" : "timeout exceeded";
50
+ const a = t.transitional || L;
51
+ t.timeoutErrorMessage && (r = t.timeoutErrorMessage), i(new n(
52
+ r,
53
+ a.clarifyTimeoutError ? n.ETIMEDOUT : n.ECONNABORTED,
54
+ s,
54
55
  e
55
56
  )), e = null;
56
- }, c === void 0 && E.setContentType(null), "setRequestHeader" in e && b.forEach(E.toJSON(), function(l, d) {
57
- e.setRequestHeader(d, l);
58
- }), b.isUndefined(t.withCredentials) || (e.withCredentials = !!t.withCredentials), i && i !== "json" && (e.responseType = t.responseType), R && ([w, p] = q(R, !0), e.addEventListener("progress", w)), T && e.upload && ([h, u] = q(T), e.upload.addEventListener("progress", h), e.upload.addEventListener("loadend", u)), (t.cancelToken || t.signal) && (a = (o) => {
59
- e && (s(!o || o.type ? new v(null, n, e) : o), e.abort(), e = null);
60
- }, t.cancelToken && t.cancelToken.subscribe(a), t.signal && (t.signal.aborted ? a() : t.signal.addEventListener("abort", a)));
61
- const f = y(t.url);
62
- if (f && O.protocols.indexOf(f) === -1) {
63
- s(new r("Unsupported protocol " + f + ":", r.ERR_BAD_REQUEST, n));
57
+ }, E === void 0 && T.setContentType(null), "setRequestHeader" in e && H.forEach(T.toJSON(), function(r, a) {
58
+ e.setRequestHeader(a, r);
59
+ }), H.isUndefined(t.withCredentials) || (e.withCredentials = !!t.withCredentials), d && d !== "json" && (e.responseType = t.responseType), h && ([w, f] = A(h, !0), e.addEventListener("progress", w)), R && e.upload && ([g, u] = A(R), e.upload.addEventListener("progress", g), e.upload.addEventListener("loadend", u)), (t.cancelToken || t.signal) && (l = (o) => {
60
+ e && (i(!o || o.type ? new y(null, s, e) : o), e.abort(), e = null);
61
+ }, t.cancelToken && t.cancelToken.subscribe(l), t.signal && (t.signal.aborted ? l() : t.signal.addEventListener("abort", l)));
62
+ const m = O(t.url);
63
+ if (m && U.protocols.indexOf(m) === -1) {
64
+ i(new n("Unsupported protocol " + m + ":", n.ERR_BAD_REQUEST, s));
64
65
  return;
65
66
  }
66
- e.send(c || null);
67
+ e.send(E || null);
67
68
  });
68
69
  };
69
70
  export {