hplx-feature-library 1.0.170 → 1.0.171

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/dist/Attachments/components/document-canvas/document-pen-tool.d.ts +1 -1
  2. package/dist/Attachments/components/drag-drop-overlay.d.ts +1 -1
  3. package/dist/Attachments/components/edit-document-modal.d.ts +1 -1
  4. package/dist/Attachments/components/uploading-toast.d.ts +1 -1
  5. package/dist/Attachments/context/index.d.ts +2 -2
  6. package/dist/Attachments/hooks/useDropdownPosition.d.ts +1 -1
  7. package/dist/Attachments/index.js +12670 -11144
  8. package/dist/CameraCapture/index.d.ts +1 -1
  9. package/dist/PediatricsCalculator/components/PediatricsCalculatorTableContext.d.ts +1 -1
  10. package/dist/PediatricsCalculator/index.js +1 -1
  11. package/dist/PediatricsCalculatorTable-BglWcUGO.cjs +40 -0
  12. package/dist/PediatricsCalculatorTable-Dwluo5W0.js +2163 -0
  13. package/dist/components/{customDropdown/CustomDropdown.d.ts → CustomDropdown.d.ts} +2 -2
  14. package/dist/components/{toggleButtons/ToggleButtons.d.ts → ToggleButtons.d.ts} +1 -1
  15. package/dist/hplx-feature-library.css +1 -1
  16. package/dist/index.d.ts +0 -5
  17. package/dist/index.js +2 -12
  18. package/dist/useOutsideClick-COATBT9j.cjs +92 -0
  19. package/dist/useOutsideClick-CYAjbj1N.js +6878 -0
  20. package/package.json +4 -60
  21. package/dist/APIAction--DyoXs57.js +0 -3752
  22. package/dist/APIAction-B5XQnkiF.cjs +0 -9
  23. package/dist/AlertPopup/index.js +0 -79
  24. package/dist/AllInvestigations/components/AllInvestigationsTable.d.ts +0 -19
  25. package/dist/AllInvestigations/index.d.ts +0 -1
  26. package/dist/AllInvestigations/index.js +0 -4
  27. package/dist/AllInvestigations/utils/test-tange-util.d.ts +0 -8
  28. package/dist/AllInvestigationsTable-Dj3AKVVv.js +0 -17066
  29. package/dist/AllInvestigationsTable-aw_zEJj_.cjs +0 -79
  30. package/dist/CustomDropdown/index.js +0 -256
  31. package/dist/DateTimePicker/DateAndTimePicker/index.js +0 -5930
  32. package/dist/PatientAddEdit/index.js +0 -1662
  33. package/dist/PatientPopup/action/APIAction.d.ts +0 -65
  34. package/dist/PatientPopup/app/PatientPopupContainer.d.ts +0 -6
  35. package/dist/PatientPopup/app/PatientPopupContext.d.ts +0 -30
  36. package/dist/PatientPopup/common/common.d.ts +0 -14
  37. package/dist/PatientPopup/components/Lab/HPLXLab.d.ts +0 -8
  38. package/dist/PatientPopup/components/Lab/LISLab.d.ts +0 -8
  39. package/dist/PatientPopup/components/Lab/LabTable.d.ts +0 -5
  40. package/dist/PatientPopup/components/Lab/index.d.ts +0 -5
  41. package/dist/PatientPopup/components/Loader/Loader.d.ts +0 -2
  42. package/dist/PatientPopup/components/Pagination.d.ts +0 -9
  43. package/dist/PatientPopup/components/Profile/Abha.d.ts +0 -11
  44. package/dist/PatientPopup/components/Profile/PatientDetailsModal.d.ts +0 -1
  45. package/dist/PatientPopup/components/Profile/Profile.d.ts +0 -11
  46. package/dist/PatientPopup/components/Profile/Sms.d.ts +0 -2
  47. package/dist/PatientPopup/components/Visits/Table.d.ts +0 -11
  48. package/dist/PatientPopup/components/Visits/index.d.ts +0 -15
  49. package/dist/PatientPopup/components/addBills/AddBillFooter.d.ts +0 -2
  50. package/dist/PatientPopup/components/addBills/AddBills.d.ts +0 -5
  51. package/dist/PatientPopup/components/addBills/AddBillsTable.d.ts +0 -17
  52. package/dist/PatientPopup/components/addBills/DropDown.d.ts +0 -15
  53. package/dist/PatientPopup/components/appointment/AllAppts.d.ts +0 -8
  54. package/dist/PatientPopup/components/appointment/Appointment.d.ts +0 -2
  55. package/dist/PatientPopup/components/appointment/AppointmentsTable.d.ts +0 -10
  56. package/dist/PatientPopup/components/bills/Bills.d.ts +0 -6
  57. package/dist/PatientPopup/components/bills/BillsTable.d.ts +0 -11
  58. package/dist/PatientPopup/components/deposit/DepositSection.d.ts +0 -9
  59. package/dist/PatientPopup/components/mainNavItem/MainNavItem.d.ts +0 -13
  60. package/dist/PatientPopup/components/patientPopupBody/PatientPopupBody.d.ts +0 -8
  61. package/dist/PatientPopup/components/patientPopupHeader/PatientPopupHeader.d.ts +0 -10
  62. package/dist/PatientPopup/components/patientPopupSummary/BillSummary.d.ts +0 -19
  63. package/dist/PatientPopup/components/patientPopupSummary/ConsultationDetails.d.ts +0 -14
  64. package/dist/PatientPopup/components/patientPopupSummary/DeleteItem.d.ts +0 -11
  65. package/dist/PatientPopup/components/patientPopupSummary/DepositRefundSummary.d.ts +0 -8
  66. package/dist/PatientPopup/components/patientPopupSummary/LabServiceDetails.d.ts +0 -13
  67. package/dist/PatientPopup/components/patientPopupSummary/OtherServiceDetails.d.ts +0 -13
  68. package/dist/PatientPopup/components/patientPopupSummary/PatientPopupSummary.d.ts +0 -8
  69. package/dist/PatientPopup/components/patientPopupSummary/PaymentCard.d.ts +0 -25
  70. package/dist/PatientPopup/components/patientPopupSummary/ServiceLevelBillSummary.d.ts +0 -18
  71. package/dist/PatientPopup/components/payments/DepositRefundTable.d.ts +0 -14
  72. package/dist/PatientPopup/components/payments/OtherServicesTable.d.ts +0 -16
  73. package/dist/PatientPopup/components/payments/PaymentEditModal.d.ts +0 -15
  74. package/dist/PatientPopup/components/payments/PaymentHeader.d.ts +0 -7
  75. package/dist/PatientPopup/components/payments/Payments.d.ts +0 -5
  76. package/dist/PatientPopup/components/payments/PaymentsTable.d.ts +0 -14
  77. package/dist/PatientPopup/constants/AppConstants.d.ts +0 -123
  78. package/dist/PatientPopup/index.d.ts +0 -1
  79. package/dist/PatientPopup/index.js +0 -135376
  80. package/dist/PatientPopup/types/hplxAPITypes.d.ts +0 -37
  81. package/dist/PatientPopup/utils/PrintFontLoader.d.ts +0 -4
  82. package/dist/PatientPopup/utils/helperFunctions.d.ts +0 -3
  83. package/dist/PediatricsCalculatorTable-CTA61g3h.cjs +0 -1
  84. package/dist/PediatricsCalculatorTable-QgonqxbR.js +0 -833
  85. package/dist/ReusableModal-CIgDYOWZ.cjs +0 -1
  86. package/dist/ReusableModal-pSi21hnc.js +0 -29
  87. package/dist/ReusableTable/ReusableTable.d.ts +0 -3
  88. package/dist/ReusableTable/ReusableTableConstants.d.ts +0 -8
  89. package/dist/ReusableTable/ReusableTableTypes.d.ts +0 -96
  90. package/dist/ReusableTable/components/EmptyTableContainer.d.ts +0 -12
  91. package/dist/ReusableTable/components/FilterCheckbox.d.ts +0 -8
  92. package/dist/ReusableTable/components/FilterDropdown.d.ts +0 -17
  93. package/dist/ReusableTable/components/Pagination.d.ts +0 -2
  94. package/dist/ReusableTable/components/TableBody.d.ts +0 -2
  95. package/dist/ReusableTable/components/TableCell.d.ts +0 -3
  96. package/dist/ReusableTable/components/TableFilterSelect.d.ts +0 -12
  97. package/dist/ReusableTable/components/TableHead.d.ts +0 -2
  98. package/dist/ReusableTable/components/TableMain.d.ts +0 -2
  99. package/dist/ReusableTable/components/TableRow.d.ts +0 -3
  100. package/dist/ReusableTable/context/TableContext.d.ts +0 -21
  101. package/dist/ReusableTable/context/TableContextBase.d.ts +0 -26
  102. package/dist/ReusableTable/context/useTableContext.d.ts +0 -2
  103. package/dist/Subscription/components/SubscriptionBadge.d.ts +0 -2
  104. package/dist/ToggleButtons/index.js +0 -17
  105. package/dist/TrendGraphs/AreaChartComponent.d.ts +0 -9
  106. package/dist/TrendGraphs/LineChartComponent/DataPointToolTip.d.ts +0 -16
  107. package/dist/TrendGraphs/LineChartComponent/LineChartBody.d.ts +0 -2
  108. package/dist/TrendGraphs/LineChartComponent/LineChartHeader.d.ts +0 -2
  109. package/dist/TrendGraphs/LineChartComponent/index.d.ts +0 -2
  110. package/dist/TrendGraphs/context/index.d.ts +0 -2
  111. package/dist/TrendGraphs/hooks/useTrendGraphContext.d.ts +0 -2
  112. package/dist/TrendGraphs/utils/index.d.ts +0 -4
  113. package/dist/changePasswordModal/APIAction/APIActions.d.ts +0 -8
  114. package/dist/changePasswordModal/component/ChangePasswordModal.d.ts +0 -14
  115. package/dist/clsx-C11secjj.cjs +0 -1
  116. package/dist/clsx-OuTLNxxd.js +0 -16
  117. package/dist/common/APIAction/APIAction.d.ts +0 -28
  118. package/dist/common/components/BorderFullWidth.d.ts +0 -2
  119. package/dist/common/components/table/ExistingPatients.d.ts +0 -17
  120. package/dist/common/editRibbon/EditRibbon.d.ts +0 -9
  121. package/dist/common/utils/NetworkInstance.d.ts +0 -4
  122. package/dist/common/utils/common-utils.d.ts +0 -36
  123. package/dist/components/Modal.d.ts +0 -5
  124. package/dist/components/PatientAddEdit.d.ts +0 -3
  125. package/dist/components/alertPopup/index.d.ts +0 -1
  126. package/dist/components/customDropdown/index.d.ts +0 -1
  127. package/dist/components/dateTimePicker/DateAndTimePicker.d.ts +0 -21
  128. package/dist/components/dateTimePicker/index.d.ts +0 -1
  129. package/dist/components/toggleButtons/index.d.ts +0 -1
  130. package/dist/constants/CommonConstant.d.ts +0 -70
  131. package/dist/constants/TrendGraphsConstants.d.ts +0 -2
  132. package/dist/dayjs.min-BbV4duaj.js +0 -284
  133. package/dist/dayjs.min-DXp74Ozx.cjs +0 -1
  134. package/dist/fonts/AnekMalayalam-Bold.ttf +0 -0
  135. package/dist/fonts/AnekMalayalam-Regular.ttf +0 -0
  136. package/dist/fonts/Arial-Bold-Italic.ttf +0 -0
  137. package/dist/fonts/Arial-Bold.ttf +0 -0
  138. package/dist/fonts/Arial-Italic.ttf +0 -0
  139. package/dist/fonts/Arial.ttf +0 -0
  140. package/dist/fonts/IndianRupee.ttf +0 -0
  141. package/dist/fonts/MuktaMaheePunjabi-Bold.ttf +0 -0
  142. package/dist/fonts/MuktaMaheePunjabi-Regular.ttf +0 -0
  143. package/dist/fonts/Noto-Sans-Telugu-Bold.ttf +0 -0
  144. package/dist/fonts/Noto-Sans-Telugu-Regular.ttf +0 -0
  145. package/dist/fonts/NotoNastaliqUrdu-Bold.ttf +0 -0
  146. package/dist/fonts/NotoNastaliqUrdu-Regular.ttf +0 -0
  147. package/dist/fonts/NotoSansArabic-Bold.ttf +0 -0
  148. package/dist/fonts/NotoSansArabic.ttf +0 -0
  149. package/dist/fonts/NotoSansHindi-Bold.ttf +0 -0
  150. package/dist/fonts/NotoSansHindi.ttf +0 -0
  151. package/dist/fonts/NotoSansKannada-Bold.ttf +0 -0
  152. package/dist/fonts/NotoSansKannada.ttf +0 -0
  153. package/dist/fonts/NotoSansOriya-Bold.ttf +0 -0
  154. package/dist/fonts/NotoSansOriya.ttf +0 -0
  155. package/dist/fonts/NotoSansTamil-Bold.ttf +0 -0
  156. package/dist/fonts/NotoSansTamil.ttf +0 -0
  157. package/dist/fonts/NotoSerifGujarati-Bold.ttf +0 -0
  158. package/dist/fonts/NotoSerifGujarati-Regular.ttf +0 -0
  159. package/dist/fonts/Roboto-Regular.ttf +0 -0
  160. package/dist/fonts/Times-Bold-Italic.ttf +0 -0
  161. package/dist/fonts/Times-Bold.ttf +0 -0
  162. package/dist/fonts/Times-Italic.ttf +0 -0
  163. package/dist/fonts/Times.ttf +0 -0
  164. package/dist/fonts/TiroBangla-Bold.ttf +0 -0
  165. package/dist/fonts/TiroBangla-Regular.ttf +0 -0
  166. package/dist/fonts/Verdana-Bold-Italic.ttf +0 -0
  167. package/dist/fonts/Verdana-Bold.ttf +0 -0
  168. package/dist/fonts/Verdana-Italic.ttf +0 -0
  169. package/dist/fonts/Verdana.ttf +0 -0
  170. package/dist/hooks/useMediaQuery.d.ts +0 -1
  171. package/dist/index-CJFGOBPb.js +0 -122
  172. package/dist/index-DQlbIHh3.cjs +0 -102
  173. package/dist/index-DfcUmlge.cjs +0 -17
  174. package/dist/index-DkA8S5IK.cjs +0 -32
  175. package/dist/index-sG1tIMJ6.js +0 -7242
  176. package/dist/index-vVtPa2-N.js +0 -961
  177. package/dist/nineDots/NineDotsTypes.d.ts +0 -22
  178. package/dist/nineDots/NineDotsUtils.d.ts +0 -3
  179. package/dist/nineDots/nineDots.d.ts +0 -3
  180. package/dist/parseISO-AwyR5Nhg.cjs +0 -1
  181. package/dist/parseISO-Cso9HWPX.js +0 -1414
  182. package/dist/searchPatients/SearchPatients.d.ts +0 -11
  183. package/dist/types/APIEndPoints.d.ts +0 -11
  184. package/dist/types/AllInvestigationTypes/index.js +0 -4
  185. package/dist/types/AllInvestigationTypes.d.ts +0 -45
  186. package/dist/types/ApiResponseTypes.d.ts +0 -290
  187. package/dist/types/CommonTypes.d.ts +0 -255
  188. package/dist/types/PatientAddEditTypes/index.js +0 -1
  189. package/dist/types/PatientAddEditTypes.d.ts +0 -7
  190. package/dist/types/PatientPopupTypes/index.js +0 -1
  191. package/dist/types/PatientPopupTypes.d.ts +0 -836
  192. package/dist/types/TrendGraphTypes.d.ts +0 -19
  193. package/dist/useClickOutside-BjJyGTec.js +0 -14
  194. package/dist/useClickOutside-DsVG12Cs.cjs +0 -1
  195. package/dist/useOutsideClick-C4Q0aGuf.js +0 -15
  196. package/dist/useOutsideClick-CicUjzPP.cjs +0 -1
  197. package/dist/userProfile/APIAction/APIActions.d.ts +0 -18
  198. package/dist/userProfile/UserProfile.d.ts +0 -18
  199. package/dist/userProfile/UserProfileItem.d.ts +0 -7
  200. package/dist/warning-BozzKWdr.js +0 -38
  201. package/dist/warning-W0tkkrLJ.cjs +0 -1
  202. /package/dist/components/{alertPopup/AlertPopup.d.ts → AlertPopup.d.ts} +0 -0
@@ -1,3752 +0,0 @@
1
- import { d as I } from "./dayjs.min-BbV4duaj.js";
2
- var Ee, Ie;
3
- function Lt() {
4
- if (Ie) return Ee;
5
- Ie = 1;
6
- function t(d) {
7
- this._maxSize = d, this.clear();
8
- }
9
- t.prototype.clear = function() {
10
- this._size = 0, this._values = /* @__PURE__ */ Object.create(null);
11
- }, t.prototype.get = function(d) {
12
- return this._values[d];
13
- }, t.prototype.set = function(d, b) {
14
- return this._size >= this._maxSize && this.clear(), d in this._values || this._size++, this._values[d] = b;
15
- };
16
- var e = /[^.^\]^[]+|(?=\[\]|\.\.)/g, r = /^\d+$/, n = /^\d/, s = /[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g, i = /^\s*(['"]?)(.*?)(\1)\s*$/, a = 512, o = new t(a), u = new t(a), c = new t(a);
17
- Ee = {
18
- Cache: t,
19
- split: h,
20
- normalizePath: f,
21
- setter: function(d) {
22
- var b = f(d);
23
- return u.get(d) || u.set(d, function(O, T) {
24
- for (var v = 0, x = b.length, C = O; v < x - 1; ) {
25
- var k = b[v];
26
- if (k === "__proto__" || k === "constructor" || k === "prototype")
27
- return O;
28
- C = C[b[v++]];
29
- }
30
- C[b[v]] = T;
31
- });
32
- },
33
- getter: function(d, b) {
34
- var E = f(d);
35
- return c.get(d) || c.set(d, function(T) {
36
- for (var v = 0, x = E.length; v < x; )
37
- if (T != null || !b) T = T[E[v++]];
38
- else return;
39
- return T;
40
- });
41
- },
42
- join: function(d) {
43
- return d.reduce(function(b, E) {
44
- return b + (w(E) || r.test(E) ? "[" + E + "]" : (b ? "." : "") + E);
45
- }, "");
46
- },
47
- forEach: function(d, b, E) {
48
- y(Array.isArray(d) ? d : h(d), b, E);
49
- }
50
- };
51
- function f(d) {
52
- return o.get(d) || o.set(
53
- d,
54
- h(d).map(function(b) {
55
- return b.replace(i, "$2");
56
- })
57
- );
58
- }
59
- function h(d) {
60
- return d.match(e) || [""];
61
- }
62
- function y(d, b, E) {
63
- var O = d.length, T, v, x, C;
64
- for (v = 0; v < O; v++)
65
- T = d[v], T && (m(T) && (T = '"' + T + '"'), C = w(T), x = !C && /^\d+$/.test(T), b.call(E, T, C, x, v, d));
66
- }
67
- function w(d) {
68
- return typeof d == "string" && d && ["'", '"'].indexOf(d.charAt(0)) !== -1;
69
- }
70
- function p(d) {
71
- return d.match(n) && !d.match(r);
72
- }
73
- function g(d) {
74
- return s.test(d);
75
- }
76
- function m(d) {
77
- return !w(d) && (p(d) || g(d));
78
- }
79
- return Ee;
80
- }
81
- var rt = Lt(), ae = { exports: {} }, Le;
82
- function Ut() {
83
- if (Le) return ae.exports;
84
- Le = 1, ae.exports = function(s) {
85
- return t(e(s), s);
86
- }, ae.exports.array = t;
87
- function t(s, i) {
88
- var a = s.length, o = new Array(a), u = {}, c = a, f = r(i), h = n(s);
89
- for (i.forEach(function(w) {
90
- if (!h.has(w[0]) || !h.has(w[1]))
91
- throw new Error("Unknown node. There is an unknown node in the supplied edges.");
92
- }); c--; )
93
- u[c] || y(s[c], c, /* @__PURE__ */ new Set());
94
- return o;
95
- function y(w, p, g) {
96
- if (g.has(w)) {
97
- var m;
98
- try {
99
- m = ", node was:" + JSON.stringify(w);
100
- } catch {
101
- m = "";
102
- }
103
- throw new Error("Cyclic dependency" + m);
104
- }
105
- if (!h.has(w))
106
- throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: " + JSON.stringify(w));
107
- if (!u[p]) {
108
- u[p] = !0;
109
- var d = f.get(w) || /* @__PURE__ */ new Set();
110
- if (d = Array.from(d), p = d.length) {
111
- g.add(w);
112
- do {
113
- var b = d[--p];
114
- y(b, h.get(b), g);
115
- } while (p);
116
- g.delete(w);
117
- }
118
- o[--a] = w;
119
- }
120
- }
121
- }
122
- function e(s) {
123
- for (var i = /* @__PURE__ */ new Set(), a = 0, o = s.length; a < o; a++) {
124
- var u = s[a];
125
- i.add(u[0]), i.add(u[1]);
126
- }
127
- return Array.from(i);
128
- }
129
- function r(s) {
130
- for (var i = /* @__PURE__ */ new Map(), a = 0, o = s.length; a < o; a++) {
131
- var u = s[a];
132
- i.has(u[0]) || i.set(u[0], /* @__PURE__ */ new Set()), i.has(u[1]) || i.set(u[1], /* @__PURE__ */ new Set()), i.get(u[0]).add(u[1]);
133
- }
134
- return i;
135
- }
136
- function n(s) {
137
- for (var i = /* @__PURE__ */ new Map(), a = 0, o = s.length; a < o; a++)
138
- i.set(s[a], a);
139
- return i;
140
- }
141
- return ae.exports;
142
- }
143
- Ut();
144
- const qt = Object.prototype.toString, zt = Error.prototype.toString, Ht = RegExp.prototype.toString, Vt = typeof Symbol < "u" ? Symbol.prototype.toString : () => "", Gt = /^Symbol\((.*)\)(.*)$/;
145
- function Jt(t) {
146
- return t != +t ? "NaN" : t === 0 && 1 / t < 0 ? "-0" : "" + t;
147
- }
148
- function Ue(t, e = !1) {
149
- if (t == null || t === !0 || t === !1) return "" + t;
150
- const r = typeof t;
151
- if (r === "number") return Jt(t);
152
- if (r === "string") return e ? `"${t}"` : t;
153
- if (r === "function") return "[Function " + (t.name || "anonymous") + "]";
154
- if (r === "symbol") return Vt.call(t).replace(Gt, "Symbol($1)");
155
- const n = qt.call(t).slice(8, -1);
156
- return n === "Date" ? isNaN(t.getTime()) ? "" + t : t.toISOString(t) : n === "Error" || t instanceof Error ? "[" + zt.call(t) + "]" : n === "RegExp" ? Ht.call(t) : null;
157
- }
158
- function L(t, e) {
159
- let r = Ue(t, e);
160
- return r !== null ? r : JSON.stringify(t, function(n, s) {
161
- let i = Ue(this[n], e);
162
- return i !== null ? i : s;
163
- }, 2);
164
- }
165
- function nt(t) {
166
- return t == null ? [] : [].concat(t);
167
- }
168
- let st, it, at, Kt = /\$\{\s*(\w+)\s*\}/g;
169
- st = Symbol.toStringTag;
170
- class qe {
171
- constructor(e, r, n, s) {
172
- this.name = void 0, this.message = void 0, this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = void 0, this.inner = void 0, this[st] = "Error", this.name = "ValidationError", this.value = r, this.path = n, this.type = s, this.errors = [], this.inner = [], nt(e).forEach((i) => {
173
- if (D.isError(i)) {
174
- this.errors.push(...i.errors);
175
- const a = i.inner.length ? i.inner : [i];
176
- this.inner.push(...a);
177
- } else
178
- this.errors.push(i);
179
- }), this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0];
180
- }
181
- }
182
- it = Symbol.hasInstance;
183
- at = Symbol.toStringTag;
184
- class D extends Error {
185
- static formatError(e, r) {
186
- const n = r.label || r.path || "this";
187
- return r = Object.assign({}, r, {
188
- path: n,
189
- originalPath: r.path
190
- }), typeof e == "string" ? e.replace(Kt, (s, i) => L(r[i])) : typeof e == "function" ? e(r) : e;
191
- }
192
- static isError(e) {
193
- return e && e.name === "ValidationError";
194
- }
195
- constructor(e, r, n, s, i) {
196
- const a = new qe(e, r, n, s);
197
- if (i)
198
- return a;
199
- super(), this.value = void 0, this.path = void 0, this.type = void 0, this.params = void 0, this.errors = [], this.inner = [], this[at] = "Error", this.name = a.name, this.message = a.message, this.type = a.type, this.value = a.value, this.path = a.path, this.errors = a.errors, this.inner = a.inner, Error.captureStackTrace && Error.captureStackTrace(this, D);
200
- }
201
- static [it](e) {
202
- return qe[Symbol.hasInstance](e) || super[Symbol.hasInstance](e);
203
- }
204
- }
205
- let M = {
206
- default: "${path} is invalid",
207
- required: "${path} is a required field",
208
- defined: "${path} must be defined",
209
- notNull: "${path} cannot be null",
210
- oneOf: "${path} must be one of the following values: ${values}",
211
- notOneOf: "${path} must not be one of the following values: ${values}",
212
- notType: ({
213
- path: t,
214
- type: e,
215
- value: r,
216
- originalValue: n
217
- }) => {
218
- const s = n != null && n !== r ? ` (cast from the value \`${L(n, !0)}\`).` : ".";
219
- return e !== "mixed" ? `${t} must be a \`${e}\` type, but the final value was: \`${L(r, !0)}\`` + s : `${t} must match the configured type. The validated value was: \`${L(r, !0)}\`` + s;
220
- }
221
- }, _ = {
222
- length: "${path} must be exactly ${length} characters",
223
- min: "${path} must be at least ${min} characters",
224
- max: "${path} must be at most ${max} characters",
225
- matches: '${path} must match the following: "${regex}"',
226
- email: "${path} must be a valid email",
227
- url: "${path} must be a valid URL",
228
- uuid: "${path} must be a valid UUID",
229
- datetime: "${path} must be a valid ISO date-time",
230
- datetime_precision: "${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",
231
- datetime_offset: '${path} must be a valid ISO date-time with UTC "Z" timezone',
232
- trim: "${path} must be a trimmed string",
233
- lowercase: "${path} must be a lowercase string",
234
- uppercase: "${path} must be a upper case string"
235
- }, Yt = {
236
- min: "${path} must be greater than or equal to ${min}",
237
- max: "${path} must be less than or equal to ${max}",
238
- lessThan: "${path} must be less than ${less}",
239
- moreThan: "${path} must be greater than ${more}",
240
- positive: "${path} must be a positive number",
241
- negative: "${path} must be a negative number",
242
- integer: "${path} must be an integer"
243
- }, Oe = {
244
- min: "${path} field must be later than ${min}",
245
- max: "${path} field must be at earlier than ${max}"
246
- }, Wt = {
247
- isValue: "${path} field must be ${value}"
248
- }, Xt = {
249
- noUnknown: "${path} field has unspecified keys: ${unknown}",
250
- exact: "${path} object contains unknown properties: ${properties}"
251
- }, Zt = {
252
- min: "${path} field must have at least ${min} items",
253
- max: "${path} field must have less than or equal to ${max} items",
254
- length: "${path} must have ${length} items"
255
- }, Qt = {
256
- notType: (t) => {
257
- const {
258
- path: e,
259
- value: r,
260
- spec: n
261
- } = t, s = n.types.length;
262
- if (Array.isArray(r)) {
263
- if (r.length < s) return `${e} tuple value has too few items, expected a length of ${s} but got ${r.length} for value: \`${L(r, !0)}\``;
264
- if (r.length > s) return `${e} tuple value has too many items, expected a length of ${s} but got ${r.length} for value: \`${L(r, !0)}\``;
265
- }
266
- return D.formatError(M.notType, t);
267
- }
268
- };
269
- Object.assign(/* @__PURE__ */ Object.create(null), {
270
- mixed: M,
271
- string: _,
272
- number: Yt,
273
- date: Oe,
274
- object: Xt,
275
- array: Zt,
276
- boolean: Wt,
277
- tuple: Qt
278
- });
279
- const ot = (t) => t && t.__isYupSchema__;
280
- class fe {
281
- static fromOptions(e, r) {
282
- if (!r.then && !r.otherwise) throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");
283
- let {
284
- is: n,
285
- then: s,
286
- otherwise: i
287
- } = r, a = typeof n == "function" ? n : (...o) => o.every((u) => u === n);
288
- return new fe(e, (o, u) => {
289
- var c;
290
- let f = a(...o) ? s : i;
291
- return (c = f?.(u)) != null ? c : u;
292
- });
293
- }
294
- constructor(e, r) {
295
- this.fn = void 0, this.refs = e, this.refs = e, this.fn = r;
296
- }
297
- resolve(e, r) {
298
- let n = this.refs.map((i) => (
299
- // TODO: ? operator here?
300
- i.getValue(r?.value, r?.parent, r?.context)
301
- )), s = this.fn(n, e, r);
302
- if (s === void 0 || // @ts-ignore this can be base
303
- s === e)
304
- return e;
305
- if (!ot(s)) throw new TypeError("conditions must return a schema object");
306
- return s.resolve(r);
307
- }
308
- }
309
- const oe = {
310
- context: "$",
311
- value: "."
312
- };
313
- class Q {
314
- constructor(e, r = {}) {
315
- if (this.key = void 0, this.isContext = void 0, this.isValue = void 0, this.isSibling = void 0, this.path = void 0, this.getter = void 0, this.map = void 0, typeof e != "string") throw new TypeError("ref must be a string, got: " + e);
316
- if (this.key = e.trim(), e === "") throw new TypeError("ref must be a non-empty string");
317
- this.isContext = this.key[0] === oe.context, this.isValue = this.key[0] === oe.value, this.isSibling = !this.isContext && !this.isValue;
318
- let n = this.isContext ? oe.context : this.isValue ? oe.value : "";
319
- this.path = this.key.slice(n.length), this.getter = this.path && rt.getter(this.path, !0), this.map = r.map;
320
- }
321
- getValue(e, r, n) {
322
- let s = this.isContext ? n : this.isValue ? e : r;
323
- return this.getter && (s = this.getter(s || {})), this.map && (s = this.map(s)), s;
324
- }
325
- /**
326
- *
327
- * @param {*} value
328
- * @param {Object} options
329
- * @param {Object=} options.context
330
- * @param {Object=} options.parent
331
- */
332
- cast(e, r) {
333
- return this.getValue(e, r?.parent, r?.context);
334
- }
335
- resolve() {
336
- return this;
337
- }
338
- describe() {
339
- return {
340
- type: "ref",
341
- key: this.key
342
- };
343
- }
344
- toString() {
345
- return `Ref(${this.key})`;
346
- }
347
- static isRef(e) {
348
- return e && e.__isYupRef;
349
- }
350
- }
351
- Q.prototype.__isYupRef = !0;
352
- const q = (t) => t == null;
353
- function G(t) {
354
- function e({
355
- value: r,
356
- path: n = "",
357
- options: s,
358
- originalValue: i,
359
- schema: a
360
- }, o, u) {
361
- const {
362
- name: c,
363
- test: f,
364
- params: h,
365
- message: y,
366
- skipAbsent: w
367
- } = t;
368
- let {
369
- parent: p,
370
- context: g,
371
- abortEarly: m = a.spec.abortEarly,
372
- disableStackTrace: d = a.spec.disableStackTrace
373
- } = s;
374
- const b = {
375
- value: r,
376
- parent: p,
377
- context: g
378
- };
379
- function E(R = {}) {
380
- const ie = lt(Object.assign({
381
- value: r,
382
- originalValue: i,
383
- label: a.spec.label,
384
- path: R.path || n,
385
- spec: a.spec,
386
- disableStackTrace: R.disableStackTrace || d
387
- }, h, R.params), b), je = new D(D.formatError(R.message || y, ie), r, ie.path, R.type || c, ie.disableStackTrace);
388
- return je.params = ie, je;
389
- }
390
- const O = m ? o : u;
391
- let T = {
392
- path: n,
393
- parent: p,
394
- type: c,
395
- from: s.from,
396
- createError: E,
397
- resolve(R) {
398
- return ut(R, b);
399
- },
400
- options: s,
401
- originalValue: i,
402
- schema: a
403
- };
404
- const v = (R) => {
405
- D.isError(R) ? O(R) : R ? u(null) : O(E());
406
- }, x = (R) => {
407
- D.isError(R) ? O(R) : o(R);
408
- };
409
- if (w && q(r))
410
- return v(!0);
411
- let k;
412
- try {
413
- var Me;
414
- if (k = f.call(T, r, T), typeof ((Me = k) == null ? void 0 : Me.then) == "function") {
415
- if (s.sync)
416
- throw new Error(`Validation test of type: "${T.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);
417
- return Promise.resolve(k).then(v, x);
418
- }
419
- } catch (R) {
420
- x(R);
421
- return;
422
- }
423
- v(k);
424
- }
425
- return e.OPTIONS = t, e;
426
- }
427
- function lt(t, e) {
428
- if (!t) return t;
429
- for (const r of Object.keys(t))
430
- t[r] = ut(t[r], e);
431
- return t;
432
- }
433
- function ut(t, e) {
434
- return Q.isRef(t) ? t.getValue(e.value, e.parent, e.context) : t;
435
- }
436
- function er(t, e, r, n = r) {
437
- let s, i, a;
438
- return e ? (rt.forEach(e, (o, u, c) => {
439
- let f = u ? o.slice(1, o.length - 1) : o;
440
- t = t.resolve({
441
- context: n,
442
- parent: s,
443
- value: r
444
- });
445
- let h = t.type === "tuple", y = c ? parseInt(f, 10) : 0;
446
- if (t.innerType || h) {
447
- if (h && !c) throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);
448
- if (r && y >= r.length)
449
- throw new Error(`Yup.reach cannot resolve an array item at index: ${o}, in the path: ${e}. because there is no value at that index. `);
450
- s = r, r = r && r[y], t = h ? t.spec.types[y] : t.innerType;
451
- }
452
- if (!c) {
453
- if (!t.fields || !t.fields[f]) throw new Error(`The schema does not contain the path: ${e}. (failed at: ${a} which is a type: "${t.type}")`);
454
- s = r, r = r && r[f], t = t.fields[f];
455
- }
456
- i = f, a = u ? "[" + o + "]" : "." + o;
457
- }), {
458
- schema: t,
459
- parent: s,
460
- parentPath: i
461
- }) : {
462
- parent: s,
463
- parentPath: e,
464
- schema: t
465
- };
466
- }
467
- class he extends Set {
468
- describe() {
469
- const e = [];
470
- for (const r of this.values())
471
- e.push(Q.isRef(r) ? r.describe() : r);
472
- return e;
473
- }
474
- resolveAll(e) {
475
- let r = [];
476
- for (const n of this.values())
477
- r.push(e(n));
478
- return r;
479
- }
480
- clone() {
481
- return new he(this.values());
482
- }
483
- merge(e, r) {
484
- const n = this.clone();
485
- return e.forEach((s) => n.add(s)), r.forEach((s) => n.delete(s)), n;
486
- }
487
- }
488
- function J(t, e = /* @__PURE__ */ new Map()) {
489
- if (ot(t) || !t || typeof t != "object") return t;
490
- if (e.has(t)) return e.get(t);
491
- let r;
492
- if (t instanceof Date)
493
- r = new Date(t.getTime()), e.set(t, r);
494
- else if (t instanceof RegExp)
495
- r = new RegExp(t), e.set(t, r);
496
- else if (Array.isArray(t)) {
497
- r = new Array(t.length), e.set(t, r);
498
- for (let n = 0; n < t.length; n++) r[n] = J(t[n], e);
499
- } else if (t instanceof Map) {
500
- r = /* @__PURE__ */ new Map(), e.set(t, r);
501
- for (const [n, s] of t.entries()) r.set(n, J(s, e));
502
- } else if (t instanceof Set) {
503
- r = /* @__PURE__ */ new Set(), e.set(t, r);
504
- for (const n of t) r.add(J(n, e));
505
- } else if (t instanceof Object) {
506
- r = {}, e.set(t, r);
507
- for (const [n, s] of Object.entries(t)) r[n] = J(s, e);
508
- } else
509
- throw Error(`Unable to clone ${t}`);
510
- return r;
511
- }
512
- function tr(t) {
513
- if (!(t != null && t.length))
514
- return;
515
- const e = [];
516
- let r = "", n = !1, s = !1;
517
- for (let i = 0; i < t.length; i++) {
518
- const a = t[i];
519
- if (a === "[" && !s) {
520
- r && (e.push(...r.split(".").filter(Boolean)), r = ""), n = !0;
521
- continue;
522
- }
523
- if (a === "]" && !s) {
524
- r && (/^\d+$/.test(r) ? e.push(r) : e.push(r.replace(/^"|"$/g, "")), r = ""), n = !1;
525
- continue;
526
- }
527
- if (a === '"') {
528
- s = !s;
529
- continue;
530
- }
531
- if (a === "." && !n && !s) {
532
- r && (e.push(r), r = "");
533
- continue;
534
- }
535
- r += a;
536
- }
537
- return r && e.push(...r.split(".").filter(Boolean)), e;
538
- }
539
- function rr(t, e) {
540
- const r = e ? `${e}.${t.path}` : t.path;
541
- return t.errors.map((n) => ({
542
- message: n,
543
- path: tr(r)
544
- }));
545
- }
546
- function ct(t, e) {
547
- var r;
548
- if (!((r = t.inner) != null && r.length) && t.errors.length)
549
- return rr(t, e);
550
- const n = e ? `${e}.${t.path}` : t.path;
551
- return t.inner.flatMap((s) => ct(s, n));
552
- }
553
- class U {
554
- constructor(e) {
555
- this.type = void 0, this.deps = [], this.tests = void 0, this.transforms = void 0, this.conditions = [], this._mutate = void 0, this.internalTests = {}, this._whitelist = new he(), this._blacklist = new he(), this.exclusiveTests = /* @__PURE__ */ Object.create(null), this._typeCheck = void 0, this.spec = void 0, this.tests = [], this.transforms = [], this.withMutation(() => {
556
- this.typeError(M.notType);
557
- }), this.type = e.type, this._typeCheck = e.check, this.spec = Object.assign({
558
- strip: !1,
559
- strict: !1,
560
- abortEarly: !0,
561
- recursive: !0,
562
- disableStackTrace: !1,
563
- nullable: !1,
564
- optional: !0,
565
- coerce: !0
566
- }, e?.spec), this.withMutation((r) => {
567
- r.nonNullable();
568
- });
569
- }
570
- // TODO: remove
571
- get _type() {
572
- return this.type;
573
- }
574
- clone(e) {
575
- if (this._mutate)
576
- return e && Object.assign(this.spec, e), this;
577
- const r = Object.create(Object.getPrototypeOf(this));
578
- return r.type = this.type, r._typeCheck = this._typeCheck, r._whitelist = this._whitelist.clone(), r._blacklist = this._blacklist.clone(), r.internalTests = Object.assign({}, this.internalTests), r.exclusiveTests = Object.assign({}, this.exclusiveTests), r.deps = [...this.deps], r.conditions = [...this.conditions], r.tests = [...this.tests], r.transforms = [...this.transforms], r.spec = J(Object.assign({}, this.spec, e)), r;
579
- }
580
- label(e) {
581
- let r = this.clone();
582
- return r.spec.label = e, r;
583
- }
584
- meta(...e) {
585
- if (e.length === 0) return this.spec.meta;
586
- let r = this.clone();
587
- return r.spec.meta = Object.assign(r.spec.meta || {}, e[0]), r;
588
- }
589
- withMutation(e) {
590
- let r = this._mutate;
591
- this._mutate = !0;
592
- let n = e(this);
593
- return this._mutate = r, n;
594
- }
595
- concat(e) {
596
- if (!e || e === this) return this;
597
- if (e.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);
598
- let r = this, n = e.clone();
599
- const s = Object.assign({}, r.spec, n.spec);
600
- return n.spec = s, n.internalTests = Object.assign({}, r.internalTests, n.internalTests), n._whitelist = r._whitelist.merge(e._whitelist, e._blacklist), n._blacklist = r._blacklist.merge(e._blacklist, e._whitelist), n.tests = r.tests, n.exclusiveTests = r.exclusiveTests, n.withMutation((i) => {
601
- e.tests.forEach((a) => {
602
- i.test(a.OPTIONS);
603
- });
604
- }), n.transforms = [...r.transforms, ...n.transforms], n;
605
- }
606
- isType(e) {
607
- return e == null ? !!(this.spec.nullable && e === null || this.spec.optional && e === void 0) : this._typeCheck(e);
608
- }
609
- resolve(e) {
610
- let r = this;
611
- if (r.conditions.length) {
612
- let n = r.conditions;
613
- r = r.clone(), r.conditions = [], r = n.reduce((s, i) => i.resolve(s, e), r), r = r.resolve(e);
614
- }
615
- return r;
616
- }
617
- resolveOptions(e) {
618
- var r, n, s, i;
619
- return Object.assign({}, e, {
620
- from: e.from || [],
621
- strict: (r = e.strict) != null ? r : this.spec.strict,
622
- abortEarly: (n = e.abortEarly) != null ? n : this.spec.abortEarly,
623
- recursive: (s = e.recursive) != null ? s : this.spec.recursive,
624
- disableStackTrace: (i = e.disableStackTrace) != null ? i : this.spec.disableStackTrace
625
- });
626
- }
627
- /**
628
- * Run the configured transform pipeline over an input value.
629
- */
630
- cast(e, r = {}) {
631
- let n = this.resolve(Object.assign({}, r, {
632
- value: e
633
- // parent: options.parent,
634
- // context: options.context,
635
- })), s = r.assert === "ignore-optionality", i = n._cast(e, r);
636
- if (r.assert !== !1 && !n.isType(i)) {
637
- if (s && q(i))
638
- return i;
639
- let a = L(e), o = L(i);
640
- throw new TypeError(`The value of ${r.path || "field"} could not be cast to a value that satisfies the schema type: "${n.type}".
641
-
642
- attempted value: ${a}
643
- ` + (o !== a ? `result of cast: ${o}` : ""));
644
- }
645
- return i;
646
- }
647
- _cast(e, r) {
648
- let n = e === void 0 ? e : this.transforms.reduce((s, i) => i.call(this, s, e, this, r), e);
649
- return n === void 0 && (n = this.getDefault(r)), n;
650
- }
651
- _validate(e, r = {}, n, s) {
652
- let {
653
- path: i,
654
- originalValue: a = e,
655
- strict: o = this.spec.strict
656
- } = r, u = e;
657
- o || (u = this._cast(u, Object.assign({
658
- assert: !1
659
- }, r)));
660
- let c = [];
661
- for (let f of Object.values(this.internalTests))
662
- f && c.push(f);
663
- this.runTests({
664
- path: i,
665
- value: u,
666
- originalValue: a,
667
- options: r,
668
- tests: c
669
- }, n, (f) => {
670
- if (f.length)
671
- return s(f, u);
672
- this.runTests({
673
- path: i,
674
- value: u,
675
- originalValue: a,
676
- options: r,
677
- tests: this.tests
678
- }, n, s);
679
- });
680
- }
681
- /**
682
- * Executes a set of validations, either schema, produced Tests or a nested
683
- * schema validate result.
684
- */
685
- runTests(e, r, n) {
686
- let s = !1, {
687
- tests: i,
688
- value: a,
689
- originalValue: o,
690
- path: u,
691
- options: c
692
- } = e, f = (g) => {
693
- s || (s = !0, r(g, a));
694
- }, h = (g) => {
695
- s || (s = !0, n(g, a));
696
- }, y = i.length, w = [];
697
- if (!y) return h([]);
698
- let p = {
699
- value: a,
700
- originalValue: o,
701
- path: u,
702
- options: c,
703
- schema: this
704
- };
705
- for (let g = 0; g < i.length; g++) {
706
- const m = i[g];
707
- m(p, f, function(b) {
708
- b && (Array.isArray(b) ? w.push(...b) : w.push(b)), --y <= 0 && h(w);
709
- });
710
- }
711
- }
712
- asNestedTest({
713
- key: e,
714
- index: r,
715
- parent: n,
716
- parentPath: s,
717
- originalParent: i,
718
- options: a
719
- }) {
720
- const o = e ?? r;
721
- if (o == null)
722
- throw TypeError("Must include `key` or `index` for nested validations");
723
- const u = typeof o == "number";
724
- let c = n[o];
725
- const f = Object.assign({}, a, {
726
- // Nested validations fields are always strict:
727
- // 1. parent isn't strict so the casting will also have cast inner values
728
- // 2. parent is strict in which case the nested values weren't cast either
729
- strict: !0,
730
- parent: n,
731
- value: c,
732
- originalValue: i[o],
733
- // FIXME: tests depend on `index` being passed around deeply,
734
- // we should not let the options.key/index bleed through
735
- key: void 0,
736
- // index: undefined,
737
- [u ? "index" : "key"]: o,
738
- path: u || o.includes(".") ? `${s || ""}[${u ? o : `"${o}"`}]` : (s ? `${s}.` : "") + e
739
- });
740
- return (h, y, w) => this.resolve(f)._validate(c, f, y, w);
741
- }
742
- validate(e, r) {
743
- var n;
744
- let s = this.resolve(Object.assign({}, r, {
745
- value: e
746
- })), i = (n = r?.disableStackTrace) != null ? n : s.spec.disableStackTrace;
747
- return new Promise((a, o) => s._validate(e, r, (u, c) => {
748
- D.isError(u) && (u.value = c), o(u);
749
- }, (u, c) => {
750
- u.length ? o(new D(u, c, void 0, void 0, i)) : a(c);
751
- }));
752
- }
753
- validateSync(e, r) {
754
- var n;
755
- let s = this.resolve(Object.assign({}, r, {
756
- value: e
757
- })), i, a = (n = r?.disableStackTrace) != null ? n : s.spec.disableStackTrace;
758
- return s._validate(e, Object.assign({}, r, {
759
- sync: !0
760
- }), (o, u) => {
761
- throw D.isError(o) && (o.value = u), o;
762
- }, (o, u) => {
763
- if (o.length) throw new D(o, e, void 0, void 0, a);
764
- i = u;
765
- }), i;
766
- }
767
- isValid(e, r) {
768
- return this.validate(e, r).then(() => !0, (n) => {
769
- if (D.isError(n)) return !1;
770
- throw n;
771
- });
772
- }
773
- isValidSync(e, r) {
774
- try {
775
- return this.validateSync(e, r), !0;
776
- } catch (n) {
777
- if (D.isError(n)) return !1;
778
- throw n;
779
- }
780
- }
781
- _getDefault(e) {
782
- let r = this.spec.default;
783
- return r == null ? r : typeof r == "function" ? r.call(this, e) : J(r);
784
- }
785
- getDefault(e) {
786
- return this.resolve(e || {})._getDefault(e);
787
- }
788
- default(e) {
789
- return arguments.length === 0 ? this._getDefault() : this.clone({
790
- default: e
791
- });
792
- }
793
- strict(e = !0) {
794
- return this.clone({
795
- strict: e
796
- });
797
- }
798
- nullability(e, r) {
799
- const n = this.clone({
800
- nullable: e
801
- });
802
- return n.internalTests.nullable = G({
803
- message: r,
804
- name: "nullable",
805
- test(s) {
806
- return s === null ? this.schema.spec.nullable : !0;
807
- }
808
- }), n;
809
- }
810
- optionality(e, r) {
811
- const n = this.clone({
812
- optional: e
813
- });
814
- return n.internalTests.optionality = G({
815
- message: r,
816
- name: "optionality",
817
- test(s) {
818
- return s === void 0 ? this.schema.spec.optional : !0;
819
- }
820
- }), n;
821
- }
822
- optional() {
823
- return this.optionality(!0);
824
- }
825
- defined(e = M.defined) {
826
- return this.optionality(!1, e);
827
- }
828
- nullable() {
829
- return this.nullability(!0);
830
- }
831
- nonNullable(e = M.notNull) {
832
- return this.nullability(!1, e);
833
- }
834
- required(e = M.required) {
835
- return this.clone().withMutation((r) => r.nonNullable(e).defined(e));
836
- }
837
- notRequired() {
838
- return this.clone().withMutation((e) => e.nullable().optional());
839
- }
840
- transform(e) {
841
- let r = this.clone();
842
- return r.transforms.push(e), r;
843
- }
844
- /**
845
- * Adds a test function to the schema's queue of tests.
846
- * tests can be exclusive or non-exclusive.
847
- *
848
- * - exclusive tests, will replace any existing tests of the same name.
849
- * - non-exclusive: can be stacked
850
- *
851
- * If a non-exclusive test is added to a schema with an exclusive test of the same name
852
- * the exclusive test is removed and further tests of the same name will be stacked.
853
- *
854
- * If an exclusive test is added to a schema with non-exclusive tests of the same name
855
- * the previous tests are removed and further tests of the same name will replace each other.
856
- */
857
- test(...e) {
858
- let r;
859
- if (e.length === 1 ? typeof e[0] == "function" ? r = {
860
- test: e[0]
861
- } : r = e[0] : e.length === 2 ? r = {
862
- name: e[0],
863
- test: e[1]
864
- } : r = {
865
- name: e[0],
866
- message: e[1],
867
- test: e[2]
868
- }, r.message === void 0 && (r.message = M.default), typeof r.test != "function") throw new TypeError("`test` is a required parameters");
869
- let n = this.clone(), s = G(r), i = r.exclusive || r.name && n.exclusiveTests[r.name] === !0;
870
- if (r.exclusive && !r.name)
871
- throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");
872
- return r.name && (n.exclusiveTests[r.name] = !!r.exclusive), n.tests = n.tests.filter((a) => !(a.OPTIONS.name === r.name && (i || a.OPTIONS.test === s.OPTIONS.test))), n.tests.push(s), n;
873
- }
874
- when(e, r) {
875
- !Array.isArray(e) && typeof e != "string" && (r = e, e = ".");
876
- let n = this.clone(), s = nt(e).map((i) => new Q(i));
877
- return s.forEach((i) => {
878
- i.isSibling && n.deps.push(i.key);
879
- }), n.conditions.push(typeof r == "function" ? new fe(s, r) : fe.fromOptions(s, r)), n;
880
- }
881
- typeError(e) {
882
- let r = this.clone();
883
- return r.internalTests.typeError = G({
884
- message: e,
885
- name: "typeError",
886
- skipAbsent: !0,
887
- test(n) {
888
- return this.schema._typeCheck(n) ? !0 : this.createError({
889
- params: {
890
- type: this.schema.type
891
- }
892
- });
893
- }
894
- }), r;
895
- }
896
- oneOf(e, r = M.oneOf) {
897
- let n = this.clone();
898
- return e.forEach((s) => {
899
- n._whitelist.add(s), n._blacklist.delete(s);
900
- }), n.internalTests.whiteList = G({
901
- message: r,
902
- name: "oneOf",
903
- skipAbsent: !0,
904
- test(s) {
905
- let i = this.schema._whitelist, a = i.resolveAll(this.resolve);
906
- return a.includes(s) ? !0 : this.createError({
907
- params: {
908
- values: Array.from(i).join(", "),
909
- resolved: a
910
- }
911
- });
912
- }
913
- }), n;
914
- }
915
- notOneOf(e, r = M.notOneOf) {
916
- let n = this.clone();
917
- return e.forEach((s) => {
918
- n._blacklist.add(s), n._whitelist.delete(s);
919
- }), n.internalTests.blacklist = G({
920
- message: r,
921
- name: "notOneOf",
922
- test(s) {
923
- let i = this.schema._blacklist, a = i.resolveAll(this.resolve);
924
- return a.includes(s) ? this.createError({
925
- params: {
926
- values: Array.from(i).join(", "),
927
- resolved: a
928
- }
929
- }) : !0;
930
- }
931
- }), n;
932
- }
933
- strip(e = !0) {
934
- let r = this.clone();
935
- return r.spec.strip = e, r;
936
- }
937
- /**
938
- * Return a serialized description of the schema including validations, flags, types etc.
939
- *
940
- * @param options Provide any needed context for resolving runtime schema alterations (lazy, when conditions, etc).
941
- */
942
- describe(e) {
943
- const r = (e ? this.resolve(e) : this).clone(), {
944
- label: n,
945
- meta: s,
946
- optional: i,
947
- nullable: a
948
- } = r.spec;
949
- return {
950
- meta: s,
951
- label: n,
952
- optional: i,
953
- nullable: a,
954
- default: r.getDefault(e),
955
- type: r.type,
956
- oneOf: r._whitelist.describe(),
957
- notOneOf: r._blacklist.describe(),
958
- tests: r.tests.filter((u, c, f) => f.findIndex((h) => h.OPTIONS.name === u.OPTIONS.name) === c).map((u) => {
959
- const c = u.OPTIONS.params && e ? lt(Object.assign({}, u.OPTIONS.params), e) : u.OPTIONS.params;
960
- return {
961
- name: u.OPTIONS.name,
962
- params: c
963
- };
964
- })
965
- };
966
- }
967
- get "~standard"() {
968
- const e = this;
969
- return {
970
- version: 1,
971
- vendor: "yup",
972
- async validate(n) {
973
- try {
974
- return {
975
- value: await e.validate(n, {
976
- abortEarly: !1
977
- })
978
- };
979
- } catch (s) {
980
- if (s instanceof D)
981
- return {
982
- issues: ct(s)
983
- };
984
- throw s;
985
- }
986
- }
987
- };
988
- }
989
- }
990
- U.prototype.__isYupSchema__ = !0;
991
- for (const t of ["validate", "validateSync"]) U.prototype[`${t}At`] = function(e, r, n = {}) {
992
- const {
993
- parent: s,
994
- parentPath: i,
995
- schema: a
996
- } = er(this, e, r, n.context);
997
- return a[t](s && s[i], Object.assign({}, n, {
998
- parent: s,
999
- path: e
1000
- }));
1001
- };
1002
- for (const t of ["equals", "is"]) U.prototype[t] = U.prototype.oneOf;
1003
- for (const t of ["not", "nope"]) U.prototype[t] = U.prototype.notOneOf;
1004
- const nr = /^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;
1005
- function sr(t) {
1006
- const e = xe(t);
1007
- if (!e) return Date.parse ? Date.parse(t) : Number.NaN;
1008
- if (e.z === void 0 && e.plusMinus === void 0)
1009
- return new Date(e.year, e.month, e.day, e.hour, e.minute, e.second, e.millisecond).valueOf();
1010
- let r = 0;
1011
- return e.z !== "Z" && e.plusMinus !== void 0 && (r = e.hourOffset * 60 + e.minuteOffset, e.plusMinus === "+" && (r = 0 - r)), Date.UTC(e.year, e.month, e.day, e.hour, e.minute + r, e.second, e.millisecond);
1012
- }
1013
- function xe(t) {
1014
- var e, r;
1015
- const n = nr.exec(t);
1016
- return n ? {
1017
- year: j(n[1]),
1018
- month: j(n[2], 1) - 1,
1019
- day: j(n[3], 1),
1020
- hour: j(n[4]),
1021
- minute: j(n[5]),
1022
- second: j(n[6]),
1023
- millisecond: n[7] ? (
1024
- // allow arbitrary sub-second precision beyond milliseconds
1025
- j(n[7].substring(0, 3))
1026
- ) : 0,
1027
- precision: (e = (r = n[7]) == null ? void 0 : r.length) != null ? e : void 0,
1028
- z: n[8] || void 0,
1029
- plusMinus: n[9] || void 0,
1030
- hourOffset: j(n[10]),
1031
- minuteOffset: j(n[11])
1032
- } : null;
1033
- }
1034
- function j(t, e = 0) {
1035
- return Number(t) || e;
1036
- }
1037
- let ir = (
1038
- // eslint-disable-next-line
1039
- /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
1040
- ), ar = (
1041
- // eslint-disable-next-line
1042
- /^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i
1043
- ), or = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, lr = "^\\d{4}-\\d{2}-\\d{2}", ur = "\\d{2}:\\d{2}:\\d{2}", cr = "(([+-]\\d{2}(:?\\d{2})?)|Z)", fr = new RegExp(`${lr}T${ur}(\\.\\d+)?${cr}$`), hr = (t) => q(t) || t === t.trim(), dr = {}.toString();
1044
- function pr() {
1045
- return new ft();
1046
- }
1047
- class ft extends U {
1048
- constructor() {
1049
- super({
1050
- type: "string",
1051
- check(e) {
1052
- return e instanceof String && (e = e.valueOf()), typeof e == "string";
1053
- }
1054
- }), this.withMutation(() => {
1055
- this.transform((e, r) => {
1056
- if (!this.spec.coerce || this.isType(e) || Array.isArray(e)) return e;
1057
- const n = e != null && e.toString ? e.toString() : e;
1058
- return n === dr ? e : n;
1059
- });
1060
- });
1061
- }
1062
- required(e) {
1063
- return super.required(e).withMutation((r) => r.test({
1064
- message: e || M.required,
1065
- name: "required",
1066
- skipAbsent: !0,
1067
- test: (n) => !!n.length
1068
- }));
1069
- }
1070
- notRequired() {
1071
- return super.notRequired().withMutation((e) => (e.tests = e.tests.filter((r) => r.OPTIONS.name !== "required"), e));
1072
- }
1073
- length(e, r = _.length) {
1074
- return this.test({
1075
- message: r,
1076
- name: "length",
1077
- exclusive: !0,
1078
- params: {
1079
- length: e
1080
- },
1081
- skipAbsent: !0,
1082
- test(n) {
1083
- return n.length === this.resolve(e);
1084
- }
1085
- });
1086
- }
1087
- min(e, r = _.min) {
1088
- return this.test({
1089
- message: r,
1090
- name: "min",
1091
- exclusive: !0,
1092
- params: {
1093
- min: e
1094
- },
1095
- skipAbsent: !0,
1096
- test(n) {
1097
- return n.length >= this.resolve(e);
1098
- }
1099
- });
1100
- }
1101
- max(e, r = _.max) {
1102
- return this.test({
1103
- name: "max",
1104
- exclusive: !0,
1105
- message: r,
1106
- params: {
1107
- max: e
1108
- },
1109
- skipAbsent: !0,
1110
- test(n) {
1111
- return n.length <= this.resolve(e);
1112
- }
1113
- });
1114
- }
1115
- matches(e, r) {
1116
- let n = !1, s, i;
1117
- return r && (typeof r == "object" ? {
1118
- excludeEmptyString: n = !1,
1119
- message: s,
1120
- name: i
1121
- } = r : s = r), this.test({
1122
- name: i || "matches",
1123
- message: s || _.matches,
1124
- params: {
1125
- regex: e
1126
- },
1127
- skipAbsent: !0,
1128
- test: (a) => a === "" && n || a.search(e) !== -1
1129
- });
1130
- }
1131
- email(e = _.email) {
1132
- return this.matches(ir, {
1133
- name: "email",
1134
- message: e,
1135
- excludeEmptyString: !0
1136
- });
1137
- }
1138
- url(e = _.url) {
1139
- return this.matches(ar, {
1140
- name: "url",
1141
- message: e,
1142
- excludeEmptyString: !0
1143
- });
1144
- }
1145
- uuid(e = _.uuid) {
1146
- return this.matches(or, {
1147
- name: "uuid",
1148
- message: e,
1149
- excludeEmptyString: !1
1150
- });
1151
- }
1152
- datetime(e) {
1153
- let r = "", n, s;
1154
- return e && (typeof e == "object" ? {
1155
- message: r = "",
1156
- allowOffset: n = !1,
1157
- precision: s = void 0
1158
- } = e : r = e), this.matches(fr, {
1159
- name: "datetime",
1160
- message: r || _.datetime,
1161
- excludeEmptyString: !0
1162
- }).test({
1163
- name: "datetime_offset",
1164
- message: r || _.datetime_offset,
1165
- params: {
1166
- allowOffset: n
1167
- },
1168
- skipAbsent: !0,
1169
- test: (i) => {
1170
- if (!i || n) return !0;
1171
- const a = xe(i);
1172
- return a ? !!a.z : !1;
1173
- }
1174
- }).test({
1175
- name: "datetime_precision",
1176
- message: r || _.datetime_precision,
1177
- params: {
1178
- precision: s
1179
- },
1180
- skipAbsent: !0,
1181
- test: (i) => {
1182
- if (!i || s == null) return !0;
1183
- const a = xe(i);
1184
- return a ? a.precision === s : !1;
1185
- }
1186
- });
1187
- }
1188
- //-- transforms --
1189
- ensure() {
1190
- return this.default("").transform((e) => e === null ? "" : e);
1191
- }
1192
- trim(e = _.trim) {
1193
- return this.transform((r) => r != null ? r.trim() : r).test({
1194
- message: e,
1195
- name: "trim",
1196
- test: hr
1197
- });
1198
- }
1199
- lowercase(e = _.lowercase) {
1200
- return this.transform((r) => q(r) ? r : r.toLowerCase()).test({
1201
- message: e,
1202
- name: "string_case",
1203
- exclusive: !0,
1204
- skipAbsent: !0,
1205
- test: (r) => q(r) || r === r.toLowerCase()
1206
- });
1207
- }
1208
- uppercase(e = _.uppercase) {
1209
- return this.transform((r) => q(r) ? r : r.toUpperCase()).test({
1210
- message: e,
1211
- name: "string_case",
1212
- exclusive: !0,
1213
- skipAbsent: !0,
1214
- test: (r) => q(r) || r === r.toUpperCase()
1215
- });
1216
- }
1217
- }
1218
- pr.prototype = ft.prototype;
1219
- let mr = /* @__PURE__ */ new Date(""), gr = (t) => Object.prototype.toString.call(t) === "[object Date]";
1220
- class Ce extends U {
1221
- constructor() {
1222
- super({
1223
- type: "date",
1224
- check(e) {
1225
- return gr(e) && !isNaN(e.getTime());
1226
- }
1227
- }), this.withMutation(() => {
1228
- this.transform((e, r) => !this.spec.coerce || this.isType(e) || e === null ? e : (e = sr(e), isNaN(e) ? Ce.INVALID_DATE : new Date(e)));
1229
- });
1230
- }
1231
- prepareParam(e, r) {
1232
- let n;
1233
- if (Q.isRef(e))
1234
- n = e;
1235
- else {
1236
- let s = this.cast(e);
1237
- if (!this._typeCheck(s)) throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);
1238
- n = s;
1239
- }
1240
- return n;
1241
- }
1242
- min(e, r = Oe.min) {
1243
- let n = this.prepareParam(e, "min");
1244
- return this.test({
1245
- message: r,
1246
- name: "min",
1247
- exclusive: !0,
1248
- params: {
1249
- min: e
1250
- },
1251
- skipAbsent: !0,
1252
- test(s) {
1253
- return s >= this.resolve(n);
1254
- }
1255
- });
1256
- }
1257
- max(e, r = Oe.max) {
1258
- let n = this.prepareParam(e, "max");
1259
- return this.test({
1260
- message: r,
1261
- name: "max",
1262
- exclusive: !0,
1263
- params: {
1264
- max: e
1265
- },
1266
- skipAbsent: !0,
1267
- test(s) {
1268
- return s <= this.resolve(n);
1269
- }
1270
- });
1271
- }
1272
- }
1273
- Ce.INVALID_DATE = mr;
1274
- var br = /* @__PURE__ */ ((t) => (t.visitpad = "/md/viewPatientDashboard.php", t.consultations = "/md/viewPatientList.php", t.appointments = "/md/viewPatientAppointments.php", t.settings = "/md/viewPreferenceSettings.php", t.privateDb = "/md/viewPrivateDB.php", t.dashboardBase = "/", t.referEarn = "/md/inviteReferrals.php", t.teleConsults = "/md/viewRemoteAppointments.php", t.pricing = "/subscription/pricing", t.billSummary = "/subscription/bill-summary", t.pediatricsCalculator = "/md/viewPediatricCalculator.php", t))(br || {}), yr = /* @__PURE__ */ ((t) => (t.PRODUCTION = "PRODUCTION", t.STAGING = "STAGING", t.DEVELOPMENT = "DEVELOPMENT", t))(yr || {}), wr = /* @__PURE__ */ ((t) => (t.visitpad = "/md/viewPatientDashboard.php", t.consultations = "/md/viewPatientList.php", t.appointments = "/md/viewPatientAppointments.php", t.settings = "/md/viewPreferenceSettings.php", t.privateDb = "/md/viewPrivateDB.php", t.dashboardBase = "/", t.referEarn = "/md/inviteReferrals.php", t.teleConsults = "/md/viewRemoteAppointments.php", t.pricing = "/subscription/pricing", t.billSummary = "/subscription/bill-summary", t.pediatricsCalculator = "/md/viewPediatricCalculator.php", t))(wr || {});
1275
- const hs = [
1276
- "Salaried Professional",
1277
- "Doctor",
1278
- "Teacher",
1279
- "Accountant",
1280
- "Lawyer",
1281
- "Farmer",
1282
- "Business Owner",
1283
- "Freelancer",
1284
- "Retail Worker",
1285
- "Others"
1286
- ], ds = [
1287
- "Visakhapatnam",
1288
- "Vijayawada",
1289
- "Guntur",
1290
- "Nellore",
1291
- "Kurnool",
1292
- "Rajahmundry",
1293
- "Tirupati",
1294
- "Kadapa",
1295
- "Kakinada",
1296
- "Eluru",
1297
- "Anantapur",
1298
- "Vijayanagaram",
1299
- "Ongole",
1300
- "Nandyal",
1301
- "Chittoor",
1302
- "Machilipatnam",
1303
- "Adoni",
1304
- "Tenali",
1305
- "Proddatur",
1306
- "Hindupur",
1307
- "Bhimavaram",
1308
- "Madanapalle",
1309
- "Guntakal",
1310
- "Srikakulam",
1311
- "Dharmavaram",
1312
- "Gudivada",
1313
- "Narasaraopet",
1314
- "Tadipatri",
1315
- "Kavali",
1316
- "Tadepalligudem",
1317
- "Amaravati",
1318
- "Guwahati",
1319
- "Patna",
1320
- "Gaya",
1321
- "Bhagalpur",
1322
- "Muzaffarpur",
1323
- "Bihar Sharif",
1324
- "Darbhanga",
1325
- "Purnia",
1326
- "Arrah",
1327
- "Begusarai",
1328
- "Katihar",
1329
- "Munger",
1330
- "Chapra",
1331
- "Danapur",
1332
- "Saharsa",
1333
- "Sasaram",
1334
- "Hajipur",
1335
- "Dehri",
1336
- "Siwan",
1337
- "Bettiah",
1338
- "Motihari",
1339
- "Bagaha",
1340
- "Kishanganj",
1341
- "Jamalpur",
1342
- "Buxar",
1343
- "Jehanabad",
1344
- "Aurangabad",
1345
- "Chandigarh",
1346
- "Raipur",
1347
- "Bhilai",
1348
- "Korba",
1349
- "Bilaspur",
1350
- "Durg",
1351
- "Delhi",
1352
- "Kirari Suleman Nagar",
1353
- "New Delhi",
1354
- "Karawal Nagar",
1355
- "Nangloi Jat",
1356
- "Bhalswa Jahangir Pur",
1357
- "Sultan Pur Majra",
1358
- "Ahmedabad",
1359
- "Surat",
1360
- "Vadodara",
1361
- "Rajkot",
1362
- "Bhavnagar",
1363
- "Jamnagar",
1364
- "Junagadh",
1365
- "Gandhidham",
1366
- "Nadiad",
1367
- "Gandhinagar",
1368
- "Anand",
1369
- "Morvi",
1370
- "Mahesana",
1371
- "Surendranagar Dudhrej",
1372
- "Faridabad",
1373
- "Gurgaon",
1374
- "Rohtak",
1375
- "Panipat",
1376
- "Karnal",
1377
- "Sonipat",
1378
- "Yamunanagar",
1379
- "Panchkula",
1380
- "Bhiwani",
1381
- "Ambala",
1382
- "Sirsa",
1383
- "Shimla",
1384
- "Srinagar",
1385
- "Jammu",
1386
- "Dhanbad",
1387
- "Ranchi",
1388
- "Jamshedpur",
1389
- "Bokaro",
1390
- "Mango",
1391
- "Deoghar",
1392
- "Bangalore",
1393
- "Hubballi-Dharwad",
1394
- "Mysore",
1395
- "Gulbarga",
1396
- "Mangalore",
1397
- "Belgaum",
1398
- "Davanagere",
1399
- "Bellary",
1400
- "Bijapur",
1401
- "Shivamogga",
1402
- "Tumkur",
1403
- "Raichur",
1404
- "Bidar",
1405
- "Hospet",
1406
- "Thiruvananthapuram",
1407
- "Kochi",
1408
- "Kozhikode",
1409
- "Kollam",
1410
- "Thrissur",
1411
- "Alappuzha",
1412
- "Kottayam",
1413
- "Indore",
1414
- "Bhopal",
1415
- "Jabalpur",
1416
- "Gwalior",
1417
- "Ujjain",
1418
- "Dewas",
1419
- "Satna",
1420
- "Sagar",
1421
- "Ratlam",
1422
- "Rewa",
1423
- "Singrauli",
1424
- "Burhanpur",
1425
- "Khandwa",
1426
- "Morena",
1427
- "Bhind",
1428
- "Guna",
1429
- "Shivpuri",
1430
- "Mumbai",
1431
- "Pune",
1432
- "Nagpur",
1433
- "Thane",
1434
- "Pimpri-Chinchwad",
1435
- "Nashik",
1436
- "Kalyan-Dombivali",
1437
- "Vasai-Virar",
1438
- "Aurangabad",
1439
- "Navi Mumbai",
1440
- "Solapur",
1441
- "Mira-Bhayandar",
1442
- "Bhiwandi",
1443
- "Amravati",
1444
- "Nanded",
1445
- "Kolhapur",
1446
- "Akola",
1447
- "Ulhasnagar",
1448
- "Sangli-Miraj & Kupwad",
1449
- "Malegaon",
1450
- "Jalgaon",
1451
- "Latur",
1452
- "Dhule",
1453
- "Ahmednagar",
1454
- "Satara",
1455
- "Chandrapur",
1456
- "Parbhani",
1457
- "Ichalkaranji",
1458
- "Jalna",
1459
- "Ambernath",
1460
- "Navi Mumbai Panvel Raigad",
1461
- "Bhusawal",
1462
- "Panvel",
1463
- "Imphal",
1464
- "Aizawl",
1465
- "Bhubaneswar",
1466
- "Cuttack",
1467
- "Rourkela",
1468
- "Berhampur",
1469
- "Sambalpur",
1470
- "Rourkela",
1471
- "Raurkela Industrial Township",
1472
- "Sambalpur",
1473
- "Ozhukarai",
1474
- "Puducherry",
1475
- "Ludhiana",
1476
- "Amritsar",
1477
- "Jalandhar",
1478
- "Patiala",
1479
- "Bathinda",
1480
- "Jaipur",
1481
- "Jodhpur",
1482
- "Kota",
1483
- "Bikaner",
1484
- "Ajmer",
1485
- "Udaipur",
1486
- "Bhilwara",
1487
- "Alwar",
1488
- "Bharatpur",
1489
- "Sikar",
1490
- "Pali",
1491
- "Sri Ganganagar",
1492
- "Chennai",
1493
- "Coimbatore",
1494
- "Madurai",
1495
- "Tiruchirappalli",
1496
- "Tiruppur",
1497
- "Salem",
1498
- "Erode",
1499
- "Ambattur",
1500
- "Tirunelveli",
1501
- "Avadi",
1502
- "Tiruvottiyur",
1503
- "Thoothukudi",
1504
- "Nagarcoil",
1505
- "Thanjavur",
1506
- "Pallavaram",
1507
- "Dindigul",
1508
- "Vellore",
1509
- "Karaikudi",
1510
- "Hyderabad",
1511
- "Warangal",
1512
- "Nizamabad",
1513
- "Khammam",
1514
- "Karimnagar",
1515
- "Ramagundam",
1516
- "Secunderabad",
1517
- "Miryalaguda",
1518
- "Suryapet",
1519
- "Agartala",
1520
- "Lucknow",
1521
- "Kanpur",
1522
- "Ghaziabad",
1523
- "Agra",
1524
- "Meerut",
1525
- "Varanasi",
1526
- "Prayagraj",
1527
- "Moradabad",
1528
- "Bareily",
1529
- "Aligarh",
1530
- "Saharanpur",
1531
- "Gorakhpur",
1532
- "Noida",
1533
- "Firozabad",
1534
- "Loni",
1535
- "Jhansi",
1536
- "Muzaffarnagar",
1537
- "Mathura",
1538
- "Shahjahanpur",
1539
- "Rampur",
1540
- "Mau",
1541
- "Farrukhabad",
1542
- "Hapur",
1543
- "Etawah",
1544
- "Mirzapur",
1545
- "Bulandshahr",
1546
- "Murwara",
1547
- "Sambhal",
1548
- "Amroha",
1549
- "Fatehpur",
1550
- "Rae Bareli",
1551
- "Khora",
1552
- "Orai",
1553
- "Bahraich",
1554
- "Jaunpur",
1555
- "Unnao",
1556
- "Dehradun",
1557
- "Haridwar",
1558
- "Kolkata",
1559
- "Howrah",
1560
- "Durgapur",
1561
- "Asansol",
1562
- "Siliguri",
1563
- "Maheshtala",
1564
- "Rajpur Sonarpur",
1565
- "South Dumdum",
1566
- "Gopalpur",
1567
- "Bhatpara",
1568
- "Panihati",
1569
- "Kamarhati",
1570
- "Bardhaman",
1571
- "Kulti",
1572
- "Bally",
1573
- "Barasat",
1574
- "North Dumdum",
1575
- "Baranagar",
1576
- "Uluberia",
1577
- "Naihati",
1578
- "Bidhan Nagar",
1579
- "Kharagpur",
1580
- "Malda",
1581
- "Haldia",
1582
- "Madhyamgram",
1583
- "Baharampur",
1584
- "Raiganj",
1585
- "Serampore",
1586
- "Pratapgarh",
1587
- "Sultanpur",
1588
- "Amethi"
1589
- ], ps = [
1590
- { label: "", value: "", gender: "" },
1591
- { label: "Mr", value: "Mr", gender: "0" },
1592
- { label: "Mrs", value: "Mrs", gender: "1" },
1593
- { label: "Ms", value: "Ms", gender: "1" },
1594
- { label: "Dr", value: "Dr", gender: "" },
1595
- { label: "Md", value: "Md", gender: "0" },
1596
- { label: "Smt", value: "Smt", gender: "1" },
1597
- { label: "Baby", value: "Baby", gender: "1" },
1598
- { label: "Master", value: "Master", gender: "0" },
1599
- { label: "Sri", value: "Sri", gender: "0" },
1600
- { label: "Kumari", value: "Kumari", gender: "1" }
1601
- ], ms = [
1602
- { value: "", label: "Blood Group" },
1603
- { value: "A+ve", label: "A +ve" },
1604
- { value: "A-ve", label: "A -ve" },
1605
- { value: "B+ve", label: "B +ve" },
1606
- { value: "B-ve", label: "B -ve" },
1607
- { value: "AB+ve", label: "AB +ve" },
1608
- { value: "AB-ve", label: "AB -ve" },
1609
- { value: "O+ve", label: "O +ve" },
1610
- { value: "O-ve", label: "O -ve" }
1611
- ], gs = {
1612
- en: "English",
1613
- hi: "Hindi",
1614
- kn: "Kannada",
1615
- ml: "Malayalam",
1616
- te: "Telugu",
1617
- gu: "Gujarati",
1618
- mr: "Marathi",
1619
- ta: "Tamil",
1620
- bn: "Bengali",
1621
- ur: "Urdu",
1622
- pa: "Punjabi",
1623
- od: "Oriya",
1624
- ar: "Arabic",
1625
- asa: "Assamese"
1626
- }, bs = [
1627
- { label: "Cardiologist", value: "Cardiologist" },
1628
- { label: "Dental", value: "Dental" },
1629
- { label: "Dermatologist", value: "Dermatologist" },
1630
- { label: "Dietician", value: "Dietician" },
1631
- { label: "Endocrinologist", value: "Endocrinologist" },
1632
- { label: "Gastroenterologist", value: "Gastroenterologist" },
1633
- { label: "Gynecologist", value: "Gynecologist" },
1634
- { label: "Hematologist", value: "Hematologist" },
1635
- { label: "Hepatologist", value: "Hepatologist" },
1636
- { label: "Immunologist", value: "Immunologist" },
1637
- { label: "Nephrologist", value: "Nephrologist" },
1638
- { label: "Neurologist", value: "Neurologist" },
1639
- { label: "Neurosurgeon", value: "Neurosurgeon" },
1640
- { label: "Ophthalmologist", value: "Ophthalmologist" },
1641
- { label: "Orthopedician", value: "Orthopedician" },
1642
- { label: "Pediatrician", value: "Pediatrician" },
1643
- { label: "Physician", value: "Physician" },
1644
- { label: "Plastic surgery", value: "Plastic surgery" },
1645
- { label: "Podiatrist", value: "Podiatrist" },
1646
- { label: "Pulmonologist", value: "Pulmonologist" },
1647
- { label: "Surgeon", value: "Surgeon" },
1648
- { label: "Urologist", value: "Urologist" },
1649
- { label: "ENT", value: "ENT" },
1650
- { label: "Psychiatrist", value: "Psychiatrist" },
1651
- { label: "Rheumatologist", value: "Rheumatologist" },
1652
- { label: "Surgical Gastrenterologist", value: "Surgical Gastrenterologist" },
1653
- { label: "Oncologist", value: "Oncologist" },
1654
- { label: "Diabetologist", value: "Diabetologist" },
1655
- { label: "CVT surgeon", value: "CVT surgeon" },
1656
- { label: "Vascular surgeon", value: "Vascular surgeon" },
1657
- { label: "Dental surgeon", value: "Dental surgeon" },
1658
- { label: "Physiotherapist", value: "Physiotherapist" },
1659
- { label: "General Surgeon", value: "General Surgeon" },
1660
- { label: "Foot Surgeon", value: "Foot Surgeon" },
1661
- { label: "Psychologist", value: "Psychologist" },
1662
- { label: "Counsellor", value: "Counsellor" },
1663
- { label: "Nutritionist", value: "Nutritionist" },
1664
- { label: "Pathologist", value: "Pathologist" },
1665
- { label: "Retina Surgeon", value: "Retina Surgeon" },
1666
- { label: "Nuclear Medicine", value: "Nuclear Medicine" },
1667
- { label: "Neuro Physician", value: "Neuro Physician" },
1668
- { label: "Ortho Surgeon", value: "Ortho Surgeon" },
1669
- { label: "Radiologist", value: "Radiologist" },
1670
- { label: "General Physician", value: "General Physician" },
1671
- { label: "TAVI Specialist", value: "TAVI Specialist" }
1672
- ], Sr = [
1673
- { value: 0, text: "Male" },
1674
- { value: 1, text: "Female" },
1675
- { value: 2, text: "Other" }
1676
- ], ys = ["Single", "Married", "Divorcee", "Widow"], Er = {
1677
- title: "Session Timed Out.",
1678
- subTitle: "Please Login again.",
1679
- type: "Error",
1680
- time: 3e4
1681
- }, ht = {
1682
- STAGING: {
1683
- php_url: "https://consultation-edge-dev.healthplix.com/",
1684
- rearch_url: "https://consultation-edge-dev.healthplix.com/"
1685
- },
1686
- DEVELOPMENT: {
1687
- php_url: "https://consultation-edge-dev.healthplix.com/",
1688
- rearch_url: "https://consultation-edge-dev.healthplix.com/"
1689
- },
1690
- PRODUCTION: {
1691
- php_url: "https://consultation-edge-dev.healthplix.com/",
1692
- rearch_url: "https://consultation-edge.healthplix.com/"
1693
- }
1694
- }, ws = (t) => {
1695
- window.location.href = t;
1696
- }, Ss = (t) => {
1697
- const e = [];
1698
- if (t.length)
1699
- for (const r of t)
1700
- e.push({ title: r, value: r });
1701
- return e;
1702
- }, Es = (t) => {
1703
- const e = [];
1704
- if (t.length)
1705
- for (const r of t)
1706
- e.push({
1707
- doctor_id: r.doctor_id ? r.doctor_id : "",
1708
- doctor_name: r.doctor_name ? r.doctor_name : "",
1709
- label: r.doctor_name ? r.doctor_name : "",
1710
- specialist: r.specialist || ""
1711
- });
1712
- return e;
1713
- }, Ts = (t) => {
1714
- try {
1715
- JSON.parse(t);
1716
- } catch (e) {
1717
- return console.log("Error parsing JSON:", e), !1;
1718
- }
1719
- return !0;
1720
- }, vs = (t, e) => {
1721
- if (e?.length) {
1722
- const r = e.toLowerCase();
1723
- if (t && (r === "day" || r === "days" || r === "weeks" || r === "months" || r === "years")) {
1724
- t = t ? t.toString() : "";
1725
- const n = I().subtract(Number(t.replace(/[^0-9]/g, "")), r);
1726
- return I(n).format("YYYY-MM-DD");
1727
- }
1728
- return null;
1729
- }
1730
- return null;
1731
- }, As = (t) => {
1732
- switch (t) {
1733
- case "0":
1734
- return "M";
1735
- case "1":
1736
- return "F";
1737
- case "2":
1738
- return "O";
1739
- default:
1740
- return "O";
1741
- }
1742
- }, Os = (t) => {
1743
- const e = Sr.find((r) => r.value === t);
1744
- return e && e.text ? e.text.slice(0, 1) : "";
1745
- }, xs = (t) => {
1746
- let e = "";
1747
- return new RegExp("^[0-9]{10}$").test(t) ? { isError: !1, msg: e } : (t.length < 10 ? e = "Please enter 10 digit number" : t.length > 10 ? e = "Invalid phone number. Should have at most 10 digits." : /^\d+$/.test(t) ? e = "Please enter 10 digit number" : e = "Invalid phone number. Should contain only digits.", {
1748
- isError: !0,
1749
- msg: e
1750
- });
1751
- }, Rs = (t) => t ? new Date(t).toString() !== "Invalid Date" : !1;
1752
- function Fs(t) {
1753
- const e = I(t).format("YYYY-MM-DD"), r = new Date(e), s = Math.abs((/* @__PURE__ */ new Date()).getTime() - r.getTime()), i = Math.ceil(s / (1e3 * 60 * 60 * 24));
1754
- if (i <= 7)
1755
- return `${i} days`;
1756
- if (i <= 30)
1757
- return `${Math.floor(i / 7)} weeks`;
1758
- if (i <= 365)
1759
- return `${Math.floor(i / 30)} months`;
1760
- {
1761
- const a = Math.floor(i / 365);
1762
- return isNaN(a) ? "" : `${a} years`;
1763
- }
1764
- }
1765
- const Ds = (t, e = 300) => {
1766
- let r = null;
1767
- return function(...n) {
1768
- r && clearTimeout(r), r = setTimeout(() => {
1769
- r = null, t.apply(this, n);
1770
- }, e);
1771
- };
1772
- }, _s = (t, e) => {
1773
- if (e?.length) {
1774
- const r = e.toLowerCase();
1775
- if (t && (r === "day" || r === "days" || r === "weeks" || r === "months" || r === "years")) {
1776
- t = t ? t.toString() : "";
1777
- const n = I().subtract(Number(t.replace(/[^0-9]/g, "")), r);
1778
- return I(n).format("YYYY-MM-DD");
1779
- }
1780
- return null;
1781
- }
1782
- return null;
1783
- }, dt = () => {
1784
- const { title: t, subTitle: e, type: r, time: n } = Er;
1785
- typeof window.showToast == "function" && window.showToast(t, e, r, n);
1786
- };
1787
- function Ns(t = "") {
1788
- return t ? t.charAt(0).toUpperCase() + t.slice(1) : "";
1789
- }
1790
- const Ps = (t, e = "") => {
1791
- const r = e?.length && e?.trim() ? e?.trim() : "";
1792
- try {
1793
- if (typeof t == "string" && t?.length && t?.trim()) {
1794
- const n = t.replace(/\s+/g, " ").trim().split(" ");
1795
- return n?.length ? {
1796
- duration: n[0] || "",
1797
- durationType: n[1]?.length ? n[1] : r || ""
1798
- } : {
1799
- duration: "",
1800
- durationType: ""
1801
- };
1802
- }
1803
- return {
1804
- duration: t ? `${t}` : "",
1805
- durationType: r
1806
- };
1807
- } catch (n) {
1808
- return console.log(n, "getDurationFormat"), {
1809
- duration: "",
1810
- durationType: ""
1811
- };
1812
- }
1813
- };
1814
- function pt(t, e) {
1815
- return function() {
1816
- return t.apply(e, arguments);
1817
- };
1818
- }
1819
- const { toString: Tr } = Object.prototype, { getPrototypeOf: ke } = Object, { iterator: me, toStringTag: mt } = Symbol, ge = /* @__PURE__ */ ((t) => (e) => {
1820
- const r = Tr.call(e);
1821
- return t[r] || (t[r] = r.slice(8, -1).toLowerCase());
1822
- })(/* @__PURE__ */ Object.create(null)), $ = (t) => (t = t.toLowerCase(), (e) => ge(e) === t), be = (t) => (e) => typeof e === t, { isArray: K } = Array, Z = be("undefined");
1823
- function ee(t) {
1824
- return t !== null && !Z(t) && t.constructor !== null && !Z(t.constructor) && N(t.constructor.isBuffer) && t.constructor.isBuffer(t);
1825
- }
1826
- const gt = $("ArrayBuffer");
1827
- function vr(t) {
1828
- let e;
1829
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && gt(t.buffer), e;
1830
- }
1831
- const Ar = be("string"), N = be("function"), bt = be("number"), te = (t) => t !== null && typeof t == "object", Or = (t) => t === !0 || t === !1, le = (t) => {
1832
- if (ge(t) !== "object")
1833
- return !1;
1834
- const e = ke(t);
1835
- return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(mt in t) && !(me in t);
1836
- }, xr = (t) => {
1837
- if (!te(t) || ee(t))
1838
- return !1;
1839
- try {
1840
- return Object.keys(t).length === 0 && Object.getPrototypeOf(t) === Object.prototype;
1841
- } catch {
1842
- return !1;
1843
- }
1844
- }, Rr = $("Date"), Fr = $("File"), Dr = $("Blob"), _r = $("FileList"), Nr = (t) => te(t) && N(t.pipe), Pr = (t) => {
1845
- let e;
1846
- return t && (typeof FormData == "function" && t instanceof FormData || N(t.append) && ((e = ge(t)) === "formdata" || // detect form-data instance
1847
- e === "object" && N(t.toString) && t.toString() === "[object FormData]"));
1848
- }, Cr = $("URLSearchParams"), [kr, $r, Br, Mr] = ["ReadableStream", "Request", "Response", "Headers"].map($), jr = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
1849
- function re(t, e, { allOwnKeys: r = !1 } = {}) {
1850
- if (t === null || typeof t > "u")
1851
- return;
1852
- let n, s;
1853
- if (typeof t != "object" && (t = [t]), K(t))
1854
- for (n = 0, s = t.length; n < s; n++)
1855
- e.call(null, t[n], n, t);
1856
- else {
1857
- if (ee(t))
1858
- return;
1859
- const i = r ? Object.getOwnPropertyNames(t) : Object.keys(t), a = i.length;
1860
- let o;
1861
- for (n = 0; n < a; n++)
1862
- o = i[n], e.call(null, t[o], o, t);
1863
- }
1864
- }
1865
- function yt(t, e) {
1866
- if (ee(t))
1867
- return null;
1868
- e = e.toLowerCase();
1869
- const r = Object.keys(t);
1870
- let n = r.length, s;
1871
- for (; n-- > 0; )
1872
- if (s = r[n], e === s.toLowerCase())
1873
- return s;
1874
- return null;
1875
- }
1876
- const z = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, wt = (t) => !Z(t) && t !== z;
1877
- function Re() {
1878
- const { caseless: t } = wt(this) && this || {}, e = {}, r = (n, s) => {
1879
- const i = t && yt(e, s) || s;
1880
- le(e[i]) && le(n) ? e[i] = Re(e[i], n) : le(n) ? e[i] = Re({}, n) : K(n) ? e[i] = n.slice() : e[i] = n;
1881
- };
1882
- for (let n = 0, s = arguments.length; n < s; n++)
1883
- arguments[n] && re(arguments[n], r);
1884
- return e;
1885
- }
1886
- const Ir = (t, e, r, { allOwnKeys: n } = {}) => (re(e, (s, i) => {
1887
- r && N(s) ? t[i] = pt(s, r) : t[i] = s;
1888
- }, { allOwnKeys: n }), t), Lr = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Ur = (t, e, r, n) => {
1889
- t.prototype = Object.create(e.prototype, n), t.prototype.constructor = t, Object.defineProperty(t, "super", {
1890
- value: e.prototype
1891
- }), r && Object.assign(t.prototype, r);
1892
- }, qr = (t, e, r, n) => {
1893
- let s, i, a;
1894
- const o = {};
1895
- if (e = e || {}, t == null) return e;
1896
- do {
1897
- for (s = Object.getOwnPropertyNames(t), i = s.length; i-- > 0; )
1898
- a = s[i], (!n || n(a, t, e)) && !o[a] && (e[a] = t[a], o[a] = !0);
1899
- t = r !== !1 && ke(t);
1900
- } while (t && (!r || r(t, e)) && t !== Object.prototype);
1901
- return e;
1902
- }, zr = (t, e, r) => {
1903
- t = String(t), (r === void 0 || r > t.length) && (r = t.length), r -= e.length;
1904
- const n = t.indexOf(e, r);
1905
- return n !== -1 && n === r;
1906
- }, Hr = (t) => {
1907
- if (!t) return null;
1908
- if (K(t)) return t;
1909
- let e = t.length;
1910
- if (!bt(e)) return null;
1911
- const r = new Array(e);
1912
- for (; e-- > 0; )
1913
- r[e] = t[e];
1914
- return r;
1915
- }, Vr = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && ke(Uint8Array)), Gr = (t, e) => {
1916
- const n = (t && t[me]).call(t);
1917
- let s;
1918
- for (; (s = n.next()) && !s.done; ) {
1919
- const i = s.value;
1920
- e.call(t, i[0], i[1]);
1921
- }
1922
- }, Jr = (t, e) => {
1923
- let r;
1924
- const n = [];
1925
- for (; (r = t.exec(e)) !== null; )
1926
- n.push(r);
1927
- return n;
1928
- }, Kr = $("HTMLFormElement"), Yr = (t) => t.toLowerCase().replace(
1929
- /[-_\s]([a-z\d])(\w*)/g,
1930
- function(r, n, s) {
1931
- return n.toUpperCase() + s;
1932
- }
1933
- ), ze = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Wr = $("RegExp"), St = (t, e) => {
1934
- const r = Object.getOwnPropertyDescriptors(t), n = {};
1935
- re(r, (s, i) => {
1936
- let a;
1937
- (a = e(s, i, t)) !== !1 && (n[i] = a || s);
1938
- }), Object.defineProperties(t, n);
1939
- }, Xr = (t) => {
1940
- St(t, (e, r) => {
1941
- if (N(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
1942
- return !1;
1943
- const n = t[r];
1944
- if (N(n)) {
1945
- if (e.enumerable = !1, "writable" in e) {
1946
- e.writable = !1;
1947
- return;
1948
- }
1949
- e.set || (e.set = () => {
1950
- throw Error("Can not rewrite read-only method '" + r + "'");
1951
- });
1952
- }
1953
- });
1954
- }, Zr = (t, e) => {
1955
- const r = {}, n = (s) => {
1956
- s.forEach((i) => {
1957
- r[i] = !0;
1958
- });
1959
- };
1960
- return K(t) ? n(t) : n(String(t).split(e)), r;
1961
- }, Qr = () => {
1962
- }, en = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
1963
- function tn(t) {
1964
- return !!(t && N(t.append) && t[mt] === "FormData" && t[me]);
1965
- }
1966
- const rn = (t) => {
1967
- const e = new Array(10), r = (n, s) => {
1968
- if (te(n)) {
1969
- if (e.indexOf(n) >= 0)
1970
- return;
1971
- if (ee(n))
1972
- return n;
1973
- if (!("toJSON" in n)) {
1974
- e[s] = n;
1975
- const i = K(n) ? [] : {};
1976
- return re(n, (a, o) => {
1977
- const u = r(a, s + 1);
1978
- !Z(u) && (i[o] = u);
1979
- }), e[s] = void 0, i;
1980
- }
1981
- }
1982
- return n;
1983
- };
1984
- return r(t, 0);
1985
- }, nn = $("AsyncFunction"), sn = (t) => t && (te(t) || N(t)) && N(t.then) && N(t.catch), Et = ((t, e) => t ? setImmediate : e ? ((r, n) => (z.addEventListener("message", ({ source: s, data: i }) => {
1986
- s === z && i === r && n.length && n.shift()();
1987
- }, !1), (s) => {
1988
- n.push(s), z.postMessage(r, "*");
1989
- }))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
1990
- typeof setImmediate == "function",
1991
- N(z.postMessage)
1992
- ), an = typeof queueMicrotask < "u" ? queueMicrotask.bind(z) : typeof process < "u" && process.nextTick || Et, on = (t) => t != null && N(t[me]), l = {
1993
- isArray: K,
1994
- isArrayBuffer: gt,
1995
- isBuffer: ee,
1996
- isFormData: Pr,
1997
- isArrayBufferView: vr,
1998
- isString: Ar,
1999
- isNumber: bt,
2000
- isBoolean: Or,
2001
- isObject: te,
2002
- isPlainObject: le,
2003
- isEmptyObject: xr,
2004
- isReadableStream: kr,
2005
- isRequest: $r,
2006
- isResponse: Br,
2007
- isHeaders: Mr,
2008
- isUndefined: Z,
2009
- isDate: Rr,
2010
- isFile: Fr,
2011
- isBlob: Dr,
2012
- isRegExp: Wr,
2013
- isFunction: N,
2014
- isStream: Nr,
2015
- isURLSearchParams: Cr,
2016
- isTypedArray: Vr,
2017
- isFileList: _r,
2018
- forEach: re,
2019
- merge: Re,
2020
- extend: Ir,
2021
- trim: jr,
2022
- stripBOM: Lr,
2023
- inherits: Ur,
2024
- toFlatObject: qr,
2025
- kindOf: ge,
2026
- kindOfTest: $,
2027
- endsWith: zr,
2028
- toArray: Hr,
2029
- forEachEntry: Gr,
2030
- matchAll: Jr,
2031
- isHTMLForm: Kr,
2032
- hasOwnProperty: ze,
2033
- hasOwnProp: ze,
2034
- // an alias to avoid ESLint no-prototype-builtins detection
2035
- reduceDescriptors: St,
2036
- freezeMethods: Xr,
2037
- toObjectSet: Zr,
2038
- toCamelCase: Yr,
2039
- noop: Qr,
2040
- toFiniteNumber: en,
2041
- findKey: yt,
2042
- global: z,
2043
- isContextDefined: wt,
2044
- isSpecCompliantForm: tn,
2045
- toJSONObject: rn,
2046
- isAsyncFn: nn,
2047
- isThenable: sn,
2048
- setImmediate: Et,
2049
- asap: an,
2050
- isIterable: on
2051
- };
2052
- function S(t, e, r, n, s) {
2053
- Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), r && (this.config = r), n && (this.request = n), s && (this.response = s, this.status = s.status ? s.status : null);
2054
- }
2055
- l.inherits(S, Error, {
2056
- toJSON: function() {
2057
- return {
2058
- // Standard
2059
- message: this.message,
2060
- name: this.name,
2061
- // Microsoft
2062
- description: this.description,
2063
- number: this.number,
2064
- // Mozilla
2065
- fileName: this.fileName,
2066
- lineNumber: this.lineNumber,
2067
- columnNumber: this.columnNumber,
2068
- stack: this.stack,
2069
- // Axios
2070
- config: l.toJSONObject(this.config),
2071
- code: this.code,
2072
- status: this.status
2073
- };
2074
- }
2075
- });
2076
- const Tt = S.prototype, vt = {};
2077
- [
2078
- "ERR_BAD_OPTION_VALUE",
2079
- "ERR_BAD_OPTION",
2080
- "ECONNABORTED",
2081
- "ETIMEDOUT",
2082
- "ERR_NETWORK",
2083
- "ERR_FR_TOO_MANY_REDIRECTS",
2084
- "ERR_DEPRECATED",
2085
- "ERR_BAD_RESPONSE",
2086
- "ERR_BAD_REQUEST",
2087
- "ERR_CANCELED",
2088
- "ERR_NOT_SUPPORT",
2089
- "ERR_INVALID_URL"
2090
- // eslint-disable-next-line func-names
2091
- ].forEach((t) => {
2092
- vt[t] = { value: t };
2093
- });
2094
- Object.defineProperties(S, vt);
2095
- Object.defineProperty(Tt, "isAxiosError", { value: !0 });
2096
- S.from = (t, e, r, n, s, i) => {
2097
- const a = Object.create(Tt);
2098
- return l.toFlatObject(t, a, function(u) {
2099
- return u !== Error.prototype;
2100
- }, (o) => o !== "isAxiosError"), S.call(a, t.message, e, r, n, s), a.cause = t, a.name = t.name, i && Object.assign(a, i), a;
2101
- };
2102
- const ln = null;
2103
- function Fe(t) {
2104
- return l.isPlainObject(t) || l.isArray(t);
2105
- }
2106
- function At(t) {
2107
- return l.endsWith(t, "[]") ? t.slice(0, -2) : t;
2108
- }
2109
- function He(t, e, r) {
2110
- return t ? t.concat(e).map(function(s, i) {
2111
- return s = At(s), !r && i ? "[" + s + "]" : s;
2112
- }).join(r ? "." : "") : e;
2113
- }
2114
- function un(t) {
2115
- return l.isArray(t) && !t.some(Fe);
2116
- }
2117
- const cn = l.toFlatObject(l, {}, null, function(e) {
2118
- return /^is[A-Z]/.test(e);
2119
- });
2120
- function ye(t, e, r) {
2121
- if (!l.isObject(t))
2122
- throw new TypeError("target must be an object");
2123
- e = e || new FormData(), r = l.toFlatObject(r, {
2124
- metaTokens: !0,
2125
- dots: !1,
2126
- indexes: !1
2127
- }, !1, function(g, m) {
2128
- return !l.isUndefined(m[g]);
2129
- });
2130
- const n = r.metaTokens, s = r.visitor || f, i = r.dots, a = r.indexes, u = (r.Blob || typeof Blob < "u" && Blob) && l.isSpecCompliantForm(e);
2131
- if (!l.isFunction(s))
2132
- throw new TypeError("visitor must be a function");
2133
- function c(p) {
2134
- if (p === null) return "";
2135
- if (l.isDate(p))
2136
- return p.toISOString();
2137
- if (l.isBoolean(p))
2138
- return p.toString();
2139
- if (!u && l.isBlob(p))
2140
- throw new S("Blob is not supported. Use a Buffer instead.");
2141
- return l.isArrayBuffer(p) || l.isTypedArray(p) ? u && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
2142
- }
2143
- function f(p, g, m) {
2144
- let d = p;
2145
- if (p && !m && typeof p == "object") {
2146
- if (l.endsWith(g, "{}"))
2147
- g = n ? g : g.slice(0, -2), p = JSON.stringify(p);
2148
- else if (l.isArray(p) && un(p) || (l.isFileList(p) || l.endsWith(g, "[]")) && (d = l.toArray(p)))
2149
- return g = At(g), d.forEach(function(E, O) {
2150
- !(l.isUndefined(E) || E === null) && e.append(
2151
- // eslint-disable-next-line no-nested-ternary
2152
- a === !0 ? He([g], O, i) : a === null ? g : g + "[]",
2153
- c(E)
2154
- );
2155
- }), !1;
2156
- }
2157
- return Fe(p) ? !0 : (e.append(He(m, g, i), c(p)), !1);
2158
- }
2159
- const h = [], y = Object.assign(cn, {
2160
- defaultVisitor: f,
2161
- convertValue: c,
2162
- isVisitable: Fe
2163
- });
2164
- function w(p, g) {
2165
- if (!l.isUndefined(p)) {
2166
- if (h.indexOf(p) !== -1)
2167
- throw Error("Circular reference detected in " + g.join("."));
2168
- h.push(p), l.forEach(p, function(d, b) {
2169
- (!(l.isUndefined(d) || d === null) && s.call(
2170
- e,
2171
- d,
2172
- l.isString(b) ? b.trim() : b,
2173
- g,
2174
- y
2175
- )) === !0 && w(d, g ? g.concat(b) : [b]);
2176
- }), h.pop();
2177
- }
2178
- }
2179
- if (!l.isObject(t))
2180
- throw new TypeError("data must be an object");
2181
- return w(t), e;
2182
- }
2183
- function Ve(t) {
2184
- const e = {
2185
- "!": "%21",
2186
- "'": "%27",
2187
- "(": "%28",
2188
- ")": "%29",
2189
- "~": "%7E",
2190
- "%20": "+",
2191
- "%00": "\0"
2192
- };
2193
- return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(n) {
2194
- return e[n];
2195
- });
2196
- }
2197
- function $e(t, e) {
2198
- this._pairs = [], t && ye(t, this, e);
2199
- }
2200
- const Ot = $e.prototype;
2201
- Ot.append = function(e, r) {
2202
- this._pairs.push([e, r]);
2203
- };
2204
- Ot.toString = function(e) {
2205
- const r = e ? function(n) {
2206
- return e.call(this, n, Ve);
2207
- } : Ve;
2208
- return this._pairs.map(function(s) {
2209
- return r(s[0]) + "=" + r(s[1]);
2210
- }, "").join("&");
2211
- };
2212
- function fn(t) {
2213
- return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
2214
- }
2215
- function xt(t, e, r) {
2216
- if (!e)
2217
- return t;
2218
- const n = r && r.encode || fn;
2219
- l.isFunction(r) && (r = {
2220
- serialize: r
2221
- });
2222
- const s = r && r.serialize;
2223
- let i;
2224
- if (s ? i = s(e, r) : i = l.isURLSearchParams(e) ? e.toString() : new $e(e, r).toString(n), i) {
2225
- const a = t.indexOf("#");
2226
- a !== -1 && (t = t.slice(0, a)), t += (t.indexOf("?") === -1 ? "?" : "&") + i;
2227
- }
2228
- return t;
2229
- }
2230
- class Ge {
2231
- constructor() {
2232
- this.handlers = [];
2233
- }
2234
- /**
2235
- * Add a new interceptor to the stack
2236
- *
2237
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
2238
- * @param {Function} rejected The function to handle `reject` for a `Promise`
2239
- *
2240
- * @return {Number} An ID used to remove interceptor later
2241
- */
2242
- use(e, r, n) {
2243
- return this.handlers.push({
2244
- fulfilled: e,
2245
- rejected: r,
2246
- synchronous: n ? n.synchronous : !1,
2247
- runWhen: n ? n.runWhen : null
2248
- }), this.handlers.length - 1;
2249
- }
2250
- /**
2251
- * Remove an interceptor from the stack
2252
- *
2253
- * @param {Number} id The ID that was returned by `use`
2254
- *
2255
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
2256
- */
2257
- eject(e) {
2258
- this.handlers[e] && (this.handlers[e] = null);
2259
- }
2260
- /**
2261
- * Clear all interceptors from the stack
2262
- *
2263
- * @returns {void}
2264
- */
2265
- clear() {
2266
- this.handlers && (this.handlers = []);
2267
- }
2268
- /**
2269
- * Iterate over all the registered interceptors
2270
- *
2271
- * This method is particularly useful for skipping over any
2272
- * interceptors that may have become `null` calling `eject`.
2273
- *
2274
- * @param {Function} fn The function to call for each interceptor
2275
- *
2276
- * @returns {void}
2277
- */
2278
- forEach(e) {
2279
- l.forEach(this.handlers, function(n) {
2280
- n !== null && e(n);
2281
- });
2282
- }
2283
- }
2284
- const Rt = {
2285
- silentJSONParsing: !0,
2286
- forcedJSONParsing: !0,
2287
- clarifyTimeoutError: !1
2288
- }, hn = typeof URLSearchParams < "u" ? URLSearchParams : $e, dn = typeof FormData < "u" ? FormData : null, pn = typeof Blob < "u" ? Blob : null, mn = {
2289
- isBrowser: !0,
2290
- classes: {
2291
- URLSearchParams: hn,
2292
- FormData: dn,
2293
- Blob: pn
2294
- },
2295
- protocols: ["http", "https", "file", "blob", "url", "data"]
2296
- }, Be = typeof window < "u" && typeof document < "u", De = typeof navigator == "object" && navigator || void 0, gn = Be && (!De || ["ReactNative", "NativeScript", "NS"].indexOf(De.product) < 0), bn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
2297
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", yn = Be && window.location.href || "http://localhost", wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2298
- __proto__: null,
2299
- hasBrowserEnv: Be,
2300
- hasStandardBrowserEnv: gn,
2301
- hasStandardBrowserWebWorkerEnv: bn,
2302
- navigator: De,
2303
- origin: yn
2304
- }, Symbol.toStringTag, { value: "Module" })), F = {
2305
- ...wn,
2306
- ...mn
2307
- };
2308
- function Sn(t, e) {
2309
- return ye(t, new F.classes.URLSearchParams(), {
2310
- visitor: function(r, n, s, i) {
2311
- return F.isNode && l.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
2312
- },
2313
- ...e
2314
- });
2315
- }
2316
- function En(t) {
2317
- return l.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
2318
- }
2319
- function Tn(t) {
2320
- const e = {}, r = Object.keys(t);
2321
- let n;
2322
- const s = r.length;
2323
- let i;
2324
- for (n = 0; n < s; n++)
2325
- i = r[n], e[i] = t[i];
2326
- return e;
2327
- }
2328
- function Ft(t) {
2329
- function e(r, n, s, i) {
2330
- let a = r[i++];
2331
- if (a === "__proto__") return !0;
2332
- const o = Number.isFinite(+a), u = i >= r.length;
2333
- return a = !a && l.isArray(s) ? s.length : a, u ? (l.hasOwnProp(s, a) ? s[a] = [s[a], n] : s[a] = n, !o) : ((!s[a] || !l.isObject(s[a])) && (s[a] = []), e(r, n, s[a], i) && l.isArray(s[a]) && (s[a] = Tn(s[a])), !o);
2334
- }
2335
- if (l.isFormData(t) && l.isFunction(t.entries)) {
2336
- const r = {};
2337
- return l.forEachEntry(t, (n, s) => {
2338
- e(En(n), s, r, 0);
2339
- }), r;
2340
- }
2341
- return null;
2342
- }
2343
- function vn(t, e, r) {
2344
- if (l.isString(t))
2345
- try {
2346
- return (e || JSON.parse)(t), l.trim(t);
2347
- } catch (n) {
2348
- if (n.name !== "SyntaxError")
2349
- throw n;
2350
- }
2351
- return (r || JSON.stringify)(t);
2352
- }
2353
- const ne = {
2354
- transitional: Rt,
2355
- adapter: ["xhr", "http", "fetch"],
2356
- transformRequest: [function(e, r) {
2357
- const n = r.getContentType() || "", s = n.indexOf("application/json") > -1, i = l.isObject(e);
2358
- if (i && l.isHTMLForm(e) && (e = new FormData(e)), l.isFormData(e))
2359
- return s ? JSON.stringify(Ft(e)) : e;
2360
- if (l.isArrayBuffer(e) || l.isBuffer(e) || l.isStream(e) || l.isFile(e) || l.isBlob(e) || l.isReadableStream(e))
2361
- return e;
2362
- if (l.isArrayBufferView(e))
2363
- return e.buffer;
2364
- if (l.isURLSearchParams(e))
2365
- return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
2366
- let o;
2367
- if (i) {
2368
- if (n.indexOf("application/x-www-form-urlencoded") > -1)
2369
- return Sn(e, this.formSerializer).toString();
2370
- if ((o = l.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
2371
- const u = this.env && this.env.FormData;
2372
- return ye(
2373
- o ? { "files[]": e } : e,
2374
- u && new u(),
2375
- this.formSerializer
2376
- );
2377
- }
2378
- }
2379
- return i || s ? (r.setContentType("application/json", !1), vn(e)) : e;
2380
- }],
2381
- transformResponse: [function(e) {
2382
- const r = this.transitional || ne.transitional, n = r && r.forcedJSONParsing, s = this.responseType === "json";
2383
- if (l.isResponse(e) || l.isReadableStream(e))
2384
- return e;
2385
- if (e && l.isString(e) && (n && !this.responseType || s)) {
2386
- const a = !(r && r.silentJSONParsing) && s;
2387
- try {
2388
- return JSON.parse(e);
2389
- } catch (o) {
2390
- if (a)
2391
- throw o.name === "SyntaxError" ? S.from(o, S.ERR_BAD_RESPONSE, this, null, this.response) : o;
2392
- }
2393
- }
2394
- return e;
2395
- }],
2396
- /**
2397
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
2398
- * timeout is not created.
2399
- */
2400
- timeout: 0,
2401
- xsrfCookieName: "XSRF-TOKEN",
2402
- xsrfHeaderName: "X-XSRF-TOKEN",
2403
- maxContentLength: -1,
2404
- maxBodyLength: -1,
2405
- env: {
2406
- FormData: F.classes.FormData,
2407
- Blob: F.classes.Blob
2408
- },
2409
- validateStatus: function(e) {
2410
- return e >= 200 && e < 300;
2411
- },
2412
- headers: {
2413
- common: {
2414
- Accept: "application/json, text/plain, */*",
2415
- "Content-Type": void 0
2416
- }
2417
- }
2418
- };
2419
- l.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
2420
- ne.headers[t] = {};
2421
- });
2422
- const An = l.toObjectSet([
2423
- "age",
2424
- "authorization",
2425
- "content-length",
2426
- "content-type",
2427
- "etag",
2428
- "expires",
2429
- "from",
2430
- "host",
2431
- "if-modified-since",
2432
- "if-unmodified-since",
2433
- "last-modified",
2434
- "location",
2435
- "max-forwards",
2436
- "proxy-authorization",
2437
- "referer",
2438
- "retry-after",
2439
- "user-agent"
2440
- ]), On = (t) => {
2441
- const e = {};
2442
- let r, n, s;
2443
- return t && t.split(`
2444
- `).forEach(function(a) {
2445
- s = a.indexOf(":"), r = a.substring(0, s).trim().toLowerCase(), n = a.substring(s + 1).trim(), !(!r || e[r] && An[r]) && (r === "set-cookie" ? e[r] ? e[r].push(n) : e[r] = [n] : e[r] = e[r] ? e[r] + ", " + n : n);
2446
- }), e;
2447
- }, Je = Symbol("internals");
2448
- function X(t) {
2449
- return t && String(t).trim().toLowerCase();
2450
- }
2451
- function ue(t) {
2452
- return t === !1 || t == null ? t : l.isArray(t) ? t.map(ue) : String(t);
2453
- }
2454
- function xn(t) {
2455
- const e = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
2456
- let n;
2457
- for (; n = r.exec(t); )
2458
- e[n[1]] = n[2];
2459
- return e;
2460
- }
2461
- const Rn = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
2462
- function Te(t, e, r, n, s) {
2463
- if (l.isFunction(n))
2464
- return n.call(this, e, r);
2465
- if (s && (e = r), !!l.isString(e)) {
2466
- if (l.isString(n))
2467
- return e.indexOf(n) !== -1;
2468
- if (l.isRegExp(n))
2469
- return n.test(e);
2470
- }
2471
- }
2472
- function Fn(t) {
2473
- return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, r, n) => r.toUpperCase() + n);
2474
- }
2475
- function Dn(t, e) {
2476
- const r = l.toCamelCase(" " + e);
2477
- ["get", "set", "has"].forEach((n) => {
2478
- Object.defineProperty(t, n + r, {
2479
- value: function(s, i, a) {
2480
- return this[n].call(this, e, s, i, a);
2481
- },
2482
- configurable: !0
2483
- });
2484
- });
2485
- }
2486
- let P = class {
2487
- constructor(e) {
2488
- e && this.set(e);
2489
- }
2490
- set(e, r, n) {
2491
- const s = this;
2492
- function i(o, u, c) {
2493
- const f = X(u);
2494
- if (!f)
2495
- throw new Error("header name must be a non-empty string");
2496
- const h = l.findKey(s, f);
2497
- (!h || s[h] === void 0 || c === !0 || c === void 0 && s[h] !== !1) && (s[h || u] = ue(o));
2498
- }
2499
- const a = (o, u) => l.forEach(o, (c, f) => i(c, f, u));
2500
- if (l.isPlainObject(e) || e instanceof this.constructor)
2501
- a(e, r);
2502
- else if (l.isString(e) && (e = e.trim()) && !Rn(e))
2503
- a(On(e), r);
2504
- else if (l.isObject(e) && l.isIterable(e)) {
2505
- let o = {}, u, c;
2506
- for (const f of e) {
2507
- if (!l.isArray(f))
2508
- throw TypeError("Object iterator must return a key-value pair");
2509
- o[c = f[0]] = (u = o[c]) ? l.isArray(u) ? [...u, f[1]] : [u, f[1]] : f[1];
2510
- }
2511
- a(o, r);
2512
- } else
2513
- e != null && i(r, e, n);
2514
- return this;
2515
- }
2516
- get(e, r) {
2517
- if (e = X(e), e) {
2518
- const n = l.findKey(this, e);
2519
- if (n) {
2520
- const s = this[n];
2521
- if (!r)
2522
- return s;
2523
- if (r === !0)
2524
- return xn(s);
2525
- if (l.isFunction(r))
2526
- return r.call(this, s, n);
2527
- if (l.isRegExp(r))
2528
- return r.exec(s);
2529
- throw new TypeError("parser must be boolean|regexp|function");
2530
- }
2531
- }
2532
- }
2533
- has(e, r) {
2534
- if (e = X(e), e) {
2535
- const n = l.findKey(this, e);
2536
- return !!(n && this[n] !== void 0 && (!r || Te(this, this[n], n, r)));
2537
- }
2538
- return !1;
2539
- }
2540
- delete(e, r) {
2541
- const n = this;
2542
- let s = !1;
2543
- function i(a) {
2544
- if (a = X(a), a) {
2545
- const o = l.findKey(n, a);
2546
- o && (!r || Te(n, n[o], o, r)) && (delete n[o], s = !0);
2547
- }
2548
- }
2549
- return l.isArray(e) ? e.forEach(i) : i(e), s;
2550
- }
2551
- clear(e) {
2552
- const r = Object.keys(this);
2553
- let n = r.length, s = !1;
2554
- for (; n--; ) {
2555
- const i = r[n];
2556
- (!e || Te(this, this[i], i, e, !0)) && (delete this[i], s = !0);
2557
- }
2558
- return s;
2559
- }
2560
- normalize(e) {
2561
- const r = this, n = {};
2562
- return l.forEach(this, (s, i) => {
2563
- const a = l.findKey(n, i);
2564
- if (a) {
2565
- r[a] = ue(s), delete r[i];
2566
- return;
2567
- }
2568
- const o = e ? Fn(i) : String(i).trim();
2569
- o !== i && delete r[i], r[o] = ue(s), n[o] = !0;
2570
- }), this;
2571
- }
2572
- concat(...e) {
2573
- return this.constructor.concat(this, ...e);
2574
- }
2575
- toJSON(e) {
2576
- const r = /* @__PURE__ */ Object.create(null);
2577
- return l.forEach(this, (n, s) => {
2578
- n != null && n !== !1 && (r[s] = e && l.isArray(n) ? n.join(", ") : n);
2579
- }), r;
2580
- }
2581
- [Symbol.iterator]() {
2582
- return Object.entries(this.toJSON())[Symbol.iterator]();
2583
- }
2584
- toString() {
2585
- return Object.entries(this.toJSON()).map(([e, r]) => e + ": " + r).join(`
2586
- `);
2587
- }
2588
- getSetCookie() {
2589
- return this.get("set-cookie") || [];
2590
- }
2591
- get [Symbol.toStringTag]() {
2592
- return "AxiosHeaders";
2593
- }
2594
- static from(e) {
2595
- return e instanceof this ? e : new this(e);
2596
- }
2597
- static concat(e, ...r) {
2598
- const n = new this(e);
2599
- return r.forEach((s) => n.set(s)), n;
2600
- }
2601
- static accessor(e) {
2602
- const n = (this[Je] = this[Je] = {
2603
- accessors: {}
2604
- }).accessors, s = this.prototype;
2605
- function i(a) {
2606
- const o = X(a);
2607
- n[o] || (Dn(s, a), n[o] = !0);
2608
- }
2609
- return l.isArray(e) ? e.forEach(i) : i(e), this;
2610
- }
2611
- };
2612
- P.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
2613
- l.reduceDescriptors(P.prototype, ({ value: t }, e) => {
2614
- let r = e[0].toUpperCase() + e.slice(1);
2615
- return {
2616
- get: () => t,
2617
- set(n) {
2618
- this[r] = n;
2619
- }
2620
- };
2621
- });
2622
- l.freezeMethods(P);
2623
- function ve(t, e) {
2624
- const r = this || ne, n = e || r, s = P.from(n.headers);
2625
- let i = n.data;
2626
- return l.forEach(t, function(o) {
2627
- i = o.call(r, i, s.normalize(), e ? e.status : void 0);
2628
- }), s.normalize(), i;
2629
- }
2630
- function Dt(t) {
2631
- return !!(t && t.__CANCEL__);
2632
- }
2633
- function Y(t, e, r) {
2634
- S.call(this, t ?? "canceled", S.ERR_CANCELED, e, r), this.name = "CanceledError";
2635
- }
2636
- l.inherits(Y, S, {
2637
- __CANCEL__: !0
2638
- });
2639
- function _t(t, e, r) {
2640
- const n = r.config.validateStatus;
2641
- !r.status || !n || n(r.status) ? t(r) : e(new S(
2642
- "Request failed with status code " + r.status,
2643
- [S.ERR_BAD_REQUEST, S.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
2644
- r.config,
2645
- r.request,
2646
- r
2647
- ));
2648
- }
2649
- function _n(t) {
2650
- const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
2651
- return e && e[1] || "";
2652
- }
2653
- function Nn(t, e) {
2654
- t = t || 10;
2655
- const r = new Array(t), n = new Array(t);
2656
- let s = 0, i = 0, a;
2657
- return e = e !== void 0 ? e : 1e3, function(u) {
2658
- const c = Date.now(), f = n[i];
2659
- a || (a = c), r[s] = u, n[s] = c;
2660
- let h = i, y = 0;
2661
- for (; h !== s; )
2662
- y += r[h++], h = h % t;
2663
- if (s = (s + 1) % t, s === i && (i = (i + 1) % t), c - a < e)
2664
- return;
2665
- const w = f && c - f;
2666
- return w ? Math.round(y * 1e3 / w) : void 0;
2667
- };
2668
- }
2669
- function Pn(t, e) {
2670
- let r = 0, n = 1e3 / e, s, i;
2671
- const a = (c, f = Date.now()) => {
2672
- r = f, s = null, i && (clearTimeout(i), i = null), t(...c);
2673
- };
2674
- return [(...c) => {
2675
- const f = Date.now(), h = f - r;
2676
- h >= n ? a(c, f) : (s = c, i || (i = setTimeout(() => {
2677
- i = null, a(s);
2678
- }, n - h)));
2679
- }, () => s && a(s)];
2680
- }
2681
- const de = (t, e, r = 3) => {
2682
- let n = 0;
2683
- const s = Nn(50, 250);
2684
- return Pn((i) => {
2685
- const a = i.loaded, o = i.lengthComputable ? i.total : void 0, u = a - n, c = s(u), f = a <= o;
2686
- n = a;
2687
- const h = {
2688
- loaded: a,
2689
- total: o,
2690
- progress: o ? a / o : void 0,
2691
- bytes: u,
2692
- rate: c || void 0,
2693
- estimated: c && o && f ? (o - a) / c : void 0,
2694
- event: i,
2695
- lengthComputable: o != null,
2696
- [e ? "download" : "upload"]: !0
2697
- };
2698
- t(h);
2699
- }, r);
2700
- }, Ke = (t, e) => {
2701
- const r = t != null;
2702
- return [(n) => e[0]({
2703
- lengthComputable: r,
2704
- total: t,
2705
- loaded: n
2706
- }), e[1]];
2707
- }, Ye = (t) => (...e) => l.asap(() => t(...e)), Cn = F.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (r) => (r = new URL(r, F.origin), t.protocol === r.protocol && t.host === r.host && (e || t.port === r.port)))(
2708
- new URL(F.origin),
2709
- F.navigator && /(msie|trident)/i.test(F.navigator.userAgent)
2710
- ) : () => !0, kn = F.hasStandardBrowserEnv ? (
2711
- // Standard browser envs support document.cookie
2712
- {
2713
- write(t, e, r, n, s, i) {
2714
- const a = [t + "=" + encodeURIComponent(e)];
2715
- l.isNumber(r) && a.push("expires=" + new Date(r).toGMTString()), l.isString(n) && a.push("path=" + n), l.isString(s) && a.push("domain=" + s), i === !0 && a.push("secure"), document.cookie = a.join("; ");
2716
- },
2717
- read(t) {
2718
- const e = document.cookie.match(new RegExp("(^|;\\s*)(" + t + ")=([^;]*)"));
2719
- return e ? decodeURIComponent(e[3]) : null;
2720
- },
2721
- remove(t) {
2722
- this.write(t, "", Date.now() - 864e5);
2723
- }
2724
- }
2725
- ) : (
2726
- // Non-standard browser env (web workers, react-native) lack needed support.
2727
- {
2728
- write() {
2729
- },
2730
- read() {
2731
- return null;
2732
- },
2733
- remove() {
2734
- }
2735
- }
2736
- );
2737
- function $n(t) {
2738
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
2739
- }
2740
- function Bn(t, e) {
2741
- return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
2742
- }
2743
- function Nt(t, e, r) {
2744
- let n = !$n(e);
2745
- return t && (n || r == !1) ? Bn(t, e) : e;
2746
- }
2747
- const We = (t) => t instanceof P ? { ...t } : t;
2748
- function V(t, e) {
2749
- e = e || {};
2750
- const r = {};
2751
- function n(c, f, h, y) {
2752
- return l.isPlainObject(c) && l.isPlainObject(f) ? l.merge.call({ caseless: y }, c, f) : l.isPlainObject(f) ? l.merge({}, f) : l.isArray(f) ? f.slice() : f;
2753
- }
2754
- function s(c, f, h, y) {
2755
- if (l.isUndefined(f)) {
2756
- if (!l.isUndefined(c))
2757
- return n(void 0, c, h, y);
2758
- } else return n(c, f, h, y);
2759
- }
2760
- function i(c, f) {
2761
- if (!l.isUndefined(f))
2762
- return n(void 0, f);
2763
- }
2764
- function a(c, f) {
2765
- if (l.isUndefined(f)) {
2766
- if (!l.isUndefined(c))
2767
- return n(void 0, c);
2768
- } else return n(void 0, f);
2769
- }
2770
- function o(c, f, h) {
2771
- if (h in e)
2772
- return n(c, f);
2773
- if (h in t)
2774
- return n(void 0, c);
2775
- }
2776
- const u = {
2777
- url: i,
2778
- method: i,
2779
- data: i,
2780
- baseURL: a,
2781
- transformRequest: a,
2782
- transformResponse: a,
2783
- paramsSerializer: a,
2784
- timeout: a,
2785
- timeoutMessage: a,
2786
- withCredentials: a,
2787
- withXSRFToken: a,
2788
- adapter: a,
2789
- responseType: a,
2790
- xsrfCookieName: a,
2791
- xsrfHeaderName: a,
2792
- onUploadProgress: a,
2793
- onDownloadProgress: a,
2794
- decompress: a,
2795
- maxContentLength: a,
2796
- maxBodyLength: a,
2797
- beforeRedirect: a,
2798
- transport: a,
2799
- httpAgent: a,
2800
- httpsAgent: a,
2801
- cancelToken: a,
2802
- socketPath: a,
2803
- responseEncoding: a,
2804
- validateStatus: o,
2805
- headers: (c, f, h) => s(We(c), We(f), h, !0)
2806
- };
2807
- return l.forEach(Object.keys({ ...t, ...e }), function(f) {
2808
- const h = u[f] || s, y = h(t[f], e[f], f);
2809
- l.isUndefined(y) && h !== o || (r[f] = y);
2810
- }), r;
2811
- }
2812
- const Pt = (t) => {
2813
- const e = V({}, t);
2814
- let { data: r, withXSRFToken: n, xsrfHeaderName: s, xsrfCookieName: i, headers: a, auth: o } = e;
2815
- e.headers = a = P.from(a), e.url = xt(Nt(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), o && a.set(
2816
- "Authorization",
2817
- "Basic " + btoa((o.username || "") + ":" + (o.password ? unescape(encodeURIComponent(o.password)) : ""))
2818
- );
2819
- let u;
2820
- if (l.isFormData(r)) {
2821
- if (F.hasStandardBrowserEnv || F.hasStandardBrowserWebWorkerEnv)
2822
- a.setContentType(void 0);
2823
- else if ((u = a.getContentType()) !== !1) {
2824
- const [c, ...f] = u ? u.split(";").map((h) => h.trim()).filter(Boolean) : [];
2825
- a.setContentType([c || "multipart/form-data", ...f].join("; "));
2826
- }
2827
- }
2828
- if (F.hasStandardBrowserEnv && (n && l.isFunction(n) && (n = n(e)), n || n !== !1 && Cn(e.url))) {
2829
- const c = s && i && kn.read(i);
2830
- c && a.set(s, c);
2831
- }
2832
- return e;
2833
- }, Mn = typeof XMLHttpRequest < "u", jn = Mn && function(t) {
2834
- return new Promise(function(r, n) {
2835
- const s = Pt(t);
2836
- let i = s.data;
2837
- const a = P.from(s.headers).normalize();
2838
- let { responseType: o, onUploadProgress: u, onDownloadProgress: c } = s, f, h, y, w, p;
2839
- function g() {
2840
- w && w(), p && p(), s.cancelToken && s.cancelToken.unsubscribe(f), s.signal && s.signal.removeEventListener("abort", f);
2841
- }
2842
- let m = new XMLHttpRequest();
2843
- m.open(s.method.toUpperCase(), s.url, !0), m.timeout = s.timeout;
2844
- function d() {
2845
- if (!m)
2846
- return;
2847
- const E = P.from(
2848
- "getAllResponseHeaders" in m && m.getAllResponseHeaders()
2849
- ), T = {
2850
- data: !o || o === "text" || o === "json" ? m.responseText : m.response,
2851
- status: m.status,
2852
- statusText: m.statusText,
2853
- headers: E,
2854
- config: t,
2855
- request: m
2856
- };
2857
- _t(function(x) {
2858
- r(x), g();
2859
- }, function(x) {
2860
- n(x), g();
2861
- }, T), m = null;
2862
- }
2863
- "onloadend" in m ? m.onloadend = d : m.onreadystatechange = function() {
2864
- !m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(d);
2865
- }, m.onabort = function() {
2866
- m && (n(new S("Request aborted", S.ECONNABORTED, t, m)), m = null);
2867
- }, m.onerror = function() {
2868
- n(new S("Network Error", S.ERR_NETWORK, t, m)), m = null;
2869
- }, m.ontimeout = function() {
2870
- let O = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
2871
- const T = s.transitional || Rt;
2872
- s.timeoutErrorMessage && (O = s.timeoutErrorMessage), n(new S(
2873
- O,
2874
- T.clarifyTimeoutError ? S.ETIMEDOUT : S.ECONNABORTED,
2875
- t,
2876
- m
2877
- )), m = null;
2878
- }, i === void 0 && a.setContentType(null), "setRequestHeader" in m && l.forEach(a.toJSON(), function(O, T) {
2879
- m.setRequestHeader(T, O);
2880
- }), l.isUndefined(s.withCredentials) || (m.withCredentials = !!s.withCredentials), o && o !== "json" && (m.responseType = s.responseType), c && ([y, p] = de(c, !0), m.addEventListener("progress", y)), u && m.upload && ([h, w] = de(u), m.upload.addEventListener("progress", h), m.upload.addEventListener("loadend", w)), (s.cancelToken || s.signal) && (f = (E) => {
2881
- m && (n(!E || E.type ? new Y(null, t, m) : E), m.abort(), m = null);
2882
- }, s.cancelToken && s.cancelToken.subscribe(f), s.signal && (s.signal.aborted ? f() : s.signal.addEventListener("abort", f)));
2883
- const b = _n(s.url);
2884
- if (b && F.protocols.indexOf(b) === -1) {
2885
- n(new S("Unsupported protocol " + b + ":", S.ERR_BAD_REQUEST, t));
2886
- return;
2887
- }
2888
- m.send(i || null);
2889
- });
2890
- }, In = (t, e) => {
2891
- const { length: r } = t = t ? t.filter(Boolean) : [];
2892
- if (e || r) {
2893
- let n = new AbortController(), s;
2894
- const i = function(c) {
2895
- if (!s) {
2896
- s = !0, o();
2897
- const f = c instanceof Error ? c : this.reason;
2898
- n.abort(f instanceof S ? f : new Y(f instanceof Error ? f.message : f));
2899
- }
2900
- };
2901
- let a = e && setTimeout(() => {
2902
- a = null, i(new S(`timeout ${e} of ms exceeded`, S.ETIMEDOUT));
2903
- }, e);
2904
- const o = () => {
2905
- t && (a && clearTimeout(a), a = null, t.forEach((c) => {
2906
- c.unsubscribe ? c.unsubscribe(i) : c.removeEventListener("abort", i);
2907
- }), t = null);
2908
- };
2909
- t.forEach((c) => c.addEventListener("abort", i));
2910
- const { signal: u } = n;
2911
- return u.unsubscribe = () => l.asap(o), u;
2912
- }
2913
- }, Ln = function* (t, e) {
2914
- let r = t.byteLength;
2915
- if (r < e) {
2916
- yield t;
2917
- return;
2918
- }
2919
- let n = 0, s;
2920
- for (; n < r; )
2921
- s = n + e, yield t.slice(n, s), n = s;
2922
- }, Un = async function* (t, e) {
2923
- for await (const r of qn(t))
2924
- yield* Ln(r, e);
2925
- }, qn = async function* (t) {
2926
- if (t[Symbol.asyncIterator]) {
2927
- yield* t;
2928
- return;
2929
- }
2930
- const e = t.getReader();
2931
- try {
2932
- for (; ; ) {
2933
- const { done: r, value: n } = await e.read();
2934
- if (r)
2935
- break;
2936
- yield n;
2937
- }
2938
- } finally {
2939
- await e.cancel();
2940
- }
2941
- }, Xe = (t, e, r, n) => {
2942
- const s = Un(t, e);
2943
- let i = 0, a, o = (u) => {
2944
- a || (a = !0, n && n(u));
2945
- };
2946
- return new ReadableStream({
2947
- async pull(u) {
2948
- try {
2949
- const { done: c, value: f } = await s.next();
2950
- if (c) {
2951
- o(), u.close();
2952
- return;
2953
- }
2954
- let h = f.byteLength;
2955
- if (r) {
2956
- let y = i += h;
2957
- r(y);
2958
- }
2959
- u.enqueue(new Uint8Array(f));
2960
- } catch (c) {
2961
- throw o(c), c;
2962
- }
2963
- },
2964
- cancel(u) {
2965
- return o(u), s.return();
2966
- }
2967
- }, {
2968
- highWaterMark: 2
2969
- });
2970
- }, we = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Ct = we && typeof ReadableStream == "function", zn = we && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((t) => (e) => t.encode(e))(new TextEncoder()) : async (t) => new Uint8Array(await new Response(t).arrayBuffer())), kt = (t, ...e) => {
2971
- try {
2972
- return !!t(...e);
2973
- } catch {
2974
- return !1;
2975
- }
2976
- }, Hn = Ct && kt(() => {
2977
- let t = !1;
2978
- const e = new Request(F.origin, {
2979
- body: new ReadableStream(),
2980
- method: "POST",
2981
- get duplex() {
2982
- return t = !0, "half";
2983
- }
2984
- }).headers.has("Content-Type");
2985
- return t && !e;
2986
- }), Ze = 64 * 1024, _e = Ct && kt(() => l.isReadableStream(new Response("").body)), pe = {
2987
- stream: _e && ((t) => t.body)
2988
- };
2989
- we && ((t) => {
2990
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((e) => {
2991
- !pe[e] && (pe[e] = l.isFunction(t[e]) ? (r) => r[e]() : (r, n) => {
2992
- throw new S(`Response type '${e}' is not supported`, S.ERR_NOT_SUPPORT, n);
2993
- });
2994
- });
2995
- })(new Response());
2996
- const Vn = async (t) => {
2997
- if (t == null)
2998
- return 0;
2999
- if (l.isBlob(t))
3000
- return t.size;
3001
- if (l.isSpecCompliantForm(t))
3002
- return (await new Request(F.origin, {
3003
- method: "POST",
3004
- body: t
3005
- }).arrayBuffer()).byteLength;
3006
- if (l.isArrayBufferView(t) || l.isArrayBuffer(t))
3007
- return t.byteLength;
3008
- if (l.isURLSearchParams(t) && (t = t + ""), l.isString(t))
3009
- return (await zn(t)).byteLength;
3010
- }, Gn = async (t, e) => {
3011
- const r = l.toFiniteNumber(t.getContentLength());
3012
- return r ?? Vn(e);
3013
- }, Jn = we && (async (t) => {
3014
- let {
3015
- url: e,
3016
- method: r,
3017
- data: n,
3018
- signal: s,
3019
- cancelToken: i,
3020
- timeout: a,
3021
- onDownloadProgress: o,
3022
- onUploadProgress: u,
3023
- responseType: c,
3024
- headers: f,
3025
- withCredentials: h = "same-origin",
3026
- fetchOptions: y
3027
- } = Pt(t);
3028
- c = c ? (c + "").toLowerCase() : "text";
3029
- let w = In([s, i && i.toAbortSignal()], a), p;
3030
- const g = w && w.unsubscribe && (() => {
3031
- w.unsubscribe();
3032
- });
3033
- let m;
3034
- try {
3035
- if (u && Hn && r !== "get" && r !== "head" && (m = await Gn(f, n)) !== 0) {
3036
- let T = new Request(e, {
3037
- method: "POST",
3038
- body: n,
3039
- duplex: "half"
3040
- }), v;
3041
- if (l.isFormData(n) && (v = T.headers.get("content-type")) && f.setContentType(v), T.body) {
3042
- const [x, C] = Ke(
3043
- m,
3044
- de(Ye(u))
3045
- );
3046
- n = Xe(T.body, Ze, x, C);
3047
- }
3048
- }
3049
- l.isString(h) || (h = h ? "include" : "omit");
3050
- const d = "credentials" in Request.prototype;
3051
- p = new Request(e, {
3052
- ...y,
3053
- signal: w,
3054
- method: r.toUpperCase(),
3055
- headers: f.normalize().toJSON(),
3056
- body: n,
3057
- duplex: "half",
3058
- credentials: d ? h : void 0
3059
- });
3060
- let b = await fetch(p, y);
3061
- const E = _e && (c === "stream" || c === "response");
3062
- if (_e && (o || E && g)) {
3063
- const T = {};
3064
- ["status", "statusText", "headers"].forEach((k) => {
3065
- T[k] = b[k];
3066
- });
3067
- const v = l.toFiniteNumber(b.headers.get("content-length")), [x, C] = o && Ke(
3068
- v,
3069
- de(Ye(o), !0)
3070
- ) || [];
3071
- b = new Response(
3072
- Xe(b.body, Ze, x, () => {
3073
- C && C(), g && g();
3074
- }),
3075
- T
3076
- );
3077
- }
3078
- c = c || "text";
3079
- let O = await pe[l.findKey(pe, c) || "text"](b, t);
3080
- return !E && g && g(), await new Promise((T, v) => {
3081
- _t(T, v, {
3082
- data: O,
3083
- headers: P.from(b.headers),
3084
- status: b.status,
3085
- statusText: b.statusText,
3086
- config: t,
3087
- request: p
3088
- });
3089
- });
3090
- } catch (d) {
3091
- throw g && g(), d && d.name === "TypeError" && /Load failed|fetch/i.test(d.message) ? Object.assign(
3092
- new S("Network Error", S.ERR_NETWORK, t, p),
3093
- {
3094
- cause: d.cause || d
3095
- }
3096
- ) : S.from(d, d && d.code, t, p);
3097
- }
3098
- }), Ne = {
3099
- http: ln,
3100
- xhr: jn,
3101
- fetch: Jn
3102
- };
3103
- l.forEach(Ne, (t, e) => {
3104
- if (t) {
3105
- try {
3106
- Object.defineProperty(t, "name", { value: e });
3107
- } catch {
3108
- }
3109
- Object.defineProperty(t, "adapterName", { value: e });
3110
- }
3111
- });
3112
- const Qe = (t) => `- ${t}`, Kn = (t) => l.isFunction(t) || t === null || t === !1, $t = {
3113
- getAdapter: (t) => {
3114
- t = l.isArray(t) ? t : [t];
3115
- const { length: e } = t;
3116
- let r, n;
3117
- const s = {};
3118
- for (let i = 0; i < e; i++) {
3119
- r = t[i];
3120
- let a;
3121
- if (n = r, !Kn(r) && (n = Ne[(a = String(r)).toLowerCase()], n === void 0))
3122
- throw new S(`Unknown adapter '${a}'`);
3123
- if (n)
3124
- break;
3125
- s[a || "#" + i] = n;
3126
- }
3127
- if (!n) {
3128
- const i = Object.entries(s).map(
3129
- ([o, u]) => `adapter ${o} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
3130
- );
3131
- let a = e ? i.length > 1 ? `since :
3132
- ` + i.map(Qe).join(`
3133
- `) : " " + Qe(i[0]) : "as no adapter specified";
3134
- throw new S(
3135
- "There is no suitable adapter to dispatch the request " + a,
3136
- "ERR_NOT_SUPPORT"
3137
- );
3138
- }
3139
- return n;
3140
- },
3141
- adapters: Ne
3142
- };
3143
- function Ae(t) {
3144
- if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
3145
- throw new Y(null, t);
3146
- }
3147
- function et(t) {
3148
- return Ae(t), t.headers = P.from(t.headers), t.data = ve.call(
3149
- t,
3150
- t.transformRequest
3151
- ), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), $t.getAdapter(t.adapter || ne.adapter)(t).then(function(n) {
3152
- return Ae(t), n.data = ve.call(
3153
- t,
3154
- t.transformResponse,
3155
- n
3156
- ), n.headers = P.from(n.headers), n;
3157
- }, function(n) {
3158
- return Dt(n) || (Ae(t), n && n.response && (n.response.data = ve.call(
3159
- t,
3160
- t.transformResponse,
3161
- n.response
3162
- ), n.response.headers = P.from(n.response.headers))), Promise.reject(n);
3163
- });
3164
- }
3165
- const Bt = "1.11.0", Se = {};
3166
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
3167
- Se[t] = function(n) {
3168
- return typeof n === t || "a" + (e < 1 ? "n " : " ") + t;
3169
- };
3170
- });
3171
- const tt = {};
3172
- Se.transitional = function(e, r, n) {
3173
- function s(i, a) {
3174
- return "[Axios v" + Bt + "] Transitional option '" + i + "'" + a + (n ? ". " + n : "");
3175
- }
3176
- return (i, a, o) => {
3177
- if (e === !1)
3178
- throw new S(
3179
- s(a, " has been removed" + (r ? " in " + r : "")),
3180
- S.ERR_DEPRECATED
3181
- );
3182
- return r && !tt[a] && (tt[a] = !0, console.warn(
3183
- s(
3184
- a,
3185
- " has been deprecated since v" + r + " and will be removed in the near future"
3186
- )
3187
- )), e ? e(i, a, o) : !0;
3188
- };
3189
- };
3190
- Se.spelling = function(e) {
3191
- return (r, n) => (console.warn(`${n} is likely a misspelling of ${e}`), !0);
3192
- };
3193
- function Yn(t, e, r) {
3194
- if (typeof t != "object")
3195
- throw new S("options must be an object", S.ERR_BAD_OPTION_VALUE);
3196
- const n = Object.keys(t);
3197
- let s = n.length;
3198
- for (; s-- > 0; ) {
3199
- const i = n[s], a = e[i];
3200
- if (a) {
3201
- const o = t[i], u = o === void 0 || a(o, i, t);
3202
- if (u !== !0)
3203
- throw new S("option " + i + " must be " + u, S.ERR_BAD_OPTION_VALUE);
3204
- continue;
3205
- }
3206
- if (r !== !0)
3207
- throw new S("Unknown option " + i, S.ERR_BAD_OPTION);
3208
- }
3209
- }
3210
- const ce = {
3211
- assertOptions: Yn,
3212
- validators: Se
3213
- }, B = ce.validators;
3214
- let H = class {
3215
- constructor(e) {
3216
- this.defaults = e || {}, this.interceptors = {
3217
- request: new Ge(),
3218
- response: new Ge()
3219
- };
3220
- }
3221
- /**
3222
- * Dispatch a request
3223
- *
3224
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
3225
- * @param {?Object} config
3226
- *
3227
- * @returns {Promise} The Promise to be fulfilled
3228
- */
3229
- async request(e, r) {
3230
- try {
3231
- return await this._request(e, r);
3232
- } catch (n) {
3233
- if (n instanceof Error) {
3234
- let s = {};
3235
- Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
3236
- const i = s.stack ? s.stack.replace(/^.+\n/, "") : "";
3237
- try {
3238
- n.stack ? i && !String(n.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (n.stack += `
3239
- ` + i) : n.stack = i;
3240
- } catch {
3241
- }
3242
- }
3243
- throw n;
3244
- }
3245
- }
3246
- _request(e, r) {
3247
- typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r = V(this.defaults, r);
3248
- const { transitional: n, paramsSerializer: s, headers: i } = r;
3249
- n !== void 0 && ce.assertOptions(n, {
3250
- silentJSONParsing: B.transitional(B.boolean),
3251
- forcedJSONParsing: B.transitional(B.boolean),
3252
- clarifyTimeoutError: B.transitional(B.boolean)
3253
- }, !1), s != null && (l.isFunction(s) ? r.paramsSerializer = {
3254
- serialize: s
3255
- } : ce.assertOptions(s, {
3256
- encode: B.function,
3257
- serialize: B.function
3258
- }, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), ce.assertOptions(r, {
3259
- baseUrl: B.spelling("baseURL"),
3260
- withXsrfToken: B.spelling("withXSRFToken")
3261
- }, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
3262
- let a = i && l.merge(
3263
- i.common,
3264
- i[r.method]
3265
- );
3266
- i && l.forEach(
3267
- ["delete", "get", "head", "post", "put", "patch", "common"],
3268
- (p) => {
3269
- delete i[p];
3270
- }
3271
- ), r.headers = P.concat(a, i);
3272
- const o = [];
3273
- let u = !0;
3274
- this.interceptors.request.forEach(function(g) {
3275
- typeof g.runWhen == "function" && g.runWhen(r) === !1 || (u = u && g.synchronous, o.unshift(g.fulfilled, g.rejected));
3276
- });
3277
- const c = [];
3278
- this.interceptors.response.forEach(function(g) {
3279
- c.push(g.fulfilled, g.rejected);
3280
- });
3281
- let f, h = 0, y;
3282
- if (!u) {
3283
- const p = [et.bind(this), void 0];
3284
- for (p.unshift(...o), p.push(...c), y = p.length, f = Promise.resolve(r); h < y; )
3285
- f = f.then(p[h++], p[h++]);
3286
- return f;
3287
- }
3288
- y = o.length;
3289
- let w = r;
3290
- for (h = 0; h < y; ) {
3291
- const p = o[h++], g = o[h++];
3292
- try {
3293
- w = p(w);
3294
- } catch (m) {
3295
- g.call(this, m);
3296
- break;
3297
- }
3298
- }
3299
- try {
3300
- f = et.call(this, w);
3301
- } catch (p) {
3302
- return Promise.reject(p);
3303
- }
3304
- for (h = 0, y = c.length; h < y; )
3305
- f = f.then(c[h++], c[h++]);
3306
- return f;
3307
- }
3308
- getUri(e) {
3309
- e = V(this.defaults, e);
3310
- const r = Nt(e.baseURL, e.url, e.allowAbsoluteUrls);
3311
- return xt(r, e.params, e.paramsSerializer);
3312
- }
3313
- };
3314
- l.forEach(["delete", "get", "head", "options"], function(e) {
3315
- H.prototype[e] = function(r, n) {
3316
- return this.request(V(n || {}, {
3317
- method: e,
3318
- url: r,
3319
- data: (n || {}).data
3320
- }));
3321
- };
3322
- });
3323
- l.forEach(["post", "put", "patch"], function(e) {
3324
- function r(n) {
3325
- return function(i, a, o) {
3326
- return this.request(V(o || {}, {
3327
- method: e,
3328
- headers: n ? {
3329
- "Content-Type": "multipart/form-data"
3330
- } : {},
3331
- url: i,
3332
- data: a
3333
- }));
3334
- };
3335
- }
3336
- H.prototype[e] = r(), H.prototype[e + "Form"] = r(!0);
3337
- });
3338
- let Wn = class Mt {
3339
- constructor(e) {
3340
- if (typeof e != "function")
3341
- throw new TypeError("executor must be a function.");
3342
- let r;
3343
- this.promise = new Promise(function(i) {
3344
- r = i;
3345
- });
3346
- const n = this;
3347
- this.promise.then((s) => {
3348
- if (!n._listeners) return;
3349
- let i = n._listeners.length;
3350
- for (; i-- > 0; )
3351
- n._listeners[i](s);
3352
- n._listeners = null;
3353
- }), this.promise.then = (s) => {
3354
- let i;
3355
- const a = new Promise((o) => {
3356
- n.subscribe(o), i = o;
3357
- }).then(s);
3358
- return a.cancel = function() {
3359
- n.unsubscribe(i);
3360
- }, a;
3361
- }, e(function(i, a, o) {
3362
- n.reason || (n.reason = new Y(i, a, o), r(n.reason));
3363
- });
3364
- }
3365
- /**
3366
- * Throws a `CanceledError` if cancellation has been requested.
3367
- */
3368
- throwIfRequested() {
3369
- if (this.reason)
3370
- throw this.reason;
3371
- }
3372
- /**
3373
- * Subscribe to the cancel signal
3374
- */
3375
- subscribe(e) {
3376
- if (this.reason) {
3377
- e(this.reason);
3378
- return;
3379
- }
3380
- this._listeners ? this._listeners.push(e) : this._listeners = [e];
3381
- }
3382
- /**
3383
- * Unsubscribe from the cancel signal
3384
- */
3385
- unsubscribe(e) {
3386
- if (!this._listeners)
3387
- return;
3388
- const r = this._listeners.indexOf(e);
3389
- r !== -1 && this._listeners.splice(r, 1);
3390
- }
3391
- toAbortSignal() {
3392
- const e = new AbortController(), r = (n) => {
3393
- e.abort(n);
3394
- };
3395
- return this.subscribe(r), e.signal.unsubscribe = () => this.unsubscribe(r), e.signal;
3396
- }
3397
- /**
3398
- * Returns an object that contains a new `CancelToken` and a function that, when called,
3399
- * cancels the `CancelToken`.
3400
- */
3401
- static source() {
3402
- let e;
3403
- return {
3404
- token: new Mt(function(s) {
3405
- e = s;
3406
- }),
3407
- cancel: e
3408
- };
3409
- }
3410
- };
3411
- function Xn(t) {
3412
- return function(r) {
3413
- return t.apply(null, r);
3414
- };
3415
- }
3416
- function Zn(t) {
3417
- return l.isObject(t) && t.isAxiosError === !0;
3418
- }
3419
- const Pe = {
3420
- Continue: 100,
3421
- SwitchingProtocols: 101,
3422
- Processing: 102,
3423
- EarlyHints: 103,
3424
- Ok: 200,
3425
- Created: 201,
3426
- Accepted: 202,
3427
- NonAuthoritativeInformation: 203,
3428
- NoContent: 204,
3429
- ResetContent: 205,
3430
- PartialContent: 206,
3431
- MultiStatus: 207,
3432
- AlreadyReported: 208,
3433
- ImUsed: 226,
3434
- MultipleChoices: 300,
3435
- MovedPermanently: 301,
3436
- Found: 302,
3437
- SeeOther: 303,
3438
- NotModified: 304,
3439
- UseProxy: 305,
3440
- Unused: 306,
3441
- TemporaryRedirect: 307,
3442
- PermanentRedirect: 308,
3443
- BadRequest: 400,
3444
- Unauthorized: 401,
3445
- PaymentRequired: 402,
3446
- Forbidden: 403,
3447
- NotFound: 404,
3448
- MethodNotAllowed: 405,
3449
- NotAcceptable: 406,
3450
- ProxyAuthenticationRequired: 407,
3451
- RequestTimeout: 408,
3452
- Conflict: 409,
3453
- Gone: 410,
3454
- LengthRequired: 411,
3455
- PreconditionFailed: 412,
3456
- PayloadTooLarge: 413,
3457
- UriTooLong: 414,
3458
- UnsupportedMediaType: 415,
3459
- RangeNotSatisfiable: 416,
3460
- ExpectationFailed: 417,
3461
- ImATeapot: 418,
3462
- MisdirectedRequest: 421,
3463
- UnprocessableEntity: 422,
3464
- Locked: 423,
3465
- FailedDependency: 424,
3466
- TooEarly: 425,
3467
- UpgradeRequired: 426,
3468
- PreconditionRequired: 428,
3469
- TooManyRequests: 429,
3470
- RequestHeaderFieldsTooLarge: 431,
3471
- UnavailableForLegalReasons: 451,
3472
- InternalServerError: 500,
3473
- NotImplemented: 501,
3474
- BadGateway: 502,
3475
- ServiceUnavailable: 503,
3476
- GatewayTimeout: 504,
3477
- HttpVersionNotSupported: 505,
3478
- VariantAlsoNegotiates: 506,
3479
- InsufficientStorage: 507,
3480
- LoopDetected: 508,
3481
- NotExtended: 510,
3482
- NetworkAuthenticationRequired: 511
3483
- };
3484
- Object.entries(Pe).forEach(([t, e]) => {
3485
- Pe[e] = t;
3486
- });
3487
- function jt(t) {
3488
- const e = new H(t), r = pt(H.prototype.request, e);
3489
- return l.extend(r, H.prototype, e, { allOwnKeys: !0 }), l.extend(r, e, null, { allOwnKeys: !0 }), r.create = function(s) {
3490
- return jt(V(t, s));
3491
- }, r;
3492
- }
3493
- const A = jt(ne);
3494
- A.Axios = H;
3495
- A.CanceledError = Y;
3496
- A.CancelToken = Wn;
3497
- A.isCancel = Dt;
3498
- A.VERSION = Bt;
3499
- A.toFormData = ye;
3500
- A.AxiosError = S;
3501
- A.Cancel = A.CanceledError;
3502
- A.all = function(e) {
3503
- return Promise.all(e);
3504
- };
3505
- A.spread = Xn;
3506
- A.isAxiosError = Zn;
3507
- A.mergeConfig = V;
3508
- A.AxiosHeaders = P;
3509
- A.formToJSON = (t) => Ft(l.isHTMLForm(t) ? new FormData(t) : t);
3510
- A.getAdapter = $t.getAdapter;
3511
- A.HttpStatusCode = Pe;
3512
- A.default = A;
3513
- const {
3514
- Axios: $s,
3515
- AxiosError: Bs,
3516
- CanceledError: Ms,
3517
- isCancel: js,
3518
- CancelToken: Is,
3519
- VERSION: Ls,
3520
- all: Us,
3521
- Cancel: qs,
3522
- isAxiosError: zs,
3523
- spread: Hs,
3524
- toFormData: Vs,
3525
- AxiosHeaders: Gs,
3526
- HttpStatusCode: Js,
3527
- formToJSON: Ks,
3528
- getAdapter: Ys,
3529
- mergeConfig: Ws
3530
- } = A, It = {
3531
- timeout: 60 * 1e3,
3532
- headers: {
3533
- Accept: "application/json",
3534
- "Content-Type": "application/json"
3535
- }
3536
- }, se = (t = "", e) => {
3537
- const r = A.create({
3538
- ...It,
3539
- baseURL: ht[e].php_url
3540
- });
3541
- return r.interceptors.request.use(
3542
- (n) => (t && n.headers && (n.headers.Authorization = `Bearer ${t}`), n),
3543
- (n) => Promise.reject(n)
3544
- ), r.interceptors.response.use(
3545
- (n) => n,
3546
- (n) => {
3547
- const { response: s, request: i } = n || {};
3548
- return Promise.reject(s || i);
3549
- }
3550
- ), r;
3551
- }, W = (t = "", e) => {
3552
- const r = A.create({
3553
- ...It,
3554
- baseURL: ht[e].rearch_url
3555
- });
3556
- return r.interceptors.request.use(
3557
- (n) => (t && n.headers && (n.headers.Authorization = `Bearer ${t}`), n),
3558
- (n) => Promise.reject(n)
3559
- ), r.interceptors.response.use(
3560
- (n) => n,
3561
- (n) => {
3562
- const { response: s, request: i } = n || {};
3563
- return Promise.reject(s || i);
3564
- }
3565
- ), r;
3566
- }, Qn = "/preferences/doctor", es = "/preferences/visitpad", ts = "/preferences/branch", rs = "patient/search", ns = "../api/modelGetAddPatientSuggestion.php", ss = "appointments/get", is = "/v1/patient/add", as = "/v1/patients", os = "../api/modelSavePatientImage.php", ls = "../api/modelDeletePatientImage.php", us = "/patient/detail", Xs = async (t = "", e = {}, r, n, s) => {
3567
- const { doc_rid: i = "" } = e;
3568
- let a = "";
3569
- Array.isArray(t) ? a = t.map((o) => `&fields_required=${encodeURIComponent(o)}`).join("") : t && (a = `&fields_required=${encodeURIComponent(t)}`);
3570
- try {
3571
- const o = await se(s?.token, s.envName).get(
3572
- `${Qn}/${i || r}?branch_id=${n}` + a
3573
- ), { data: u } = o || {};
3574
- return Promise.resolve(u);
3575
- } catch (o) {
3576
- return console.error("Error fetching doctor preference:", o), Promise.reject(o);
3577
- }
3578
- }, Zs = async (t = "", e, r) => {
3579
- try {
3580
- const n = await W(r.token, r.envName).get(
3581
- `${ts}/${e}?fields_required=${t}`
3582
- ), { data: s } = n || {};
3583
- return Promise.resolve(s);
3584
- } catch (n) {
3585
- return console.log(n), Promise.reject(n);
3586
- }
3587
- }, cs = async (t, e, r, n, s) => {
3588
- try {
3589
- const i = {
3590
- appnt_date: t,
3591
- // If empty then will take today's date
3592
- doctor_role_id: e,
3593
- doctor_id: n,
3594
- org_branch_id: r
3595
- }, a = await W(s.token, s.envName).post(ss, {
3596
- ...i
3597
- }), { data: o } = a || {};
3598
- return Promise.resolve(o);
3599
- } catch (i) {
3600
- return i instanceof Error && console.error("Error fetching appointments:", i.message), i?.response?.status === 401 && dt(), Promise.reject(i);
3601
- }
3602
- }, Qs = async (t, e) => {
3603
- let r = [];
3604
- const n = await cs(
3605
- I().format("YYYY-MM-DD"),
3606
- t.doctor_role_id,
3607
- t.branch_id,
3608
- t.doctor_id,
3609
- e
3610
- );
3611
- n?.appointments?.length && (r = n.appointments), window.filteredUpcomingAppts = [], r.length && (t.term?.length ? window.filteredUpcomingAppts = r.filter((s) => s.org_person_name.length && s.org_person_name.toLowerCase().includes(t.term.toLowerCase()) && s.appnt_date >= I(/* @__PURE__ */ new Date()).format("YYYY-MM-DD") && (s.remote_appnt_status === "CONFIRMED" || s.appnt_status === 0 || s.appnt_status === 3 || s.appnt_status === 5)) : window.filteredUpcomingAppts = r.filter((s) => s.appnt_date >= I(/* @__PURE__ */ new Date()).format("YYYY-MM-DD") && (s.remote_appnt_status === "CONFIRMED" || s.appnt_status === 0 || s.appnt_status === 3 || s.appnt_status === 5)));
3612
- try {
3613
- const s = await W(e.token, e.envName).post(
3614
- rs,
3615
- t
3616
- ), { data: i } = s || {};
3617
- return Promise.resolve(i);
3618
- } catch (s) {
3619
- return console.log(s), null;
3620
- }
3621
- }, ei = async (t) => {
3622
- try {
3623
- const e = await se(t.token, t.envName).post(
3624
- ns
3625
- ), { data: r } = e || {}, { apiError: n } = r || {};
3626
- if (n)
3627
- throw new Error(n);
3628
- return Promise.resolve(r);
3629
- } catch (e) {
3630
- return e instanceof Error && console.error("Error fetching referred by list:", e.message), e?.response?.status === 401 && dt(), Promise.reject(e);
3631
- }
3632
- }, ti = async (t, e) => {
3633
- try {
3634
- const r = await W(e.token, e.envName).post(is, {
3635
- ...t,
3636
- token: e.token
3637
- }), { data: n } = r || {};
3638
- return Promise.resolve(n);
3639
- } catch (r) {
3640
- return Promise.reject(r);
3641
- }
3642
- }, ri = async (t, e) => {
3643
- try {
3644
- const r = await W(e.token, e.envName).put(
3645
- as + "/" + t?.person_role_id,
3646
- {
3647
- ...t
3648
- }
3649
- ), { data: n } = r || {};
3650
- return Promise.resolve(n);
3651
- } catch (r) {
3652
- return console.log(r), Promise.reject(r);
3653
- }
3654
- }, ni = async (t, e) => {
3655
- try {
3656
- const r = await se(e.token, e.envName).post(
3657
- os,
3658
- t
3659
- ), { data: n } = r || {};
3660
- return Promise.resolve(n);
3661
- } catch (r) {
3662
- return console.log(r), Promise.reject(r);
3663
- }
3664
- }, si = async (t, e) => {
3665
- try {
3666
- const r = await se(e.token, e.envName).post(
3667
- ls,
3668
- t
3669
- ), { data: n } = r || {};
3670
- return Promise.resolve(n);
3671
- } catch (r) {
3672
- return console.log(r), Promise.reject(r);
3673
- }
3674
- }, ii = async ({
3675
- callback: t,
3676
- payload: e,
3677
- token_env: r,
3678
- isCallbackNeeded: n = !0
3679
- }) => {
3680
- try {
3681
- const s = e;
3682
- window?.partner_service_enabled === "1" && (s.partner_service_enabled = !0);
3683
- const i = await W(r.token, r.envName).post(
3684
- us,
3685
- {
3686
- ...s
3687
- }
3688
- ), { data: a } = i || {}, { error: o } = a || {};
3689
- if (o)
3690
- throw new Error(o);
3691
- if (n)
3692
- t(a);
3693
- else return a;
3694
- } catch (s) {
3695
- console.log(s);
3696
- }
3697
- }, ai = async ({ doc_id: t = "", doc_rid: e = "" }, r, n, s, i) => {
3698
- try {
3699
- const a = {
3700
- branch_id: n,
3701
- doctor_id: t || s,
3702
- doctor_role_id: e || i
3703
- }, o = await se(r.token, r.envName).post(
3704
- es,
3705
- a
3706
- ), { data: u } = o || {};
3707
- return Promise.resolve(u);
3708
- } catch (a) {
3709
- return console.error("Error fetching visitpad preference:", a), Promise.reject(a);
3710
- }
3711
- };
3712
- export {
3713
- Ps as A,
3714
- Ns as B,
3715
- ds as C,
3716
- gs as D,
3717
- br as E,
3718
- Xs as F,
3719
- us as G,
3720
- ps as H,
3721
- ai as I,
3722
- ys as M,
3723
- hs as O,
3724
- W as R,
3725
- bs as S,
3726
- Zs as a,
3727
- ei as b,
3728
- _s as c,
3729
- Ds as d,
3730
- Ss as e,
3731
- ii as f,
3732
- ws as g,
3733
- Fs as h,
3734
- Ts as i,
3735
- Os as j,
3736
- Rs as k,
3737
- ms as l,
3738
- pr as m,
3739
- As as n,
3740
- vs as o,
3741
- Es as p,
3742
- ti as q,
3743
- Qs as r,
3744
- ni as s,
3745
- si as t,
3746
- ri as u,
3747
- xs as v,
3748
- yr as w,
3749
- se as x,
3750
- wr as y,
3751
- Sr as z
3752
- };