mvframe 1.0.18 → 1.0.58

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.
@@ -1,238 +1,248 @@
1
- import { g as k } from "./vendor.js";
2
- import { a as ie, m as le, b as se, c as ae, p as ce, u as ue } from "./vendor.js";
3
- const O = "lang", D = (t) => {
4
- var o, s;
5
- const e = typeof window < "u", r = () => {
6
- if (!e)
1
+ import { M as B, g as U, s as V } from "./vendor.js";
2
+ import { a as Se, m as $e, b as Pe, c as Me, p as Le, u as Ae } from "./vendor.js";
3
+ import C from "axios";
4
+ const W = "lang", pe = (e, t) => {
5
+ var i, l;
6
+ const n = typeof window < "u", r = () => {
7
+ var m;
8
+ if (!n)
7
9
  return { innerWidth: 1920, innerHeight: 1080 };
8
- const i = window, l = typeof navigator < "u" ? i.navigator : {}, c = i.screen || {}, a = i.visualViewport, u = {
9
- innerWidth: i.innerWidth,
10
- innerHeight: i.innerHeight,
11
- outerWidth: i.outerWidth,
12
- outerHeight: i.outerHeight,
13
- screenWidth: c.width ?? i.innerWidth,
14
- screenHeight: c.height ?? i.innerHeight,
15
- availWidth: c.availWidth ?? i.innerWidth,
16
- availHeight: c.availHeight ?? i.innerHeight,
17
- devicePixelRatio: i.devicePixelRatio || 1
10
+ const s = window, c = typeof navigator < "u" ? s.navigator : {}, u = s.screen || {}, d = s.visualViewport, a = {
11
+ innerWidth: s.innerWidth,
12
+ innerHeight: s.innerHeight,
13
+ outerWidth: s.outerWidth,
14
+ outerHeight: s.outerHeight,
15
+ screenWidth: u.width ?? s.innerWidth,
16
+ screenHeight: u.height ?? s.innerHeight,
17
+ availWidth: u.availWidth ?? s.innerWidth,
18
+ availHeight: u.availHeight ?? s.innerHeight,
19
+ devicePixelRatio: s.devicePixelRatio || 1,
20
+ bodyHeight: s.innerHeight - ((m = t.pinia) != null && m.useTab ? 36 : 0) - 64 - 32,
21
+ drawerHeight: parseInt(s.innerHeight * 0.9),
22
+ pageHeight: s.innerHeight - 64 - 32,
23
+ pageWidth: s.innerWidth
18
24
  };
19
- a && (u.visualViewportWidth = a.width, u.visualViewportHeight = a.height, u.visualViewportScale = a.scale);
20
- const g = l.userAgent || "";
21
- return u.env = {
25
+ d && (a.visualViewportWidth = d.width, a.visualViewportHeight = d.height, a.visualViewportScale = d.scale);
26
+ const g = c.userAgent || "";
27
+ return a.env = {
22
28
  userAgent: g,
23
- language: l.language || "",
24
- languages: l.languages ? [...l.languages] : [],
25
- platform: l.platform || "",
26
- cookieEnabled: !!l.cookieEnabled,
27
- onLine: l.onLine !== !1,
28
- maxTouchPoints: l.maxTouchPoints || 0,
29
- isTouch: "ontouchstart" in i || (l.maxTouchPoints || 0) > 0,
29
+ language: c.language || "",
30
+ languages: c.languages ? [...c.languages] : [],
31
+ platform: c.platform || "",
32
+ cookieEnabled: !!c.cookieEnabled,
33
+ onLine: c.onLine !== !1,
34
+ maxTouchPoints: c.maxTouchPoints || 0,
35
+ isTouch: "ontouchstart" in s || (c.maxTouchPoints || 0) > 0,
30
36
  isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(
31
37
  g
32
38
  )
33
- }, u;
34
- }, n = () => {
35
- var l;
36
- const i = r();
39
+ }, console.info(a), a;
40
+ }, o = () => {
41
+ var c;
42
+ const s = r();
37
43
  globalThis.$config = globalThis.$config || {}, globalThis.$config.options = {
38
44
  ...globalThis.$config.options || {},
39
- ...i
40
- }, (l = t == null ? void 0 : t.config) != null && l.globalProperties && (t.config.globalProperties.$config = globalThis.$config);
45
+ ...s
46
+ }, (c = e == null ? void 0 : e.config) != null && c.globalProperties && (e.config.globalProperties.$config = globalThis.$config);
41
47
  };
42
- n(), e && (window.addEventListener("resize", n, { passive: !0 }), (s = (o = window.visualViewport) == null ? void 0 : o.addEventListener) == null || s.call(o, "resize", n, {
48
+ o(), n && (window.addEventListener("resize", o, { passive: !0 }), (l = (i = window.visualViewport) == null ? void 0 : i.addEventListener) == null || l.call(i, "resize", o, {
43
49
  passive: !0
44
50
  }));
45
- }, X = (t, e) => {
46
- var l, c;
47
- const r = e || {}, o = (typeof localStorage < "u" ? localStorage.getItem(O) : null) || ((l = globalThis.$config) == null ? void 0 : l.lang) || "en_us", s = Object.assign(
51
+ }, ge = (e, t) => {
52
+ var c, u, d;
53
+ const n = t || {}, r = Array.isArray(n.use) && n.use.length > 0 ? n.use : B;
54
+ globalThis.$config = globalThis.$config || {}, globalThis.$config.langUse = r.filter(
55
+ (a) => a && a.use !== !1 && a.value
56
+ ), (c = e == null ? void 0 : e.config) != null && c.globalProperties && (e.config.globalProperties.$config = globalThis.$config);
57
+ const i = (typeof localStorage < "u" ? localStorage.getItem(W) : null) || ((u = globalThis.$config) == null ? void 0 : u.lang) || "en_us", l = Object.assign(
48
58
  {},
49
- k(o),
50
- ((c = globalThis.$config) == null ? void 0 : c.langMaps) || {},
51
- r.langMaps || {}
52
- ), i = (a, u) => {
59
+ U(i),
60
+ ((d = globalThis.$config) == null ? void 0 : d.langMaps) || {},
61
+ n.langMaps || {}
62
+ ), s = (a, g) => {
53
63
  if (a)
54
- if (u && globalThis.$getType(u) === "Object") {
55
- let g = s[a] || a;
56
- return Object.keys(u).forEach((y) => {
57
- g[`{${y}}`] = u[y];
58
- }), g;
64
+ if (g && globalThis.$getType(g) === "Object") {
65
+ let m = l[a] || a;
66
+ return Object.keys(g).forEach((p) => {
67
+ m[`{${p}}`] = g[p];
68
+ }), m;
59
69
  } else
60
- return s[a] || a;
70
+ return l[a] || a;
61
71
  else
62
- return a;
72
+ return a ?? "";
63
73
  };
64
74
  globalThis.$patchLangMaps = (a) => {
65
- a && globalThis.$getType(a) === "Object" && Object.assign(s, a);
66
- }, globalThis.$l = i, t.config.globalProperties.$l = i, t.config.globalProperties.$patchLangMaps = globalThis.$patchLangMaps, String.prototype.$l = function() {
75
+ a && globalThis.$getType(a) === "Object" && Object.assign(l, a);
76
+ }, globalThis.$l = s, e.config.globalProperties.$l = s, e.config.globalProperties.$patchLangMaps = globalThis.$patchLangMaps, String.prototype.$l = function() {
67
77
  return $l(this);
68
78
  };
69
- }, Q = (t, e) => {
70
- if (!t || !e) return !1;
71
- const r = t.getBoundingClientRect(), n = e.getBoundingClientRect(), o = n.right > r.left && n.left < r.right, s = n.bottom > r.top && n.top < r.bottom;
72
- return o && s;
73
- }, _ = (t, e) => {
74
- if (t === e) return !0;
75
- if (t == null || e == null || typeof t != "object" || typeof e != "object")
76
- return JSON.stringify(t) === JSON.stringify(e);
77
- const r = Object.keys(t), n = Object.keys(e);
78
- if (r.length !== n.length) return !1;
79
- for (const o of r)
80
- if (!n.includes(o) || !_(t[o], e[o])) return !1;
79
+ }, he = (e, t) => {
80
+ if (!e || !t) return !1;
81
+ const n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), o = r.right > n.left && r.left < n.right, i = r.bottom > n.top && r.top < n.bottom;
82
+ return o && i;
83
+ }, N = (e, t) => {
84
+ if (e === t) return !0;
85
+ if (e == null || t == null || typeof e != "object" || typeof t != "object")
86
+ return JSON.stringify(e) === JSON.stringify(t);
87
+ const n = Object.keys(e), r = Object.keys(t);
88
+ if (n.length !== r.length) return !1;
89
+ for (const o of n)
90
+ if (!r.includes(o) || !N(e[o], t[o])) return !1;
81
91
  return !0;
82
- }, M = "download", A = 150, B = (t, e = M) => {
83
- const r = e || M, n = String(t ?? "").trim();
84
- if (!n) return r;
85
- const s = n.replace(/[/\\?%*:|"<>]/g, "_").replace(/\.\./g, "_").split(/[/\\]/).pop() || r, i = 200;
86
- return s.length > i ? s.slice(0, i) : s;
87
- }, H = (t) => {
88
- const e = ((t == null ? void 0 : t.type) || "").toLowerCase();
89
- return e ? e.includes("spreadsheet") || e.includes("ms-excel") || e.includes("excel") && e.includes("application") : !1;
90
- }, v = (t, e) => {
91
- const r = URL.createObjectURL(t), n = B(e), o = document.createElement("a");
92
- o.href = r, o.download = n, o.style.display = "none", document.body.appendChild(o);
92
+ }, x = "download", q = 150, F = (e, t = x) => {
93
+ const n = t || x, r = String(e ?? "").trim();
94
+ if (!r) return n;
95
+ const i = r.replace(/[/\\?%*:|"<>]/g, "_").replace(/\.\./g, "_").split(/[/\\]/).pop() || n, l = 200;
96
+ return i.length > l ? i.slice(0, l) : i;
97
+ }, D = (e) => {
98
+ const t = ((e == null ? void 0 : e.type) || "").toLowerCase();
99
+ return t ? t.includes("spreadsheet") || t.includes("ms-excel") || t.includes("excel") && t.includes("application") : !1;
100
+ }, $ = (e, t) => {
101
+ const n = URL.createObjectURL(e), r = F(t), o = document.createElement("a");
102
+ o.href = n, o.download = r, o.style.display = "none", document.body.appendChild(o);
93
103
  try {
94
104
  o.click();
95
105
  } finally {
96
- document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(r), A);
106
+ document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(n), q);
97
107
  }
98
- }, I = (t) => {
99
- if (!t || t.source !== void 0 || t.type === void 0)
100
- return t;
101
- const { type: e, data: r, url: n, headers: o, name: s, filename: i, init: l, ...c } = t, a = i ?? s;
102
- return e === "csv" ? {
108
+ }, z = (e) => {
109
+ if (!e || e.source !== void 0 || e.type === void 0)
110
+ return e;
111
+ const { type: t, data: n, url: r, headers: o, name: i, filename: l, init: s, ...c } = e, u = l ?? i;
112
+ return t === "csv" ? {
103
113
  ...c,
104
114
  source: "inline",
105
- content: r,
106
- filename: a,
107
- bom: t.bom
108
- } : e === "excel" ? {
115
+ content: n,
116
+ filename: u,
117
+ bom: e.bom
118
+ } : t === "excel" ? {
109
119
  ...c,
110
120
  source: "fetch",
111
- url: n,
112
- init: { ...l || {}, headers: o ?? (l == null ? void 0 : l.headers) },
121
+ url: r,
122
+ init: { ...s || {}, headers: o ?? (s == null ? void 0 : s.headers) },
113
123
  response: "blob",
114
124
  expectExcel: !0,
115
- filename: a
116
- } : t;
117
- }, Z = async (t = {}) => {
118
- const e = I(t), {
119
- source: r = "inline",
120
- content: n,
125
+ filename: u
126
+ } : e;
127
+ }, me = async (e = {}) => {
128
+ const t = z(e), {
129
+ source: n = "inline",
130
+ content: r,
121
131
  blob: o,
122
- bom: s = !0,
123
- mime: i,
124
- url: l,
132
+ bom: i = !0,
133
+ mime: l,
134
+ url: s,
125
135
  init: c,
126
- response: a = "blob",
127
- openIn: u = "self",
128
- expectExcel: g,
129
- filename: y,
130
- name: L,
136
+ response: u = "blob",
137
+ openIn: d = "self",
138
+ expectExcel: a,
139
+ filename: g,
140
+ name: m,
131
141
  error: p = () => {
132
142
  },
133
143
  // 避免 legacy 字段渗入后续逻辑
134
- type: q,
135
- data: G,
136
- headers: Y,
137
- ...J
138
- } = e, b = y ?? L;
144
+ type: le,
145
+ data: ae,
146
+ headers: ce,
147
+ ...ue
148
+ } = t, v = g ?? m;
139
149
  try {
140
- if (r === "inline") {
150
+ if (n === "inline") {
141
151
  if (o instanceof Blob) {
142
- v(o, b);
152
+ $(o, v);
143
153
  return;
144
154
  }
145
- if (n == null) {
155
+ if (r == null) {
146
156
  p(new Error("content or blob is required for inline"));
147
157
  return;
148
158
  }
149
- const f = typeof n == "string" ? n : String(n), E = s ? "\uFEFF" + f : f, w = i || (s ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
150
- v(new Blob([E], { type: w }), b);
159
+ const f = typeof r == "string" ? r : String(r), R = i ? "\uFEFF" + f : f, S = l || (i ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
160
+ $(new Blob([R], { type: S }), v);
151
161
  return;
152
162
  }
153
- if (r === "fetch") {
154
- if (!l) {
163
+ if (n === "fetch") {
164
+ if (!s) {
155
165
  p(new Error("url is required for fetch"));
156
166
  return;
157
167
  }
158
- const f = await fetch(l, c);
168
+ const f = await fetch(s, c);
159
169
  if (!f.ok) {
160
170
  p(new Error(`fetch failed: ${f.status}`));
161
171
  return;
162
172
  }
163
- if (a === "text") {
164
- const w = await f.text(), R = s ? "\uFEFF" + w : w, $ = i || (s ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
165
- v(new Blob([R], { type: $ }), b);
173
+ if (u === "text") {
174
+ const S = await f.text(), H = i ? "\uFEFF" + S : S, j = l || (i ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
175
+ $(new Blob([H], { type: j }), v);
166
176
  return;
167
177
  }
168
- const E = await f.blob();
169
- if (g && !H(E)) {
178
+ const R = await f.blob();
179
+ if (a && !D(R)) {
170
180
  p(new Error("excel does not exist"));
171
181
  return;
172
182
  }
173
- v(E, b);
183
+ $(R, v);
174
184
  return;
175
185
  }
176
- if (r === "open") {
177
- if (!l) {
186
+ if (n === "open") {
187
+ if (!s) {
178
188
  p(new Error("url is required for open"));
179
189
  return;
180
190
  }
181
- u === "blank" ? window.open(l, "_blank", "noopener,noreferrer") : window.location.href = l;
191
+ d === "blank" ? window.open(s, "_blank", "noopener,noreferrer") : window.location.href = s;
182
192
  return;
183
193
  }
184
- p(new Error(`unknown source: ${r}`));
194
+ p(new Error(`unknown source: ${n}`));
185
195
  } catch (f) {
186
196
  p(f instanceof Error ? f : new Error(String(f)));
187
197
  }
188
198
  };
189
- function j(t, e, r) {
190
- if (e === "" || e === void 0 || e === null)
199
+ function G(e, t, n) {
200
+ if (t === "" || t === void 0 || t === null)
191
201
  return "";
192
- const n = globalThis.$fa, o = globalThis.$fu, s = (r == null ? void 0 : r.precision) ?? 2, i = r == null ? void 0 : r.unit;
193
- if ((i === "currency" || i === "%") && o) {
194
- const l = {
195
- [t]: {
196
- unit: i === "currency" ? "currency" : "%",
197
- precision: s
202
+ const r = globalThis.$fa, o = globalThis.$fu, i = (n == null ? void 0 : n.precision) ?? 2, l = n == null ? void 0 : n.unit;
203
+ if ((l === "currency" || l === "%") && o) {
204
+ const s = {
205
+ [e]: {
206
+ unit: l === "currency" ? "currency" : "%",
207
+ precision: i
198
208
  }
199
209
  };
200
210
  try {
201
211
  return o({
202
- prop: t,
203
- currency: r == null ? void 0 : r.currency,
204
- value: e,
205
- obj: l
212
+ prop: e,
213
+ currency: n == null ? void 0 : n.currency,
214
+ value: t,
215
+ obj: s
206
216
  });
207
217
  } catch {
208
218
  }
209
219
  }
210
- if (n)
220
+ if (r)
211
221
  try {
212
- return n(e, s);
222
+ return r(t, i);
213
223
  } catch {
214
- return String(e);
224
+ return String(t);
215
225
  }
216
- return String(e);
226
+ return String(t);
217
227
  }
218
- function ee(t, e, r = {}) {
219
- const { columns: n = [] } = t || {}, { resolveMetric: o } = r;
220
- return !n.length || !e || typeof e != "object" ? [] : n.map((s) => {
221
- const i = s.property ?? s.prop ?? "";
222
- if (!i)
228
+ function ye(e, t, n = {}) {
229
+ const { columns: r = [] } = e || {}, { resolveMetric: o } = n;
230
+ return !r.length || !t || typeof t != "object" ? [] : r.map((i) => {
231
+ const l = i.property ?? i.prop ?? "";
232
+ if (!l)
223
233
  return "";
224
- let l = e[i];
225
- if (l === void 0 && (l = ""), l === "")
234
+ let s = t[l];
235
+ if (s === void 0 && (s = ""), s === "")
226
236
  return "";
227
- const c = typeof o == "function" ? o(i) : void 0;
237
+ const c = typeof o == "function" ? o(l) : void 0;
228
238
  try {
229
- return j(i, l, c);
239
+ return G(l, s, c);
230
240
  } catch {
231
- return String(l);
241
+ return String(s);
232
242
  }
233
243
  });
234
244
  }
235
- const T = "mvframe_primary", P = "mvframe_theme", m = { r: 255, g: 255, b: 255 }, W = { r: 0, g: 0, b: 0 }, V = [
245
+ const M = "mvframe_primary", I = "mvframe_theme", w = { r: 255, g: 255, b: 255 }, Y = { r: 0, g: 0, b: 0 }, J = [
236
246
  "--el-color-primary-light-3",
237
247
  "--el-color-primary-light-5",
238
248
  "--el-color-primary-light-7",
@@ -240,106 +250,268 @@ const T = "mvframe_primary", P = "mvframe_theme", m = { r: 255, g: 255, b: 255 }
240
250
  "--el-color-primary-light-9",
241
251
  "--el-color-primary-dark-2"
242
252
  ];
243
- function S(t) {
244
- let e = String(t).trim().replace(/^#/, "");
245
- if (e.length === 3 && (e = e.split("").map((n) => n + n).join("")), e.length >= 8 && (e = e.slice(0, 6)), e.length !== 6 || Number.isNaN(parseInt(e, 16)))
253
+ function A(e) {
254
+ let t = String(e).trim().replace(/^#/, "");
255
+ if (t.length === 3 && (t = t.split("").map((r) => r + r).join("")), t.length >= 8 && (t = t.slice(0, 6)), t.length !== 6 || Number.isNaN(parseInt(t, 16)))
246
256
  return null;
247
- const r = parseInt(e, 16);
257
+ const n = parseInt(t, 16);
248
258
  return {
249
- r: r >> 16 & 255,
250
- g: r >> 8 & 255,
251
- b: r & 255
259
+ r: n >> 16 & 255,
260
+ g: n >> 8 & 255,
261
+ b: n & 255
252
262
  };
253
263
  }
254
- function d(t, e, r) {
255
- const n = (o) => Math.max(0, Math.min(255, Math.round(o)));
256
- return `#${[n(t), n(e), n(r)].map((o) => o.toString(16).padStart(2, "0")).join("")}`;
264
+ function y(e, t, n) {
265
+ const r = (o) => Math.max(0, Math.min(255, Math.round(o)));
266
+ return `#${[r(e), r(t), r(n)].map((o) => o.toString(16).padStart(2, "0")).join("")}`;
257
267
  }
258
- function C(t) {
259
- const e = [t.r, t.g, t.b].map((r) => (r /= 255, r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4));
260
- return 0.2126 * e[0] + 0.7152 * e[1] + 0.0722 * e[2];
268
+ function K(e) {
269
+ const t = [e.r, e.g, e.b].map((n) => (n /= 255, n <= 0.03928 ? n / 12.92 : ((n + 0.055) / 1.055) ** 2.4));
270
+ return 0.2126 * t[0] + 0.7152 * t[1] + 0.0722 * t[2];
261
271
  }
262
- function x(t) {
263
- return C(t) > 0.5 ? "#1a1a1a" : "#ffffff";
272
+ function O(e) {
273
+ return K(e) > 0.5 ? "#1a1a1a" : "#ffffff";
264
274
  }
265
- function h(t, e, r) {
266
- const n = r / 100, o = 1 - n;
275
+ function b(e, t, n) {
276
+ const r = n / 100, o = 1 - r;
267
277
  return {
268
- r: t.r * n + e.r * o,
269
- g: t.g * n + e.g * o,
270
- b: t.b * n + e.b * o
278
+ r: e.r * r + t.r * o,
279
+ g: e.g * r + t.g * o,
280
+ b: e.b * r + t.b * o
271
281
  };
272
282
  }
273
- function N(t) {
274
- const e = S(t);
275
- if (!e)
283
+ function X(e) {
284
+ const t = A(e);
285
+ if (!t)
276
286
  return null;
277
- const r = h(m, e, 30), n = h(m, e, 50), o = h(m, e, 70), s = h(m, e, 80), i = h(m, e, 90), l = h(W, e, 20);
287
+ const n = b(w, t, 30), r = b(w, t, 50), o = b(w, t, 70), i = b(w, t, 80), l = b(w, t, 90), s = b(Y, t, 20);
278
288
  return {
279
- "--el-color-primary-light-3": d(r.r, r.g, r.b),
280
- "--el-color-primary-light-5": d(n.r, n.g, n.b),
281
- "--el-color-primary-light-7": d(o.r, o.g, o.b),
282
- "--el-color-primary-light-8": d(s.r, s.g, s.b),
283
- "--el-color-primary-light-9": d(i.r, i.g, i.b),
284
- "--el-color-primary-dark-2": d(l.r, l.g, l.b)
289
+ "--el-color-primary-light-3": y(n.r, n.g, n.b),
290
+ "--el-color-primary-light-5": y(r.r, r.g, r.b),
291
+ "--el-color-primary-light-7": y(o.r, o.g, o.b),
292
+ "--el-color-primary-light-8": y(i.r, i.g, i.b),
293
+ "--el-color-primary-light-9": y(l.r, l.g, l.b),
294
+ "--el-color-primary-dark-2": y(s.r, s.g, s.b)
285
295
  };
286
296
  }
287
- function U(t) {
288
- t.style.removeProperty("--el-color-primary"), t.style.removeProperty("--color-on-primary-text");
289
- for (const e of V)
290
- t.style.removeProperty(e);
297
+ function Q(e) {
298
+ e.style.removeProperty("--el-color-primary"), e.style.removeProperty("--color-on-primary-text");
299
+ for (const t of J)
300
+ e.style.removeProperty(t);
291
301
  }
292
- function F(t, e) {
293
- const r = S(e.startsWith("#") ? e : `#${e}`);
294
- if (!r)
302
+ function Z(e, t) {
303
+ const n = A(t.startsWith("#") ? t : `#${t}`);
304
+ if (!n)
295
305
  return !1;
296
- const n = d(r.r, r.g, r.b);
297
- t.style.setProperty("--color-primary", n), t.style.setProperty("--el-color-primary", n), t.style.setProperty("--color-on-primary-text", x(r));
298
- const o = N(n);
299
- return o && Object.entries(o).forEach(([s, i]) => t.style.setProperty(s, i)), !0;
306
+ const r = y(n.r, n.g, n.b);
307
+ e.style.setProperty("--color-primary", r), e.style.setProperty("--el-color-primary", r), e.style.setProperty("--color-on-primary-text", O(n));
308
+ const o = X(r);
309
+ return o && Object.entries(o).forEach(([i, l]) => e.style.setProperty(i, l)), !0;
300
310
  }
301
- function z(t = {}) {
302
- const e = document.documentElement;
303
- if (t.primary != null && t.primary !== "") {
304
- const n = String(t.primary).trim();
305
- if (!F(e, n)) {
306
- e.style.setProperty("--color-primary", n), e.style.setProperty("--el-color-primary", n);
307
- const o = S(n.startsWith("#") ? n : `#${n}`);
308
- o && e.style.setProperty("--color-on-primary-text", x(o));
311
+ function ee(e = {}) {
312
+ const t = document.documentElement;
313
+ if (e.primary != null && e.primary !== "") {
314
+ const r = String(e.primary).trim();
315
+ if (!Z(t, r)) {
316
+ t.style.setProperty("--color-primary", r), t.style.setProperty("--el-color-primary", r);
317
+ const o = A(r.startsWith("#") ? r : `#${r}`);
318
+ o && t.style.setProperty("--color-on-primary-text", O(o));
309
319
  }
310
- } else (t.primary === null || t.primary === "") && (e.style.removeProperty("--color-primary"), U(e));
311
- const r = t.mode ?? (e.classList.contains("dark") ? "dark" : "light");
312
- e.classList.toggle("dark", r === "dark");
320
+ } else (e.primary === null || e.primary === "") && (t.style.removeProperty("--color-primary"), Q(t));
321
+ const n = e.mode ?? (t.classList.contains("dark") ? "dark" : "light");
322
+ t.classList.toggle("dark", n === "dark");
313
323
  }
314
- function te(t) {
315
- t.primary !== void 0 && (t.primary == null || t.primary === "" ? localStorage.removeItem(T) : localStorage.setItem(T, String(t.primary))), t.mode !== void 0 && localStorage.setItem(P, t.mode);
324
+ function be(e) {
325
+ e.primary !== void 0 && (e.primary == null || e.primary === "" ? localStorage.removeItem(M) : localStorage.setItem(M, String(e.primary))), e.mode !== void 0 && localStorage.setItem(I, e.mode);
316
326
  }
317
- function re() {
318
- const t = localStorage.getItem(T), r = localStorage.getItem(P) === "dark" ? "dark" : "light";
319
- z({
320
- primary: t != null && t !== "" ? t : null,
321
- mode: r
327
+ function Ee() {
328
+ const e = localStorage.getItem(M), n = localStorage.getItem(I) === "dark" ? "dark" : "light";
329
+ ee({
330
+ primary: e != null && e !== "" ? e : null,
331
+ mode: n
322
332
  });
323
333
  }
334
+ const te = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 };
335
+ let _ = null;
336
+ function k(e) {
337
+ V("error", e);
338
+ }
339
+ function Te(e) {
340
+ _ = e && typeof e == "object" ? e : null;
341
+ }
342
+ function P(e) {
343
+ if (_ && _[e] != null && _[e] !== "")
344
+ return String(_[e]);
345
+ const t = typeof globalThis < "u" ? globalThis.__MVFRAME_ENV__ : null;
346
+ if (t && t[e] != null && t[e] !== "")
347
+ return String(t[e]);
348
+ const n = typeof import.meta < "u" ? te : null;
349
+ return n && n[e] != null && n[e] !== "" ? String(n[e]) : "";
350
+ }
351
+ const T = C.create({
352
+ timeout: 0,
353
+ withCredentials: !1
354
+ });
355
+ let h = [];
356
+ const ne = C.CancelToken, re = (e) => {
357
+ const t = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex, n = [];
358
+ if (h.length)
359
+ for (let r in h)
360
+ h[r].v === t && n.push(r);
361
+ n.length > 0 && (h[n[0]].cb(), h.splice(n[0], 1));
362
+ }, E = (e) => {
363
+ if (e != null && e.url) {
364
+ const t = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex;
365
+ for (let n in h)
366
+ if (h[n].v === t) {
367
+ h.splice(n, 1);
368
+ break;
369
+ }
370
+ }
371
+ };
372
+ T.interceptors.request.use(
373
+ (e) => {
374
+ e.headers = e.headers || {};
375
+ const { login: t } = window.$store.launch(), { access_token: n } = t.info;
376
+ return n && e.headers["Content-HI"] && (e.headers.Authorization = `Bearer ${n}`), re(e), e.cancelToken = new ne((r) => {
377
+ h.push({
378
+ v: e.url + "_" + e.headers["Content-HI"] + "_" + e.ex,
379
+ cb: r
380
+ });
381
+ }), e;
382
+ },
383
+ (e) => Promise.reject(e)
384
+ );
385
+ T.interceptors.response.use(
386
+ ({ data: e, config: t }) => {
387
+ var i;
388
+ if (e == null || typeof e != "object" || Array.isArray(e))
389
+ return E(t), e;
390
+ let { code: n, message: r, msg: o } = e;
391
+ if (o = o || r, n === 200)
392
+ E(t);
393
+ else if (n === 500) {
394
+ if (t.showMsg !== !1) {
395
+ const l = (i = t == null ? void 0 : t.headers) != null && i.CONTACT_CUSTOMER_SERVICE ? window.$l("CONTACT_CUSTOMER_SERVICE") : "";
396
+ k({
397
+ grouping: !0,
398
+ showClose: !0,
399
+ duration: 0,
400
+ message: [o, l].filter(Boolean).join(" ")
401
+ });
402
+ }
403
+ E(t);
404
+ } else n === 403 && window.location.replace("/"), E(t);
405
+ return e;
406
+ },
407
+ (e) => {
408
+ var n, r, o, i, l;
409
+ let t = !1;
410
+ if (e && e.response)
411
+ switch (e.response.status) {
412
+ case 403:
413
+ e.message = "403 Token Expired", window.location.replace("/");
414
+ break;
415
+ case 502:
416
+ e.message = "502 Error";
417
+ break;
418
+ case 503:
419
+ e.message = "503 Error";
420
+ break;
421
+ case 504:
422
+ e.message = "504 Error", e.response = {};
423
+ break;
424
+ default:
425
+ e.message = `Connection Error-${e.response.status}`;
426
+ }
427
+ else
428
+ (n = e.stack) != null && n.includes("timeout") ? e.message = window.$l("Timeout, Please Refresh") : (e.message = window.$l("Connect Failed"), t = !0);
429
+ return t || ((r = e == null ? void 0 : e.response) == null ? void 0 : r.status) !== 403 && k({
430
+ grouping: !0,
431
+ message: `${e.message} ${(i = (o = e.config) == null ? void 0 : o.headers) == null ? void 0 : i["Content-HI"]}`
432
+ }), E(e.config), e.code === "ERR_CANCELED" ? Promise.resolve({ code: e.code, msg: e.message }) : Promise.resolve({
433
+ code: (l = e.response) == null ? void 0 : l.status,
434
+ msg: e.message
435
+ });
436
+ }
437
+ );
438
+ function oe(e) {
439
+ return e.baseURL = P("VITE_APP_BASEURL"), e.method = "get", e.headers = { "Content-Type": "application/x-www-form-urlencoded" }, e.data && (e.params = e.data), T(e);
440
+ }
441
+ function se(e) {
442
+ return e.baseURL = P("VITE_APP_BASEURL"), e.method = "get", e.headers = {
443
+ ...e.headers,
444
+ "Content-HI": e.url
445
+ }, e.url = e.ver ? `api/${e.ver}/ads` : "api/v2/ads", e.data && (e.params = e.data), T(e);
446
+ }
447
+ function ie(e) {
448
+ if (e.baseURL = P("VITE_APP_BASEURL"), e.method = "post", e.headers = {
449
+ ...e.headers,
450
+ "Content-HI": e.url
451
+ }, e.data && window.$getType(e.data) === "Object") {
452
+ const n = {};
453
+ Object.keys(e.data).forEach((r) => {
454
+ const o = e.data[r];
455
+ [null, "", void 0].includes(o) || (n[r] = o);
456
+ }), e.data = n;
457
+ }
458
+ return e.url = e.ver ? `api/${e.ver}/ads` : "api/v2/ads", T(e);
459
+ }
460
+ function L({
461
+ data: e,
462
+ url: t,
463
+ ex: n,
464
+ method: r = "post",
465
+ emptyString: o = !1
466
+ }) {
467
+ const i = {}, l = [void 0, null];
468
+ o === !1 && l.push("");
469
+ for (let a in e)
470
+ l.indexOf(e[a]) === -1 && (i[a] = e[a]);
471
+ const { login: s, userinfo: c } = window.$store.launch(), { access_token: u } = s.info || {}, d = c && c.id != null && c.id !== "" ? c.id : "";
472
+ return T({
473
+ headers: {
474
+ "Content-Type": "application/json",
475
+ token: u != null ? String(u) : "",
476
+ userId: d
477
+ },
478
+ baseURL: P("VITE_APP_AIURL"),
479
+ url: t,
480
+ method: r,
481
+ data: i,
482
+ ex: n
483
+ });
484
+ }
485
+ const we = L;
486
+ function _e(e) {
487
+ globalThis.$login = oe, globalThis.$get = se, globalThis.$post = ie, globalThis.$form = L, globalThis.$xform = L;
488
+ }
324
489
  export {
325
- O as MVFRAME_STORAGE_LANG,
326
- T as MVFRAME_STORAGE_PRIMARY,
327
- P as MVFRAME_STORAGE_THEME,
328
- z as applyMvframeTheme,
329
- _ as deepEqual,
330
- Z as download,
331
- j as formatSummaryCell,
332
- ie as getMaps,
333
- Q as isInView,
334
- re as loadMvframeTheme,
335
- le as mapLang,
336
- se as mapLangPath,
337
- ae as mergeMaps,
338
- ce as patchMaps,
339
- te as persistMvframeTheme,
340
- B as sanitizeDownloadFileName,
341
- X as useLang,
342
- ue as useMap,
343
- D as useOptions,
344
- ee as useRemoteSummary
490
+ W as MVFRAME_STORAGE_LANG,
491
+ M as MVFRAME_STORAGE_PRIMARY,
492
+ I as MVFRAME_STORAGE_THEME,
493
+ ee as applyMvframeTheme,
494
+ N as deepEqual,
495
+ me as download,
496
+ G as formatSummaryCell,
497
+ Se as getMaps,
498
+ _e as installRq,
499
+ he as isInView,
500
+ Ee as loadMvframeTheme,
501
+ $e as mapLang,
502
+ Pe as mapLangPath,
503
+ Me as mergeMaps,
504
+ Le as patchMaps,
505
+ be as persistMvframeTheme,
506
+ F as sanitizeDownloadFileName,
507
+ Te as setMvframeRqEnv,
508
+ L as useForm,
509
+ se as useGet,
510
+ ge as useLang,
511
+ oe as useLogin,
512
+ Ae as useMap,
513
+ pe as useOptions,
514
+ ie as usePost,
515
+ ye as useRemoteSummary,
516
+ we as useXform
345
517
  };