wcz-layout 6.7.2 → 7.6.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.

Potentially problematic release.


This version of wcz-layout might be problematic. Click here for more details.

Files changed (303) hide show
  1. package/dist/DialogsContext-BIhId-r8.js +7 -0
  2. package/dist/DialogsContext-BIhId-r8.js.map +1 -0
  3. package/dist/DialogsHooks-CZVdKmPv.js +207 -0
  4. package/dist/DialogsHooks-CZVdKmPv.js.map +1 -0
  5. package/dist/FileMeta-YGG9mxo_.js +36 -0
  6. package/dist/FileMeta-YGG9mxo_.js.map +1 -0
  7. package/dist/NotificationContext-DovR_auQ.js +7 -0
  8. package/dist/NotificationContext-DovR_auQ.js.map +1 -0
  9. package/dist/RouterListItemButton-DeaQB4ym.js +31 -0
  10. package/dist/RouterListItemButton-DeaQB4ym.js.map +1 -0
  11. package/dist/components/core/AppTitle.d.ts +2 -0
  12. package/dist/components/core/Fullscreen.d.ts +3 -0
  13. package/dist/components/core/Layout.d.ts +10 -0
  14. package/dist/{src/components/layout → components/core}/TypographyWithIcon.d.ts +1 -1
  15. package/dist/components/core/account/UserAvatar.d.ts +2 -0
  16. package/dist/components/core/account/UserMenu.d.ts +2 -0
  17. package/dist/components/core/navigation/NavigationContent.d.ts +11 -0
  18. package/dist/components/core/navigation/NavigationList.d.ts +22 -0
  19. package/dist/components/core/navigation/NavigationListItem.d.ts +16 -0
  20. package/dist/components/core/navigation/NavigationRail.d.ts +12 -0
  21. package/dist/{src/components/dataGrid → components/data-grid}/ChipInputCell.d.ts +3 -3
  22. package/dist/components/data-grid/EditableColumnHeader.d.ts +2 -0
  23. package/dist/components/file/Dropzone.d.ts +8 -0
  24. package/dist/components/file/FileViewer.d.ts +20 -0
  25. package/dist/components/file/fileViewer/FileViewerGrid.d.ts +17 -0
  26. package/dist/components/file/fileViewer/FileViewerList.d.ts +12 -0
  27. package/dist/components/file/fileViewer/ImageViewer.d.ts +6 -0
  28. package/dist/components/file/fileViewer/common/ActionsMenu.d.ts +15 -0
  29. package/dist/{src/components → components}/form/FormAutocomplete.d.ts +3 -3
  30. package/dist/{src/components → components}/form/FormCheckbox.d.ts +3 -3
  31. package/dist/components/form/FormDatePicker.d.ts +8 -0
  32. package/dist/components/form/FormDateRangePicker.d.ts +8 -0
  33. package/dist/components/form/FormDateTimePicker.d.ts +8 -0
  34. package/dist/components/form/FormDateTimeRangePicker.d.ts +8 -0
  35. package/dist/{src/components → components}/form/FormNumberField.d.ts +4 -7
  36. package/dist/{src/components → components}/form/FormRadioGroup.d.ts +4 -4
  37. package/dist/{src/components → components}/form/FormSlider.d.ts +3 -3
  38. package/dist/components/form/FormSubmitButton.d.ts +4 -0
  39. package/dist/{src/components → components}/form/FormSwitch.d.ts +3 -3
  40. package/dist/{src/components → components}/form/FormTextField.d.ts +3 -3
  41. package/dist/components/form/FormTimePicker.d.ts +8 -0
  42. package/dist/components/form/FormTimeRangePicker.d.ts +8 -0
  43. package/dist/components/router/RouterButton.d.ts +6 -0
  44. package/dist/components/router/RouterError.d.ts +7 -0
  45. package/dist/components/router/RouterFab.d.ts +6 -0
  46. package/dist/components/router/RouterGridActionsCellItem.d.ts +6 -0
  47. package/dist/components/router/RouterIconButton.d.ts +6 -0
  48. package/dist/components/router/RouterLink.d.ts +6 -0
  49. package/dist/components/router/RouterListItemButton.d.ts +6 -0
  50. package/dist/components/router/RouterNotFound.d.ts +1 -0
  51. package/dist/components/router/RouterTab.d.ts +6 -0
  52. package/dist/components.js +3255 -0
  53. package/dist/components.js.map +1 -0
  54. package/dist/contexts/DialogsContext.d.ts +6 -0
  55. package/dist/contexts/FileContext.d.ts +13 -0
  56. package/dist/contexts/NotificationContext.d.ts +9 -0
  57. package/dist/dist-Bxzg1_9c.js +152 -0
  58. package/dist/dist-Bxzg1_9c.js.map +1 -0
  59. package/dist/exports/components.d.ts +15 -0
  60. package/dist/exports/hooks.d.ts +7 -0
  61. package/dist/exports/index.d.ts +5 -0
  62. package/dist/exports/middleware.d.ts +2 -0
  63. package/dist/exports/models.d.ts +24 -0
  64. package/dist/exports/query.d.ts +3 -0
  65. package/dist/exports/utils.d.ts +6 -0
  66. package/dist/exports/vite.d.ts +1 -0
  67. package/dist/hooks/DialogsHooks.d.ts +42 -0
  68. package/dist/hooks/FormHooks.d.ts +52 -0
  69. package/dist/hooks/UseNotification.d.ts +1 -0
  70. package/dist/hooks/UseScanDetection.d.ts +28 -0
  71. package/dist/hooks.js +1075 -0
  72. package/dist/hooks.js.map +1 -0
  73. package/dist/index.js +1105 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/lib/auth/msalClient.d.ts +19 -0
  76. package/dist/lib/auth/msalServer.d.ts +11 -0
  77. package/dist/lib/auth/permissions.d.ts +4 -0
  78. package/dist/lib/auth/scopes.d.ts +4 -0
  79. package/dist/lib/db/collections/userCollection.d.ts +18 -0
  80. package/dist/lib/queryClient.d.ts +2 -0
  81. package/dist/lib/theme.d.ts +1 -0
  82. package/dist/lib/utils.d.ts +63 -0
  83. package/dist/lib/vite-plugin.d.ts +2 -0
  84. package/dist/middleware/authMiddleware.d.ts +22 -0
  85. package/dist/middleware/validationMiddleware.d.ts +4 -0
  86. package/dist/middleware.js +1051 -0
  87. package/dist/middleware.js.map +1 -0
  88. package/dist/models/LayoutOptions.d.ts +7 -0
  89. package/dist/models/Navigation.d.ts +18 -0
  90. package/dist/models/TokenPayload.d.ts +9 -0
  91. package/dist/models/User.d.ts +10 -0
  92. package/dist/models/VaultConfig.d.ts +9 -0
  93. package/dist/models/approval/Approval.d.ts +177 -0
  94. package/dist/models/approval/ApprovalEmployee.d.ts +7 -0
  95. package/dist/models/approval/ApprovalFlow.d.ts +49 -0
  96. package/dist/models/approval/ApprovalFlowStep.d.ts +29 -0
  97. package/dist/models/approval/ApprovalRequestType.d.ts +5 -0
  98. package/dist/models/approval/ApprovalStatus.d.ts +9 -0
  99. package/dist/models/approval/ApprovalStepResult.d.ts +11 -0
  100. package/dist/models/approval/StepApprovalOrder.d.ts +6 -0
  101. package/dist/models/email/Email.d.ts +13 -0
  102. package/dist/models/email/EmailAttachment.d.ts +6 -0
  103. package/dist/models/file/FileActions.d.ts +6 -0
  104. package/dist/models/file/FileMeta.d.ts +15 -0
  105. package/dist/models/peoplesoft/Department.d.ts +58 -0
  106. package/dist/models/peoplesoft/Employee.d.ts +46 -0
  107. package/dist/models/peoplesoft/EmployeeCategoryGroup.d.ts +6 -0
  108. package/dist/models/peoplesoft/EmployeeStatus.d.ts +6 -0
  109. package/dist/models.js +150 -0
  110. package/dist/models.js.map +1 -0
  111. package/dist/providers/DialogsProvider.d.ts +5 -0
  112. package/dist/providers/LayoutProvider.d.ts +12 -0
  113. package/dist/providers/MsalAuthProvider.d.ts +6 -0
  114. package/dist/providers/NotificationProvider.d.ts +7 -0
  115. package/dist/queries/ApprovalQueries.d.ts +661 -0
  116. package/dist/queries/FileQueries.d.ts +205 -0
  117. package/dist/queries/PeopleSoftQueries.d.ts +2173 -0
  118. package/dist/queries/index.d.ts +2958 -0
  119. package/dist/queries-D-DV5lCw.js +2941 -0
  120. package/dist/queries-D-DV5lCw.js.map +1 -0
  121. package/dist/query.js +3 -0
  122. package/dist/queryClient-B__OEZ70.js +7 -0
  123. package/dist/queryClient-B__OEZ70.js.map +1 -0
  124. package/dist/utils-C4oJ0tr5.js +157 -0
  125. package/dist/utils-C4oJ0tr5.js.map +1 -0
  126. package/dist/utils.js +35 -0
  127. package/dist/utils.js.map +1 -0
  128. package/dist/vite.js +110 -0
  129. package/dist/vite.js.map +1 -0
  130. package/package.json +132 -62
  131. package/dist/src/components/Layout.d.ts +0 -16
  132. package/dist/src/components/Layout.js +0 -122
  133. package/dist/src/components/Layout.js.map +0 -1
  134. package/dist/src/components/dataGrid/ChipInputCell.js +0 -17
  135. package/dist/src/components/dataGrid/ChipInputCell.js.map +0 -1
  136. package/dist/src/components/dataGrid/EditableColumnHeader.d.ts +0 -2
  137. package/dist/src/components/dataGrid/EditableColumnHeader.js +0 -7
  138. package/dist/src/components/dataGrid/EditableColumnHeader.js.map +0 -1
  139. package/dist/src/components/dataGrid/GridToolbar.d.ts +0 -8
  140. package/dist/src/components/dataGrid/GridToolbar.js +0 -40
  141. package/dist/src/components/dataGrid/GridToolbar.js.map +0 -1
  142. package/dist/src/components/dataGrid/TableContainer.d.ts +0 -3
  143. package/dist/src/components/dataGrid/TableContainer.js +0 -32
  144. package/dist/src/components/dataGrid/TableContainer.js.map +0 -1
  145. package/dist/src/components/form/FormAutocomplete.js +0 -10
  146. package/dist/src/components/form/FormAutocomplete.js.map +0 -1
  147. package/dist/src/components/form/FormCheckbox.js +0 -11
  148. package/dist/src/components/form/FormCheckbox.js.map +0 -1
  149. package/dist/src/components/form/FormDatePicker.d.ts +0 -9
  150. package/dist/src/components/form/FormDatePicker.js +0 -19
  151. package/dist/src/components/form/FormDatePicker.js.map +0 -1
  152. package/dist/src/components/form/FormDateTimePicker.d.ts +0 -9
  153. package/dist/src/components/form/FormDateTimePicker.js +0 -19
  154. package/dist/src/components/form/FormDateTimePicker.js.map +0 -1
  155. package/dist/src/components/form/FormNumberField.js +0 -12
  156. package/dist/src/components/form/FormNumberField.js.map +0 -1
  157. package/dist/src/components/form/FormRadioGroup.js +0 -11
  158. package/dist/src/components/form/FormRadioGroup.js.map +0 -1
  159. package/dist/src/components/form/FormSlider.js +0 -11
  160. package/dist/src/components/form/FormSlider.js.map +0 -1
  161. package/dist/src/components/form/FormSubmitButton.d.ts +0 -5
  162. package/dist/src/components/form/FormSubmitButton.js +0 -13
  163. package/dist/src/components/form/FormSubmitButton.js.map +0 -1
  164. package/dist/src/components/form/FormSwitch.js +0 -11
  165. package/dist/src/components/form/FormSwitch.js.map +0 -1
  166. package/dist/src/components/form/FormTextField.js +0 -11
  167. package/dist/src/components/form/FormTextField.js.map +0 -1
  168. package/dist/src/components/layout/AccountMenu.d.ts +0 -9
  169. package/dist/src/components/layout/AccountMenu.js +0 -44
  170. package/dist/src/components/layout/AccountMenu.js.map +0 -1
  171. package/dist/src/components/layout/DevelopmentBanner.d.ts +0 -7
  172. package/dist/src/components/layout/DevelopmentBanner.js +0 -29
  173. package/dist/src/components/layout/DevelopmentBanner.js.map +0 -1
  174. package/dist/src/components/layout/ErrorPage.d.ts +0 -2
  175. package/dist/src/components/layout/ErrorPage.js +0 -25
  176. package/dist/src/components/layout/ErrorPage.js.map +0 -1
  177. package/dist/src/components/layout/LayoutDialog.d.ts +0 -12
  178. package/dist/src/components/layout/LayoutDialog.js +0 -12
  179. package/dist/src/components/layout/LayoutDialog.js.map +0 -1
  180. package/dist/src/components/layout/LayoutSnackbar.d.ts +0 -8
  181. package/dist/src/components/layout/LayoutSnackbar.js +0 -25
  182. package/dist/src/components/layout/LayoutSnackbar.js.map +0 -1
  183. package/dist/src/components/layout/NavigationDrawer.d.ts +0 -11
  184. package/dist/src/components/layout/NavigationDrawer.js +0 -70
  185. package/dist/src/components/layout/NavigationDrawer.js.map +0 -1
  186. package/dist/src/components/layout/NotificationMenu.d.ts +0 -8
  187. package/dist/src/components/layout/NotificationMenu.js +0 -26
  188. package/dist/src/components/layout/NotificationMenu.js.map +0 -1
  189. package/dist/src/components/layout/TypographyWithIcon.js +0 -22
  190. package/dist/src/components/layout/TypographyWithIcon.js.map +0 -1
  191. package/dist/src/components/layout/Unauthorized.d.ts +0 -2
  192. package/dist/src/components/layout/Unauthorized.js +0 -26
  193. package/dist/src/components/layout/Unauthorized.js.map +0 -1
  194. package/dist/src/contexts/LayoutContext.d.ts +0 -40
  195. package/dist/src/contexts/LayoutContext.js +0 -60
  196. package/dist/src/contexts/LayoutContext.js.map +0 -1
  197. package/dist/src/contexts/UserContext.d.ts +0 -24
  198. package/dist/src/contexts/UserContext.js +0 -55
  199. package/dist/src/contexts/UserContext.js.map +0 -1
  200. package/dist/src/hooks/FormHooks.d.ts +0 -46
  201. package/dist/src/hooks/FormHooks.js +0 -31
  202. package/dist/src/hooks/FormHooks.js.map +0 -1
  203. package/dist/src/hooks/UseSnackbar.d.ts +0 -10
  204. package/dist/src/hooks/UseSnackbar.js +0 -23
  205. package/dist/src/hooks/UseSnackbar.js.map +0 -1
  206. package/dist/src/hooks/UseUser.d.ts +0 -10
  207. package/dist/src/hooks/UseUser.js +0 -25
  208. package/dist/src/hooks/UseUser.js.map +0 -1
  209. package/dist/src/index.d.ts +0 -20
  210. package/dist/src/index.js +0 -15
  211. package/dist/src/index.js.map +0 -1
  212. package/dist/src/models/Error.d.ts +0 -6
  213. package/dist/src/models/Error.js +0 -2
  214. package/dist/src/models/Error.js.map +0 -1
  215. package/dist/src/models/KeycloakSettings.d.ts +0 -8
  216. package/dist/src/models/KeycloakSettings.js +0 -2
  217. package/dist/src/models/KeycloakSettings.js.map +0 -1
  218. package/dist/src/models/LayoutPaletteColorOptions.d.ts +0 -6
  219. package/dist/src/models/LayoutPaletteColorOptions.js +0 -2
  220. package/dist/src/models/LayoutPaletteColorOptions.js.map +0 -1
  221. package/dist/src/models/LayoutRoute.d.ts +0 -14
  222. package/dist/src/models/LayoutRoute.js +0 -2
  223. package/dist/src/models/LayoutRoute.js.map +0 -1
  224. package/dist/src/models/Notification.d.ts +0 -9
  225. package/dist/src/models/Notification.js +0 -2
  226. package/dist/src/models/Notification.js.map +0 -1
  227. package/dist/src/models/PeoplesoftDepartment.d.ts +0 -14
  228. package/dist/src/models/PeoplesoftDepartment.js +0 -2
  229. package/dist/src/models/PeoplesoftDepartment.js.map +0 -1
  230. package/dist/src/models/PeoplesoftEmployee.d.ts +0 -34
  231. package/dist/src/models/PeoplesoftEmployee.js +0 -2
  232. package/dist/src/models/PeoplesoftEmployee.js.map +0 -1
  233. package/dist/src/models/Snackbar.d.ts +0 -15
  234. package/dist/src/models/Snackbar.js +0 -2
  235. package/dist/src/models/Snackbar.js.map +0 -1
  236. package/dist/src/models/User.d.ts +0 -27
  237. package/dist/src/models/User.js +0 -11
  238. package/dist/src/models/User.js.map +0 -1
  239. package/dist/src/models/types/EmployeeCategoryGroup.d.ts +0 -1
  240. package/dist/src/models/types/EmployeeCategoryGroup.js +0 -2
  241. package/dist/src/models/types/EmployeeCategoryGroup.js.map +0 -1
  242. package/dist/src/models/types/EmployeeStatus.d.ts +0 -1
  243. package/dist/src/models/types/EmployeeStatus.js +0 -2
  244. package/dist/src/models/types/EmployeeStatus.js.map +0 -1
  245. package/dist/src/utils/Auth.d.ts +0 -12
  246. package/dist/src/utils/Auth.js +0 -49
  247. package/dist/src/utils/Auth.js.map +0 -1
  248. package/dist/src/utils/Fetches.d.ts +0 -5
  249. package/dist/src/utils/Fetches.js +0 -66
  250. package/dist/src/utils/Fetches.js.map +0 -1
  251. package/dist/src/utils/FormUtils.d.ts +0 -7
  252. package/dist/src/utils/FormUtils.js +0 -9
  253. package/dist/src/utils/FormUtils.js.map +0 -1
  254. package/dist/src/utils/Helpers.d.ts +0 -11
  255. package/dist/src/utils/Helpers.js +0 -26
  256. package/dist/src/utils/Helpers.js.map +0 -1
  257. package/dist/tsconfig.tsbuildinfo +0 -1
  258. package/src/components/Layout.tsx +0 -183
  259. package/src/components/dataGrid/ChipInputCell.tsx +0 -31
  260. package/src/components/dataGrid/EditableColumnHeader.tsx +0 -7
  261. package/src/components/dataGrid/GridToolbar.tsx +0 -63
  262. package/src/components/dataGrid/TableContainer.tsx +0 -39
  263. package/src/components/form/FormAutocomplete.tsx +0 -34
  264. package/src/components/form/FormCheckbox.tsx +0 -32
  265. package/src/components/form/FormDatePicker.tsx +0 -34
  266. package/src/components/form/FormDateTimePicker.tsx +0 -34
  267. package/src/components/form/FormNumberField.tsx +0 -33
  268. package/src/components/form/FormRadioGroup.tsx +0 -43
  269. package/src/components/form/FormSlider.tsx +0 -28
  270. package/src/components/form/FormSubmitButton.tsx +0 -29
  271. package/src/components/form/FormSwitch.tsx +0 -32
  272. package/src/components/form/FormTextField.tsx +0 -26
  273. package/src/components/layout/AccountMenu.tsx +0 -160
  274. package/src/components/layout/DevelopmentBanner.tsx +0 -54
  275. package/src/components/layout/ErrorPage.tsx +0 -34
  276. package/src/components/layout/LayoutDialog.tsx +0 -50
  277. package/src/components/layout/LayoutSnackbar.tsx +0 -44
  278. package/src/components/layout/NavigationDrawer.tsx +0 -131
  279. package/src/components/layout/NotificationMenu.tsx +0 -76
  280. package/src/components/layout/TypographyWithIcon.tsx +0 -35
  281. package/src/components/layout/Unauthorized.tsx +0 -37
  282. package/src/contexts/LayoutContext.tsx +0 -127
  283. package/src/contexts/UserContext.tsx +0 -88
  284. package/src/hooks/FormHooks.ts +0 -33
  285. package/src/hooks/UseSnackbar.tsx +0 -28
  286. package/src/hooks/UseUser.tsx +0 -29
  287. package/src/index.ts +0 -27
  288. package/src/models/Error.tsx +0 -6
  289. package/src/models/KeycloakSettings.ts +0 -8
  290. package/src/models/LayoutPaletteColorOptions.tsx +0 -7
  291. package/src/models/LayoutRoute.ts +0 -15
  292. package/src/models/Notification.ts +0 -10
  293. package/src/models/PeoplesoftDepartment.ts +0 -15
  294. package/src/models/PeoplesoftEmployee.ts +0 -35
  295. package/src/models/Snackbar.ts +0 -16
  296. package/src/models/User.ts +0 -13
  297. package/src/models/types/EmployeeCategoryGroup.ts +0 -1
  298. package/src/models/types/EmployeeStatus.ts +0 -1
  299. package/src/utils/Auth.ts +0 -58
  300. package/src/utils/Fetches.ts +0 -83
  301. package/src/utils/FormUtils.ts +0 -22
  302. package/src/utils/Helpers.ts +0 -27
  303. package/tsconfig.json +0 -29
@@ -0,0 +1,2941 @@
1
+ import { c as e, m as t, u as n } from "./utils-C4oJ0tr5.js";
2
+ import { t as r } from "./queryClient-B__OEZ70.js";
3
+ import { t as i } from "./dist-Bxzg1_9c.js";
4
+ import { n as a, r as o, t as s } from "./FileMeta-YGG9mxo_.js";
5
+ import { c } from "react/compiler-runtime";
6
+ import l from "zod";
7
+ import { useState as u } from "react";
8
+ import d from "axios";
9
+ import { mutationOptions as f, queryOptions as p } from "@tanstack/react-query";
10
+ //#region \0rolldown/runtime.js
11
+ var m = Object.create, h = Object.defineProperty, g = Object.getOwnPropertyDescriptor, _ = Object.getOwnPropertyNames, v = Object.getPrototypeOf, y = Object.prototype.hasOwnProperty, b = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), x = (e, t, n, r) => {
12
+ if (t && typeof t == "object" || typeof t == "function") for (var i = _(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !y.call(e, s) && s !== n && h(e, s, {
13
+ get: ((e) => t[e]).bind(null, s),
14
+ enumerable: !(r = g(t, s)) || r.enumerable
15
+ });
16
+ return e;
17
+ }, S = (e, t, n) => (n = e == null ? {} : m(v(e)), x(t || !e || !e.__esModule ? h(n, "default", {
18
+ value: e,
19
+ enumerable: !0
20
+ }) : n, e)), C = "approval", w = e(t.VITE_APP_TITLE), T = d.create({ baseURL: "https://graph.microsoft.com/v1.0" });
21
+ T.interceptors.request.use(async (e) => {
22
+ let t = await n("graph");
23
+ return e.headers.set("Authorization", `Bearer ${t}`), e;
24
+ }), l.object({
25
+ appName: l.string().min(1).max(255).default(w).optional(),
26
+ status: o.optional(),
27
+ approverEmployeeId: l.string().min(1).max(20).optional(),
28
+ stepResult: a.optional()
29
+ });
30
+ var ee = {
31
+ approvals: (e) => {
32
+ let t = new URLSearchParams();
33
+ return t.append("applicationName", e?.appName ?? w), e?.status && t.append("status", e.status.toString()), e?.approverEmployeeId && t.append("approverEmployeeId", e.approverEmployeeId), e?.stepResult && t.append("stepResult", e.stepResult.toString()), p({
34
+ queryKey: [C, e],
35
+ queryFn: ({ signal: e }) => T.request({
36
+ url: `/${C}/Requests/Requests?${t.toString()}`,
37
+ method: "GET",
38
+ signal: e
39
+ }).then((e) => e.data)
40
+ });
41
+ },
42
+ approval: (e) => p({
43
+ queryKey: [C, e],
44
+ queryFn: ({ signal: t }) => T.request({
45
+ url: `/${C}/Requests/${e}`,
46
+ method: "GET",
47
+ signal: t
48
+ }).then((e) => e.data)
49
+ }),
50
+ create: () => f({
51
+ mutationFn: (e) => T.request({
52
+ url: `/${C}/Requests`,
53
+ method: "POST",
54
+ data: e
55
+ }).then((e) => e.data),
56
+ onSettled: () => r.invalidateQueries({
57
+ queryKey: [C],
58
+ exact: !1
59
+ })
60
+ }),
61
+ approve: () => f({
62
+ mutationFn: (e) => T.request({
63
+ url: `/${C}/Requests/${e.id}/single-approval`,
64
+ method: "POST",
65
+ data: e
66
+ }).then((e) => e.data),
67
+ onSettled: () => r.invalidateQueries({
68
+ queryKey: [C],
69
+ exact: !1
70
+ })
71
+ }),
72
+ resubmit: () => f({
73
+ mutationFn: (e) => T.request({
74
+ url: `/${C}/Requests/${e.id}/resubmit`,
75
+ method: "POST",
76
+ data: e
77
+ }).then((e) => e.data),
78
+ onSettled: () => r.invalidateQueries({
79
+ queryKey: [C],
80
+ exact: !1
81
+ })
82
+ }),
83
+ withdraw: () => f({
84
+ mutationFn: (e) => T.request({
85
+ url: `/${C}/Requests/${e.id}/withdraw`,
86
+ method: "POST",
87
+ data: e
88
+ }).then((e) => e.data),
89
+ onSettled: () => r.invalidateQueries({
90
+ queryKey: [C],
91
+ exact: !1
92
+ })
93
+ }),
94
+ cancel: () => f({
95
+ mutationFn: (e) => T.request({
96
+ url: `/${C}/Requests/${e.id}/cancel`,
97
+ method: "POST",
98
+ data: e
99
+ }).then((e) => e.data),
100
+ onSettled: () => r.invalidateQueries({
101
+ queryKey: [C],
102
+ exact: !1
103
+ })
104
+ })
105
+ }, E = /* @__PURE__ */ b(((e, t) => {
106
+ (function(t, n) {
107
+ typeof define == "function" && define.amd ? define([], n) : e === void 0 ? (n(), t.FileSaver = { exports: {} }.exports) : n();
108
+ })(e, function() {
109
+ function e(e, t) {
110
+ return t === void 0 ? t = { autoBom: !1 } : typeof t != "object" && (console.warn("Deprecated: Expected third argument to be a object"), t = { autoBom: !t }), t.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type) ? new Blob(["", e], { type: e.type }) : e;
111
+ }
112
+ function n(e, t, n) {
113
+ var r = new XMLHttpRequest();
114
+ r.open("GET", e), r.responseType = "blob", r.onload = function() {
115
+ s(r.response, t, n);
116
+ }, r.onerror = function() {
117
+ console.error("could not download file");
118
+ }, r.send();
119
+ }
120
+ function r(e) {
121
+ var t = new XMLHttpRequest();
122
+ t.open("HEAD", e, !1);
123
+ try {
124
+ t.send();
125
+ } catch {}
126
+ return 200 <= t.status && 299 >= t.status;
127
+ }
128
+ function i(e) {
129
+ try {
130
+ e.dispatchEvent(new MouseEvent("click"));
131
+ } catch {
132
+ var t = document.createEvent("MouseEvents");
133
+ t.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), e.dispatchEvent(t);
134
+ }
135
+ }
136
+ var a = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof global == "object" && global.global === global ? global : void 0, o = a.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), s = a.saveAs || (typeof window != "object" || window !== a ? function() {} : "download" in HTMLAnchorElement.prototype && !o ? function(e, t, o) {
137
+ var s = a.URL || a.webkitURL, c = document.createElement("a");
138
+ t = t || e.name || "download", c.download = t, c.rel = "noopener", typeof e == "string" ? (c.href = e, c.origin === location.origin ? i(c) : r(c.href) ? n(e, t, o) : i(c, c.target = "_blank")) : (c.href = s.createObjectURL(e), setTimeout(function() {
139
+ s.revokeObjectURL(c.href);
140
+ }, 4e4), setTimeout(function() {
141
+ i(c);
142
+ }, 0));
143
+ } : "msSaveOrOpenBlob" in navigator ? function(t, a, o) {
144
+ if (a = a || t.name || "download", typeof t != "string") navigator.msSaveOrOpenBlob(e(t, o), a);
145
+ else if (r(t)) n(t, a, o);
146
+ else {
147
+ var s = document.createElement("a");
148
+ s.href = t, s.target = "_blank", setTimeout(function() {
149
+ i(s);
150
+ });
151
+ }
152
+ } : function(e, t, r, i) {
153
+ if (i ||= open("", "_blank"), i && (i.document.title = i.document.body.innerText = "downloading..."), typeof e == "string") return n(e, t, r);
154
+ var s = e.type === "application/octet-stream", c = /constructor/i.test(a.HTMLElement) || a.safari, l = /CriOS\/[\d]+/.test(navigator.userAgent);
155
+ if ((l || s && c || o) && typeof FileReader < "u") {
156
+ var u = new FileReader();
157
+ u.onloadend = function() {
158
+ var e = u.result;
159
+ e = l ? e : e.replace(/^data:[^;]*;/, "data:attachment/file;"), i ? i.location.href = e : location = e, i = null;
160
+ }, u.readAsDataURL(e);
161
+ } else {
162
+ var d = a.URL || a.webkitURL, f = d.createObjectURL(e);
163
+ i ? i.location = f : location.href = f, i = null, setTimeout(function() {
164
+ d.revokeObjectURL(f);
165
+ }, 4e4);
166
+ }
167
+ });
168
+ a.saveAs = s.saveAs = s, t !== void 0 && (t.exports = s);
169
+ });
170
+ }));
171
+ //#endregion
172
+ //#region node_modules/tus-js-client/lib.esm/error.js
173
+ function D(e) {
174
+ "@babel/helpers - typeof";
175
+ return D = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
176
+ return typeof e;
177
+ } : function(e) {
178
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
179
+ }, D(e);
180
+ }
181
+ function O(e, t) {
182
+ for (var n = 0; n < t.length; n++) {
183
+ var r = t[n];
184
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, A(r.key), r);
185
+ }
186
+ }
187
+ function k(e, t, n) {
188
+ return t && O(e.prototype, t), n && O(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
189
+ }
190
+ function A(e) {
191
+ var t = te(e, "string");
192
+ return D(t) == "symbol" ? t : t + "";
193
+ }
194
+ function te(e, t) {
195
+ if (D(e) != "object" || !e) return e;
196
+ var n = e[Symbol.toPrimitive];
197
+ if (n !== void 0) {
198
+ var r = n.call(e, t || "default");
199
+ if (D(r) != "object") return r;
200
+ throw TypeError("@@toPrimitive must return a primitive value.");
201
+ }
202
+ return (t === "string" ? String : Number)(e);
203
+ }
204
+ function ne(e, t) {
205
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
206
+ }
207
+ function re(e, t, n) {
208
+ return t = j(t), ie(e, le() ? Reflect.construct(t, n || [], j(e).constructor) : t.apply(e, n));
209
+ }
210
+ function ie(e, t) {
211
+ if (t && (D(t) === "object" || typeof t == "function")) return t;
212
+ if (t !== void 0) throw TypeError("Derived constructors may only return object or undefined");
213
+ return ae(e);
214
+ }
215
+ function ae(e) {
216
+ if (e === void 0) throw ReferenceError("this hasn't been initialised - super() hasn't been called");
217
+ return e;
218
+ }
219
+ function oe(e, t) {
220
+ if (typeof t != "function" && t !== null) throw TypeError("Super expression must either be null or a function");
221
+ e.prototype = Object.create(t && t.prototype, { constructor: {
222
+ value: e,
223
+ writable: !0,
224
+ configurable: !0
225
+ } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && de(e, t);
226
+ }
227
+ function se(e) {
228
+ var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
229
+ return se = function(e) {
230
+ if (e === null || !ue(e)) return e;
231
+ if (typeof e != "function") throw TypeError("Super expression must either be null or a function");
232
+ if (t !== void 0) {
233
+ if (t.has(e)) return t.get(e);
234
+ t.set(e, n);
235
+ }
236
+ function n() {
237
+ return ce(e, arguments, j(this).constructor);
238
+ }
239
+ return n.prototype = Object.create(e.prototype, { constructor: {
240
+ value: n,
241
+ enumerable: !1,
242
+ writable: !0,
243
+ configurable: !0
244
+ } }), de(n, e);
245
+ }, se(e);
246
+ }
247
+ function ce(e, t, n) {
248
+ if (le()) return Reflect.construct.apply(null, arguments);
249
+ var r = [null];
250
+ r.push.apply(r, t);
251
+ var i = new (e.bind.apply(e, r))();
252
+ return n && de(i, n.prototype), i;
253
+ }
254
+ function le() {
255
+ try {
256
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
257
+ } catch {}
258
+ return (le = function() {
259
+ return !!e;
260
+ })();
261
+ }
262
+ function ue(e) {
263
+ try {
264
+ return Function.toString.call(e).indexOf("[native code]") !== -1;
265
+ } catch {
266
+ return typeof e == "function";
267
+ }
268
+ }
269
+ function de(e, t) {
270
+ return de = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
271
+ return e.__proto__ = t, e;
272
+ }, de(e, t);
273
+ }
274
+ function j(e) {
275
+ return j = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
276
+ return e.__proto__ || Object.getPrototypeOf(e);
277
+ }, j(e);
278
+ }
279
+ var fe = /* @__PURE__ */ function(e) {
280
+ function t(e) {
281
+ var n, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
282
+ if (ne(this, t), n = re(this, t, [e]), n.originalRequest = i, n.originalResponse = a, n.causingError = r, r != null && (e += `, caused by ${r.toString()}`), i != null) {
283
+ var o = i.getHeader("X-Request-ID") || "n/a", s = i.getMethod(), c = i.getURL(), l = a ? a.getStatus() : "n/a", u = a ? a.getBody() || "" : "n/a";
284
+ e += `, originated from request (method: ${s}, url: ${c}, response code: ${l}, response text: ${u}, request id: ${o})`;
285
+ }
286
+ return n.message = e, n;
287
+ }
288
+ return oe(t, e), k(t);
289
+ }(/* @__PURE__ */ se(Error)), pe = !1;
290
+ function M(e) {
291
+ pe && console.log(e);
292
+ }
293
+ //#endregion
294
+ //#region node_modules/tus-js-client/lib.esm/noopUrlStorage.js
295
+ function me(e) {
296
+ "@babel/helpers - typeof";
297
+ return me = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
298
+ return typeof e;
299
+ } : function(e) {
300
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
301
+ }, me(e);
302
+ }
303
+ function he(e, t) {
304
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
305
+ }
306
+ function ge(e, t) {
307
+ for (var n = 0; n < t.length; n++) {
308
+ var r = t[n];
309
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, ve(r.key), r);
310
+ }
311
+ }
312
+ function _e(e, t, n) {
313
+ return t && ge(e.prototype, t), n && ge(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
314
+ }
315
+ function ve(e) {
316
+ var t = ye(e, "string");
317
+ return me(t) == "symbol" ? t : t + "";
318
+ }
319
+ function ye(e, t) {
320
+ if (me(e) != "object" || !e) return e;
321
+ var n = e[Symbol.toPrimitive];
322
+ if (n !== void 0) {
323
+ var r = n.call(e, t || "default");
324
+ if (me(r) != "object") return r;
325
+ throw TypeError("@@toPrimitive must return a primitive value.");
326
+ }
327
+ return (t === "string" ? String : Number)(e);
328
+ }
329
+ var be = /* @__PURE__ */ function() {
330
+ function e() {
331
+ he(this, e);
332
+ }
333
+ return _e(e, [
334
+ {
335
+ key: "listAllUploads",
336
+ value: function() {
337
+ return Promise.resolve([]);
338
+ }
339
+ },
340
+ {
341
+ key: "findUploadsByFingerprint",
342
+ value: function(e) {
343
+ return Promise.resolve([]);
344
+ }
345
+ },
346
+ {
347
+ key: "removeUpload",
348
+ value: function(e) {
349
+ return Promise.resolve();
350
+ }
351
+ },
352
+ {
353
+ key: "addUpload",
354
+ value: function(e, t) {
355
+ return Promise.resolve(null);
356
+ }
357
+ }
358
+ ]);
359
+ }(), xe = "3.7.8", Se = xe, N = typeof Buffer == "function", Ce = typeof TextDecoder == "function" ? new TextDecoder() : void 0, we = typeof TextEncoder == "function" ? new TextEncoder() : void 0, Te = Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="), Ee = ((e) => {
360
+ let t = {};
361
+ return e.forEach((e, n) => t[e] = n), t;
362
+ })(Te), De = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/, P = String.fromCharCode.bind(String), Oe = typeof Uint8Array.from == "function" ? Uint8Array.from.bind(Uint8Array) : (e) => new Uint8Array(Array.prototype.slice.call(e, 0)), ke = (e) => e.replace(/=/g, "").replace(/[+\/]/g, (e) => e == "+" ? "-" : "_"), Ae = (e) => e.replace(/[^A-Za-z0-9\+\/]/g, ""), je = (e) => {
363
+ let t, n, r, i, a = "", o = e.length % 3;
364
+ for (let o = 0; o < e.length;) {
365
+ if ((n = e.charCodeAt(o++)) > 255 || (r = e.charCodeAt(o++)) > 255 || (i = e.charCodeAt(o++)) > 255) throw TypeError("invalid character found");
366
+ t = n << 16 | r << 8 | i, a += Te[t >> 18 & 63] + Te[t >> 12 & 63] + Te[t >> 6 & 63] + Te[t & 63];
367
+ }
368
+ return o ? a.slice(0, o - 3) + "===".substring(o) : a;
369
+ }, Me = typeof btoa == "function" ? (e) => btoa(e) : N ? (e) => Buffer.from(e, "binary").toString("base64") : je, Ne = N ? (e) => Buffer.from(e).toString("base64") : (e) => {
370
+ let t = 4096, n = [];
371
+ for (let r = 0, i = e.length; r < i; r += t) n.push(P.apply(null, e.subarray(r, r + t)));
372
+ return Me(n.join(""));
373
+ }, Pe = (e, t = !1) => t ? ke(Ne(e)) : Ne(e), Fe = (e) => {
374
+ if (e.length < 2) {
375
+ var t = e.charCodeAt(0);
376
+ return t < 128 ? e : t < 2048 ? P(192 | t >>> 6) + P(128 | t & 63) : P(224 | t >>> 12 & 15) + P(128 | t >>> 6 & 63) + P(128 | t & 63);
377
+ } else {
378
+ var t = 65536 + (e.charCodeAt(0) - 55296) * 1024 + (e.charCodeAt(1) - 56320);
379
+ return P(240 | t >>> 18 & 7) + P(128 | t >>> 12 & 63) + P(128 | t >>> 6 & 63) + P(128 | t & 63);
380
+ }
381
+ }, Ie = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, Le = (e) => e.replace(Ie, Fe), Re = N ? (e) => Buffer.from(e, "utf8").toString("base64") : we ? (e) => Ne(we.encode(e)) : (e) => Me(Le(e)), F = (e, t = !1) => t ? ke(Re(e)) : Re(e), ze = (e) => F(e, !0), Be = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g, Ve = (e) => {
382
+ switch (e.length) {
383
+ case 4:
384
+ var t = ((7 & e.charCodeAt(0)) << 18 | (63 & e.charCodeAt(1)) << 12 | (63 & e.charCodeAt(2)) << 6 | 63 & e.charCodeAt(3)) - 65536;
385
+ return P((t >>> 10) + 55296) + P((t & 1023) + 56320);
386
+ case 3: return P((15 & e.charCodeAt(0)) << 12 | (63 & e.charCodeAt(1)) << 6 | 63 & e.charCodeAt(2));
387
+ default: return P((31 & e.charCodeAt(0)) << 6 | 63 & e.charCodeAt(1));
388
+ }
389
+ }, He = (e) => e.replace(Be, Ve), Ue = (e) => {
390
+ if (e = e.replace(/\s+/g, ""), !De.test(e)) throw TypeError("malformed base64.");
391
+ e += "==".slice(2 - (e.length & 3));
392
+ let t, n, r, i = [];
393
+ for (let a = 0; a < e.length;) t = Ee[e.charAt(a++)] << 18 | Ee[e.charAt(a++)] << 12 | (n = Ee[e.charAt(a++)]) << 6 | (r = Ee[e.charAt(a++)]), n === 64 ? i.push(P(t >> 16 & 255)) : r === 64 ? i.push(P(t >> 16 & 255, t >> 8 & 255)) : i.push(P(t >> 16 & 255, t >> 8 & 255, t & 255));
394
+ return i.join("");
395
+ }, We = typeof atob == "function" ? (e) => atob(Ae(e)) : N ? (e) => Buffer.from(e, "base64").toString("binary") : Ue, Ge = N ? (e) => Oe(Buffer.from(e, "base64")) : (e) => Oe(We(e).split("").map((e) => e.charCodeAt(0))), Ke = (e) => Ge(Je(e)), qe = N ? (e) => Buffer.from(e, "base64").toString("utf8") : Ce ? (e) => Ce.decode(Ge(e)) : (e) => He(We(e)), Je = (e) => Ae(e.replace(/[-_]/g, (e) => e == "-" ? "+" : "/")), Ye = (e) => qe(Je(e)), Xe = (e) => {
396
+ if (typeof e != "string") return !1;
397
+ let t = e.replace(/\s+/g, "").replace(/={0,2}$/, "");
398
+ return !/[^\s0-9a-zA-Z\+/]/.test(t) || !/[^\s0-9a-zA-Z\-_]/.test(t);
399
+ }, Ze = (e) => ({
400
+ value: e,
401
+ enumerable: !1,
402
+ writable: !0,
403
+ configurable: !0
404
+ }), Qe = function() {
405
+ let e = (e, t) => Object.defineProperty(String.prototype, e, Ze(t));
406
+ e("fromBase64", function() {
407
+ return Ye(this);
408
+ }), e("toBase64", function(e) {
409
+ return F(this, e);
410
+ }), e("toBase64URI", function() {
411
+ return F(this, !0);
412
+ }), e("toBase64URL", function() {
413
+ return F(this, !0);
414
+ }), e("toUint8Array", function() {
415
+ return Ke(this);
416
+ });
417
+ }, $e = function() {
418
+ let e = (e, t) => Object.defineProperty(Uint8Array.prototype, e, Ze(t));
419
+ e("toBase64", function(e) {
420
+ return Pe(this, e);
421
+ }), e("toBase64URI", function() {
422
+ return Pe(this, !0);
423
+ }), e("toBase64URL", function() {
424
+ return Pe(this, !0);
425
+ });
426
+ }, et = {
427
+ version: xe,
428
+ VERSION: Se,
429
+ atob: We,
430
+ atobPolyfill: Ue,
431
+ btoa: Me,
432
+ btoaPolyfill: je,
433
+ fromBase64: Ye,
434
+ toBase64: F,
435
+ encode: F,
436
+ encodeURI: ze,
437
+ encodeURL: ze,
438
+ utob: Le,
439
+ btou: He,
440
+ decode: Ye,
441
+ isValid: Xe,
442
+ fromUint8Array: Pe,
443
+ toUint8Array: Ke,
444
+ extendString: Qe,
445
+ extendUint8Array: $e,
446
+ extendBuiltins: () => {
447
+ Qe(), $e();
448
+ }
449
+ }, tt = /* @__PURE__ */ b(((e, t) => {
450
+ t.exports = function(e, t) {
451
+ if (t = t.split(":")[0], e = +e, !e) return !1;
452
+ switch (t) {
453
+ case "http":
454
+ case "ws": return e !== 80;
455
+ case "https":
456
+ case "wss": return e !== 443;
457
+ case "ftp": return e !== 21;
458
+ case "gopher": return e !== 70;
459
+ case "file": return !1;
460
+ }
461
+ return e !== 0;
462
+ };
463
+ })), nt = /* @__PURE__ */ b(((e) => {
464
+ var t = Object.prototype.hasOwnProperty, n;
465
+ function r(e) {
466
+ try {
467
+ return decodeURIComponent(e.replace(/\+/g, " "));
468
+ } catch {
469
+ return null;
470
+ }
471
+ }
472
+ function i(e) {
473
+ try {
474
+ return encodeURIComponent(e);
475
+ } catch {
476
+ return null;
477
+ }
478
+ }
479
+ function a(e) {
480
+ for (var t = /([^=?#&]+)=?([^&]*)/g, n = {}, i; i = t.exec(e);) {
481
+ var a = r(i[1]), o = r(i[2]);
482
+ a === null || o === null || a in n || (n[a] = o);
483
+ }
484
+ return n;
485
+ }
486
+ function o(e, r) {
487
+ r ||= "";
488
+ var a = [], o, s;
489
+ for (s in typeof r != "string" && (r = "?"), e) if (t.call(e, s)) {
490
+ if (o = e[s], !o && (o === null || o === n || isNaN(o)) && (o = ""), s = i(s), o = i(o), s === null || o === null) continue;
491
+ a.push(s + "=" + o);
492
+ }
493
+ return a.length ? r + a.join("&") : "";
494
+ }
495
+ e.stringify = o, e.parse = a;
496
+ })), rt = /* @__PURE__ */ b(((e, t) => {
497
+ var n = tt(), r = nt(), i = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/, a = /[\n\r\t]/g, o = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//, s = /:\d+$/, c = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i, l = /^[a-zA-Z]:/;
498
+ function u(e) {
499
+ return (e || "").toString().replace(i, "");
500
+ }
501
+ var d = [
502
+ ["#", "hash"],
503
+ ["?", "query"],
504
+ function(e, t) {
505
+ return m(t.protocol) ? e.replace(/\\/g, "/") : e;
506
+ },
507
+ ["/", "pathname"],
508
+ [
509
+ "@",
510
+ "auth",
511
+ 1
512
+ ],
513
+ [
514
+ NaN,
515
+ "host",
516
+ void 0,
517
+ 1,
518
+ 1
519
+ ],
520
+ [
521
+ /:(\d*)$/,
522
+ "port",
523
+ void 0,
524
+ 1
525
+ ],
526
+ [
527
+ NaN,
528
+ "hostname",
529
+ void 0,
530
+ 1,
531
+ 1
532
+ ]
533
+ ], f = {
534
+ hash: 1,
535
+ query: 1
536
+ };
537
+ function p(e) {
538
+ var t = (typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}).location || {};
539
+ e ||= t;
540
+ var n = {}, r = typeof e, i;
541
+ if (e.protocol === "blob:") n = new _(unescape(e.pathname), {});
542
+ else if (r === "string") for (i in n = new _(e, {}), f) delete n[i];
543
+ else if (r === "object") {
544
+ for (i in e) i in f || (n[i] = e[i]);
545
+ n.slashes === void 0 && (n.slashes = o.test(e.href));
546
+ }
547
+ return n;
548
+ }
549
+ function m(e) {
550
+ return e === "file:" || e === "ftp:" || e === "http:" || e === "https:" || e === "ws:" || e === "wss:";
551
+ }
552
+ function h(e, t) {
553
+ e = u(e), e = e.replace(a, ""), t ||= {};
554
+ var n = c.exec(e), r = n[1] ? n[1].toLowerCase() : "", i = !!n[2], o = !!n[3], s = 0, l;
555
+ return i ? o ? (l = n[2] + n[3] + n[4], s = n[2].length + n[3].length) : (l = n[2] + n[4], s = n[2].length) : o ? (l = n[3] + n[4], s = n[3].length) : l = n[4], r === "file:" ? s >= 2 && (l = l.slice(2)) : m(r) ? l = n[4] : r ? i && (l = l.slice(2)) : s >= 2 && m(t.protocol) && (l = n[4]), {
556
+ protocol: r,
557
+ slashes: i || m(r),
558
+ slashesCount: s,
559
+ rest: l
560
+ };
561
+ }
562
+ function g(e, t) {
563
+ if (e === "") return t;
564
+ for (var n = (t || "/").split("/").slice(0, -1).concat(e.split("/")), r = n.length, i = n[r - 1], a = !1, o = 0; r--;) n[r] === "." ? n.splice(r, 1) : n[r] === ".." ? (n.splice(r, 1), o++) : o && (r === 0 && (a = !0), n.splice(r, 1), o--);
565
+ return a && n.unshift(""), (i === "." || i === "..") && n.push(""), n.join("/");
566
+ }
567
+ function _(e, t, i) {
568
+ if (e = u(e), e = e.replace(a, ""), !(this instanceof _)) return new _(e, t, i);
569
+ var o, s, c, f, v, y, b = d.slice(), x = typeof t, S = this, C = 0;
570
+ for (x !== "object" && x !== "string" && (i = t, t = null), i && typeof i != "function" && (i = r.parse), t = p(t), s = h(e || "", t), o = !s.protocol && !s.slashes, S.slashes = s.slashes || o && t.slashes, S.protocol = s.protocol || t.protocol || "", e = s.rest, (s.protocol === "file:" && (s.slashesCount !== 2 || l.test(e)) || !s.slashes && (s.protocol || s.slashesCount < 2 || !m(S.protocol))) && (b[3] = [/(.*)/, "pathname"]); C < b.length; C++) {
571
+ if (f = b[C], typeof f == "function") {
572
+ e = f(e, S);
573
+ continue;
574
+ }
575
+ c = f[0], y = f[1], c === c ? typeof c == "string" ? (v = c === "@" ? e.lastIndexOf(c) : e.indexOf(c), ~v && (typeof f[2] == "number" ? (S[y] = e.slice(0, v), e = e.slice(v + f[2])) : (S[y] = e.slice(v), e = e.slice(0, v)))) : (v = c.exec(e)) && (S[y] = v[1], e = e.slice(0, v.index)) : S[y] = e, S[y] = S[y] || o && f[3] && t[y] || "", f[4] && (S[y] = S[y].toLowerCase());
576
+ }
577
+ i && (S.query = i(S.query)), o && t.slashes && S.pathname.charAt(0) !== "/" && (S.pathname !== "" || t.pathname !== "") && (S.pathname = g(S.pathname, t.pathname)), S.pathname.charAt(0) !== "/" && m(S.protocol) && (S.pathname = "/" + S.pathname), n(S.port, S.protocol) || (S.host = S.hostname, S.port = ""), S.username = S.password = "", S.auth &&= (v = S.auth.indexOf(":"), ~v ? (S.username = S.auth.slice(0, v), S.username = encodeURIComponent(decodeURIComponent(S.username)), S.password = S.auth.slice(v + 1), S.password = encodeURIComponent(decodeURIComponent(S.password))) : S.username = encodeURIComponent(decodeURIComponent(S.auth)), S.password ? S.username + ":" + S.password : S.username), S.origin = S.protocol !== "file:" && m(S.protocol) && S.host ? S.protocol + "//" + S.host : "null", S.href = S.toString();
578
+ }
579
+ function v(e, t, i) {
580
+ var a = this;
581
+ switch (e) {
582
+ case "query":
583
+ typeof t == "string" && t.length && (t = (i || r.parse)(t)), a[e] = t;
584
+ break;
585
+ case "port":
586
+ a[e] = t, n(t, a.protocol) ? t && (a.host = a.hostname + ":" + t) : (a.host = a.hostname, a[e] = "");
587
+ break;
588
+ case "hostname":
589
+ a[e] = t, a.port && (t += ":" + a.port), a.host = t;
590
+ break;
591
+ case "host":
592
+ a[e] = t, s.test(t) ? (t = t.split(":"), a.port = t.pop(), a.hostname = t.join(":")) : (a.hostname = t, a.port = "");
593
+ break;
594
+ case "protocol":
595
+ a.protocol = t.toLowerCase(), a.slashes = !i;
596
+ break;
597
+ case "pathname":
598
+ case "hash":
599
+ if (t) {
600
+ var o = e === "pathname" ? "/" : "#";
601
+ a[e] = t.charAt(0) === o ? t : o + t;
602
+ } else a[e] = t;
603
+ break;
604
+ case "username":
605
+ case "password":
606
+ a[e] = encodeURIComponent(t);
607
+ break;
608
+ case "auth":
609
+ var c = t.indexOf(":");
610
+ ~c ? (a.username = t.slice(0, c), a.username = encodeURIComponent(decodeURIComponent(a.username)), a.password = t.slice(c + 1), a.password = encodeURIComponent(decodeURIComponent(a.password))) : a.username = encodeURIComponent(decodeURIComponent(t));
611
+ }
612
+ for (var l = 0; l < d.length; l++) {
613
+ var u = d[l];
614
+ u[4] && (a[u[1]] = a[u[1]].toLowerCase());
615
+ }
616
+ return a.auth = a.password ? a.username + ":" + a.password : a.username, a.origin = a.protocol !== "file:" && m(a.protocol) && a.host ? a.protocol + "//" + a.host : "null", a.href = a.toString(), a;
617
+ }
618
+ function y(e) {
619
+ (!e || typeof e != "function") && (e = r.stringify);
620
+ var t, n = this, i = n.host, a = n.protocol;
621
+ a && a.charAt(a.length - 1) !== ":" && (a += ":");
622
+ var o = a + (n.protocol && n.slashes || m(n.protocol) ? "//" : "");
623
+ return n.username ? (o += n.username, n.password && (o += ":" + n.password), o += "@") : n.password ? (o += ":" + n.password, o += "@") : n.protocol !== "file:" && m(n.protocol) && !i && n.pathname !== "/" && (o += "@"), (i[i.length - 1] === ":" || s.test(n.hostname) && !n.port) && (i += ":"), o += i + n.pathname, t = typeof n.query == "object" ? e(n.query) : n.query, t && (o += t.charAt(0) === "?" ? t : "?" + t), n.hash && (o += n.hash), o;
624
+ }
625
+ _.prototype = {
626
+ set: v,
627
+ toString: y
628
+ }, _.extractProtocol = h, _.location = p, _.trimLeft = u, _.qs = r, t.exports = _;
629
+ }));
630
+ //#endregion
631
+ //#region node_modules/tus-js-client/lib.esm/uuid.js
632
+ function it() {
633
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
634
+ var t = Math.random() * 16 | 0;
635
+ return (e === "x" ? t : t & 3 | 8).toString(16);
636
+ });
637
+ }
638
+ //#endregion
639
+ //#region node_modules/tus-js-client/lib.esm/upload.js
640
+ var at = /* @__PURE__ */ S(rt());
641
+ function ot() {
642
+ ot = function() {
643
+ return t;
644
+ };
645
+ var e, t = {}, n = Object.prototype, r = n.hasOwnProperty, i = Object.defineProperty || function(e, t, n) {
646
+ e[t] = n.value;
647
+ }, a = typeof Symbol == "function" ? Symbol : {}, o = a.iterator || "@@iterator", s = a.asyncIterator || "@@asyncIterator", c = a.toStringTag || "@@toStringTag";
648
+ function l(e, t, n) {
649
+ return Object.defineProperty(e, t, {
650
+ value: n,
651
+ enumerable: !0,
652
+ configurable: !0,
653
+ writable: !0
654
+ }), e[t];
655
+ }
656
+ try {
657
+ l({}, "");
658
+ } catch {
659
+ l = function(e, t, n) {
660
+ return e[t] = n;
661
+ };
662
+ }
663
+ function u(e, t, n, r) {
664
+ var a = t && t.prototype instanceof _ ? t : _, o = Object.create(a.prototype);
665
+ return i(o, "_invoke", { value: ee(e, n, new k(r || [])) }), o;
666
+ }
667
+ function d(e, t, n) {
668
+ try {
669
+ return {
670
+ type: "normal",
671
+ arg: e.call(t, n)
672
+ };
673
+ } catch (e) {
674
+ return {
675
+ type: "throw",
676
+ arg: e
677
+ };
678
+ }
679
+ }
680
+ t.wrap = u;
681
+ var f = "suspendedStart", p = "suspendedYield", m = "executing", h = "completed", g = {};
682
+ function _() {}
683
+ function v() {}
684
+ function y() {}
685
+ var b = {};
686
+ l(b, o, function() {
687
+ return this;
688
+ });
689
+ var x = Object.getPrototypeOf, S = x && x(x(A([])));
690
+ S && S !== n && r.call(S, o) && (b = S);
691
+ var C = y.prototype = _.prototype = Object.create(b);
692
+ function w(e) {
693
+ [
694
+ "next",
695
+ "throw",
696
+ "return"
697
+ ].forEach(function(t) {
698
+ l(e, t, function(e) {
699
+ return this._invoke(t, e);
700
+ });
701
+ });
702
+ }
703
+ function T(e, t) {
704
+ function n(i, a, o, s) {
705
+ var c = d(e[i], e, a);
706
+ if (c.type !== "throw") {
707
+ var l = c.arg, u = l.value;
708
+ return u && I(u) == "object" && r.call(u, "__await") ? t.resolve(u.__await).then(function(e) {
709
+ n("next", e, o, s);
710
+ }, function(e) {
711
+ n("throw", e, o, s);
712
+ }) : t.resolve(u).then(function(e) {
713
+ l.value = e, o(l);
714
+ }, function(e) {
715
+ return n("throw", e, o, s);
716
+ });
717
+ }
718
+ s(c.arg);
719
+ }
720
+ var a;
721
+ i(this, "_invoke", { value: function(e, r) {
722
+ function i() {
723
+ return new t(function(t, i) {
724
+ n(e, r, t, i);
725
+ });
726
+ }
727
+ return a = a ? a.then(i, i) : i();
728
+ } });
729
+ }
730
+ function ee(t, n, r) {
731
+ var i = f;
732
+ return function(a, o) {
733
+ if (i === m) throw Error("Generator is already running");
734
+ if (i === h) {
735
+ if (a === "throw") throw o;
736
+ return {
737
+ value: e,
738
+ done: !0
739
+ };
740
+ }
741
+ for (r.method = a, r.arg = o;;) {
742
+ var s = r.delegate;
743
+ if (s) {
744
+ var c = E(s, r);
745
+ if (c) {
746
+ if (c === g) continue;
747
+ return c;
748
+ }
749
+ }
750
+ if (r.method === "next") r.sent = r._sent = r.arg;
751
+ else if (r.method === "throw") {
752
+ if (i === f) throw i = h, r.arg;
753
+ r.dispatchException(r.arg);
754
+ } else r.method === "return" && r.abrupt("return", r.arg);
755
+ i = m;
756
+ var l = d(t, n, r);
757
+ if (l.type === "normal") {
758
+ if (i = r.done ? h : p, l.arg === g) continue;
759
+ return {
760
+ value: l.arg,
761
+ done: r.done
762
+ };
763
+ }
764
+ l.type === "throw" && (i = h, r.method = "throw", r.arg = l.arg);
765
+ }
766
+ };
767
+ }
768
+ function E(t, n) {
769
+ var r = n.method, i = t.iterator[r];
770
+ if (i === e) return n.delegate = null, r === "throw" && t.iterator.return && (n.method = "return", n.arg = e, E(t, n), n.method === "throw") || r !== "return" && (n.method = "throw", n.arg = /* @__PURE__ */ TypeError("The iterator does not provide a '" + r + "' method")), g;
771
+ var a = d(i, t.iterator, n.arg);
772
+ if (a.type === "throw") return n.method = "throw", n.arg = a.arg, n.delegate = null, g;
773
+ var o = a.arg;
774
+ return o ? o.done ? (n[t.resultName] = o.value, n.next = t.nextLoc, n.method !== "return" && (n.method = "next", n.arg = e), n.delegate = null, g) : o : (n.method = "throw", n.arg = /* @__PURE__ */ TypeError("iterator result is not an object"), n.delegate = null, g);
775
+ }
776
+ function D(e) {
777
+ var t = { tryLoc: e[0] };
778
+ 1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t);
779
+ }
780
+ function O(e) {
781
+ var t = e.completion || {};
782
+ t.type = "normal", delete t.arg, e.completion = t;
783
+ }
784
+ function k(e) {
785
+ this.tryEntries = [{ tryLoc: "root" }], e.forEach(D, this), this.reset(!0);
786
+ }
787
+ function A(t) {
788
+ if (t || t === "") {
789
+ var n = t[o];
790
+ if (n) return n.call(t);
791
+ if (typeof t.next == "function") return t;
792
+ if (!isNaN(t.length)) {
793
+ var i = -1, a = function n() {
794
+ for (; ++i < t.length;) if (r.call(t, i)) return n.value = t[i], n.done = !1, n;
795
+ return n.value = e, n.done = !0, n;
796
+ };
797
+ return a.next = a;
798
+ }
799
+ }
800
+ throw TypeError(I(t) + " is not iterable");
801
+ }
802
+ return v.prototype = y, i(C, "constructor", {
803
+ value: y,
804
+ configurable: !0
805
+ }), i(y, "constructor", {
806
+ value: v,
807
+ configurable: !0
808
+ }), v.displayName = l(y, c, "GeneratorFunction"), t.isGeneratorFunction = function(e) {
809
+ var t = typeof e == "function" && e.constructor;
810
+ return !!t && (t === v || (t.displayName || t.name) === "GeneratorFunction");
811
+ }, t.mark = function(e) {
812
+ return Object.setPrototypeOf ? Object.setPrototypeOf(e, y) : (e.__proto__ = y, l(e, c, "GeneratorFunction")), e.prototype = Object.create(C), e;
813
+ }, t.awrap = function(e) {
814
+ return { __await: e };
815
+ }, w(T.prototype), l(T.prototype, s, function() {
816
+ return this;
817
+ }), t.AsyncIterator = T, t.async = function(e, n, r, i, a) {
818
+ a === void 0 && (a = Promise);
819
+ var o = new T(u(e, n, r, i), a);
820
+ return t.isGeneratorFunction(n) ? o : o.next().then(function(e) {
821
+ return e.done ? e.value : o.next();
822
+ });
823
+ }, w(C), l(C, c, "Generator"), l(C, o, function() {
824
+ return this;
825
+ }), l(C, "toString", function() {
826
+ return "[object Generator]";
827
+ }), t.keys = function(e) {
828
+ var t = Object(e), n = [];
829
+ for (var r in t) n.push(r);
830
+ return n.reverse(), function e() {
831
+ for (; n.length;) {
832
+ var r = n.pop();
833
+ if (r in t) return e.value = r, e.done = !1, e;
834
+ }
835
+ return e.done = !0, e;
836
+ };
837
+ }, t.values = A, k.prototype = {
838
+ constructor: k,
839
+ reset: function(t) {
840
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(O), !t) for (var n in this) n.charAt(0) === "t" && r.call(this, n) && !isNaN(+n.slice(1)) && (this[n] = e);
841
+ },
842
+ stop: function() {
843
+ this.done = !0;
844
+ var e = this.tryEntries[0].completion;
845
+ if (e.type === "throw") throw e.arg;
846
+ return this.rval;
847
+ },
848
+ dispatchException: function(t) {
849
+ if (this.done) throw t;
850
+ var n = this;
851
+ function i(r, i) {
852
+ return s.type = "throw", s.arg = t, n.next = r, i && (n.method = "next", n.arg = e), !!i;
853
+ }
854
+ for (var a = this.tryEntries.length - 1; a >= 0; --a) {
855
+ var o = this.tryEntries[a], s = o.completion;
856
+ if (o.tryLoc === "root") return i("end");
857
+ if (o.tryLoc <= this.prev) {
858
+ var c = r.call(o, "catchLoc"), l = r.call(o, "finallyLoc");
859
+ if (c && l) {
860
+ if (this.prev < o.catchLoc) return i(o.catchLoc, !0);
861
+ if (this.prev < o.finallyLoc) return i(o.finallyLoc);
862
+ } else if (c) {
863
+ if (this.prev < o.catchLoc) return i(o.catchLoc, !0);
864
+ } else {
865
+ if (!l) throw Error("try statement without catch or finally");
866
+ if (this.prev < o.finallyLoc) return i(o.finallyLoc);
867
+ }
868
+ }
869
+ }
870
+ },
871
+ abrupt: function(e, t) {
872
+ for (var n = this.tryEntries.length - 1; n >= 0; --n) {
873
+ var i = this.tryEntries[n];
874
+ if (i.tryLoc <= this.prev && r.call(i, "finallyLoc") && this.prev < i.finallyLoc) {
875
+ var a = i;
876
+ break;
877
+ }
878
+ }
879
+ a && (e === "break" || e === "continue") && a.tryLoc <= t && t <= a.finallyLoc && (a = null);
880
+ var o = a ? a.completion : {};
881
+ return o.type = e, o.arg = t, a ? (this.method = "next", this.next = a.finallyLoc, g) : this.complete(o);
882
+ },
883
+ complete: function(e, t) {
884
+ if (e.type === "throw") throw e.arg;
885
+ return e.type === "break" || e.type === "continue" ? this.next = e.arg : e.type === "return" ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : e.type === "normal" && t && (this.next = t), g;
886
+ },
887
+ finish: function(e) {
888
+ for (var t = this.tryEntries.length - 1; t >= 0; --t) {
889
+ var n = this.tryEntries[t];
890
+ if (n.finallyLoc === e) return this.complete(n.completion, n.afterLoc), O(n), g;
891
+ }
892
+ },
893
+ catch: function(e) {
894
+ for (var t = this.tryEntries.length - 1; t >= 0; --t) {
895
+ var n = this.tryEntries[t];
896
+ if (n.tryLoc === e) {
897
+ var r = n.completion;
898
+ if (r.type === "throw") {
899
+ var i = r.arg;
900
+ O(n);
901
+ }
902
+ return i;
903
+ }
904
+ }
905
+ throw Error("illegal catch attempt");
906
+ },
907
+ delegateYield: function(t, n, r) {
908
+ return this.delegate = {
909
+ iterator: A(t),
910
+ resultName: n,
911
+ nextLoc: r
912
+ }, this.method === "next" && (this.arg = e), g;
913
+ }
914
+ }, t;
915
+ }
916
+ function st(e, t, n, r, i, a, o) {
917
+ try {
918
+ var s = e[a](o), c = s.value;
919
+ } catch (e) {
920
+ n(e);
921
+ return;
922
+ }
923
+ s.done ? t(c) : Promise.resolve(c).then(r, i);
924
+ }
925
+ function ct(e) {
926
+ return function() {
927
+ var t = this, n = arguments;
928
+ return new Promise(function(r, i) {
929
+ var a = e.apply(t, n);
930
+ function o(e) {
931
+ st(a, r, i, o, s, "next", e);
932
+ }
933
+ function s(e) {
934
+ st(a, r, i, o, s, "throw", e);
935
+ }
936
+ o(void 0);
937
+ });
938
+ };
939
+ }
940
+ function lt(e, t) {
941
+ return ft(e) || dt(e, t) || mt(e, t) || ut();
942
+ }
943
+ function ut() {
944
+ throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
945
+ }
946
+ function dt(e, t) {
947
+ var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
948
+ if (n != null) {
949
+ var r, i, a, o, s = [], c = !0, l = !1;
950
+ try {
951
+ if (a = (n = n.call(e)).next, t === 0) {
952
+ if (Object(n) !== n) return;
953
+ c = !1;
954
+ } else for (; !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); c = !0);
955
+ } catch (e) {
956
+ l = !0, i = e;
957
+ } finally {
958
+ try {
959
+ if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
960
+ } finally {
961
+ if (l) throw i;
962
+ }
963
+ }
964
+ return s;
965
+ }
966
+ }
967
+ function ft(e) {
968
+ if (Array.isArray(e)) return e;
969
+ }
970
+ function I(e) {
971
+ "@babel/helpers - typeof";
972
+ return I = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
973
+ return typeof e;
974
+ } : function(e) {
975
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
976
+ }, I(e);
977
+ }
978
+ function pt(e, t) {
979
+ var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
980
+ if (!n) {
981
+ if (Array.isArray(e) || (n = mt(e)) || t && e && typeof e.length == "number") {
982
+ n && (e = n);
983
+ var r = 0, i = function() {};
984
+ return {
985
+ s: i,
986
+ n: function() {
987
+ return r >= e.length ? { done: !0 } : {
988
+ done: !1,
989
+ value: e[r++]
990
+ };
991
+ },
992
+ e: function(e) {
993
+ throw e;
994
+ },
995
+ f: i
996
+ };
997
+ }
998
+ throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
999
+ }
1000
+ var a = !0, o = !1, s;
1001
+ return {
1002
+ s: function() {
1003
+ n = n.call(e);
1004
+ },
1005
+ n: function() {
1006
+ var e = n.next();
1007
+ return a = e.done, e;
1008
+ },
1009
+ e: function(e) {
1010
+ o = !0, s = e;
1011
+ },
1012
+ f: function() {
1013
+ try {
1014
+ !a && n.return != null && n.return();
1015
+ } finally {
1016
+ if (o) throw s;
1017
+ }
1018
+ }
1019
+ };
1020
+ }
1021
+ function mt(e, t) {
1022
+ if (e) {
1023
+ if (typeof e == "string") return ht(e, t);
1024
+ var n = Object.prototype.toString.call(e).slice(8, -1);
1025
+ if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
1026
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ht(e, t);
1027
+ }
1028
+ }
1029
+ function ht(e, t) {
1030
+ (t == null || t > e.length) && (t = e.length);
1031
+ for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
1032
+ return r;
1033
+ }
1034
+ function gt(e, t) {
1035
+ var n = Object.keys(e);
1036
+ if (Object.getOwnPropertySymbols) {
1037
+ var r = Object.getOwnPropertySymbols(e);
1038
+ t && (r = r.filter(function(t) {
1039
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
1040
+ })), n.push.apply(n, r);
1041
+ }
1042
+ return n;
1043
+ }
1044
+ function L(e) {
1045
+ for (var t = 1; t < arguments.length; t++) {
1046
+ var n = arguments[t] == null ? {} : arguments[t];
1047
+ t % 2 ? gt(Object(n), !0).forEach(function(t) {
1048
+ _t(e, t, n[t]);
1049
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : gt(Object(n)).forEach(function(t) {
1050
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
1051
+ });
1052
+ }
1053
+ return e;
1054
+ }
1055
+ function _t(e, t, n) {
1056
+ return t = xt(t), t in e ? Object.defineProperty(e, t, {
1057
+ value: n,
1058
+ enumerable: !0,
1059
+ configurable: !0,
1060
+ writable: !0
1061
+ }) : e[t] = n, e;
1062
+ }
1063
+ function vt(e, t) {
1064
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
1065
+ }
1066
+ function yt(e, t) {
1067
+ for (var n = 0; n < t.length; n++) {
1068
+ var r = t[n];
1069
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, xt(r.key), r);
1070
+ }
1071
+ }
1072
+ function bt(e, t, n) {
1073
+ return t && yt(e.prototype, t), n && yt(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
1074
+ }
1075
+ function xt(e) {
1076
+ var t = St(e, "string");
1077
+ return I(t) == "symbol" ? t : t + "";
1078
+ }
1079
+ function St(e, t) {
1080
+ if (I(e) != "object" || !e) return e;
1081
+ var n = e[Symbol.toPrimitive];
1082
+ if (n !== void 0) {
1083
+ var r = n.call(e, t || "default");
1084
+ if (I(r) != "object") return r;
1085
+ throw TypeError("@@toPrimitive must return a primitive value.");
1086
+ }
1087
+ return (t === "string" ? String : Number)(e);
1088
+ }
1089
+ var Ct = "tus-v1", wt = "ietf-draft-03", R = "ietf-draft-05", Tt = {
1090
+ endpoint: null,
1091
+ uploadUrl: null,
1092
+ metadata: {},
1093
+ metadataForPartialUploads: {},
1094
+ fingerprint: null,
1095
+ uploadSize: null,
1096
+ onProgress: null,
1097
+ onChunkComplete: null,
1098
+ onSuccess: null,
1099
+ onError: null,
1100
+ onUploadUrlAvailable: null,
1101
+ overridePatchMethod: !1,
1102
+ headers: {},
1103
+ addRequestId: !1,
1104
+ onBeforeRequest: null,
1105
+ onAfterResponse: null,
1106
+ onShouldRetry: Nt,
1107
+ chunkSize: Infinity,
1108
+ retryDelays: [
1109
+ 0,
1110
+ 1e3,
1111
+ 3e3,
1112
+ 5e3
1113
+ ],
1114
+ parallelUploads: 1,
1115
+ parallelUploadBoundaries: null,
1116
+ storeFingerprintForResuming: !0,
1117
+ removeFingerprintOnSuccess: !1,
1118
+ uploadLengthDeferred: !1,
1119
+ uploadDataDuringCreation: !1,
1120
+ urlStorage: null,
1121
+ fileReader: null,
1122
+ httpStack: null,
1123
+ protocol: Ct
1124
+ }, Et = /* @__PURE__ */ function() {
1125
+ function e(t, n) {
1126
+ vt(this, e), "resume" in n && console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."), this.options = n, this.options.chunkSize = Number(this.options.chunkSize), this._urlStorage = this.options.urlStorage, this.file = t, this.url = null, this._req = null, this._fingerprint = null, this._urlStorageKey = null, this._offset = null, this._aborted = !1, this._size = null, this._source = null, this._retryAttempt = 0, this._retryTimeout = null, this._offsetBeforeRetry = 0, this._parallelUploads = null, this._parallelUploadUrls = null;
1127
+ }
1128
+ return bt(e, [
1129
+ {
1130
+ key: "findPreviousUploads",
1131
+ value: function() {
1132
+ var e = this;
1133
+ return this.options.fingerprint(this.file, this.options).then(function(t) {
1134
+ return e._urlStorage.findUploadsByFingerprint(t);
1135
+ });
1136
+ }
1137
+ },
1138
+ {
1139
+ key: "resumeFromPreviousUpload",
1140
+ value: function(e) {
1141
+ this.url = e.uploadUrl || null, this._parallelUploadUrls = e.parallelUploadUrls || null, this._urlStorageKey = e.urlStorageKey;
1142
+ }
1143
+ },
1144
+ {
1145
+ key: "start",
1146
+ value: function() {
1147
+ var e = this, t = this.file;
1148
+ if (!t) {
1149
+ this._emitError(/* @__PURE__ */ Error("tus: no file or stream to upload provided"));
1150
+ return;
1151
+ }
1152
+ if (![
1153
+ Ct,
1154
+ wt,
1155
+ R
1156
+ ].includes(this.options.protocol)) {
1157
+ this._emitError(Error(`tus: unsupported protocol ${this.options.protocol}`));
1158
+ return;
1159
+ }
1160
+ if (!this.options.endpoint && !this.options.uploadUrl && !this.url) {
1161
+ this._emitError(/* @__PURE__ */ Error("tus: neither an endpoint or an upload URL is provided"));
1162
+ return;
1163
+ }
1164
+ var n = this.options.retryDelays;
1165
+ if (n != null && Object.prototype.toString.call(n) !== "[object Array]") {
1166
+ this._emitError(/* @__PURE__ */ Error("tus: the `retryDelays` option must either be an array or null"));
1167
+ return;
1168
+ }
1169
+ if (this.options.parallelUploads > 1) for (var r = 0, i = [
1170
+ "uploadUrl",
1171
+ "uploadSize",
1172
+ "uploadLengthDeferred"
1173
+ ]; r < i.length; r++) {
1174
+ var a = i[r];
1175
+ if (this.options[a]) {
1176
+ this._emitError(Error(`tus: cannot use the ${a} option when parallelUploads is enabled`));
1177
+ return;
1178
+ }
1179
+ }
1180
+ if (this.options.parallelUploadBoundaries) {
1181
+ if (this.options.parallelUploads <= 1) {
1182
+ this._emitError(/* @__PURE__ */ Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));
1183
+ return;
1184
+ }
1185
+ if (this.options.parallelUploads !== this.options.parallelUploadBoundaries.length) {
1186
+ this._emitError(/* @__PURE__ */ Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));
1187
+ return;
1188
+ }
1189
+ }
1190
+ this.options.fingerprint(t, this.options).then(function(n) {
1191
+ return M(n == null ? "No fingerprint was calculated meaning that the upload cannot be stored in the URL storage." : `Calculated fingerprint: ${n}`), e._fingerprint = n, e._source ? e._source : e.options.fileReader.openFile(t, e.options.chunkSize);
1192
+ }).then(function(t) {
1193
+ if (e._source = t, e.options.uploadLengthDeferred) e._size = null;
1194
+ else if (e.options.uploadSize != null) {
1195
+ if (e._size = Number(e.options.uploadSize), Number.isNaN(e._size)) {
1196
+ e._emitError(/* @__PURE__ */ Error("tus: cannot convert `uploadSize` option into a number"));
1197
+ return;
1198
+ }
1199
+ } else if (e._size = e._source.size, e._size == null) {
1200
+ e._emitError(/* @__PURE__ */ Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));
1201
+ return;
1202
+ }
1203
+ e.options.parallelUploads > 1 || e._parallelUploadUrls != null ? e._startParallelUpload() : e._startSingleUpload();
1204
+ }).catch(function(t) {
1205
+ e._emitError(t);
1206
+ });
1207
+ }
1208
+ },
1209
+ {
1210
+ key: "_startParallelUpload",
1211
+ value: function() {
1212
+ var t = this, n = this._size, r = 0;
1213
+ this._parallelUploads = [];
1214
+ var i = this._parallelUploadUrls == null ? this.options.parallelUploads : this._parallelUploadUrls.length, a = this.options.parallelUploadBoundaries ?? Ft(this._source.size, i);
1215
+ this._parallelUploadUrls && a.forEach(function(e, n) {
1216
+ e.uploadUrl = t._parallelUploadUrls[n] || null;
1217
+ }), this._parallelUploadUrls = Array(a.length);
1218
+ var o = a.map(function(i, o) {
1219
+ var s = 0;
1220
+ return t._source.slice(i.start, i.end).then(function(c) {
1221
+ var l = c.value;
1222
+ return new Promise(function(c, u) {
1223
+ var d = new e(l, L(L({}, t.options), {}, {
1224
+ uploadUrl: i.uploadUrl || null,
1225
+ storeFingerprintForResuming: !1,
1226
+ removeFingerprintOnSuccess: !1,
1227
+ parallelUploads: 1,
1228
+ parallelUploadBoundaries: null,
1229
+ metadata: t.options.metadataForPartialUploads,
1230
+ headers: L(L({}, t.options.headers), {}, { "Upload-Concat": "partial" }),
1231
+ onSuccess: c,
1232
+ onError: u,
1233
+ onProgress: function(e) {
1234
+ r = r - s + e, s = e, t._emitProgress(r, n);
1235
+ },
1236
+ onUploadUrlAvailable: function() {
1237
+ t._parallelUploadUrls[o] = d.url, t._parallelUploadUrls.filter(function(e) {
1238
+ return !!e;
1239
+ }).length === a.length && t._saveUploadInUrlStorage();
1240
+ }
1241
+ }));
1242
+ d.start(), t._parallelUploads.push(d);
1243
+ });
1244
+ });
1245
+ }), s;
1246
+ Promise.all(o).then(function() {
1247
+ s = t._openRequest("POST", t.options.endpoint), s.setHeader("Upload-Concat", `final;${t._parallelUploadUrls.join(" ")}`);
1248
+ var e = Dt(t.options.metadata);
1249
+ return e !== "" && s.setHeader("Upload-Metadata", e), t._sendRequest(s, null);
1250
+ }).then(function(e) {
1251
+ if (!z(e.getStatus(), 200)) {
1252
+ t._emitHttpError(s, e, "tus: unexpected response while creating upload");
1253
+ return;
1254
+ }
1255
+ var n = e.getHeader("Location");
1256
+ if (n == null) {
1257
+ t._emitHttpError(s, e, "tus: invalid or missing Location header");
1258
+ return;
1259
+ }
1260
+ t.url = Pt(t.options.endpoint, n), M(`Created upload at ${t.url}`), t._emitSuccess(e);
1261
+ }).catch(function(e) {
1262
+ t._emitError(e);
1263
+ });
1264
+ }
1265
+ },
1266
+ {
1267
+ key: "_startSingleUpload",
1268
+ value: function() {
1269
+ if (this._aborted = !1, this.url != null) {
1270
+ M(`Resuming upload from previous URL: ${this.url}`), this._resumeUpload();
1271
+ return;
1272
+ }
1273
+ if (this.options.uploadUrl != null) {
1274
+ M(`Resuming upload from provided URL: ${this.options.uploadUrl}`), this.url = this.options.uploadUrl, this._resumeUpload();
1275
+ return;
1276
+ }
1277
+ M("Creating a new upload"), this._createUpload();
1278
+ }
1279
+ },
1280
+ {
1281
+ key: "abort",
1282
+ value: function(t) {
1283
+ var n = this;
1284
+ if (this._parallelUploads != null) {
1285
+ var r = pt(this._parallelUploads), i;
1286
+ try {
1287
+ for (r.s(); !(i = r.n()).done;) i.value.abort(t);
1288
+ } catch (e) {
1289
+ r.e(e);
1290
+ } finally {
1291
+ r.f();
1292
+ }
1293
+ }
1294
+ return this._req !== null && this._req.abort(), this._aborted = !0, this._retryTimeout != null && (clearTimeout(this._retryTimeout), this._retryTimeout = null), !t || this.url == null ? Promise.resolve() : e.terminate(this.url, this.options).then(function() {
1295
+ return n._removeFromUrlStorage();
1296
+ });
1297
+ }
1298
+ },
1299
+ {
1300
+ key: "_emitHttpError",
1301
+ value: function(e, t, n, r) {
1302
+ this._emitError(new fe(n, r, e, t));
1303
+ }
1304
+ },
1305
+ {
1306
+ key: "_emitError",
1307
+ value: function(e) {
1308
+ var t = this;
1309
+ if (!this._aborted) {
1310
+ if (this.options.retryDelays != null && (this._offset != null && this._offset > this._offsetBeforeRetry && (this._retryAttempt = 0), Mt(e, this._retryAttempt, this.options))) {
1311
+ var n = this.options.retryDelays[this._retryAttempt++];
1312
+ this._offsetBeforeRetry = this._offset, this._retryTimeout = setTimeout(function() {
1313
+ t.start();
1314
+ }, n);
1315
+ return;
1316
+ }
1317
+ if (typeof this.options.onError == "function") this.options.onError(e);
1318
+ else throw e;
1319
+ }
1320
+ }
1321
+ },
1322
+ {
1323
+ key: "_emitSuccess",
1324
+ value: function(e) {
1325
+ this.options.removeFingerprintOnSuccess && this._removeFromUrlStorage(), typeof this.options.onSuccess == "function" && this.options.onSuccess({ lastResponse: e });
1326
+ }
1327
+ },
1328
+ {
1329
+ key: "_emitProgress",
1330
+ value: function(e, t) {
1331
+ typeof this.options.onProgress == "function" && this.options.onProgress(e, t);
1332
+ }
1333
+ },
1334
+ {
1335
+ key: "_emitChunkComplete",
1336
+ value: function(e, t, n) {
1337
+ typeof this.options.onChunkComplete == "function" && this.options.onChunkComplete(e, t, n);
1338
+ }
1339
+ },
1340
+ {
1341
+ key: "_createUpload",
1342
+ value: function() {
1343
+ var e = this;
1344
+ if (!this.options.endpoint) {
1345
+ this._emitError(/* @__PURE__ */ Error("tus: unable to create upload because no endpoint is provided"));
1346
+ return;
1347
+ }
1348
+ var t = this._openRequest("POST", this.options.endpoint);
1349
+ this.options.uploadLengthDeferred ? t.setHeader("Upload-Defer-Length", "1") : t.setHeader("Upload-Length", `${this._size}`);
1350
+ var n = Dt(this.options.metadata);
1351
+ n !== "" && t.setHeader("Upload-Metadata", n);
1352
+ var r;
1353
+ this.options.uploadDataDuringCreation && !this.options.uploadLengthDeferred ? (this._offset = 0, r = this._addChunkToRequest(t)) : ((this.options.protocol === wt || this.options.protocol === R) && t.setHeader("Upload-Complete", "?0"), r = this._sendRequest(t, null)), r.then(function(n) {
1354
+ if (!z(n.getStatus(), 200)) {
1355
+ e._emitHttpError(t, n, "tus: unexpected response while creating upload");
1356
+ return;
1357
+ }
1358
+ var r = n.getHeader("Location");
1359
+ if (r == null) {
1360
+ e._emitHttpError(t, n, "tus: invalid or missing Location header");
1361
+ return;
1362
+ }
1363
+ if (e.url = Pt(e.options.endpoint, r), M(`Created upload at ${e.url}`), typeof e.options.onUploadUrlAvailable == "function" && e.options.onUploadUrlAvailable(), e._size === 0) {
1364
+ e._emitSuccess(n), e._source.close();
1365
+ return;
1366
+ }
1367
+ e._saveUploadInUrlStorage().then(function() {
1368
+ e.options.uploadDataDuringCreation ? e._handleUploadResponse(t, n) : (e._offset = 0, e._performUpload());
1369
+ });
1370
+ }).catch(function(n) {
1371
+ e._emitHttpError(t, null, "tus: failed to create upload", n);
1372
+ });
1373
+ }
1374
+ },
1375
+ {
1376
+ key: "_resumeUpload",
1377
+ value: function() {
1378
+ var e = this, t = this._openRequest("HEAD", this.url);
1379
+ this._sendRequest(t, null).then(function(n) {
1380
+ var r = n.getStatus();
1381
+ if (!z(r, 200)) {
1382
+ if (r === 423) {
1383
+ e._emitHttpError(t, n, "tus: upload is currently locked; retry later");
1384
+ return;
1385
+ }
1386
+ if (z(r, 400) && e._removeFromUrlStorage(), !e.options.endpoint) {
1387
+ e._emitHttpError(t, n, "tus: unable to resume upload (new upload cannot be created without an endpoint)");
1388
+ return;
1389
+ }
1390
+ e.url = null, e._createUpload();
1391
+ return;
1392
+ }
1393
+ var i = Number.parseInt(n.getHeader("Upload-Offset"), 10);
1394
+ if (Number.isNaN(i)) {
1395
+ e._emitHttpError(t, n, "tus: invalid or missing offset value");
1396
+ return;
1397
+ }
1398
+ var a = Number.parseInt(n.getHeader("Upload-Length"), 10);
1399
+ if (Number.isNaN(a) && !e.options.uploadLengthDeferred && e.options.protocol === Ct) {
1400
+ e._emitHttpError(t, n, "tus: invalid or missing length value");
1401
+ return;
1402
+ }
1403
+ typeof e.options.onUploadUrlAvailable == "function" && e.options.onUploadUrlAvailable(), e._saveUploadInUrlStorage().then(function() {
1404
+ if (i === a) {
1405
+ e._emitProgress(a, a), e._emitSuccess(n);
1406
+ return;
1407
+ }
1408
+ e._offset = i, e._performUpload();
1409
+ });
1410
+ }).catch(function(n) {
1411
+ e._emitHttpError(t, null, "tus: failed to resume upload", n);
1412
+ });
1413
+ }
1414
+ },
1415
+ {
1416
+ key: "_performUpload",
1417
+ value: function() {
1418
+ var e = this;
1419
+ if (!this._aborted) {
1420
+ var t;
1421
+ this.options.overridePatchMethod ? (t = this._openRequest("POST", this.url), t.setHeader("X-HTTP-Method-Override", "PATCH")) : t = this._openRequest("PATCH", this.url), t.setHeader("Upload-Offset", `${this._offset}`), this._addChunkToRequest(t).then(function(n) {
1422
+ if (!z(n.getStatus(), 200)) {
1423
+ e._emitHttpError(t, n, "tus: unexpected response while uploading chunk");
1424
+ return;
1425
+ }
1426
+ e._handleUploadResponse(t, n);
1427
+ }).catch(function(n) {
1428
+ e._aborted || e._emitHttpError(t, null, `tus: failed to upload chunk at offset ${e._offset}`, n);
1429
+ });
1430
+ }
1431
+ }
1432
+ },
1433
+ {
1434
+ key: "_addChunkToRequest",
1435
+ value: function(e) {
1436
+ var t = this, n = this._offset, r = this._offset + this.options.chunkSize;
1437
+ return e.setProgressHandler(function(e) {
1438
+ t._emitProgress(n + e, t._size);
1439
+ }), this.options.protocol === Ct ? e.setHeader("Content-Type", "application/offset+octet-stream") : this.options.protocol === R && e.setHeader("Content-Type", "application/partial-upload"), (r === Infinity || r > this._size) && !this.options.uploadLengthDeferred && (r = this._size), this._source.slice(n, r).then(function(n) {
1440
+ var r = n.value, i = n.done, a = r != null && r.size ? r.size : 0;
1441
+ t.options.uploadLengthDeferred && i && (t._size = t._offset + a, e.setHeader("Upload-Length", `${t._size}`));
1442
+ var o = t._offset + a;
1443
+ return !t.options.uploadLengthDeferred && i && o !== t._size ? Promise.reject(Error(`upload was configured with a size of ${t._size} bytes, but the source is done after ${o} bytes`)) : r === null ? t._sendRequest(e) : ((t.options.protocol === wt || t.options.protocol === R) && e.setHeader("Upload-Complete", i ? "?1" : "?0"), t._emitProgress(t._offset, t._size), t._sendRequest(e, r));
1444
+ });
1445
+ }
1446
+ },
1447
+ {
1448
+ key: "_handleUploadResponse",
1449
+ value: function(e, t) {
1450
+ var n = Number.parseInt(t.getHeader("Upload-Offset"), 10);
1451
+ if (Number.isNaN(n)) {
1452
+ this._emitHttpError(e, t, "tus: invalid or missing offset value");
1453
+ return;
1454
+ }
1455
+ if (this._emitProgress(n, this._size), this._emitChunkComplete(n - this._offset, n, this._size), this._offset = n, n === this._size) {
1456
+ this._emitSuccess(t), this._source.close();
1457
+ return;
1458
+ }
1459
+ this._performUpload();
1460
+ }
1461
+ },
1462
+ {
1463
+ key: "_openRequest",
1464
+ value: function(e, t) {
1465
+ var n = Ot(e, t, this.options);
1466
+ return this._req = n, n;
1467
+ }
1468
+ },
1469
+ {
1470
+ key: "_removeFromUrlStorage",
1471
+ value: function() {
1472
+ var e = this;
1473
+ this._urlStorageKey &&= (this._urlStorage.removeUpload(this._urlStorageKey).catch(function(t) {
1474
+ e._emitError(t);
1475
+ }), null);
1476
+ }
1477
+ },
1478
+ {
1479
+ key: "_saveUploadInUrlStorage",
1480
+ value: function() {
1481
+ var e = this;
1482
+ if (!this.options.storeFingerprintForResuming || !this._fingerprint || this._urlStorageKey !== null) return Promise.resolve();
1483
+ var t = {
1484
+ size: this._size,
1485
+ metadata: this.options.metadata,
1486
+ creationTime: (/* @__PURE__ */ new Date()).toString()
1487
+ };
1488
+ return this._parallelUploads ? t.parallelUploadUrls = this._parallelUploadUrls : t.uploadUrl = this.url, this._urlStorage.addUpload(this._fingerprint, t).then(function(t) {
1489
+ e._urlStorageKey = t;
1490
+ });
1491
+ }
1492
+ },
1493
+ {
1494
+ key: "_sendRequest",
1495
+ value: function(e) {
1496
+ return kt(e, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null, this.options);
1497
+ }
1498
+ }
1499
+ ], [{
1500
+ key: "terminate",
1501
+ value: function(t) {
1502
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = Ot("DELETE", t, n);
1503
+ return kt(r, null, n).then(function(e) {
1504
+ if (e.getStatus() !== 204) throw new fe("tus: unexpected response while terminating upload", null, r, e);
1505
+ }).catch(function(i) {
1506
+ if (i instanceof fe || (i = new fe("tus: failed to terminate upload", i, r, null)), !Mt(i, 0, n)) throw i;
1507
+ var a = n.retryDelays[0], o = n.retryDelays.slice(1), s = L(L({}, n), {}, { retryDelays: o });
1508
+ return new Promise(function(e) {
1509
+ return setTimeout(e, a);
1510
+ }).then(function() {
1511
+ return e.terminate(t, s);
1512
+ });
1513
+ });
1514
+ }
1515
+ }]);
1516
+ }();
1517
+ function Dt(e) {
1518
+ return Object.entries(e).map(function(e) {
1519
+ var t = lt(e, 2), n = t[0], r = t[1];
1520
+ return `${n} ${et.encode(String(r))}`;
1521
+ }).join(",");
1522
+ }
1523
+ function z(e, t) {
1524
+ return e >= t && e < t + 100;
1525
+ }
1526
+ function Ot(e, t, n) {
1527
+ var r = n.httpStack.createRequest(e, t);
1528
+ n.protocol === wt ? r.setHeader("Upload-Draft-Interop-Version", "5") : n.protocol === R ? r.setHeader("Upload-Draft-Interop-Version", "6") : r.setHeader("Tus-Resumable", "1.0.0");
1529
+ for (var i = n.headers || {}, a = 0, o = Object.entries(i); a < o.length; a++) {
1530
+ var s = lt(o[a], 2), c = s[0], l = s[1];
1531
+ r.setHeader(c, l);
1532
+ }
1533
+ if (n.addRequestId) {
1534
+ var u = it();
1535
+ r.setHeader("X-Request-ID", u);
1536
+ }
1537
+ return r;
1538
+ }
1539
+ function kt(e, t, n) {
1540
+ return At.apply(this, arguments);
1541
+ }
1542
+ function At() {
1543
+ return At = ct(/* @__PURE__ */ ot().mark(function e(t, n, r) {
1544
+ var i;
1545
+ return ot().wrap(function(e) {
1546
+ for (;;) switch (e.prev = e.next) {
1547
+ case 0:
1548
+ if (typeof r.onBeforeRequest != "function") {
1549
+ e.next = 3;
1550
+ break;
1551
+ }
1552
+ return e.next = 3, r.onBeforeRequest(t);
1553
+ case 3: return e.next = 5, t.send(n);
1554
+ case 5:
1555
+ if (i = e.sent, typeof r.onAfterResponse != "function") {
1556
+ e.next = 9;
1557
+ break;
1558
+ }
1559
+ return e.next = 9, r.onAfterResponse(t, i);
1560
+ case 9: return e.abrupt("return", i);
1561
+ case 10:
1562
+ case "end": return e.stop();
1563
+ }
1564
+ }, e);
1565
+ })), At.apply(this, arguments);
1566
+ }
1567
+ function jt() {
1568
+ var e = !0;
1569
+ return typeof navigator < "u" && navigator.onLine === !1 && (e = !1), e;
1570
+ }
1571
+ function Mt(e, t, n) {
1572
+ return n.retryDelays == null || t >= n.retryDelays.length || e.originalRequest == null ? !1 : n && typeof n.onShouldRetry == "function" ? n.onShouldRetry(e, t, n) : Nt(e);
1573
+ }
1574
+ function Nt(e) {
1575
+ var t = e.originalResponse ? e.originalResponse.getStatus() : 0;
1576
+ return (!z(t, 400) || t === 409 || t === 423) && jt();
1577
+ }
1578
+ function Pt(e, t) {
1579
+ return new at.default(t, e).toString();
1580
+ }
1581
+ function Ft(e, t) {
1582
+ for (var n = Math.floor(e / t), r = [], i = 0; i < t; i++) r.push({
1583
+ start: n * i,
1584
+ end: n * (i + 1)
1585
+ });
1586
+ return r[t - 1].end = e, r;
1587
+ }
1588
+ Et.defaultOptions = Tt;
1589
+ //#endregion
1590
+ //#region node_modules/tus-js-client/lib.esm/browser/isReactNative.js
1591
+ var It = function() {
1592
+ return typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative";
1593
+ };
1594
+ //#endregion
1595
+ //#region node_modules/tus-js-client/lib.esm/browser/uriToBlob.js
1596
+ function Lt(e) {
1597
+ return new Promise(function(t, n) {
1598
+ var r = new XMLHttpRequest();
1599
+ r.responseType = "blob", r.onload = function() {
1600
+ var e = r.response;
1601
+ t(e);
1602
+ }, r.onerror = function(e) {
1603
+ n(e);
1604
+ }, r.open("GET", e), r.send();
1605
+ });
1606
+ }
1607
+ //#endregion
1608
+ //#region node_modules/tus-js-client/lib.esm/browser/sources/isCordova.js
1609
+ var Rt = function() {
1610
+ return typeof window < "u" && (window.PhoneGap !== void 0 || window.Cordova !== void 0 || window.cordova !== void 0);
1611
+ };
1612
+ //#endregion
1613
+ //#region node_modules/tus-js-client/lib.esm/browser/sources/readAsByteArray.js
1614
+ function zt(e) {
1615
+ return new Promise(function(t, n) {
1616
+ var r = new FileReader();
1617
+ r.onload = function() {
1618
+ t({ value: new Uint8Array(r.result) });
1619
+ }, r.onerror = function(e) {
1620
+ n(e);
1621
+ }, r.readAsArrayBuffer(e);
1622
+ });
1623
+ }
1624
+ //#endregion
1625
+ //#region node_modules/tus-js-client/lib.esm/browser/sources/FileSource.js
1626
+ function B(e) {
1627
+ "@babel/helpers - typeof";
1628
+ return B = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
1629
+ return typeof e;
1630
+ } : function(e) {
1631
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
1632
+ }, B(e);
1633
+ }
1634
+ function Bt(e, t) {
1635
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
1636
+ }
1637
+ function Vt(e, t) {
1638
+ for (var n = 0; n < t.length; n++) {
1639
+ var r = t[n];
1640
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, Ut(r.key), r);
1641
+ }
1642
+ }
1643
+ function Ht(e, t, n) {
1644
+ return t && Vt(e.prototype, t), n && Vt(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
1645
+ }
1646
+ function Ut(e) {
1647
+ var t = Wt(e, "string");
1648
+ return B(t) == "symbol" ? t : t + "";
1649
+ }
1650
+ function Wt(e, t) {
1651
+ if (B(e) != "object" || !e) return e;
1652
+ var n = e[Symbol.toPrimitive];
1653
+ if (n !== void 0) {
1654
+ var r = n.call(e, t || "default");
1655
+ if (B(r) != "object") return r;
1656
+ throw TypeError("@@toPrimitive must return a primitive value.");
1657
+ }
1658
+ return (t === "string" ? String : Number)(e);
1659
+ }
1660
+ var Gt = /* @__PURE__ */ function() {
1661
+ function e(t) {
1662
+ Bt(this, e), this._file = t, this.size = t.size;
1663
+ }
1664
+ return Ht(e, [{
1665
+ key: "slice",
1666
+ value: function(e, t) {
1667
+ if (Rt()) return zt(this._file.slice(e, t));
1668
+ var n = this._file.slice(e, t), r = t >= this.size;
1669
+ return Promise.resolve({
1670
+ value: n,
1671
+ done: r
1672
+ });
1673
+ }
1674
+ }, {
1675
+ key: "close",
1676
+ value: function() {}
1677
+ }]);
1678
+ }();
1679
+ //#endregion
1680
+ //#region node_modules/tus-js-client/lib.esm/browser/sources/StreamSource.js
1681
+ function V(e) {
1682
+ "@babel/helpers - typeof";
1683
+ return V = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
1684
+ return typeof e;
1685
+ } : function(e) {
1686
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
1687
+ }, V(e);
1688
+ }
1689
+ function Kt(e, t) {
1690
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
1691
+ }
1692
+ function qt(e, t) {
1693
+ for (var n = 0; n < t.length; n++) {
1694
+ var r = t[n];
1695
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, Yt(r.key), r);
1696
+ }
1697
+ }
1698
+ function Jt(e, t, n) {
1699
+ return t && qt(e.prototype, t), n && qt(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
1700
+ }
1701
+ function Yt(e) {
1702
+ var t = Xt(e, "string");
1703
+ return V(t) == "symbol" ? t : t + "";
1704
+ }
1705
+ function Xt(e, t) {
1706
+ if (V(e) != "object" || !e) return e;
1707
+ var n = e[Symbol.toPrimitive];
1708
+ if (n !== void 0) {
1709
+ var r = n.call(e, t || "default");
1710
+ if (V(r) != "object") return r;
1711
+ throw TypeError("@@toPrimitive must return a primitive value.");
1712
+ }
1713
+ return (t === "string" ? String : Number)(e);
1714
+ }
1715
+ function Zt(e) {
1716
+ return e === void 0 ? 0 : e.size === void 0 ? e.length : e.size;
1717
+ }
1718
+ function Qt(e, t) {
1719
+ if (e.concat) return e.concat(t);
1720
+ if (e instanceof Blob) return new Blob([e, t], { type: e.type });
1721
+ if (e.set) {
1722
+ var n = new e.constructor(e.length + t.length);
1723
+ return n.set(e), n.set(t, e.length), n;
1724
+ }
1725
+ throw Error("Unknown data type");
1726
+ }
1727
+ var $t = /* @__PURE__ */ function() {
1728
+ function e(t) {
1729
+ Kt(this, e), this._buffer = void 0, this._bufferOffset = 0, this._reader = t, this._done = !1;
1730
+ }
1731
+ return Jt(e, [
1732
+ {
1733
+ key: "slice",
1734
+ value: function(e, t) {
1735
+ return e < this._bufferOffset ? Promise.reject(/* @__PURE__ */ Error("Requested data is before the reader's current offset")) : this._readUntilEnoughDataOrDone(e, t);
1736
+ }
1737
+ },
1738
+ {
1739
+ key: "_readUntilEnoughDataOrDone",
1740
+ value: function(e, t) {
1741
+ var n = this, r = t <= this._bufferOffset + Zt(this._buffer);
1742
+ if (this._done || r) {
1743
+ var i = this._getDataFromBuffer(e, t), a = i == null ? this._done : !1;
1744
+ return Promise.resolve({
1745
+ value: i,
1746
+ done: a
1747
+ });
1748
+ }
1749
+ return this._reader.read().then(function(r) {
1750
+ var i = r.value;
1751
+ return r.done ? n._done = !0 : n._buffer === void 0 ? n._buffer = i : n._buffer = Qt(n._buffer, i), n._readUntilEnoughDataOrDone(e, t);
1752
+ });
1753
+ }
1754
+ },
1755
+ {
1756
+ key: "_getDataFromBuffer",
1757
+ value: function(e, t) {
1758
+ e > this._bufferOffset && (this._buffer = this._buffer.slice(e - this._bufferOffset), this._bufferOffset = e);
1759
+ var n = Zt(this._buffer) === 0;
1760
+ return this._done && n ? null : this._buffer.slice(0, t - e);
1761
+ }
1762
+ },
1763
+ {
1764
+ key: "close",
1765
+ value: function() {
1766
+ this._reader.cancel && this._reader.cancel();
1767
+ }
1768
+ }
1769
+ ]);
1770
+ }();
1771
+ //#endregion
1772
+ //#region node_modules/tus-js-client/lib.esm/browser/fileReader.js
1773
+ function H(e) {
1774
+ "@babel/helpers - typeof";
1775
+ return H = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
1776
+ return typeof e;
1777
+ } : function(e) {
1778
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
1779
+ }, H(e);
1780
+ }
1781
+ function en() {
1782
+ en = function() {
1783
+ return t;
1784
+ };
1785
+ var e, t = {}, n = Object.prototype, r = n.hasOwnProperty, i = Object.defineProperty || function(e, t, n) {
1786
+ e[t] = n.value;
1787
+ }, a = typeof Symbol == "function" ? Symbol : {}, o = a.iterator || "@@iterator", s = a.asyncIterator || "@@asyncIterator", c = a.toStringTag || "@@toStringTag";
1788
+ function l(e, t, n) {
1789
+ return Object.defineProperty(e, t, {
1790
+ value: n,
1791
+ enumerable: !0,
1792
+ configurable: !0,
1793
+ writable: !0
1794
+ }), e[t];
1795
+ }
1796
+ try {
1797
+ l({}, "");
1798
+ } catch {
1799
+ l = function(e, t, n) {
1800
+ return e[t] = n;
1801
+ };
1802
+ }
1803
+ function u(e, t, n, r) {
1804
+ var a = t && t.prototype instanceof _ ? t : _, o = Object.create(a.prototype);
1805
+ return i(o, "_invoke", { value: ee(e, n, new k(r || [])) }), o;
1806
+ }
1807
+ function d(e, t, n) {
1808
+ try {
1809
+ return {
1810
+ type: "normal",
1811
+ arg: e.call(t, n)
1812
+ };
1813
+ } catch (e) {
1814
+ return {
1815
+ type: "throw",
1816
+ arg: e
1817
+ };
1818
+ }
1819
+ }
1820
+ t.wrap = u;
1821
+ var f = "suspendedStart", p = "suspendedYield", m = "executing", h = "completed", g = {};
1822
+ function _() {}
1823
+ function v() {}
1824
+ function y() {}
1825
+ var b = {};
1826
+ l(b, o, function() {
1827
+ return this;
1828
+ });
1829
+ var x = Object.getPrototypeOf, S = x && x(x(A([])));
1830
+ S && S !== n && r.call(S, o) && (b = S);
1831
+ var C = y.prototype = _.prototype = Object.create(b);
1832
+ function w(e) {
1833
+ [
1834
+ "next",
1835
+ "throw",
1836
+ "return"
1837
+ ].forEach(function(t) {
1838
+ l(e, t, function(e) {
1839
+ return this._invoke(t, e);
1840
+ });
1841
+ });
1842
+ }
1843
+ function T(e, t) {
1844
+ function n(i, a, o, s) {
1845
+ var c = d(e[i], e, a);
1846
+ if (c.type !== "throw") {
1847
+ var l = c.arg, u = l.value;
1848
+ return u && H(u) == "object" && r.call(u, "__await") ? t.resolve(u.__await).then(function(e) {
1849
+ n("next", e, o, s);
1850
+ }, function(e) {
1851
+ n("throw", e, o, s);
1852
+ }) : t.resolve(u).then(function(e) {
1853
+ l.value = e, o(l);
1854
+ }, function(e) {
1855
+ return n("throw", e, o, s);
1856
+ });
1857
+ }
1858
+ s(c.arg);
1859
+ }
1860
+ var a;
1861
+ i(this, "_invoke", { value: function(e, r) {
1862
+ function i() {
1863
+ return new t(function(t, i) {
1864
+ n(e, r, t, i);
1865
+ });
1866
+ }
1867
+ return a = a ? a.then(i, i) : i();
1868
+ } });
1869
+ }
1870
+ function ee(t, n, r) {
1871
+ var i = f;
1872
+ return function(a, o) {
1873
+ if (i === m) throw Error("Generator is already running");
1874
+ if (i === h) {
1875
+ if (a === "throw") throw o;
1876
+ return {
1877
+ value: e,
1878
+ done: !0
1879
+ };
1880
+ }
1881
+ for (r.method = a, r.arg = o;;) {
1882
+ var s = r.delegate;
1883
+ if (s) {
1884
+ var c = E(s, r);
1885
+ if (c) {
1886
+ if (c === g) continue;
1887
+ return c;
1888
+ }
1889
+ }
1890
+ if (r.method === "next") r.sent = r._sent = r.arg;
1891
+ else if (r.method === "throw") {
1892
+ if (i === f) throw i = h, r.arg;
1893
+ r.dispatchException(r.arg);
1894
+ } else r.method === "return" && r.abrupt("return", r.arg);
1895
+ i = m;
1896
+ var l = d(t, n, r);
1897
+ if (l.type === "normal") {
1898
+ if (i = r.done ? h : p, l.arg === g) continue;
1899
+ return {
1900
+ value: l.arg,
1901
+ done: r.done
1902
+ };
1903
+ }
1904
+ l.type === "throw" && (i = h, r.method = "throw", r.arg = l.arg);
1905
+ }
1906
+ };
1907
+ }
1908
+ function E(t, n) {
1909
+ var r = n.method, i = t.iterator[r];
1910
+ if (i === e) return n.delegate = null, r === "throw" && t.iterator.return && (n.method = "return", n.arg = e, E(t, n), n.method === "throw") || r !== "return" && (n.method = "throw", n.arg = /* @__PURE__ */ TypeError("The iterator does not provide a '" + r + "' method")), g;
1911
+ var a = d(i, t.iterator, n.arg);
1912
+ if (a.type === "throw") return n.method = "throw", n.arg = a.arg, n.delegate = null, g;
1913
+ var o = a.arg;
1914
+ return o ? o.done ? (n[t.resultName] = o.value, n.next = t.nextLoc, n.method !== "return" && (n.method = "next", n.arg = e), n.delegate = null, g) : o : (n.method = "throw", n.arg = /* @__PURE__ */ TypeError("iterator result is not an object"), n.delegate = null, g);
1915
+ }
1916
+ function D(e) {
1917
+ var t = { tryLoc: e[0] };
1918
+ 1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t);
1919
+ }
1920
+ function O(e) {
1921
+ var t = e.completion || {};
1922
+ t.type = "normal", delete t.arg, e.completion = t;
1923
+ }
1924
+ function k(e) {
1925
+ this.tryEntries = [{ tryLoc: "root" }], e.forEach(D, this), this.reset(!0);
1926
+ }
1927
+ function A(t) {
1928
+ if (t || t === "") {
1929
+ var n = t[o];
1930
+ if (n) return n.call(t);
1931
+ if (typeof t.next == "function") return t;
1932
+ if (!isNaN(t.length)) {
1933
+ var i = -1, a = function n() {
1934
+ for (; ++i < t.length;) if (r.call(t, i)) return n.value = t[i], n.done = !1, n;
1935
+ return n.value = e, n.done = !0, n;
1936
+ };
1937
+ return a.next = a;
1938
+ }
1939
+ }
1940
+ throw TypeError(H(t) + " is not iterable");
1941
+ }
1942
+ return v.prototype = y, i(C, "constructor", {
1943
+ value: y,
1944
+ configurable: !0
1945
+ }), i(y, "constructor", {
1946
+ value: v,
1947
+ configurable: !0
1948
+ }), v.displayName = l(y, c, "GeneratorFunction"), t.isGeneratorFunction = function(e) {
1949
+ var t = typeof e == "function" && e.constructor;
1950
+ return !!t && (t === v || (t.displayName || t.name) === "GeneratorFunction");
1951
+ }, t.mark = function(e) {
1952
+ return Object.setPrototypeOf ? Object.setPrototypeOf(e, y) : (e.__proto__ = y, l(e, c, "GeneratorFunction")), e.prototype = Object.create(C), e;
1953
+ }, t.awrap = function(e) {
1954
+ return { __await: e };
1955
+ }, w(T.prototype), l(T.prototype, s, function() {
1956
+ return this;
1957
+ }), t.AsyncIterator = T, t.async = function(e, n, r, i, a) {
1958
+ a === void 0 && (a = Promise);
1959
+ var o = new T(u(e, n, r, i), a);
1960
+ return t.isGeneratorFunction(n) ? o : o.next().then(function(e) {
1961
+ return e.done ? e.value : o.next();
1962
+ });
1963
+ }, w(C), l(C, c, "Generator"), l(C, o, function() {
1964
+ return this;
1965
+ }), l(C, "toString", function() {
1966
+ return "[object Generator]";
1967
+ }), t.keys = function(e) {
1968
+ var t = Object(e), n = [];
1969
+ for (var r in t) n.push(r);
1970
+ return n.reverse(), function e() {
1971
+ for (; n.length;) {
1972
+ var r = n.pop();
1973
+ if (r in t) return e.value = r, e.done = !1, e;
1974
+ }
1975
+ return e.done = !0, e;
1976
+ };
1977
+ }, t.values = A, k.prototype = {
1978
+ constructor: k,
1979
+ reset: function(t) {
1980
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(O), !t) for (var n in this) n.charAt(0) === "t" && r.call(this, n) && !isNaN(+n.slice(1)) && (this[n] = e);
1981
+ },
1982
+ stop: function() {
1983
+ this.done = !0;
1984
+ var e = this.tryEntries[0].completion;
1985
+ if (e.type === "throw") throw e.arg;
1986
+ return this.rval;
1987
+ },
1988
+ dispatchException: function(t) {
1989
+ if (this.done) throw t;
1990
+ var n = this;
1991
+ function i(r, i) {
1992
+ return s.type = "throw", s.arg = t, n.next = r, i && (n.method = "next", n.arg = e), !!i;
1993
+ }
1994
+ for (var a = this.tryEntries.length - 1; a >= 0; --a) {
1995
+ var o = this.tryEntries[a], s = o.completion;
1996
+ if (o.tryLoc === "root") return i("end");
1997
+ if (o.tryLoc <= this.prev) {
1998
+ var c = r.call(o, "catchLoc"), l = r.call(o, "finallyLoc");
1999
+ if (c && l) {
2000
+ if (this.prev < o.catchLoc) return i(o.catchLoc, !0);
2001
+ if (this.prev < o.finallyLoc) return i(o.finallyLoc);
2002
+ } else if (c) {
2003
+ if (this.prev < o.catchLoc) return i(o.catchLoc, !0);
2004
+ } else {
2005
+ if (!l) throw Error("try statement without catch or finally");
2006
+ if (this.prev < o.finallyLoc) return i(o.finallyLoc);
2007
+ }
2008
+ }
2009
+ }
2010
+ },
2011
+ abrupt: function(e, t) {
2012
+ for (var n = this.tryEntries.length - 1; n >= 0; --n) {
2013
+ var i = this.tryEntries[n];
2014
+ if (i.tryLoc <= this.prev && r.call(i, "finallyLoc") && this.prev < i.finallyLoc) {
2015
+ var a = i;
2016
+ break;
2017
+ }
2018
+ }
2019
+ a && (e === "break" || e === "continue") && a.tryLoc <= t && t <= a.finallyLoc && (a = null);
2020
+ var o = a ? a.completion : {};
2021
+ return o.type = e, o.arg = t, a ? (this.method = "next", this.next = a.finallyLoc, g) : this.complete(o);
2022
+ },
2023
+ complete: function(e, t) {
2024
+ if (e.type === "throw") throw e.arg;
2025
+ return e.type === "break" || e.type === "continue" ? this.next = e.arg : e.type === "return" ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : e.type === "normal" && t && (this.next = t), g;
2026
+ },
2027
+ finish: function(e) {
2028
+ for (var t = this.tryEntries.length - 1; t >= 0; --t) {
2029
+ var n = this.tryEntries[t];
2030
+ if (n.finallyLoc === e) return this.complete(n.completion, n.afterLoc), O(n), g;
2031
+ }
2032
+ },
2033
+ catch: function(e) {
2034
+ for (var t = this.tryEntries.length - 1; t >= 0; --t) {
2035
+ var n = this.tryEntries[t];
2036
+ if (n.tryLoc === e) {
2037
+ var r = n.completion;
2038
+ if (r.type === "throw") {
2039
+ var i = r.arg;
2040
+ O(n);
2041
+ }
2042
+ return i;
2043
+ }
2044
+ }
2045
+ throw Error("illegal catch attempt");
2046
+ },
2047
+ delegateYield: function(t, n, r) {
2048
+ return this.delegate = {
2049
+ iterator: A(t),
2050
+ resultName: n,
2051
+ nextLoc: r
2052
+ }, this.method === "next" && (this.arg = e), g;
2053
+ }
2054
+ }, t;
2055
+ }
2056
+ function tn(e, t, n, r, i, a, o) {
2057
+ try {
2058
+ var s = e[a](o), c = s.value;
2059
+ } catch (e) {
2060
+ n(e);
2061
+ return;
2062
+ }
2063
+ s.done ? t(c) : Promise.resolve(c).then(r, i);
2064
+ }
2065
+ function nn(e) {
2066
+ return function() {
2067
+ var t = this, n = arguments;
2068
+ return new Promise(function(r, i) {
2069
+ var a = e.apply(t, n);
2070
+ function o(e) {
2071
+ tn(a, r, i, o, s, "next", e);
2072
+ }
2073
+ function s(e) {
2074
+ tn(a, r, i, o, s, "throw", e);
2075
+ }
2076
+ o(void 0);
2077
+ });
2078
+ };
2079
+ }
2080
+ function rn(e, t) {
2081
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
2082
+ }
2083
+ function an(e, t) {
2084
+ for (var n = 0; n < t.length; n++) {
2085
+ var r = t[n];
2086
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, sn(r.key), r);
2087
+ }
2088
+ }
2089
+ function on(e, t, n) {
2090
+ return t && an(e.prototype, t), n && an(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
2091
+ }
2092
+ function sn(e) {
2093
+ var t = cn(e, "string");
2094
+ return H(t) == "symbol" ? t : t + "";
2095
+ }
2096
+ function cn(e, t) {
2097
+ if (H(e) != "object" || !e) return e;
2098
+ var n = e[Symbol.toPrimitive];
2099
+ if (n !== void 0) {
2100
+ var r = n.call(e, t || "default");
2101
+ if (H(r) != "object") return r;
2102
+ throw TypeError("@@toPrimitive must return a primitive value.");
2103
+ }
2104
+ return (t === "string" ? String : Number)(e);
2105
+ }
2106
+ var ln = /* @__PURE__ */ function() {
2107
+ function e() {
2108
+ rn(this, e);
2109
+ }
2110
+ return on(e, [{
2111
+ key: "openFile",
2112
+ value: function() {
2113
+ var e = nn(/* @__PURE__ */ en().mark(function e(t, n) {
2114
+ var r;
2115
+ return en().wrap(function(e) {
2116
+ for (;;) switch (e.prev = e.next) {
2117
+ case 0:
2118
+ if (!(It() && t && t.uri !== void 0)) {
2119
+ e.next = 11;
2120
+ break;
2121
+ }
2122
+ return e.prev = 1, e.next = 4, Lt(t.uri);
2123
+ case 4: return r = e.sent, e.abrupt("return", new Gt(r));
2124
+ case 8: throw e.prev = 8, e.t0 = e.catch(1), Error(`tus: cannot fetch \`file.uri\` as Blob, make sure the uri is correct and accessible. ${e.t0}`);
2125
+ case 11:
2126
+ if (!(typeof t.slice == "function" && t.size !== void 0)) {
2127
+ e.next = 13;
2128
+ break;
2129
+ }
2130
+ return e.abrupt("return", Promise.resolve(new Gt(t)));
2131
+ case 13:
2132
+ if (typeof t.read != "function") {
2133
+ e.next = 18;
2134
+ break;
2135
+ }
2136
+ if (n = Number(n), Number.isFinite(n)) {
2137
+ e.next = 17;
2138
+ break;
2139
+ }
2140
+ return e.abrupt("return", Promise.reject(/* @__PURE__ */ Error("cannot create source for stream without a finite value for the `chunkSize` option")));
2141
+ case 17: return e.abrupt("return", Promise.resolve(new $t(t, n)));
2142
+ case 18: return e.abrupt("return", Promise.reject(/* @__PURE__ */ Error("source object may only be an instance of File, Blob, or Reader in this environment")));
2143
+ case 19:
2144
+ case "end": return e.stop();
2145
+ }
2146
+ }, e, null, [[1, 8]]);
2147
+ }));
2148
+ function t(t, n) {
2149
+ return e.apply(this, arguments);
2150
+ }
2151
+ return t;
2152
+ }()
2153
+ }]);
2154
+ }();
2155
+ //#endregion
2156
+ //#region node_modules/tus-js-client/lib.esm/browser/fileSignature.js
2157
+ function un(e, t) {
2158
+ return It() ? Promise.resolve(dn(e, t)) : Promise.resolve([
2159
+ "tus-br",
2160
+ e.name,
2161
+ e.type,
2162
+ e.size,
2163
+ e.lastModified,
2164
+ t.endpoint
2165
+ ].join("-"));
2166
+ }
2167
+ function dn(e, t) {
2168
+ var n = e.exif ? fn(JSON.stringify(e.exif)) : "noexif";
2169
+ return [
2170
+ "tus-rn",
2171
+ e.name || "noname",
2172
+ e.size || "nosize",
2173
+ n,
2174
+ t.endpoint
2175
+ ].join("/");
2176
+ }
2177
+ function fn(e) {
2178
+ var t = 0;
2179
+ if (e.length === 0) return t;
2180
+ for (var n = 0; n < e.length; n++) {
2181
+ var r = e.charCodeAt(n);
2182
+ t = (t << 5) - t + r, t &= t;
2183
+ }
2184
+ return t;
2185
+ }
2186
+ //#endregion
2187
+ //#region node_modules/tus-js-client/lib.esm/browser/httpStack.js
2188
+ function U(e) {
2189
+ "@babel/helpers - typeof";
2190
+ return U = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
2191
+ return typeof e;
2192
+ } : function(e) {
2193
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2194
+ }, U(e);
2195
+ }
2196
+ function pn(e, t) {
2197
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
2198
+ }
2199
+ function mn(e, t) {
2200
+ for (var n = 0; n < t.length; n++) {
2201
+ var r = t[n];
2202
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, gn(r.key), r);
2203
+ }
2204
+ }
2205
+ function hn(e, t, n) {
2206
+ return t && mn(e.prototype, t), n && mn(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
2207
+ }
2208
+ function gn(e) {
2209
+ var t = _n(e, "string");
2210
+ return U(t) == "symbol" ? t : t + "";
2211
+ }
2212
+ function _n(e, t) {
2213
+ if (U(e) != "object" || !e) return e;
2214
+ var n = e[Symbol.toPrimitive];
2215
+ if (n !== void 0) {
2216
+ var r = n.call(e, t || "default");
2217
+ if (U(r) != "object") return r;
2218
+ throw TypeError("@@toPrimitive must return a primitive value.");
2219
+ }
2220
+ return (t === "string" ? String : Number)(e);
2221
+ }
2222
+ var vn = /* @__PURE__ */ function() {
2223
+ function e() {
2224
+ pn(this, e);
2225
+ }
2226
+ return hn(e, [{
2227
+ key: "createRequest",
2228
+ value: function(e, t) {
2229
+ return new yn(e, t);
2230
+ }
2231
+ }, {
2232
+ key: "getName",
2233
+ value: function() {
2234
+ return "XHRHttpStack";
2235
+ }
2236
+ }]);
2237
+ }(), yn = /* @__PURE__ */ function() {
2238
+ function e(t, n) {
2239
+ pn(this, e), this._xhr = new XMLHttpRequest(), this._xhr.open(t, n, !0), this._method = t, this._url = n, this._headers = {};
2240
+ }
2241
+ return hn(e, [
2242
+ {
2243
+ key: "getMethod",
2244
+ value: function() {
2245
+ return this._method;
2246
+ }
2247
+ },
2248
+ {
2249
+ key: "getURL",
2250
+ value: function() {
2251
+ return this._url;
2252
+ }
2253
+ },
2254
+ {
2255
+ key: "setHeader",
2256
+ value: function(e, t) {
2257
+ this._xhr.setRequestHeader(e, t), this._headers[e] = t;
2258
+ }
2259
+ },
2260
+ {
2261
+ key: "getHeader",
2262
+ value: function(e) {
2263
+ return this._headers[e];
2264
+ }
2265
+ },
2266
+ {
2267
+ key: "setProgressHandler",
2268
+ value: function(e) {
2269
+ "upload" in this._xhr && (this._xhr.upload.onprogress = function(t) {
2270
+ t.lengthComputable && e(t.loaded);
2271
+ });
2272
+ }
2273
+ },
2274
+ {
2275
+ key: "send",
2276
+ value: function() {
2277
+ var e = this, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
2278
+ return new Promise(function(n, r) {
2279
+ e._xhr.onload = function() {
2280
+ n(new bn(e._xhr));
2281
+ }, e._xhr.onerror = function(e) {
2282
+ r(e);
2283
+ }, e._xhr.send(t);
2284
+ });
2285
+ }
2286
+ },
2287
+ {
2288
+ key: "abort",
2289
+ value: function() {
2290
+ return this._xhr.abort(), Promise.resolve();
2291
+ }
2292
+ },
2293
+ {
2294
+ key: "getUnderlyingObject",
2295
+ value: function() {
2296
+ return this._xhr;
2297
+ }
2298
+ }
2299
+ ]);
2300
+ }(), bn = /* @__PURE__ */ function() {
2301
+ function e(t) {
2302
+ pn(this, e), this._xhr = t;
2303
+ }
2304
+ return hn(e, [
2305
+ {
2306
+ key: "getStatus",
2307
+ value: function() {
2308
+ return this._xhr.status;
2309
+ }
2310
+ },
2311
+ {
2312
+ key: "getHeader",
2313
+ value: function(e) {
2314
+ return this._xhr.getResponseHeader(e);
2315
+ }
2316
+ },
2317
+ {
2318
+ key: "getBody",
2319
+ value: function() {
2320
+ return this._xhr.responseText;
2321
+ }
2322
+ },
2323
+ {
2324
+ key: "getUnderlyingObject",
2325
+ value: function() {
2326
+ return this._xhr;
2327
+ }
2328
+ }
2329
+ ]);
2330
+ }();
2331
+ //#endregion
2332
+ //#region node_modules/tus-js-client/lib.esm/browser/urlStorage.js
2333
+ function W(e) {
2334
+ "@babel/helpers - typeof";
2335
+ return W = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
2336
+ return typeof e;
2337
+ } : function(e) {
2338
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2339
+ }, W(e);
2340
+ }
2341
+ function xn(e, t) {
2342
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
2343
+ }
2344
+ function Sn(e, t) {
2345
+ for (var n = 0; n < t.length; n++) {
2346
+ var r = t[n];
2347
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, wn(r.key), r);
2348
+ }
2349
+ }
2350
+ function Cn(e, t, n) {
2351
+ return t && Sn(e.prototype, t), n && Sn(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
2352
+ }
2353
+ function wn(e) {
2354
+ var t = Tn(e, "string");
2355
+ return W(t) == "symbol" ? t : t + "";
2356
+ }
2357
+ function Tn(e, t) {
2358
+ if (W(e) != "object" || !e) return e;
2359
+ var n = e[Symbol.toPrimitive];
2360
+ if (n !== void 0) {
2361
+ var r = n.call(e, t || "default");
2362
+ if (W(r) != "object") return r;
2363
+ throw TypeError("@@toPrimitive must return a primitive value.");
2364
+ }
2365
+ return (t === "string" ? String : Number)(e);
2366
+ }
2367
+ var En = !1;
2368
+ try {
2369
+ En = "localStorage" in window;
2370
+ var Dn = "tusSupport", On = localStorage.getItem(Dn);
2371
+ localStorage.setItem(Dn, On), On === null && localStorage.removeItem(Dn);
2372
+ } catch (e) {
2373
+ if (e.code === e.SECURITY_ERR || e.code === e.QUOTA_EXCEEDED_ERR) En = !1;
2374
+ else throw e;
2375
+ }
2376
+ var kn = En, An = /* @__PURE__ */ function() {
2377
+ function e() {
2378
+ xn(this, e);
2379
+ }
2380
+ return Cn(e, [
2381
+ {
2382
+ key: "findAllUploads",
2383
+ value: function() {
2384
+ var e = this._findEntries("tus::");
2385
+ return Promise.resolve(e);
2386
+ }
2387
+ },
2388
+ {
2389
+ key: "findUploadsByFingerprint",
2390
+ value: function(e) {
2391
+ var t = this._findEntries(`tus::${e}::`);
2392
+ return Promise.resolve(t);
2393
+ }
2394
+ },
2395
+ {
2396
+ key: "removeUpload",
2397
+ value: function(e) {
2398
+ return localStorage.removeItem(e), Promise.resolve();
2399
+ }
2400
+ },
2401
+ {
2402
+ key: "addUpload",
2403
+ value: function(e, t) {
2404
+ var n = `tus::${e}::${Math.round(Math.random() * 0xe8d4a51000)}`;
2405
+ return localStorage.setItem(n, JSON.stringify(t)), Promise.resolve(n);
2406
+ }
2407
+ },
2408
+ {
2409
+ key: "_findEntries",
2410
+ value: function(e) {
2411
+ for (var t = [], n = 0; n < localStorage.length; n++) {
2412
+ var r = localStorage.key(n);
2413
+ if (r.indexOf(e) === 0) try {
2414
+ var i = JSON.parse(localStorage.getItem(r));
2415
+ i.urlStorageKey = r, t.push(i);
2416
+ } catch {}
2417
+ }
2418
+ return t;
2419
+ }
2420
+ }
2421
+ ]);
2422
+ }();
2423
+ //#endregion
2424
+ //#region node_modules/tus-js-client/lib.esm/browser/index.js
2425
+ function G(e) {
2426
+ "@babel/helpers - typeof";
2427
+ return G = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
2428
+ return typeof e;
2429
+ } : function(e) {
2430
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2431
+ }, G(e);
2432
+ }
2433
+ function jn(e, t) {
2434
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
2435
+ }
2436
+ function Mn(e, t) {
2437
+ for (var n = 0; n < t.length; n++) {
2438
+ var r = t[n];
2439
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, Un(r.key), r);
2440
+ }
2441
+ }
2442
+ function Nn(e, t, n) {
2443
+ return t && Mn(e.prototype, t), n && Mn(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
2444
+ }
2445
+ function Pn(e, t, n) {
2446
+ return t = Rn(t), Fn(e, Ln() ? Reflect.construct(t, n || [], Rn(e).constructor) : t.apply(e, n));
2447
+ }
2448
+ function Fn(e, t) {
2449
+ if (t && (G(t) === "object" || typeof t == "function")) return t;
2450
+ if (t !== void 0) throw TypeError("Derived constructors may only return object or undefined");
2451
+ return In(e);
2452
+ }
2453
+ function In(e) {
2454
+ if (e === void 0) throw ReferenceError("this hasn't been initialised - super() hasn't been called");
2455
+ return e;
2456
+ }
2457
+ function Ln() {
2458
+ try {
2459
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2460
+ } catch {}
2461
+ return (Ln = function() {
2462
+ return !!e;
2463
+ })();
2464
+ }
2465
+ function Rn(e) {
2466
+ return Rn = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
2467
+ return e.__proto__ || Object.getPrototypeOf(e);
2468
+ }, Rn(e);
2469
+ }
2470
+ function zn(e, t) {
2471
+ if (typeof t != "function" && t !== null) throw TypeError("Super expression must either be null or a function");
2472
+ e.prototype = Object.create(t && t.prototype, { constructor: {
2473
+ value: e,
2474
+ writable: !0,
2475
+ configurable: !0
2476
+ } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && Bn(e, t);
2477
+ }
2478
+ function Bn(e, t) {
2479
+ return Bn = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
2480
+ return e.__proto__ = t, e;
2481
+ }, Bn(e, t);
2482
+ }
2483
+ function Vn(e, t) {
2484
+ var n = Object.keys(e);
2485
+ if (Object.getOwnPropertySymbols) {
2486
+ var r = Object.getOwnPropertySymbols(e);
2487
+ t && (r = r.filter(function(t) {
2488
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
2489
+ })), n.push.apply(n, r);
2490
+ }
2491
+ return n;
2492
+ }
2493
+ function K(e) {
2494
+ for (var t = 1; t < arguments.length; t++) {
2495
+ var n = arguments[t] == null ? {} : arguments[t];
2496
+ t % 2 ? Vn(Object(n), !0).forEach(function(t) {
2497
+ Hn(e, t, n[t]);
2498
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Vn(Object(n)).forEach(function(t) {
2499
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
2500
+ });
2501
+ }
2502
+ return e;
2503
+ }
2504
+ function Hn(e, t, n) {
2505
+ return t = Un(t), t in e ? Object.defineProperty(e, t, {
2506
+ value: n,
2507
+ enumerable: !0,
2508
+ configurable: !0,
2509
+ writable: !0
2510
+ }) : e[t] = n, e;
2511
+ }
2512
+ function Un(e) {
2513
+ var t = Wn(e, "string");
2514
+ return G(t) == "symbol" ? t : t + "";
2515
+ }
2516
+ function Wn(e, t) {
2517
+ if (G(e) != "object" || !e) return e;
2518
+ var n = e[Symbol.toPrimitive];
2519
+ if (n !== void 0) {
2520
+ var r = n.call(e, t || "default");
2521
+ if (G(r) != "object") return r;
2522
+ throw TypeError("@@toPrimitive must return a primitive value.");
2523
+ }
2524
+ return (t === "string" ? String : Number)(e);
2525
+ }
2526
+ var Gn = K(K({}, Et.defaultOptions), {}, {
2527
+ httpStack: new vn(),
2528
+ fileReader: new ln(),
2529
+ urlStorage: kn ? new An() : new be(),
2530
+ fingerprint: un
2531
+ }), Kn = /* @__PURE__ */ function(e) {
2532
+ function t() {
2533
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2534
+ return jn(this, t), n = K(K({}, Gn), n), Pn(this, t, [e, n]);
2535
+ }
2536
+ return zn(t, e), Nn(t, null, [{
2537
+ key: "terminate",
2538
+ value: function(e) {
2539
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2540
+ return t = K(K({}, Gn), t), Et.terminate(e, t);
2541
+ }
2542
+ }]);
2543
+ }(Et);
2544
+ typeof XMLHttpRequest == "function" && typeof Blob == "function" && Blob.prototype.slice;
2545
+ //#endregion
2546
+ //#region src/queries/FileQueries.ts
2547
+ var qn = /* @__PURE__ */ S(E(), 1), q = "file", J = 1e3 * 60 * 60, Y = e(t.VITE_APP_TITLE), Jn = "later", X = d.create({ baseURL: "https://graph.microsoft.com/v1.0" });
2548
+ X.interceptors.request.use(async (e) => {
2549
+ let t = await n("graph");
2550
+ return e.headers.set("Authorization", `Bearer ${t}`), e;
2551
+ }), l.object({
2552
+ appName: l.string().min(1).max(255).default(Y).optional(),
2553
+ subId: l.uuid()
2554
+ }), l.object({
2555
+ appName: l.string().min(1).max(255).default(Y).optional(),
2556
+ meta: s.nullish()
2557
+ }), l.object({
2558
+ appName: l.string().min(1).max(255).default(Y).optional(),
2559
+ meta: s.nullish()
2560
+ });
2561
+ var Yn = {
2562
+ metas: (e) => {
2563
+ let t = new URLSearchParams();
2564
+ return t.append("appName", e.appName ?? Y), t.append("subId", e.subId), p({
2565
+ queryKey: [
2566
+ q,
2567
+ "meta",
2568
+ e.appName ?? Y,
2569
+ e.subId
2570
+ ],
2571
+ queryFn: ({ signal: e }) => X.request({
2572
+ url: `/${q}/v1/meta?${t.toString()}`,
2573
+ method: "GET",
2574
+ signal: e
2575
+ }).then((e) => e.data),
2576
+ staleTime: J,
2577
+ gcTime: J,
2578
+ refetchOnWindowFocus: !1
2579
+ });
2580
+ },
2581
+ thumbnail: (e) => {
2582
+ let t = new URLSearchParams();
2583
+ return t.append("appName", e.appName ?? Y), t.append("id", e.meta?.id ?? ""), p({
2584
+ queryKey: [
2585
+ q,
2586
+ "thumbnail",
2587
+ e.appName ?? Y,
2588
+ e.meta?.id
2589
+ ],
2590
+ queryFn: ({ signal: e }) => X.request({
2591
+ url: `/${q}/v1/thumbnail?${t.toString()}`,
2592
+ method: "GET",
2593
+ signal: e,
2594
+ responseType: "blob"
2595
+ }).then((e) => e.data),
2596
+ select: (e) => URL.createObjectURL(e),
2597
+ staleTime: J,
2598
+ gcTime: J,
2599
+ refetchOnWindowFocus: !1
2600
+ });
2601
+ },
2602
+ getOne: (e) => {
2603
+ let t = new URLSearchParams();
2604
+ return t.append("appName", e.appName ?? Y), t.append("id", e.meta?.id ?? ""), p({
2605
+ queryKey: [
2606
+ q,
2607
+ e.appName ?? Y,
2608
+ e.meta?.id
2609
+ ],
2610
+ queryFn: ({ signal: e }) => X.request({
2611
+ url: `/${q}/v1?${t.toString()}`,
2612
+ method: "GET",
2613
+ signal: e,
2614
+ responseType: "blob"
2615
+ }).then((e) => e.data),
2616
+ select: (e) => URL.createObjectURL(e),
2617
+ staleTime: J,
2618
+ gcTime: J,
2619
+ refetchOnWindowFocus: !1
2620
+ });
2621
+ },
2622
+ download: () => f({
2623
+ mutationFn: (e) => X.request({
2624
+ url: `/${q}/v1/download?appName=${Y}&id=${e.id}`,
2625
+ method: "GET",
2626
+ responseType: "blob"
2627
+ }).then((e) => e.data),
2628
+ onSuccess: (e, t) => (0, qn.default)(e, `${t.fileName}.${t.fileExtension}`)
2629
+ }),
2630
+ open: () => f({
2631
+ mutationFn: (e) => X.request({
2632
+ url: `/${q}/v1?appName=${Y}&id=${e.id}`,
2633
+ method: "GET",
2634
+ responseType: "blob"
2635
+ }).then((e) => e.data),
2636
+ onSuccess: (e) => {
2637
+ window.open(URL.createObjectURL(e));
2638
+ }
2639
+ }),
2640
+ updateMeta: () => f({
2641
+ mutationFn: (e) => X.request({
2642
+ url: `/${q}/v1/meta?appName=${Y}&id=${e.id}`,
2643
+ method: "PUT",
2644
+ data: e
2645
+ }).then((e) => e.data),
2646
+ onSettled: () => r.invalidateQueries({
2647
+ queryKey: [q, "meta"],
2648
+ exact: !1
2649
+ })
2650
+ }),
2651
+ delete: () => f({
2652
+ mutationFn: (e) => X.request({
2653
+ url: `/${q}/v1?appName=${Y}&id=${e.id}`,
2654
+ method: "DELETE"
2655
+ }).then((e) => e.data),
2656
+ onSettled: () => r.invalidateQueries({
2657
+ queryKey: [q, "meta"],
2658
+ exact: !1
2659
+ })
2660
+ }),
2661
+ batchDelete: () => f({
2662
+ mutationFn: (e) => X.request({
2663
+ url: `/${q}/v1?appName=${Y}&subId=${e}`,
2664
+ method: "DELETE"
2665
+ }).then((e) => e.data),
2666
+ onSettled: () => r.invalidateQueries({
2667
+ queryKey: [q, "meta"],
2668
+ exact: !1
2669
+ })
2670
+ })
2671
+ }, Xn = (e) => {
2672
+ let t = c(7), { subId: a, onSuccess: o, onError: s } = e, [l, d] = u(0), f;
2673
+ t[0] !== s || t[1] !== o || t[2] !== a ? (f = async (e) => {
2674
+ if (!a) throw Error("subId is required for file upload");
2675
+ let t = {
2676
+ id: i(),
2677
+ appName: Y,
2678
+ subId: a,
2679
+ fileName: e.name
2680
+ }, c = await n("graph"), l = new Kn(e, {
2681
+ endpoint: `${Jn}/${q}/v1/upload`,
2682
+ chunkSize: 1048576,
2683
+ metadata: {
2684
+ id: t.id,
2685
+ appName: t.appName,
2686
+ subId: t.subId,
2687
+ fileName: t.fileName,
2688
+ fileExtension: e.type
2689
+ },
2690
+ headers: { Authorization: `Bearer ${c}` },
2691
+ onError: (e) => {
2692
+ d(0), s?.(e);
2693
+ },
2694
+ onProgress: (e, t) => {
2695
+ d(e / t * 100);
2696
+ },
2697
+ onSuccess: () => {
2698
+ d(0), r.invalidateQueries({
2699
+ queryKey: [
2700
+ q,
2701
+ "meta",
2702
+ a
2703
+ ],
2704
+ exact: !1
2705
+ }), o?.(t);
2706
+ }
2707
+ }), u = await l.findPreviousUploads();
2708
+ u.length > 0 && l.resumeFromPreviousUpload(u[0]), l.start();
2709
+ }, t[0] = s, t[1] = o, t[2] = a, t[3] = f) : f = t[3];
2710
+ let p = f, m;
2711
+ return t[4] !== p || t[5] !== l ? (m = {
2712
+ mutate: p,
2713
+ progress: l
2714
+ }, t[4] = p, t[5] = l, t[6] = m) : m = t[6], m;
2715
+ }, Z = "ps", Q = 1e3 * 60 * 60 * 24, $ = d.create({ baseURL: "https://graph.microsoft.com/v1.0" });
2716
+ $.interceptors.request.use(async (e) => {
2717
+ let t = await n("graph");
2718
+ return e.headers.set("Authorization", `Bearer ${t}`), e;
2719
+ });
2720
+ //#endregion
2721
+ //#region src/queries/index.ts
2722
+ var Zn = {
2723
+ peopleSoft: {
2724
+ employeesSearch: (e) => p({
2725
+ queryKey: [
2726
+ Z,
2727
+ "employee",
2728
+ "search",
2729
+ e
2730
+ ],
2731
+ queryFn: ({ signal: t }) => $.request({
2732
+ url: `/${Z}/v1/employee?search=${e}`,
2733
+ method: "GET",
2734
+ signal: t
2735
+ }).then((e) => e.data),
2736
+ staleTime: Q,
2737
+ gcTime: Q,
2738
+ refetchOnWindowFocus: !1
2739
+ }),
2740
+ employees: () => p({
2741
+ queryKey: [Z, "employee"],
2742
+ queryFn: ({ signal: e }) => $.request({
2743
+ url: `/${Z}/v1/employee/all`,
2744
+ method: "GET",
2745
+ signal: e
2746
+ }).then((e) => e.data),
2747
+ staleTime: Q,
2748
+ gcTime: Q,
2749
+ refetchOnWindowFocus: !1
2750
+ }),
2751
+ activeEmployees: () => p({
2752
+ queryKey: [
2753
+ Z,
2754
+ "employee",
2755
+ "active"
2756
+ ],
2757
+ queryFn: ({ signal: e }) => $.request({
2758
+ url: `/${Z}/v1/employee/active`,
2759
+ method: "GET",
2760
+ signal: e
2761
+ }).then((e) => e.data),
2762
+ staleTime: Q,
2763
+ gcTime: Q,
2764
+ refetchOnWindowFocus: !1
2765
+ }),
2766
+ employeeById: (e) => p({
2767
+ queryKey: [
2768
+ Z,
2769
+ "employee",
2770
+ e
2771
+ ],
2772
+ queryFn: ({ signal: t }) => $.request({
2773
+ url: `/${Z}/v1/employee/${e}`,
2774
+ method: "GET",
2775
+ signal: t
2776
+ }).then((e) => e.data),
2777
+ staleTime: Q,
2778
+ gcTime: Q,
2779
+ refetchOnWindowFocus: !1
2780
+ }),
2781
+ previousEmployeeIds: () => p({
2782
+ queryKey: [
2783
+ Z,
2784
+ "employee",
2785
+ "previousIds"
2786
+ ],
2787
+ queryFn: ({ signal: e }) => $.request({
2788
+ url: `/${Z}/v1/employee/previousIds`,
2789
+ method: "GET",
2790
+ signal: e
2791
+ }).then((e) => e.data),
2792
+ staleTime: Q,
2793
+ gcTime: Q,
2794
+ refetchOnWindowFocus: !1
2795
+ }),
2796
+ employeeSupervisor: (e) => p({
2797
+ queryKey: [
2798
+ Z,
2799
+ "employee",
2800
+ e,
2801
+ "supervisor"
2802
+ ],
2803
+ queryFn: ({ signal: t }) => $.request({
2804
+ url: `/${Z}/v1/employee/${e}/supervisor`,
2805
+ method: "GET",
2806
+ signal: t
2807
+ }).then((e) => e.data),
2808
+ staleTime: Q,
2809
+ gcTime: Q,
2810
+ refetchOnWindowFocus: !1
2811
+ }),
2812
+ employeeSubordinates: (e) => p({
2813
+ queryKey: [
2814
+ Z,
2815
+ "employee",
2816
+ e,
2817
+ "subordinates"
2818
+ ],
2819
+ queryFn: ({ signal: t }) => $.request({
2820
+ url: `/${Z}/v1/employee/${e}/subordinates`,
2821
+ method: "GET",
2822
+ signal: t
2823
+ }).then((e) => e.data),
2824
+ staleTime: Q,
2825
+ gcTime: Q,
2826
+ refetchOnWindowFocus: !1
2827
+ }),
2828
+ employeeManager: (e) => p({
2829
+ queryKey: [
2830
+ Z,
2831
+ "employee",
2832
+ e,
2833
+ "manager"
2834
+ ],
2835
+ queryFn: ({ signal: t }) => $.request({
2836
+ url: `/${Z}/v1/employee/${e}/manager`,
2837
+ method: "GET",
2838
+ signal: t
2839
+ }).then((e) => e.data),
2840
+ staleTime: Q,
2841
+ gcTime: Q,
2842
+ refetchOnWindowFocus: !1
2843
+ }),
2844
+ employeeGeneralManager: (e) => p({
2845
+ queryKey: [
2846
+ Z,
2847
+ "employee",
2848
+ e,
2849
+ "generalManager"
2850
+ ],
2851
+ queryFn: ({ signal: t }) => $.request({
2852
+ url: `/${Z}/v1/employee/${e}/generalManager`,
2853
+ method: "GET",
2854
+ signal: t
2855
+ }).then((e) => e.data),
2856
+ staleTime: Q,
2857
+ gcTime: Q,
2858
+ refetchOnWindowFocus: !1
2859
+ }),
2860
+ departments: () => p({
2861
+ queryKey: [Z, "department"],
2862
+ queryFn: ({ signal: e }) => $.request({
2863
+ url: `/${Z}/v1/department/all`,
2864
+ method: "GET",
2865
+ signal: e
2866
+ }).then((e) => e.data),
2867
+ staleTime: Q,
2868
+ gcTime: Q,
2869
+ refetchOnWindowFocus: !1
2870
+ }),
2871
+ departmentById: (e) => p({
2872
+ queryKey: [
2873
+ Z,
2874
+ "department",
2875
+ e
2876
+ ],
2877
+ queryFn: ({ signal: t }) => $.request({
2878
+ url: `/${Z}/v1/department/${e}`,
2879
+ method: "GET",
2880
+ signal: t
2881
+ }).then((e) => e.data),
2882
+ staleTime: Q,
2883
+ gcTime: Q,
2884
+ refetchOnWindowFocus: !1
2885
+ }),
2886
+ departmentManager: (e) => p({
2887
+ queryKey: [
2888
+ Z,
2889
+ "department",
2890
+ e,
2891
+ "manager"
2892
+ ],
2893
+ queryFn: ({ signal: t }) => $.request({
2894
+ url: `/${Z}/v1/department/${e}/manager`,
2895
+ method: "GET",
2896
+ signal: t
2897
+ }).then((e) => e.data),
2898
+ staleTime: Q,
2899
+ gcTime: Q,
2900
+ refetchOnWindowFocus: !1
2901
+ }),
2902
+ departmentEmployees: (e) => p({
2903
+ queryKey: [
2904
+ Z,
2905
+ "department",
2906
+ e,
2907
+ "employees"
2908
+ ],
2909
+ queryFn: ({ signal: t }) => $.request({
2910
+ url: `/${Z}/v1/department/${e}/employees`,
2911
+ method: "GET",
2912
+ signal: t
2913
+ }).then((e) => e.data),
2914
+ staleTime: Q,
2915
+ gcTime: Q,
2916
+ refetchOnWindowFocus: !1
2917
+ }),
2918
+ companyGeneralManager: (e) => p({
2919
+ queryKey: [
2920
+ Z,
2921
+ "company",
2922
+ e,
2923
+ "generalManager"
2924
+ ],
2925
+ queryFn: ({ signal: t }) => $.request({
2926
+ url: `/${Z}/v1/company/${e}/generalManager`,
2927
+ method: "GET",
2928
+ signal: t
2929
+ }).then((e) => e.data),
2930
+ staleTime: Q,
2931
+ gcTime: Q,
2932
+ refetchOnWindowFocus: !1
2933
+ })
2934
+ },
2935
+ approval: ee,
2936
+ file: Yn
2937
+ };
2938
+ //#endregion
2939
+ export { S as i, Xn as n, b as r, Zn as t };
2940
+
2941
+ //# sourceMappingURL=queries-D-DV5lCw.js.map