mvframe 1.0.20 → 1.0.60

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,240 +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, e) => {
4
- var l, s;
5
- const r = typeof window < "u", n = () => {
6
- var b;
7
- if (!r)
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)
8
9
  return { innerWidth: 1920, innerHeight: 1080 };
9
- const i = window, a = typeof navigator < "u" ? i.navigator : {}, c = i.screen || {}, u = i.visualViewport, f = {
10
- innerWidth: i.innerWidth,
11
- innerHeight: i.innerHeight,
12
- outerWidth: i.outerWidth,
13
- outerHeight: i.outerHeight,
14
- screenWidth: c.width ?? i.innerWidth,
15
- screenHeight: c.height ?? i.innerHeight,
16
- availWidth: c.availWidth ?? i.innerWidth,
17
- availHeight: c.availHeight ?? i.innerHeight,
18
- devicePixelRatio: i.devicePixelRatio || 1,
19
- bodyHeight: i.innerHeight - ((b = e.pinia) != null && b.useTab ? 36 : 0) - 64 - 32
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
20
24
  };
21
- u && (f.visualViewportWidth = u.width, f.visualViewportHeight = u.height, f.visualViewportScale = u.scale);
22
- const p = a.userAgent || "";
23
- return f.env = {
24
- userAgent: p,
25
- language: a.language || "",
26
- languages: a.languages ? [...a.languages] : [],
27
- platform: a.platform || "",
28
- cookieEnabled: !!a.cookieEnabled,
29
- onLine: a.onLine !== !1,
30
- maxTouchPoints: a.maxTouchPoints || 0,
31
- isTouch: "ontouchstart" in i || (a.maxTouchPoints || 0) > 0,
25
+ d && (a.visualViewportWidth = d.width, a.visualViewportHeight = d.height, a.visualViewportScale = d.scale);
26
+ const g = c.userAgent || "";
27
+ return a.env = {
28
+ userAgent: g,
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,
32
36
  isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(
33
- p
37
+ g
34
38
  )
35
- }, console.info(f), f;
39
+ }, console.info(a), a;
36
40
  }, o = () => {
37
- var a;
38
- const i = n();
41
+ var c;
42
+ const s = r();
39
43
  globalThis.$config = globalThis.$config || {}, globalThis.$config.options = {
40
44
  ...globalThis.$config.options || {},
41
- ...i
42
- }, (a = t == null ? void 0 : t.config) != null && a.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);
43
47
  };
44
- o(), r && (window.addEventListener("resize", o, { passive: !0 }), (s = (l = window.visualViewport) == null ? void 0 : l.addEventListener) == null || s.call(l, "resize", o, {
48
+ o(), n && (window.addEventListener("resize", o, { passive: !0 }), (l = (i = window.visualViewport) == null ? void 0 : i.addEventListener) == null || l.call(i, "resize", o, {
45
49
  passive: !0
46
50
  }));
47
- }, X = (t, e) => {
48
- var i, a;
49
- const r = e || {}, o = (typeof localStorage < "u" ? localStorage.getItem(O) : null) || ((i = globalThis.$config) == null ? void 0 : i.lang) || "en_us", l = 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(
50
58
  {},
51
- k(o),
52
- ((a = globalThis.$config) == null ? void 0 : a.langMaps) || {},
53
- r.langMaps || {}
54
- ), s = (c, u) => {
55
- if (c)
56
- if (u && globalThis.$getType(u) === "Object") {
57
- let f = l[c] || c;
58
- return Object.keys(u).forEach((p) => {
59
- f[`{${p}}`] = u[p];
60
- }), f;
59
+ U(i),
60
+ ((d = globalThis.$config) == null ? void 0 : d.langMaps) || {},
61
+ n.langMaps || {}
62
+ ), s = (a, g) => {
63
+ if (a)
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;
61
69
  } else
62
- return l[c] || c;
70
+ return l[a] || a;
63
71
  else
64
- return c;
72
+ return a ?? "";
65
73
  };
66
- globalThis.$patchLangMaps = (c) => {
67
- c && globalThis.$getType(c) === "Object" && Object.assign(l, c);
68
- }, globalThis.$l = s, t.config.globalProperties.$l = s, t.config.globalProperties.$patchLangMaps = globalThis.$patchLangMaps, String.prototype.$l = function() {
74
+ globalThis.$patchLangMaps = (a) => {
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() {
69
77
  return $l(this);
70
78
  };
71
- }, Q = (t, e) => {
72
- if (!t || !e) return !1;
73
- const r = t.getBoundingClientRect(), n = e.getBoundingClientRect(), o = n.right > r.left && n.left < r.right, l = n.bottom > r.top && n.top < r.bottom;
74
- return o && l;
75
- }, _ = (t, e) => {
76
- if (t === e) return !0;
77
- if (t == null || e == null || typeof t != "object" || typeof e != "object")
78
- return JSON.stringify(t) === JSON.stringify(e);
79
- const r = Object.keys(t), n = Object.keys(e);
80
- if (r.length !== n.length) return !1;
81
- for (const o of r)
82
- 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;
83
91
  return !0;
84
- }, P = "download", A = 150, H = (t, e = P) => {
85
- const r = e || P, n = String(t ?? "").trim();
86
- if (!n) return r;
87
- const l = n.replace(/[/\\?%*:|"<>]/g, "_").replace(/\.\./g, "_").split(/[/\\]/).pop() || r, s = 200;
88
- return l.length > s ? l.slice(0, s) : l;
89
- }, B = (t) => {
90
- const e = ((t == null ? void 0 : t.type) || "").toLowerCase();
91
- return e ? e.includes("spreadsheet") || e.includes("ms-excel") || e.includes("excel") && e.includes("application") : !1;
92
- }, T = (t, e) => {
93
- const r = URL.createObjectURL(t), n = H(e), o = document.createElement("a");
94
- 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);
95
103
  try {
96
104
  o.click();
97
105
  } finally {
98
- document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(r), A);
106
+ document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(n), q);
99
107
  }
100
- }, I = (t) => {
101
- if (!t || t.source !== void 0 || t.type === void 0)
102
- return t;
103
- const { type: e, data: r, url: n, headers: o, name: l, filename: s, init: i, ...a } = t, c = s ?? l;
104
- return e === "csv" ? {
105
- ...a,
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" ? {
113
+ ...c,
106
114
  source: "inline",
107
- content: r,
108
- filename: c,
109
- bom: t.bom
110
- } : e === "excel" ? {
111
- ...a,
115
+ content: n,
116
+ filename: u,
117
+ bom: e.bom
118
+ } : t === "excel" ? {
119
+ ...c,
112
120
  source: "fetch",
113
- url: n,
114
- init: { ...i || {}, headers: o ?? (i == null ? void 0 : i.headers) },
121
+ url: r,
122
+ init: { ...s || {}, headers: o ?? (s == null ? void 0 : s.headers) },
115
123
  response: "blob",
116
124
  expectExcel: !0,
117
- filename: c
118
- } : t;
119
- }, Z = async (t = {}) => {
120
- const e = I(t), {
121
- source: r = "inline",
122
- content: n,
125
+ filename: u
126
+ } : e;
127
+ }, me = async (e = {}) => {
128
+ const t = z(e), {
129
+ source: n = "inline",
130
+ content: r,
123
131
  blob: o,
124
- bom: l = !0,
125
- mime: s,
126
- url: i,
127
- init: a,
128
- response: c = "blob",
129
- openIn: u = "self",
130
- expectExcel: f,
131
- filename: p,
132
- name: b,
133
- error: d = () => {
132
+ bom: i = !0,
133
+ mime: l,
134
+ url: s,
135
+ init: c,
136
+ response: u = "blob",
137
+ openIn: d = "self",
138
+ expectExcel: a,
139
+ filename: g,
140
+ name: m,
141
+ error: p = () => {
134
142
  },
135
143
  // 避免 legacy 字段渗入后续逻辑
136
- type: q,
137
- data: G,
138
- headers: Y,
139
- ...J
140
- } = e, E = p ?? b;
144
+ type: le,
145
+ data: ae,
146
+ headers: ce,
147
+ ...ue
148
+ } = t, v = g ?? m;
141
149
  try {
142
- if (r === "inline") {
150
+ if (n === "inline") {
143
151
  if (o instanceof Blob) {
144
- T(o, E);
152
+ $(o, v);
145
153
  return;
146
154
  }
147
- if (n == null) {
148
- d(new Error("content or blob is required for inline"));
155
+ if (r == null) {
156
+ p(new Error("content or blob is required for inline"));
149
157
  return;
150
158
  }
151
- const g = typeof n == "string" ? n : String(n), w = l ? "\uFEFF" + g : g, v = s || (l ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
152
- T(new Blob([w], { type: v }), E);
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);
153
161
  return;
154
162
  }
155
- if (r === "fetch") {
156
- if (!i) {
157
- d(new Error("url is required for fetch"));
163
+ if (n === "fetch") {
164
+ if (!s) {
165
+ p(new Error("url is required for fetch"));
158
166
  return;
159
167
  }
160
- const g = await fetch(i, a);
161
- if (!g.ok) {
162
- d(new Error(`fetch failed: ${g.status}`));
168
+ const f = await fetch(s, c);
169
+ if (!f.ok) {
170
+ p(new Error(`fetch failed: ${f.status}`));
163
171
  return;
164
172
  }
165
- if (c === "text") {
166
- const v = await g.text(), R = l ? "\uFEFF" + v : v, $ = s || (l ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
167
- T(new Blob([R], { type: $ }), E);
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);
168
176
  return;
169
177
  }
170
- const w = await g.blob();
171
- if (f && !B(w)) {
172
- d(new Error("excel does not exist"));
178
+ const R = await f.blob();
179
+ if (a && !D(R)) {
180
+ p(new Error("excel does not exist"));
173
181
  return;
174
182
  }
175
- T(w, E);
183
+ $(R, v);
176
184
  return;
177
185
  }
178
- if (r === "open") {
179
- if (!i) {
180
- d(new Error("url is required for open"));
186
+ if (n === "open") {
187
+ if (!s) {
188
+ p(new Error("url is required for open"));
181
189
  return;
182
190
  }
183
- u === "blank" ? window.open(i, "_blank", "noopener,noreferrer") : window.location.href = i;
191
+ d === "blank" ? window.open(s, "_blank", "noopener,noreferrer") : window.location.href = s;
184
192
  return;
185
193
  }
186
- d(new Error(`unknown source: ${r}`));
187
- } catch (g) {
188
- d(g instanceof Error ? g : new Error(String(g)));
194
+ p(new Error(`unknown source: ${n}`));
195
+ } catch (f) {
196
+ p(f instanceof Error ? f : new Error(String(f)));
189
197
  }
190
198
  };
191
- function j(t, e, r) {
192
- if (e === "" || e === void 0 || e === null)
199
+ function G(e, t, n) {
200
+ if (t === "" || t === void 0 || t === null)
193
201
  return "";
194
- const n = globalThis.$fa, o = globalThis.$fu, l = (r == null ? void 0 : r.precision) ?? 2, s = r == null ? void 0 : r.unit;
195
- if ((s === "currency" || s === "%") && o) {
196
- const i = {
197
- [t]: {
198
- unit: s === "currency" ? "currency" : "%",
199
- precision: l
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
200
208
  }
201
209
  };
202
210
  try {
203
211
  return o({
204
- prop: t,
205
- currency: r == null ? void 0 : r.currency,
206
- value: e,
207
- obj: i
212
+ prop: e,
213
+ currency: n == null ? void 0 : n.currency,
214
+ value: t,
215
+ obj: s
208
216
  });
209
217
  } catch {
210
218
  }
211
219
  }
212
- if (n)
220
+ if (r)
213
221
  try {
214
- return n(e, l);
222
+ return r(t, i);
215
223
  } catch {
216
- return String(e);
224
+ return String(t);
217
225
  }
218
- return String(e);
226
+ return String(t);
219
227
  }
220
- function ee(t, e, r = {}) {
221
- const { columns: n = [] } = t || {}, { resolveMetric: o } = r;
222
- return !n.length || !e || typeof e != "object" ? [] : n.map((l) => {
223
- const s = l.property ?? l.prop ?? "";
224
- if (!s)
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)
225
233
  return "";
226
- let i = e[s];
227
- if (i === void 0 && (i = ""), i === "")
234
+ let s = t[l];
235
+ if (s === void 0 && (s = ""), s === "")
228
236
  return "";
229
- const a = typeof o == "function" ? o(s) : void 0;
237
+ const c = typeof o == "function" ? o(l) : void 0;
230
238
  try {
231
- return j(s, i, a);
239
+ return G(l, s, c);
232
240
  } catch {
233
- return String(i);
241
+ return String(s);
234
242
  }
235
243
  });
236
244
  }
237
- const S = "mvframe_primary", x = "mvframe_theme", y = { 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 = [
238
246
  "--el-color-primary-light-3",
239
247
  "--el-color-primary-light-5",
240
248
  "--el-color-primary-light-7",
@@ -242,106 +250,268 @@ const S = "mvframe_primary", x = "mvframe_theme", y = { r: 255, g: 255, b: 255 }
242
250
  "--el-color-primary-light-9",
243
251
  "--el-color-primary-dark-2"
244
252
  ];
245
- function M(t) {
246
- let e = String(t).trim().replace(/^#/, "");
247
- 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)))
248
256
  return null;
249
- const r = parseInt(e, 16);
257
+ const n = parseInt(t, 16);
250
258
  return {
251
- r: r >> 16 & 255,
252
- g: r >> 8 & 255,
253
- b: r & 255
259
+ r: n >> 16 & 255,
260
+ g: n >> 8 & 255,
261
+ b: n & 255
254
262
  };
255
263
  }
256
- function h(t, e, r) {
257
- const n = (o) => Math.max(0, Math.min(255, Math.round(o)));
258
- 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("")}`;
259
267
  }
260
- function C(t) {
261
- 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));
262
- 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];
263
271
  }
264
- function L(t) {
265
- return C(t) > 0.5 ? "#1a1a1a" : "#ffffff";
272
+ function O(e) {
273
+ return K(e) > 0.5 ? "#1a1a1a" : "#ffffff";
266
274
  }
267
- function m(t, e, r) {
268
- const n = r / 100, o = 1 - n;
275
+ function b(e, t, n) {
276
+ const r = n / 100, o = 1 - r;
269
277
  return {
270
- r: t.r * n + e.r * o,
271
- g: t.g * n + e.g * o,
272
- 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
273
281
  };
274
282
  }
275
- function N(t) {
276
- const e = M(t);
277
- if (!e)
283
+ function X(e) {
284
+ const t = A(e);
285
+ if (!t)
278
286
  return null;
279
- const r = m(y, e, 30), n = m(y, e, 50), o = m(y, e, 70), l = m(y, e, 80), s = m(y, e, 90), i = m(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);
280
288
  return {
281
- "--el-color-primary-light-3": h(r.r, r.g, r.b),
282
- "--el-color-primary-light-5": h(n.r, n.g, n.b),
283
- "--el-color-primary-light-7": h(o.r, o.g, o.b),
284
- "--el-color-primary-light-8": h(l.r, l.g, l.b),
285
- "--el-color-primary-light-9": h(s.r, s.g, s.b),
286
- "--el-color-primary-dark-2": h(i.r, i.g, i.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)
287
295
  };
288
296
  }
289
- function U(t) {
290
- t.style.removeProperty("--el-color-primary"), t.style.removeProperty("--color-on-primary-text");
291
- for (const e of V)
292
- 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);
293
301
  }
294
- function F(t, e) {
295
- const r = M(e.startsWith("#") ? e : `#${e}`);
296
- if (!r)
302
+ function Z(e, t) {
303
+ const n = A(t.startsWith("#") ? t : `#${t}`);
304
+ if (!n)
297
305
  return !1;
298
- const n = h(r.r, r.g, r.b);
299
- t.style.setProperty("--color-primary", n), t.style.setProperty("--el-color-primary", n), t.style.setProperty("--color-on-primary-text", L(r));
300
- const o = N(n);
301
- return o && Object.entries(o).forEach(([l, s]) => t.style.setProperty(l, s)), !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;
302
310
  }
303
- function z(t = {}) {
304
- const e = document.documentElement;
305
- if (t.primary != null && t.primary !== "") {
306
- const n = String(t.primary).trim();
307
- if (!F(e, n)) {
308
- e.style.setProperty("--color-primary", n), e.style.setProperty("--el-color-primary", n);
309
- const o = M(n.startsWith("#") ? n : `#${n}`);
310
- o && e.style.setProperty("--color-on-primary-text", L(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));
311
319
  }
312
- } else (t.primary === null || t.primary === "") && (e.style.removeProperty("--color-primary"), U(e));
313
- const r = t.mode ?? (e.classList.contains("dark") ? "dark" : "light");
314
- 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");
315
323
  }
316
- function te(t) {
317
- t.primary !== void 0 && (t.primary == null || t.primary === "" ? localStorage.removeItem(S) : localStorage.setItem(S, String(t.primary))), t.mode !== void 0 && localStorage.setItem(x, 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);
318
326
  }
319
- function re() {
320
- const t = localStorage.getItem(S), r = localStorage.getItem(x) === "dark" ? "dark" : "light";
321
- z({
322
- primary: t != null && t !== "" ? t : null,
323
- 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
324
332
  });
325
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
+ }
326
489
  export {
327
- O as MVFRAME_STORAGE_LANG,
328
- S as MVFRAME_STORAGE_PRIMARY,
329
- x as MVFRAME_STORAGE_THEME,
330
- z as applyMvframeTheme,
331
- _ as deepEqual,
332
- Z as download,
333
- j as formatSummaryCell,
334
- ie as getMaps,
335
- Q as isInView,
336
- re as loadMvframeTheme,
337
- le as mapLang,
338
- se as mapLangPath,
339
- ae as mergeMaps,
340
- ce as patchMaps,
341
- te as persistMvframeTheme,
342
- H as sanitizeDownloadFileName,
343
- X as useLang,
344
- ue as useMap,
345
- D as useOptions,
346
- 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
347
517
  };