vome-core 0.0.44 → 0.0.45

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 +1,216 @@
1
- (function(_0x165531,_0x4703ff){const _0x21084c=_0x30f7,_0x2d37c3=_0x165531();while(!![]){try{const _0x3324e9=parseInt(_0x21084c(0x157))/0x1*(-parseInt(_0x21084c(0x148))/0x2)+parseInt(_0x21084c(0x152))/0x3+-parseInt(_0x21084c(0x14c))/0x4*(parseInt(_0x21084c(0x144))/0x5)+-parseInt(_0x21084c(0x123))/0x6+-parseInt(_0x21084c(0x145))/0x7*(-parseInt(_0x21084c(0x140))/0x8)+parseInt(_0x21084c(0x13d))/0x9*(parseInt(_0x21084c(0x130))/0xa)+parseInt(_0x21084c(0x132))/0xb;if(_0x3324e9===_0x4703ff)break;else _0x2d37c3['push'](_0x2d37c3['shift']());}catch(_0x5b4b13){_0x2d37c3['push'](_0x2d37c3['shift']());}}}(_0x4e47,0xe14e8));import{findEpsEntity}from'../lib/eps';import{getCrudStyle}from'./style';export function toTree(_0x25c71a={}){const _0x3db471=_0x30f7;return{'__plugin':'toTree','tree':!![],'lazy':_0x25c71a[_0x3db471(0x143)]??![]};}export function setFocus(_0x445136){const _0x4d99a4=_0x30f7;return{'__plugin':_0x4d99a4(0x133),'prop':_0x445136??''};}export function setRules(){const _0xfbefcb=_0x30f7;return{'__plugin':_0xfbefcb(0x118)};}export function setAuto(_0x122468={'hideLabel':!![]}){const _0x24619f=_0x30f7;return{'__plugin':_0x24619f(0x120),..._0x122468};}export const Plugins={'Table':{'toTree':toTree},'Form':{'setFocus':setFocus,'setRules':setRules},'Search':{'setAuto':setAuto}};export function applyTablePlugins(_0x3efaa7){const _0x7e6a62=_0x30f7,_0x2e96be=getCrudStyle()[_0x7e6a62(0x119)],_0x508d28={'border':_0x2e96be[_0x7e6a62(0x137)],'autoHeight':_0x2e96be[_0x7e6a62(0x13f)],'contextMenu':_0x2e96be[_0x7e6a62(0x11b)],..._0x3efaa7},_0x122bf4=[..._0x2e96be[_0x7e6a62(0x146)],..._0x3efaa7?.[_0x7e6a62(0x146)]||[]],_0x211639={..._0x508d28};delete _0x211639[_0x7e6a62(0x146)];for(const _0x1d5fc6 of _0x122bf4){if(!_0x1d5fc6||typeof _0x1d5fc6!==_0x7e6a62(0x153))continue;_0x1d5fc6[_0x7e6a62(0x126)]===_0x7e6a62(0x11e)&&(_0x211639[_0x7e6a62(0x139)]=!![],_0x211639[_0x7e6a62(0x11d)]=Boolean(_0x1d5fc6[_0x7e6a62(0x143)]));}return _0x211639;}function _0x30f7(_0x31088c,_0x3082e7){_0x31088c=_0x31088c-0x118;const _0x4e477d=_0x4e47();let _0x30f751=_0x4e477d[_0x31088c];if(_0x30f7['MzgYGC']===undefined){var _0x4a940b=function(_0x57868c){const _0x1f8090='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x25c71a='',_0x445136='';for(let _0x122468=0x0,_0x3efaa7,_0x2e96be,_0x508d28=0x0;_0x2e96be=_0x57868c['charAt'](_0x508d28++);~_0x2e96be&&(_0x3efaa7=_0x122468%0x4?_0x3efaa7*0x40+_0x2e96be:_0x2e96be,_0x122468++%0x4)?_0x25c71a+=String['fromCharCode'](0xff&_0x3efaa7>>(-0x2*_0x122468&0x6)):0x0){_0x2e96be=_0x1f8090['indexOf'](_0x2e96be);}for(let _0x122bf4=0x0,_0x211639=_0x25c71a['length'];_0x122bf4<_0x211639;_0x122bf4++){_0x445136+='%'+('00'+_0x25c71a['charCodeAt'](_0x122bf4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x445136);};_0x30f7['rOHSfb']=_0x4a940b,_0x30f7['MrOGUs']={},_0x30f7['MzgYGC']=!![];}const _0x4a0e63=_0x4e477d[0x0],_0x2c6839=_0x31088c+_0x4a0e63,_0x317b5f=_0x30f7['MrOGUs'][_0x2c6839];return!_0x317b5f?(_0x30f751=_0x30f7['rOHSfb'](_0x30f751),_0x30f7['MrOGUs'][_0x2c6839]=_0x30f751):_0x30f751=_0x317b5f,_0x30f751;}function stripAlias(_0xd95949){const _0x307fa7=_0x30f7;return _0xd95949[_0x307fa7(0x12c)]('.')?_0xd95949[_0x307fa7(0x124)]('.')[_0x307fa7(0x14a)]():_0xd95949;}function _0x4e47(){const _0x3353bf=['BM9Uzq','nJbdwvH2AgS','zMLLBgrsyw5Nzq','AxnbCNjHEq','BMfTzxnWywnL','C2vHCMnO','CMvXDwvZDfbHCMfT','mtu1nZy2v3vKru9I','B2jQzwn0','zgLJDa','C2vSzwn0','DM0TBNvTyMvYlxjHBMDL','mtiWmdu4rMfnz2Hv','zMLLBgrfCq','AgLKzuXHyMvS','zMLUza','C2v0uNvSzxm','DgfIBgu','Bwf4','y29UDgv4De1LBNu','y29TBwvUDa','DhjLzuXHENK','Dg9uCMvL','A2v5v29YzeXPA2vgAwvSzhm','C2v0qxv0BW','C3rYAw5N','5PYa5AsN5yc8','mJq4ntm4nLrkBhv6BW','C3bSAxq','BxvSDgLWBgu','x19WBhvNAw4','AgfZ','ywrK','CgfNzunVBhvTBNm','zMLLBgrbCNjHEq','zMLLBgrmAwTL','Aw5JBhvKzxm','DhLWzq','AM9PBG','Aw5WDxq','nZi2nJbQqwHztLu','Aw50','mJe1mJGXmtfAtwjvC3i','C2v0rM9JDxm','BgvUz3rO','BgfIzwW','ChjVCa','yM9YzgvY','zMLSDgvY','DhjLzq','BwLU','y29SDw1UCW','CgfNzvf1zxj5t3a','ouTVsLLhqW','y29SDw1U','yxv0B0HLAwDODa','mZm3ndriq0TxCva','zMXVyxq','zgf0zxjHBMDL','Bgf6Eq','mZu4ndmWyLLss01m','mJG0ouDZEuLvsG','CgX1z2LUCW','5PYa5Bcp5yc8','mJjbBe9sruO','CgfYyw0','Cg9W'];_0x4e47=function(){return _0x3353bf;};return _0x4e47();}function parseRef(_0xb9f23){const _0x2dd1e4=_0x30f7;if(typeof _0xb9f23===_0x2dd1e4(0x121)){const _0x30256e=stripAlias(_0xb9f23);return{'column':_0x30256e,'param':_0x30256e,'multiple':!![],'none':![]};}if(!_0xb9f23||typeof _0xb9f23!==_0x2dd1e4(0x153))return null;const _0x4b8af0=_0xb9f23;if(!_0x4b8af0['column'])return null;const _0x5832b5=stripAlias(_0x4b8af0['column']);return{'column':_0x5832b5,'param':_0x4b8af0[_0x2dd1e4(0x151)]||_0x5832b5,'label':_0x4b8af0[_0x2dd1e4(0x135)],'dict':_0x4b8af0[_0x2dd1e4(0x154)],'multiple':_0x4b8af0[_0x2dd1e4(0x125)]!==![],'none':Boolean(_0x4b8af0['none'])};}function displayName(_0x5e94c1,_0x2b2ae3){const _0x478305=_0x30f7;return _0x5e94c1['label']||_0x2b2ae3?.[_0x478305(0x11c)]||_0x5e94c1[_0x478305(0x13e)];}export function buildAutoSearchItems(_0x411c35,_0x37a6fc={}){const _0x2c2cb5=_0x30f7,_0x5e7429=new Set(_0x37a6fc['ignoreFields']||[]),_0x50d2d8=_0x411c35['search']||{};let _0x576c9e=_0x50d2d8[_0x2c2cb5(0x158)]||[],_0x19b387=_0x50d2d8['fieldLike']||[],_0x3f84c5=_0x50d2d8[_0x2c2cb5(0x12a)]||[],_0x5240e5=_0x50d2d8[_0x2c2cb5(0x14d)]||[],_0x40b3ea=_0x50d2d8[_0x2c2cb5(0x11f)]||[],_0x52fa2c=[];const _0x234a51=_0x411c35['namespace']?findEpsEntity('/'+_0x411c35[_0x2c2cb5(0x14f)]):undefined;if(_0x234a51){_0x52fa2c=[..._0x234a51[_0x2c2cb5(0x13b)]||[],..._0x234a51[_0x2c2cb5(0x129)]||[]];if(!_0x411c35[_0x2c2cb5(0x150)]){const _0xe301a2=_0x234a51[_0x2c2cb5(0x13c)];_0xe301a2&&(_0x576c9e=_0xe301a2['fieldEq']||[],_0x19b387=_0xe301a2[_0x2c2cb5(0x12b)]||[],_0x3f84c5=_0xe301a2[_0x2c2cb5(0x12a)]||[],_0x5240e5=_0xe301a2[_0x2c2cb5(0x14d)]||[],_0x40b3ea=_0xe301a2[_0x2c2cb5(0x11f)]||[]);}}const _0x3e999f=_0x3ea0eb=>_0x52fa2c[_0x2c2cb5(0x15a)](_0x2b72de=>_0x2b72de['propertyName']===_0x3ea0eb),_0x2072ea=[],_0x34d5ec=new Set(),_0x1d18c3=_0x1d36f4=>{const _0x2490b2=_0x2c2cb5;if(!_0x1d36f4['prop']||_0x34d5ec[_0x2490b2(0x127)](_0x1d36f4[_0x2490b2(0x136)]))return;_0x34d5ec[_0x2490b2(0x128)](_0x1d36f4[_0x2490b2(0x136)]),_0x2072ea['push'](_0x1d36f4);};for(const _0x2aeee1 of _0x19b387){const _0x55823d=parseRef(_0x2aeee1);if(!_0x55823d||_0x55823d[_0x2c2cb5(0x14b)]||_0x5e7429['has'](_0x55823d[_0x2c2cb5(0x149)]))continue;const _0x281149=_0x3e999f(_0x55823d[_0x2c2cb5(0x13e)]),_0x49f747=displayName(_0x55823d,_0x281149);_0x1d18c3({'prop':_0x55823d[_0x2c2cb5(0x149)],'label':_0x37a6fc[_0x2c2cb5(0x159)]?'':_0x49f747,'placeholder':'搜索'+_0x49f747,'type':_0x2c2cb5(0x12f)});}for(const _0x396168 of _0x3f84c5){const _0x39799a=parseRef(_0x396168);if(!_0x39799a||_0x39799a[_0x2c2cb5(0x14b)]||_0x5e7429['has'](_0x39799a[_0x2c2cb5(0x149)]))continue;const _0xe1f807=_0x3e999f(_0x39799a[_0x2c2cb5(0x13e)]),_0x12c94b=displayName(_0x39799a,_0xe1f807);_0x1d18c3({'prop':_0x39799a[_0x2c2cb5(0x149)],'label':_0x37a6fc[_0x2c2cb5(0x159)]?'':_0x12c94b,'placeholder':'搜索'+_0x12c94b,'type':'input'});}for(const _0x5ed73a of _0x576c9e){const _0x385a89=parseRef(_0x5ed73a);if(!_0x385a89||_0x385a89['none']||_0x5e7429[_0x2c2cb5(0x127)](_0x385a89[_0x2c2cb5(0x149)]))continue;const _0x380510=_0x3e999f(_0x385a89[_0x2c2cb5(0x13e)]),_0x46fe69=_0x385a89[_0x2c2cb5(0x154)]||(typeof _0x380510?.[_0x2c2cb5(0x154)]===_0x2c2cb5(0x121)?_0x380510['dict']:Array[_0x2c2cb5(0x14e)](_0x380510?.['dict'])?_0x380510[_0x2c2cb5(0x154)][0x0]:undefined),_0x39aaeb=displayName(_0x385a89,_0x380510),_0x5a05c0=_0x37a6fc[_0x2c2cb5(0x159)]?'':_0x39aaeb;_0x46fe69?_0x1d18c3({'prop':_0x385a89['param'],'label':_0x5a05c0,'placeholder':'选择'+_0x39aaeb,'type':_0x2c2cb5(0x155),'dict':_0x46fe69,'multiple':_0x385a89['multiple']}):_0x1d18c3({'prop':_0x385a89[_0x2c2cb5(0x149)],'label':_0x5a05c0,'placeholder':'搜索'+_0x39aaeb,'type':_0x2c2cb5(0x12f)});}for(const _0x1da320 of _0x5240e5){if(!_0x1da320?.[_0x2c2cb5(0x13e)]||_0x1da320[_0x2c2cb5(0x14b)])continue;if(_0x5e7429[_0x2c2cb5(0x127)](_0x1da320['min'])||_0x5e7429['has'](_0x1da320[_0x2c2cb5(0x11a)]))continue;const _0x4df1b5=stripAlias(_0x1da320[_0x2c2cb5(0x13e)]),_0x46c216=_0x3e999f(_0x4df1b5),_0x5ccda7=_0x1da320[_0x2c2cb5(0x135)]||_0x46c216?.[_0x2c2cb5(0x11c)]||_0x4df1b5,_0x218b9b=_0x37a6fc[_0x2c2cb5(0x159)]?'':_0x5ccda7,_0x19efeb=_0x1da320[_0x2c2cb5(0x12d)]===_0x2c2cb5(0x131)||_0x1da320[_0x2c2cb5(0x12d)]===_0x2c2cb5(0x141),_0x44521d=_0x19efeb?_0x2c2cb5(0x147):'开始',_0x28aa3e=_0x19efeb?_0x2c2cb5(0x122):'结束';_0x1d18c3({'prop':'__range_'+_0x1da320['min']+'_'+_0x1da320[_0x2c2cb5(0x11a)],'label':_0x218b9b,'placeholder':_0x5ccda7||'区间','type':_0x19efeb?'number-range':_0x2c2cb5(0x142),'range':{'min':_0x1da320[_0x2c2cb5(0x13a)],'max':_0x1da320[_0x2c2cb5(0x11a)],'rangeType':_0x1da320[_0x2c2cb5(0x12d)]},'component':{'name':_0x19efeb?_0x2c2cb5(0x156):'vm-date-range','props':_0x19efeb?{'mode':_0x1da320[_0x2c2cb5(0x12d)],'startPlaceholder':''+_0x5ccda7+_0x44521d,'endPlaceholder':''+_0x5ccda7+_0x28aa3e}:{'precision':_0x1da320[_0x2c2cb5(0x12d)],'startPlaceholder':''+_0x5ccda7+_0x44521d,'endPlaceholder':''+_0x5ccda7+_0x28aa3e}}});}if(_0x40b3ea[_0x2c2cb5(0x134)]){const _0x2d544c=_0x40b3ea['map'](_0x4787ca=>{const _0xd01ee5=_0x2c2cb5,_0x323a7f=parseRef(_0x4787ca);if(!_0x323a7f)return typeof _0x4787ca==='string'?stripAlias(_0x4787ca):'';return displayName(_0x323a7f,_0x3e999f(_0x323a7f[_0xd01ee5(0x13e)]));})[_0x2c2cb5(0x138)](Boolean);_0x1d18c3({'prop':'keyWord','label':_0x37a6fc[_0x2c2cb5(0x159)]?'':'关键字','placeholder':'搜索'+(_0x2d544c[_0x2c2cb5(0x12e)]('、')||'关键字'),'type':'input'});}return _0x2072ea;}
1
+ import { findEpsEntity } from "../lib/eps";
2
+ import { getCrudStyle } from "./style";
3
+ export function toTree(options = {}) {
4
+ return {
5
+ __plugin: "toTree",
6
+ tree: true,
7
+ lazy: options.lazy ?? false
8
+ };
9
+ }
10
+ export function setFocus(prop) {
11
+ return {
12
+ __plugin: "setFocus",
13
+ prop: prop ?? ""
14
+ };
15
+ }
16
+ export function setRules() {
17
+ return {
18
+ __plugin: "setRules"
19
+ };
20
+ }
21
+ export function setAuto(options = { hideLabel: true }) {
22
+ return {
23
+ __plugin: "setAuto",
24
+ ...options
25
+ };
26
+ }
27
+ export const Plugins = {
28
+ Table: { toTree },
29
+ Form: { setFocus, setRules },
30
+ Search: { setAuto }
31
+ };
32
+ export function applyTablePlugins(options) {
33
+ const style = getCrudStyle().table;
34
+ const base = {
35
+ border: style.border,
36
+ autoHeight: style.autoHeight,
37
+ contextMenu: style.contextMenu,
38
+ ...options
39
+ };
40
+ const plugins = [
41
+ ...style.plugins,
42
+ ...options?.plugins || []
43
+ ];
44
+ const next = { ...base };
45
+ delete next.plugins;
46
+ for (const p of plugins) {
47
+ if (!p || typeof p !== "object")
48
+ continue;
49
+ if (p.__plugin === "toTree") {
50
+ next.tree = true;
51
+ next.treeLazy = Boolean(p.lazy);
52
+ }
53
+ }
54
+ return next;
55
+ }
56
+ function stripAlias(name) {
57
+ return name.includes(".") ? name.split(".").pop() : name;
58
+ }
59
+ function parseRef(ref) {
60
+ if (typeof ref === "string") {
61
+ const column = stripAlias(ref);
62
+ return { column, param: column, multiple: true, none: false };
63
+ }
64
+ if (!ref || typeof ref !== "object")
65
+ return null;
66
+ const o = ref;
67
+ if (!o.column)
68
+ return null;
69
+ const column = stripAlias(o.column);
70
+ return {
71
+ column,
72
+ param: o.requestParam || column,
73
+ label: o.label,
74
+ dict: o.dict,
75
+ multiple: o.multiple !== false,
76
+ none: Boolean(o.none)
77
+ };
78
+ }
79
+ function displayName(ref, meta) {
80
+ return ref.label || meta?.comment || ref.column;
81
+ }
82
+ export function buildAutoSearchItems(service, options = {}) {
83
+ const ignore = new Set(options.ignoreFields || []);
84
+ const search = service.search || {};
85
+ let fieldEq = search.fieldEq || [];
86
+ let fieldLike = search.fieldLike || [];
87
+ let fieldArray = search.fieldArray || [];
88
+ let fieldRange = search.fieldRange || [];
89
+ let keyWordLikeFields = search.keyWordLikeFields || [];
90
+ let cols = [];
91
+ const entity = service.namespace ? findEpsEntity(`/${service.namespace}`) : undefined;
92
+ if (entity) {
93
+ cols = [
94
+ ...entity.columns || [],
95
+ ...entity.pageColumns || []
96
+ ];
97
+ if (!service.search) {
98
+ const op = entity.pageQueryOp;
99
+ if (op) {
100
+ fieldEq = op.fieldEq || [];
101
+ fieldLike = op.fieldLike || [];
102
+ fieldArray = op.fieldArray || [];
103
+ fieldRange = op.fieldRange || [];
104
+ keyWordLikeFields = op.keyWordLikeFields || [];
105
+ }
106
+ }
107
+ }
108
+ const colOf = (name) => cols.find((c) => c.propertyName === name);
109
+ const items = [];
110
+ const usedProps = new Set;
111
+ const pushItem = (item) => {
112
+ if (!item.prop || usedProps.has(item.prop))
113
+ return;
114
+ usedProps.add(item.prop);
115
+ items.push(item);
116
+ };
117
+ for (const raw of fieldLike) {
118
+ const ref = parseRef(raw);
119
+ if (!ref || ref.none || ignore.has(ref.param))
120
+ continue;
121
+ const meta = colOf(ref.column);
122
+ const name = displayName(ref, meta);
123
+ pushItem({
124
+ prop: ref.param,
125
+ label: options.hideLabel ? "" : name,
126
+ placeholder: `搜索${name}`,
127
+ type: "input"
128
+ });
129
+ }
130
+ for (const raw of fieldArray) {
131
+ const ref = parseRef(raw);
132
+ if (!ref || ref.none || ignore.has(ref.param))
133
+ continue;
134
+ const meta = colOf(ref.column);
135
+ const name = displayName(ref, meta);
136
+ pushItem({
137
+ prop: ref.param,
138
+ label: options.hideLabel ? "" : name,
139
+ placeholder: `搜索${name}`,
140
+ type: "input"
141
+ });
142
+ }
143
+ for (const raw of fieldEq) {
144
+ const ref = parseRef(raw);
145
+ if (!ref || ref.none || ignore.has(ref.param))
146
+ continue;
147
+ const meta = colOf(ref.column);
148
+ const dictKey = ref.dict || (typeof meta?.dict === "string" ? meta.dict : Array.isArray(meta?.dict) ? meta.dict[0] : undefined);
149
+ const name = displayName(ref, meta);
150
+ const label = options.hideLabel ? "" : name;
151
+ if (dictKey) {
152
+ pushItem({
153
+ prop: ref.param,
154
+ label,
155
+ placeholder: `选择${name}`,
156
+ type: "select",
157
+ dict: dictKey,
158
+ multiple: ref.multiple
159
+ });
160
+ } else {
161
+ pushItem({
162
+ prop: ref.param,
163
+ label,
164
+ placeholder: `搜索${name}`,
165
+ type: "input"
166
+ });
167
+ }
168
+ }
169
+ for (const r of fieldRange) {
170
+ if (!r?.column || r.none)
171
+ continue;
172
+ if (ignore.has(r.min) || ignore.has(r.max))
173
+ continue;
174
+ const col = stripAlias(r.column);
175
+ const meta = colOf(col);
176
+ const name = r.label || meta?.comment || col;
177
+ const label = options.hideLabel ? "" : name;
178
+ const isNum = r.type === "int" || r.type === "float";
179
+ const startHint = isNum ? "最小值" : "开始";
180
+ const endHint = isNum ? "最大值" : "结束";
181
+ pushItem({
182
+ prop: `__range_${r.min}_${r.max}`,
183
+ label,
184
+ placeholder: name || "区间",
185
+ type: isNum ? "number-range" : "daterange",
186
+ range: { min: r.min, max: r.max, rangeType: r.type },
187
+ component: {
188
+ name: isNum ? "vm-number-range" : "vm-date-range",
189
+ props: isNum ? {
190
+ mode: r.type,
191
+ startPlaceholder: `${name}${startHint}`,
192
+ endPlaceholder: `${name}${endHint}`
193
+ } : {
194
+ precision: r.type,
195
+ startPlaceholder: `${name}${startHint}`,
196
+ endPlaceholder: `${name}${endHint}`
197
+ }
198
+ }
199
+ });
200
+ }
201
+ if (keyWordLikeFields.length) {
202
+ const names = keyWordLikeFields.map((raw) => {
203
+ const ref = parseRef(raw);
204
+ if (!ref)
205
+ return typeof raw === "string" ? stripAlias(raw) : "";
206
+ return displayName(ref, colOf(ref.column));
207
+ }).filter(Boolean);
208
+ pushItem({
209
+ prop: "keyWord",
210
+ label: options.hideLabel ? "" : "关键字",
211
+ placeholder: `搜索${names.join("、") || "关键字"}`,
212
+ type: "input"
213
+ });
214
+ }
215
+ return items;
216
+ }
@@ -1 +1,35 @@
1
- (function(_0x5797f1,_0x28725a){const _0x4281e6=_0x4baf,_0x22e604=_0x5797f1();while(!![]){try{const _0x2c585d=-parseInt(_0x4281e6(0xbd))/0x1+-parseInt(_0x4281e6(0xb6))/0x2+parseInt(_0x4281e6(0xbe))/0x3*(-parseInt(_0x4281e6(0xc8))/0x4)+-parseInt(_0x4281e6(0xc3))/0x5*(-parseInt(_0x4281e6(0xc4))/0x6)+-parseInt(_0x4281e6(0xc6))/0x7+-parseInt(_0x4281e6(0xc2))/0x8+parseInt(_0x4281e6(0xc1))/0x9;if(_0x2c585d===_0x28725a)break;else _0x22e604['push'](_0x22e604['shift']());}catch(_0x3df61b){_0x22e604['push'](_0x22e604['shift']());}}}(_0x2fe0,0xf14b6));import{onMounted,onUnmounted,ref}from'vue';import{getCrudStyle}from'./style';export const FORM_COLS_DESKTOP=0x18;export const FORM_COLS_MOBILE=0xc;export const FORM_SPAN_FULL=0x18;export const FORM_MQ_MOBILE='(max-width:\x20768px)';function _0x2fe0(){const _0x16c8be=['nde0ndCYmJn6uKvoCwK','nJi0mdaYnfrYCLbjtq','mZa5odiWtezeBMDi','mtaYquvgtwjJ','ywrKrxzLBNrmAxn0zw5LCG','mte5mdGWnJrLtgT2tMK','BwLU','ohvsC3nxrq','mJiYnJq5mK5jA0PnyW','Bwf0y2HnzwrPyq','CM91BMq','y2HHBMDL','C3bHBG','Bwf0y2HLCW','DMfSDwu','ndKWnJm4CfzVDMXY','odC3odGXq0Hqtev2','Bwf4','Dw5KzwzPBMvK'];_0x2fe0=function(){return _0x16c8be;};return _0x2fe0();}function _0x4baf(_0x406d90,_0x2db4cf){_0x406d90=_0x406d90-0xb6;const _0x2fe06b=_0x2fe0();let _0x4baf4=_0x2fe06b[_0x406d90];if(_0x4baf['nIrdAq']===undefined){var _0x3c0dfe=function(_0x19ada3){const _0x2ab5b3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3cd7bf='',_0x8ba7ad='';for(let _0x543211=0x0,_0x4c1aae,_0x54397f,_0x2ffd26=0x0;_0x54397f=_0x19ada3['charAt'](_0x2ffd26++);~_0x54397f&&(_0x4c1aae=_0x543211%0x4?_0x4c1aae*0x40+_0x54397f:_0x54397f,_0x543211++%0x4)?_0x3cd7bf+=String['fromCharCode'](0xff&_0x4c1aae>>(-0x2*_0x543211&0x6)):0x0){_0x54397f=_0x2ab5b3['indexOf'](_0x54397f);}for(let _0x51d528=0x0,_0x5e21d4=_0x3cd7bf['length'];_0x51d528<_0x5e21d4;_0x51d528++){_0x8ba7ad+='%'+('00'+_0x3cd7bf['charCodeAt'](_0x51d528)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x8ba7ad);};_0x4baf['MLDVsU']=_0x3c0dfe,_0x4baf['VjiTeD']={},_0x4baf['nIrdAq']=!![];}const _0x51f46a=_0x2fe06b[0x0],_0x1ddd68=_0x406d90+_0x51f46a,_0x33364b=_0x4baf['VjiTeD'][_0x1ddd68];return!_0x33364b?(_0x4baf4=_0x4baf['MLDVsU'](_0x4baf4),_0x4baf['VjiTeD'][_0x1ddd68]=_0x4baf4):_0x4baf4=_0x33364b,_0x4baf4;}export function getFormCols(){const _0xc9ba4b=_0x4baf;if(typeof window!==_0xc9ba4b(0xc0)&&window[_0xc9ba4b(0xb7)](FORM_MQ_MOBILE)[_0xc9ba4b(0xbb)])return FORM_COLS_MOBILE;return FORM_COLS_DESKTOP;}export function resolveFormSpan(_0x3cd7bf,_0x8ba7ad=getFormCols()){const _0x361696=_0x4baf,_0x543211=_0x3cd7bf??getCrudStyle()['form'][_0x361696(0xba)]??FORM_SPAN_FULL,_0x4c1aae=Math[_0x361696(0xc7)](FORM_SPAN_FULL,Math[_0x361696(0xbf)](0x1,_0x543211));if(_0x8ba7ad===FORM_COLS_DESKTOP)return _0x4c1aae;return Math['max'](0x1,Math[_0x361696(0xb8)](_0x4c1aae/FORM_COLS_DESKTOP*FORM_COLS_MOBILE));}export function useFormCols(){const _0x54397f=ref(getFormCols());let _0x2ffd26=null;const _0x51d528=()=>{const _0x281d36=_0x4baf;_0x54397f[_0x281d36(0xbc)]=getFormCols();};return onMounted(()=>{const _0x535aac=_0x4baf;_0x2ffd26=window[_0x535aac(0xb7)](FORM_MQ_MOBILE),_0x2ffd26[_0x535aac(0xc5)]('change',_0x51d528),_0x51d528();}),onUnmounted(()=>{const _0x2c466c=_0x4baf;_0x2ffd26?.['removeEventListener'](_0x2c466c(0xb9),_0x51d528);}),_0x54397f;}
1
+ import { onMounted, onUnmounted, ref } from "vue";
2
+ import { getCrudStyle } from "./style";
3
+ export const FORM_COLS_DESKTOP = 24;
4
+ export const FORM_COLS_MOBILE = 12;
5
+ export const FORM_SPAN_FULL = 24;
6
+ export const FORM_MQ_MOBILE = "(max-width: 768px)";
7
+ export function getFormCols() {
8
+ if (typeof window !== "undefined" && window.matchMedia(FORM_MQ_MOBILE).matches) {
9
+ return FORM_COLS_MOBILE;
10
+ }
11
+ return FORM_COLS_DESKTOP;
12
+ }
13
+ export function resolveFormSpan(span, cols = getFormCols()) {
14
+ const raw = span ?? getCrudStyle().form.span ?? FORM_SPAN_FULL;
15
+ const normalized = Math.min(FORM_SPAN_FULL, Math.max(1, raw));
16
+ if (cols === FORM_COLS_DESKTOP)
17
+ return normalized;
18
+ return Math.max(1, Math.round(normalized / FORM_COLS_DESKTOP * FORM_COLS_MOBILE));
19
+ }
20
+ export function useFormCols() {
21
+ const cols = ref(getFormCols());
22
+ let mql = null;
23
+ const sync = () => {
24
+ cols.value = getFormCols();
25
+ };
26
+ onMounted(() => {
27
+ mql = window.matchMedia(FORM_MQ_MOBILE);
28
+ mql.addEventListener("change", sync);
29
+ sync();
30
+ });
31
+ onUnmounted(() => {
32
+ mql?.removeEventListener("change", sync);
33
+ });
34
+ return cols;
35
+ }
@@ -1 +1,74 @@
1
- function _0x2482(){const _0x269bbf=['C29YDa','C3r5Bgu','iZrfnurgrG','B3jKzxiTyxnJ','zgLJDa','mtC2nJeZAM1tywHu','mtaWChG','mJmZoda0ntjIueDfDMG','mJiYotmZnKfTt25XuG','iZzKmtDJmW','y29SDw1U','BgfIzwW','nfPRzxfWuq','i2q1nZeYmq','iZa0yZi3mW','mtHdDNjdz2q','mteZEMvosMHI','mZq4oteXmwj0v2Lpta','i2fHn2eYna','mtbQqwXUq2e','C2vHCMnO','mtfnD0DpyNG','DgfIBgu','i2u5m2y0za','zwrPDa','CMvMCMvZAa','ntyZntu0nMvvv0zzyG','CgfNAw5HDgLVBG','ndG0ohLXBLblBG','yxbP','mZu3ntvzyMLtDKm','y29SB3jZ','y2HLy2S'];_0x2482=function(){return _0x269bbf;};return _0x2482();}const _0x30940d=_0x4ef9;(function(_0x549762,_0x21976b){const _0x1bd1e3=_0x4ef9,_0xefd0b6=_0x549762();while(!![]){try{const _0xa5011b=parseInt(_0x1bd1e3(0x10e))/0x1*(parseInt(_0x1bd1e3(0xf9))/0x2)+-parseInt(_0x1bd1e3(0x103))/0x3*(parseInt(_0x1bd1e3(0x10a))/0x4)+parseInt(_0x1bd1e3(0xfb))/0x5*(-parseInt(_0x1bd1e3(0x10d))/0x6)+-parseInt(_0x1bd1e3(0xf7))/0x7+-parseInt(_0x1bd1e3(0x106))/0x8+parseInt(_0x1bd1e3(0x10f))/0x9*(-parseInt(_0x1bd1e3(0x111))/0xa)+-parseInt(_0x1bd1e3(0x113))/0xb*(-parseInt(_0x1bd1e3(0x105))/0xc);if(_0xa5011b===_0x21976b)break;else _0xefd0b6['push'](_0xefd0b6['shift']());}catch(_0x36f206){_0xefd0b6['push'](_0xefd0b6['shift']());}}}(_0x2482,0xa3b47));import{CRUD_LABELS,DEFAULT_CRUD_DICT}from'./dict';function _0x4ef9(_0x26ec65,_0x2353d6){_0x26ec65=_0x26ec65-0xf6;const _0x248250=_0x2482();let _0x4ef9f4=_0x248250[_0x26ec65];if(_0x4ef9['DnzpYw']===undefined){var _0x31a9d8=function(_0xe3ddbe){const _0x2520cc='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x52561d='',_0x3c75a6='';for(let _0x396d47=0x0,_0x2d986f,_0x2eecfe,_0x1310cc=0x0;_0x2eecfe=_0xe3ddbe['charAt'](_0x1310cc++);~_0x2eecfe&&(_0x2d986f=_0x396d47%0x4?_0x2d986f*0x40+_0x2eecfe:_0x2eecfe,_0x396d47++%0x4)?_0x52561d+=String['fromCharCode'](0xff&_0x2d986f>>(-0x2*_0x396d47&0x6)):0x0){_0x2eecfe=_0x2520cc['indexOf'](_0x2eecfe);}for(let _0x25c7f3=0x0,_0x21e7c6=_0x52561d['length'];_0x25c7f3<_0x21e7c6;_0x25c7f3++){_0x3c75a6+='%'+('00'+_0x52561d['charCodeAt'](_0x25c7f3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3c75a6);};_0x4ef9['YbnCyb']=_0x31a9d8,_0x4ef9['xtVepk']={},_0x4ef9['DnzpYw']=!![];}const _0x10ccd1=_0x248250[0x0],_0x404c94=_0x26ec65+_0x10ccd1,_0x30a8d7=_0x4ef9['xtVepk'][_0x404c94];return!_0x30a8d7?(_0x4ef9f4=_0x4ef9['YbnCyb'](_0x4ef9f4),_0x4ef9['xtVepk'][_0x404c94]=_0x4ef9f4):_0x4ef9f4=_0x30a8d7,_0x4ef9f4;}export const DEFAULT_CRUD_STYLE={'form':{'labelPosition':'top','labelWidth':_0x30940d(0x104),'span':0x18,'plugins':[]},'table':{'border':![],'highlightCurrentRow':!![],'autoHeight':!![],'contextMenu':[_0x30940d(0xf6),_0x30940d(0xfd),_0x30940d(0x116),'delete',_0x30940d(0x101),'order-desc'],'column':{'align':'left','opWidth':0xb4},'plugins':[]},'search':{'plugins':[]},'colors':[_0x30940d(0x100),'#06b31c',_0x30940d(0x115),_0x30940d(0x10b),_0x30940d(0x107),_0x30940d(0x10c),_0x30940d(0x110),'#1c109d']};let globalConfig={'dict':{...DEFAULT_CRUD_DICT,'label':{...CRUD_LABELS}},'style':structuredClone(DEFAULT_CRUD_STYLE)};export function setCrudConfig(_0x52561d){const _0xb5dfff=_0x30940d;if(!_0x52561d)return globalConfig;return globalConfig={'dict':{...globalConfig[_0xb5dfff(0x102)],..._0x52561d[_0xb5dfff(0x102)],'api':{...globalConfig[_0xb5dfff(0x102)]['api'],..._0x52561d[_0xb5dfff(0x102)]?.[_0xb5dfff(0xfa)]},'pagination':{...globalConfig[_0xb5dfff(0x102)][_0xb5dfff(0xf8)],..._0x52561d[_0xb5dfff(0x102)]?.[_0xb5dfff(0xf8)]},'search':{...globalConfig['dict']['search'],..._0x52561d[_0xb5dfff(0x102)]?.[_0xb5dfff(0x112)]},'sort':{...globalConfig[_0xb5dfff(0x102)]['sort'],..._0x52561d[_0xb5dfff(0x102)]?.[_0xb5dfff(0xfe)]},'label':{...globalConfig[_0xb5dfff(0x102)][_0xb5dfff(0x109)],..._0x52561d[_0xb5dfff(0x102)]?.['label']}},'style':{...globalConfig['style'],..._0x52561d[_0xb5dfff(0xff)],'form':{...globalConfig[_0xb5dfff(0xff)]['form'],..._0x52561d['style']?.['form']},'table':{...globalConfig[_0xb5dfff(0xff)][_0xb5dfff(0x114)],..._0x52561d[_0xb5dfff(0xff)]?.['table'],'column':{...globalConfig['style'][_0xb5dfff(0x114)][_0xb5dfff(0x108)],..._0x52561d[_0xb5dfff(0xff)]?.[_0xb5dfff(0x114)]?.[_0xb5dfff(0x108)]}},'search':{...globalConfig[_0xb5dfff(0xff)][_0xb5dfff(0x112)],..._0x52561d[_0xb5dfff(0xff)]?.[_0xb5dfff(0x112)]},'colors':_0x52561d['style']?.[_0xb5dfff(0xfc)]||globalConfig[_0xb5dfff(0xff)][_0xb5dfff(0xfc)]}},globalConfig;}export function getCrudConfig(){return globalConfig;}export function getCrudStyle(){return globalConfig['style'];}
1
+ import { CRUD_LABELS, DEFAULT_CRUD_DICT } from "./dict";
2
+ export const DEFAULT_CRUD_STYLE = {
3
+ form: {
4
+ labelPosition: "top",
5
+ labelWidth: "100px",
6
+ span: 24,
7
+ plugins: []
8
+ },
9
+ table: {
10
+ border: false,
11
+ highlightCurrentRow: true,
12
+ autoHeight: true,
13
+ contextMenu: ["refresh", "check", "edit", "delete", "order-asc", "order-desc"],
14
+ column: {
15
+ align: "left",
16
+ opWidth: 180
17
+ },
18
+ plugins: []
19
+ },
20
+ search: {
21
+ plugins: []
22
+ },
23
+ colors: [
24
+ "#4E5DFF",
25
+ "#06b31c",
26
+ "#e93f4d",
27
+ "#d57121",
28
+ "#6d17c3",
29
+ "#04c273",
30
+ "#aa7a24",
31
+ "#1c109d"
32
+ ]
33
+ };
34
+ let globalConfig = {
35
+ dict: { ...DEFAULT_CRUD_DICT, label: { ...CRUD_LABELS } },
36
+ style: structuredClone(DEFAULT_CRUD_STYLE)
37
+ };
38
+ export function setCrudConfig(partial) {
39
+ if (!partial)
40
+ return globalConfig;
41
+ globalConfig = {
42
+ dict: {
43
+ ...globalConfig.dict,
44
+ ...partial.dict,
45
+ api: { ...globalConfig.dict.api, ...partial.dict?.api },
46
+ pagination: { ...globalConfig.dict.pagination, ...partial.dict?.pagination },
47
+ search: { ...globalConfig.dict.search, ...partial.dict?.search },
48
+ sort: { ...globalConfig.dict.sort, ...partial.dict?.sort },
49
+ label: { ...globalConfig.dict.label, ...partial.dict?.label }
50
+ },
51
+ style: {
52
+ ...globalConfig.style,
53
+ ...partial.style,
54
+ form: { ...globalConfig.style.form, ...partial.style?.form },
55
+ table: {
56
+ ...globalConfig.style.table,
57
+ ...partial.style?.table,
58
+ column: {
59
+ ...globalConfig.style.table.column,
60
+ ...partial.style?.table?.column
61
+ }
62
+ },
63
+ search: { ...globalConfig.style.search, ...partial.style?.search },
64
+ colors: partial.style?.colors || globalConfig.style.colors
65
+ }
66
+ };
67
+ return globalConfig;
68
+ }
69
+ export function getCrudConfig() {
70
+ return globalConfig;
71
+ }
72
+ export function getCrudStyle() {
73
+ return globalConfig.style;
74
+ }
@@ -1 +1,92 @@
1
- (function(_0x55fb02,_0x474bea){const _0x3937ae=_0x534f,_0x4806dd=_0x55fb02();while(!![]){try{const _0x234b60=parseInt(_0x3937ae(0xe1))/0x1+parseInt(_0x3937ae(0xe2))/0x2*(-parseInt(_0x3937ae(0xd2))/0x3)+-parseInt(_0x3937ae(0xde))/0x4+parseInt(_0x3937ae(0xdf))/0x5+-parseInt(_0x3937ae(0xd0))/0x6+-parseInt(_0x3937ae(0xcf))/0x7+parseInt(_0x3937ae(0xc9))/0x8;if(_0x234b60===_0x474bea)break;else _0x4806dd['push'](_0x4806dd['shift']());}catch(_0x2fc42e){_0x4806dd['push'](_0x4806dd['shift']());}}}(_0x2dda,0x5bd7f));function _0x2dda(){const _0x338613=['ndaWnJqYEePKyLbJ','mtaYntaWnKfMwLrnDa','5QcH6AQm5AsX6lsL','Cgf0DgvYBG','CMvXDwLYzwq','5lIn6io95lI656M6','BwfW','mtaWntKYnZjjq0nfq1i','Bwf4','BgfIzwW','DhjPBq','BgvUz3rO','ios4QUwTL+ESPG','ntaXmJeYnMndCKTdzq','mtqZodK4nLrPywD3CG','6iEZ5Bcria','m2TvzfrbCq','BwvZC2fNzq','DgvZDa','AxnbCNjHEq','C3rYAw5N','DMfSAwrHDg9Y','ChvZAa','B2jQzwn0','zNvUy3rPB24','BwLU','ChjVCa','5Qc85BYp5lIn5Q2J56gU','mtu3oti2ng5tzMfOEa','mJKWnJu0mfDKDeL0qq','AgLKzgvU'];_0x2dda=function(){return _0x338613;};return _0x2dda();}function isEmpty(_0x17cb2b){const _0x461609=_0x534f;if(_0x17cb2b==null||_0x17cb2b==='')return!![];if(typeof _0x17cb2b===_0x461609(0xd6)&&_0x17cb2b[_0x461609(0xcc)]()==='')return!![];if(Array[_0x461609(0xd5)](_0x17cb2b)&&_0x17cb2b[_0x461609(0xcd)]===0x0)return!![];return![];}function normalizeRules(_0x5c48b1){const _0x1687d5=_0x534f,_0xe77afa=[];_0x5c48b1[_0x1687d5(0xc6)]&&_0xe77afa['push']({'required':!![],'message':_0x5c48b1[_0x1687d5(0xcb)]+_0x1687d5(0xc7)});const _0x23c773=_0x5c48b1['rules'];if(!_0x23c773)return _0xe77afa;if(Array[_0x1687d5(0xd5)](_0x23c773))for(const _0x164b3d of _0x23c773){if(_0x164b3d&&typeof _0x164b3d===_0x1687d5(0xd9))_0xe77afa[_0x1687d5(0xd8)](_0x164b3d);}else typeof _0x23c773==='object'&&_0xe77afa['push'](_0x23c773);return _0xe77afa;}function _0x534f(_0x5d5845,_0x2dc047){_0x5d5845=_0x5d5845-0xc5;const _0x2dda65=_0x2dda();let _0x534f0b=_0x2dda65[_0x5d5845];if(_0x534f['iGesvd']===undefined){var _0x3de7e3=function(_0x1d6077){const _0x33d863='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x17cb2b='',_0x5c48b1='';for(let _0xe77afa=0x0,_0x23c773,_0x164b3d,_0x2d8111=0x0;_0x164b3d=_0x1d6077['charAt'](_0x2d8111++);~_0x164b3d&&(_0x23c773=_0xe77afa%0x4?_0x23c773*0x40+_0x164b3d:_0x164b3d,_0xe77afa++%0x4)?_0x17cb2b+=String['fromCharCode'](0xff&_0x23c773>>(-0x2*_0xe77afa&0x6)):0x0){_0x164b3d=_0x33d863['indexOf'](_0x164b3d);}for(let _0x3c57e0=0x0,_0x1e919f=_0x17cb2b['length'];_0x3c57e0<_0x1e919f;_0x3c57e0++){_0x5c48b1+='%'+('00'+_0x17cb2b['charCodeAt'](_0x3c57e0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5c48b1);};_0x534f['qDfErN']=_0x3de7e3,_0x534f['IkJKPJ']={},_0x534f['iGesvd']=!![];}const _0x311120=_0x2dda65[0x0],_0xd1457f=_0x5d5845+_0x311120,_0x1ff71a=_0x534f['IkJKPJ'][_0xd1457f];return!_0x1ff71a?(_0x534f0b=_0x534f['qDfErN'](_0x534f0b),_0x534f['IkJKPJ'][_0xd1457f]=_0x534f0b):_0x534f0b=_0x1ff71a,_0x534f0b;}function isItemHidden(_0x2d8111,_0x3c57e0){const _0xa04d7e=_0x534f;if(typeof _0x2d8111[_0xa04d7e(0xe0)]===_0xa04d7e(0xda))return _0x2d8111['hidden'](_0x3c57e0);return Boolean(_0x2d8111['hidden']);}async function validateItem(_0x1e919f,_0x175c5b){const _0xfe1577=_0x534f,_0x4d702b=_0x175c5b[_0x1e919f['prop']];for(const _0x304cac of normalizeRules(_0x1e919f)){if(_0x304cac[_0xfe1577(0xc6)]&&isEmpty(_0x4d702b))return _0x304cac[_0xfe1577(0xd3)]||_0x1e919f['label']+_0xfe1577(0xc7);if(isEmpty(_0x4d702b))continue;const _0x2b0b14=String(_0x4d702b);if(_0x304cac[_0xfe1577(0xdb)]!=null&&_0x2b0b14['length']<_0x304cac[_0xfe1577(0xdb)])return _0x304cac[_0xfe1577(0xd3)]||_0x1e919f[_0xfe1577(0xcb)]+_0xfe1577(0xd1)+_0x304cac['min']+_0xfe1577(0xce);if(_0x304cac['max']!=null&&_0x2b0b14[_0xfe1577(0xcd)]>_0x304cac[_0xfe1577(0xca)])return _0x304cac[_0xfe1577(0xd3)]||_0x1e919f[_0xfe1577(0xcb)]+'最多\x20'+_0x304cac[_0xfe1577(0xca)]+'\x20个字符';if(_0x304cac[_0xfe1577(0xc5)]&&!_0x304cac['pattern'][_0xfe1577(0xd4)](_0x2b0b14))return _0x304cac[_0xfe1577(0xd3)]||_0x1e919f[_0xfe1577(0xcb)]+_0xfe1577(0xdd);if(_0x304cac[_0xfe1577(0xd7)]){const _0x179066=await _0x304cac[_0xfe1577(0xd7)](_0x4d702b,_0x175c5b);if(_0x179066!==!![])return _0x179066||_0x1e919f[_0xfe1577(0xcb)]+_0xfe1577(0xe3);}}return null;}export async function validateFormItems(_0x392051,_0x5af312){for(const _0x47288e of _0x392051){if(isItemHidden(_0x47288e,_0x5af312))continue;const _0x49cc68=await validateItem(_0x47288e,_0x5af312);if(_0x49cc68)return _0x49cc68;}return null;}export async function validateFormFields(_0x8b0cd,_0x45ea25){const _0x4cd8b1=_0x534f,_0x313813={};for(const _0x5ea7b0 of _0x8b0cd){if(isItemHidden(_0x5ea7b0,_0x45ea25))continue;const _0x35aa39=await validateItem(_0x5ea7b0,_0x45ea25);if(_0x35aa39)_0x313813[_0x5ea7b0[_0x4cd8b1(0xdc)]]=_0x35aa39;}return _0x313813;}export function applySetRules(_0x224ee3){const _0x3b14cb=_0x534f;return _0x224ee3[_0x3b14cb(0xc8)](_0x5d31f2=>{const _0x35900f=_0x3b14cb;if(!_0x5d31f2[_0x35900f(0xc6)]||_0x5d31f2['rules'])return _0x5d31f2;return{..._0x5d31f2,'rules':[{'required':!![],'message':_0x5d31f2[_0x35900f(0xcb)]+'不能为空'}]};});}
1
+ function isEmpty(v) {
2
+ if (v == null || v === "")
3
+ return true;
4
+ if (typeof v === "string" && v.trim() === "")
5
+ return true;
6
+ if (Array.isArray(v) && v.length === 0)
7
+ return true;
8
+ return false;
9
+ }
10
+ function normalizeRules(item) {
11
+ const rules = [];
12
+ if (item.required) {
13
+ rules.push({
14
+ required: true,
15
+ message: `${item.label}不能为空`
16
+ });
17
+ }
18
+ const raw = item.rules;
19
+ if (!raw)
20
+ return rules;
21
+ if (Array.isArray(raw)) {
22
+ for (const r of raw) {
23
+ if (r && typeof r === "object")
24
+ rules.push(r);
25
+ }
26
+ } else if (typeof raw === "object") {
27
+ rules.push(raw);
28
+ }
29
+ return rules;
30
+ }
31
+ function isItemHidden(item, form) {
32
+ if (typeof item.hidden === "function")
33
+ return item.hidden(form);
34
+ return Boolean(item.hidden);
35
+ }
36
+ async function validateItem(item, form) {
37
+ const value = form[item.prop];
38
+ for (const rule of normalizeRules(item)) {
39
+ if (rule.required && isEmpty(value)) {
40
+ return rule.message || `${item.label}不能为空`;
41
+ }
42
+ if (isEmpty(value))
43
+ continue;
44
+ const str = String(value);
45
+ if (rule.min != null && str.length < rule.min) {
46
+ return rule.message || `${item.label}至少 ${rule.min} 个字符`;
47
+ }
48
+ if (rule.max != null && str.length > rule.max) {
49
+ return rule.message || `${item.label}最多 ${rule.max} 个字符`;
50
+ }
51
+ if (rule.pattern && !rule.pattern.test(str)) {
52
+ return rule.message || `${item.label}格式不正确`;
53
+ }
54
+ if (rule.validator) {
55
+ const r = await rule.validator(value, form);
56
+ if (r !== true)
57
+ return r || `${item.label}校验失败`;
58
+ }
59
+ }
60
+ return null;
61
+ }
62
+ export async function validateFormItems(items, form) {
63
+ for (const item of items) {
64
+ if (isItemHidden(item, form))
65
+ continue;
66
+ const err = await validateItem(item, form);
67
+ if (err)
68
+ return err;
69
+ }
70
+ return null;
71
+ }
72
+ export async function validateFormFields(items, form) {
73
+ const errors = {};
74
+ for (const item of items) {
75
+ if (isItemHidden(item, form))
76
+ continue;
77
+ const err = await validateItem(item, form);
78
+ if (err)
79
+ errors[item.prop] = err;
80
+ }
81
+ return errors;
82
+ }
83
+ export function applySetRules(items) {
84
+ return items.map((it) => {
85
+ if (!it.required || it.rules)
86
+ return it;
87
+ return {
88
+ ...it,
89
+ rules: [{ required: true, message: `${it.label}不能为空` }]
90
+ };
91
+ });
92
+ }
@@ -1 +1,14 @@
1
- function _0x57f3(_0x14d3eb,_0x333afc){_0x14d3eb=_0x14d3eb-0x1e5;const _0x5cdc18=_0x5cdc();let _0x57f32f=_0x5cdc18[_0x14d3eb];if(_0x57f3['ENRfaU']===undefined){var _0x546c49=function(_0x4be823){const _0x390cfd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5afe6b='',_0x240963='';for(let _0x3698fa=0x0,_0x4c5cd5,_0x4f450,_0x39bacd=0x0;_0x4f450=_0x4be823['charAt'](_0x39bacd++);~_0x4f450&&(_0x4c5cd5=_0x3698fa%0x4?_0x4c5cd5*0x40+_0x4f450:_0x4f450,_0x3698fa++%0x4)?_0x5afe6b+=String['fromCharCode'](0xff&_0x4c5cd5>>(-0x2*_0x3698fa&0x6)):0x0){_0x4f450=_0x390cfd['indexOf'](_0x4f450);}for(let _0x3aaeb1=0x0,_0x87a0d2=_0x5afe6b['length'];_0x3aaeb1<_0x87a0d2;_0x3aaeb1++){_0x240963+='%'+('00'+_0x5afe6b['charCodeAt'](_0x3aaeb1)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x240963);};_0x57f3['TGgDyx']=_0x546c49,_0x57f3['vDfGba']={},_0x57f3['ENRfaU']=!![];}const _0x43da76=_0x5cdc18[0x0],_0x1074d5=_0x14d3eb+_0x43da76,_0x1815a8=_0x57f3['vDfGba'][_0x1074d5];return!_0x1815a8?(_0x57f32f=_0x57f3['TGgDyx'](_0x57f32f),_0x57f3['vDfGba'][_0x1074d5]=_0x57f32f):_0x57f32f=_0x1815a8,_0x57f32f;}(function(_0x554614,_0x2b53f1){const _0x132000=_0x57f3,_0xa7f4f5=_0x554614();while(!![]){try{const _0x8f1f6a=-parseInt(_0x132000(0x1ee))/0x1*(parseInt(_0x132000(0x1f2))/0x2)+-parseInt(_0x132000(0x1e6))/0x3*(parseInt(_0x132000(0x1e8))/0x4)+-parseInt(_0x132000(0x1ed))/0x5+-parseInt(_0x132000(0x1ea))/0x6+parseInt(_0x132000(0x1f1))/0x7+-parseInt(_0x132000(0x1ef))/0x8+-parseInt(_0x132000(0x1e5))/0x9*(-parseInt(_0x132000(0x1e7))/0xa);if(_0x8f1f6a===_0x2b53f1)break;else _0xa7f4f5['push'](_0xa7f4f5['shift']());}catch(_0x57d744){_0xa7f4f5['push'](_0xa7f4f5['shift']());}}}(_0x5cdc,0x88c4d));function _0x5cdc(){const _0x11c30d=['mxPJuMrxra','mZG0mtm2ohvkAfDSrG','BM9Uzq','nJu4ode0ogvcCgfqsG','mtKZmda0nMLdExrouW','mJGXn0nfAvjKCq','nJb2z09lEuK','odq5ntbbrKLoCMG','mZeZntjIBMzutLK','zgLZCgXHEq','mtK5mZqYmMTdserIBa','C3r5Bgu','DMfSDwu','ntuYoduXnuDUvKPgvG'];_0x5cdc=function(){return _0x11c30d;};return _0x5cdc();}import{useUserStore}from'../stores/user';export const vPerm={'mounted'(_0x5afe6b,_0x240963){const _0x45305e=_0x57f3;apply(_0x5afe6b,_0x240963[_0x45305e(0x1ec)]);},'updated'(_0x3698fa,_0x4c5cd5){const _0x5bd142=_0x57f3;apply(_0x3698fa,_0x4c5cd5[_0x5bd142(0x1ec)]);}};function apply(_0x4f450,_0x39bacd){const _0x4bda22=_0x57f3,_0x3aaeb1=useUserStore(),_0x87a0d2=_0x3aaeb1['hasPerm'](_0x39bacd);_0x4f450[_0x4bda22(0x1eb)][_0x4bda22(0x1e9)]=_0x87a0d2?'':_0x4bda22(0x1f0);}
1
+ import { useUserStore } from "../stores/user";
2
+ export const vPerm = {
3
+ mounted(el, binding) {
4
+ apply(el, binding.value);
5
+ },
6
+ updated(el, binding) {
7
+ apply(el, binding.value);
8
+ }
9
+ };
10
+ function apply(el, value) {
11
+ const user = useUserStore();
12
+ const ok = user.hasPerm(value);
13
+ el.style.display = ok ? "" : "none";
14
+ }
@@ -1 +1,63 @@
1
- const _0x183854=_0x1b94;(function(_0x1fe3bc,_0x2b6e53){const _0x24df16=_0x1b94,_0x254500=_0x1fe3bc();while(!![]){try{const _0x1fdae0=parseInt(_0x24df16(0x184))/0x1*(parseInt(_0x24df16(0x17a))/0x2)+-parseInt(_0x24df16(0x194))/0x3*(-parseInt(_0x24df16(0x18d))/0x4)+parseInt(_0x24df16(0x191))/0x5*(-parseInt(_0x24df16(0x17e))/0x6)+-parseInt(_0x24df16(0x185))/0x7+-parseInt(_0x24df16(0x17f))/0x8*(parseInt(_0x24df16(0x195))/0x9)+-parseInt(_0x24df16(0x193))/0xa+-parseInt(_0x24df16(0x181))/0xb*(-parseInt(_0x24df16(0x187))/0xc);if(_0x1fdae0===_0x2b6e53)break;else _0x254500['push'](_0x254500['shift']());}catch(_0x386303){_0x254500['push'](_0x254500['shift']());}}}(_0x41c6,0x7a07c));import{toast}from'vue-sonner';import{request}from'../api/client';import{extname,filename,pathJoin,uploadUid}from'../lib/upload';function _0x41c6(){const _0x10e4e8=['B25WCM9NCMvZCW','yxbWzw5K','DxbSB2fKvxjS','zw50CMLLCW','Ag9ZDa','zxjYB3i','DxbSB2fK','mte1ndGXogfwve5TDa','5lIk5lYG572r57UC6zsz6k+V','C2XPy2u','C3rHDhvZ','otiWmtbnwgzJtgG','mZCWmJmYCuX2AMTp','ChjLDMLLD1vYBa','mtfvBhLgCuK','C3rYAw5NAwz5','zMXVB3i','mvzUzuTWyW','mJm2mdr0DNbRqxa','AgfZ','mZC2odu4oe1IswXJDG','B25LCNjVCG','ue9tva','DxjS','Dg90ywW','yxbWl2jHC2u','nJe1nJqWsgn5wgHN','ChvIBgLJrg9TywLU','C2vUza','ChjLDMLLDW','mtK1A21nExjh','BgvUz3rOq29TChv0ywjSzq','nJy3otKWvufwCxrm','owjpvgzHCG','mZzxA05Vse4'];_0x41c6=function(){return _0x10e4e8;};return _0x41c6();}const UPLOAD_PATH='/admin/base/comm/upload',SIGN_SKIP=new Set([_0x183854(0x18a),_0x183854(0x177),_0x183854(0x175),_0x183854(0x18e),'previewUrl',_0x183854(0x190)]);function _0x1b94(_0xc72df2,_0x421fcc){_0xc72df2=_0xc72df2-0x173;const _0x41c6bf=_0x41c6();let _0x1b947c=_0x41c6bf[_0xc72df2];if(_0x1b94['uEZVGI']===undefined){var _0x3c3002=function(_0xbba262){const _0x34c5e3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5cebcf='',_0x5e655c='';for(let _0x40b2f0=0x0,_0x4cacd5,_0x4332a1,_0x22626c=0x0;_0x4332a1=_0xbba262['charAt'](_0x22626c++);~_0x4332a1&&(_0x4cacd5=_0x40b2f0%0x4?_0x4cacd5*0x40+_0x4332a1:_0x4332a1,_0x40b2f0++%0x4)?_0x5cebcf+=String['fromCharCode'](0xff&_0x4cacd5>>(-0x2*_0x40b2f0&0x6)):0x0){_0x4332a1=_0x34c5e3['indexOf'](_0x4332a1);}for(let _0x1c29a6=0x0,_0x58f38e=_0x5cebcf['length'];_0x1c29a6<_0x58f38e;_0x1c29a6++){_0x5e655c+='%'+('00'+_0x5cebcf['charCodeAt'](_0x1c29a6)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5e655c);};_0x1b94['LAuHqb']=_0x3c3002,_0x1b94['YiCbQq']={},_0x1b94['uEZVGI']=!![];}const _0x51bf4e=_0x41c6bf[0x0],_0x45110a=_0xc72df2+_0x51bf4e,_0x35e221=_0x1b94['YiCbQq'][_0x45110a];return!_0x35e221?(_0x1b947c=_0x1b94['LAuHqb'](_0x1b947c),_0x1b94['YiCbQq'][_0x45110a]=_0x1b947c):_0x1b947c=_0x35e221,_0x1b947c;}export function useUpload(){async function _0x5cebcf(_0x5e655c,_0x40b2f0={}){const _0x3c227c=_0x1b94,{prefixPath:prefixPath=_0x3c227c(0x18c),onProgress:_0x4cacd5}=_0x40b2f0,_0x4332a1=uploadUid(),_0x22626c=extname(_0x5e655c['name']),_0x1c29a6=filename(_0x5e655c['name'])+'_'+_0x4332a1+(_0x22626c?'.'+_0x22626c:''),_0x58f38e=pathJoin(prefixPath,_0x1c29a6),_0x9061d6=await request(UPLOAD_PATH,{'method':_0x3c227c(0x189),'body':JSON[_0x3c227c(0x182)]({})}),_0x472dfe=String(_0x9061d6[_0x3c227c(0x177)]||_0x9061d6[_0x3c227c(0x18a)]||_0x9061d6[_0x3c227c(0x175)]||'');if(!_0x472dfe)throw new Error('上传地址无效');const _0x232133=new FormData();_0x232133[_0x3c227c(0x174)]('key',_0x58f38e);for(const [_0x52b74d,_0x2b896d]of Object[_0x3c227c(0x176)](_0x9061d6)){if(SIGN_SKIP[_0x3c227c(0x186)](_0x52b74d)||_0x2b896d==null||_0x232133[_0x3c227c(0x186)](_0x52b74d))continue;_0x232133['append'](_0x52b74d,String(_0x2b896d));}_0x232133[_0x3c227c(0x174)]('file',_0x5e655c),await xhrUpload(_0x472dfe,_0x232133,_0x4cacd5);const _0x7424e4=String(_0x9061d6[_0x3c227c(0x18e)]||_0x9061d6[_0x3c227c(0x180)]||_0x472dfe);return{'url':pathJoin(_0x7424e4,_0x58f38e),'key':_0x58f38e,'fileId':_0x4332a1};}return{'toUpload':_0x5cebcf};}function xhrUpload(_0x48ca01,_0x319c33,_0x1463af){return new Promise((_0x559719,_0x372bc8)=>{const _0x53df5a=_0x1b94,_0x45c40b=new XMLHttpRequest();_0x45c40b['open'](_0x53df5a(0x189),_0x48ca01),_0x45c40b[_0x53df5a(0x179)][_0x53df5a(0x173)]=_0x2cce78=>{const _0x184262=_0x53df5a;if(!_0x2cce78[_0x184262(0x192)])return;_0x1463af?.(Math['min'](0x64,Math[_0x184262(0x183)](_0x2cce78['loaded']/_0x2cce78[_0x184262(0x18b)]*0x64)));},_0x45c40b['onload']=()=>{const _0x5b7e46=_0x53df5a;if(_0x45c40b['status']<0xc8||_0x45c40b['status']>=0x12c){const _0x586d02=_0x45c40b['responseText']||'上传失败\x20('+_0x45c40b[_0x5b7e46(0x17d)]+')';toast[_0x5b7e46(0x178)](_0x586d02[_0x5b7e46(0x17c)](0x0,0xc8)),_0x372bc8(new Error(_0x586d02));return;}_0x1463af?.(0x64),_0x559719();},_0x45c40b[_0x53df5a(0x188)]=()=>_0x372bc8(new Error(_0x53df5a(0x17b))),_0x45c40b[_0x53df5a(0x18f)](_0x319c33);});}
1
+ import { toast } from "vue-sonner";
2
+ import { request } from "../api/client";
3
+ import { extname, filename, pathJoin, uploadUid } from "../lib/upload";
4
+ const UPLOAD_PATH = "/admin/base/comm/upload";
5
+ const SIGN_SKIP = new Set([
6
+ "url",
7
+ "host",
8
+ "uploadUrl",
9
+ "publicDomain",
10
+ "previewUrl",
11
+ "preview"
12
+ ]);
13
+ export function useUpload() {
14
+ async function toUpload(file, opts = {}) {
15
+ const { prefixPath = "app/base", onProgress } = opts;
16
+ const fileId = uploadUid();
17
+ const ext = extname(file.name);
18
+ const name = `${filename(file.name)}_${fileId}${ext ? `.${ext}` : ""}`;
19
+ const key = pathJoin(prefixPath, name);
20
+ const sign = await request(UPLOAD_PATH, {
21
+ method: "POST",
22
+ body: JSON.stringify({})
23
+ });
24
+ const host = String(sign.host || sign.url || sign.uploadUrl || "");
25
+ if (!host)
26
+ throw new Error("上传地址无效");
27
+ const fd = new FormData;
28
+ fd.append("key", key);
29
+ for (const [k, v] of Object.entries(sign)) {
30
+ if (SIGN_SKIP.has(k) || v == null || fd.has(k))
31
+ continue;
32
+ fd.append(k, String(v));
33
+ }
34
+ fd.append("file", file);
35
+ await xhrUpload(host, fd, onProgress);
36
+ const preview = String(sign.publicDomain || sign.previewUrl || host);
37
+ return { url: pathJoin(preview, key), key, fileId };
38
+ }
39
+ return { toUpload };
40
+ }
41
+ function xhrUpload(url, body, onProgress) {
42
+ return new Promise((resolve, reject) => {
43
+ const xhr = new XMLHttpRequest;
44
+ xhr.open("POST", url);
45
+ xhr.upload.onprogress = (e) => {
46
+ if (!e.lengthComputable)
47
+ return;
48
+ onProgress?.(Math.min(100, Math.floor(e.loaded / e.total * 100)));
49
+ };
50
+ xhr.onload = () => {
51
+ if (xhr.status < 200 || xhr.status >= 300) {
52
+ const msg = xhr.responseText || `上传失败 (${xhr.status})`;
53
+ toast.error(msg.slice(0, 200));
54
+ reject(new Error(msg));
55
+ return;
56
+ }
57
+ onProgress?.(100);
58
+ resolve();
59
+ };
60
+ xhr.onerror = () => reject(new Error("上传网络错误"));
61
+ xhr.send(body);
62
+ });
63
+ }
@@ -1 +1,24 @@
1
- function _0x5d4e(){const _0x1a041c=['Bwf0y2G','mZC5otjSAKjHvge','DgvZDa','ourzDe9PDq','nvD1A1fTvG','mteZm1rXwuDVra','nda2nduZmfzwCgD0Ea','mtbRuePfz0S','ntq0mtC5u0TNyMDW','BxnPzq','mtiWDMj1wLfT','Dg9mB3DLCKnHC2u','mtmZntu3uNHrB3nN','mJm0nJC5ogzKywPtra','B3rOzxi','nZC5otiWvgX6yun1','zNvSBa','mtq3nZKXsu5Tu0Pq','zg9JDw1LBNrfBgvTzw50'];_0x5d4e=function(){return _0x1a041c;};return _0x5d4e();}(function(_0x1a7cbe,_0x53cd0c){const _0x1b3e7b=_0x1221,_0x4bf1c1=_0x1a7cbe();while(!![]){try{const _0x4ca6fd=-parseInt(_0x1b3e7b(0x1e3))/0x1+parseInt(_0x1b3e7b(0x1e2))/0x2*(parseInt(_0x1b3e7b(0x1e7))/0x3)+-parseInt(_0x1b3e7b(0x1ea))/0x4+parseInt(_0x1b3e7b(0x1df))/0x5*(parseInt(_0x1b3e7b(0x1e8))/0x6)+-parseInt(_0x1b3e7b(0x1ec))/0x7*(parseInt(_0x1b3e7b(0x1e5))/0x8)+-parseInt(_0x1b3e7b(0x1de))/0x9*(-parseInt(_0x1b3e7b(0x1e1))/0xa)+parseInt(_0x1b3e7b(0x1e0))/0xb*(parseInt(_0x1b3e7b(0x1ef))/0xc);if(_0x4ca6fd===_0x53cd0c)break;else _0x4bf1c1['push'](_0x4bf1c1['shift']());}catch(_0xca2fc7){_0x4bf1c1['push'](_0x4bf1c1['shift']());}}}(_0x5d4e,0x46e79));function _0x1221(_0x2a7586,_0x1290b8){_0x2a7586=_0x2a7586-0x1de;const _0x5d4ed7=_0x5d4e();let _0x1221d2=_0x5d4ed7[_0x2a7586];if(_0x1221['ekCkWM']===undefined){var _0x30ab40=function(_0x2ed560){const _0x51cd76='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5496b5='',_0x2d37fb='';for(let _0x517f98=0x0,_0x563593,_0x4a4461,_0x4ccf7b=0x0;_0x4a4461=_0x2ed560['charAt'](_0x4ccf7b++);~_0x4a4461&&(_0x563593=_0x517f98%0x4?_0x563593*0x40+_0x4a4461:_0x4a4461,_0x517f98++%0x4)?_0x5496b5+=String['fromCharCode'](0xff&_0x563593>>(-0x2*_0x517f98&0x6)):0x0){_0x4a4461=_0x51cd76['indexOf'](_0x4a4461);}for(let _0x142f8a=0x0,_0x3050e1=_0x5496b5['length'];_0x142f8a<_0x3050e1;_0x142f8a++){_0x2d37fb+='%'+('00'+_0x5496b5['charCodeAt'](_0x142f8a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2d37fb);};_0x1221['KBbvXN']=_0x30ab40,_0x1221['PqoaTn']={},_0x1221['ekCkWM']=!![];}const _0x418f4a=_0x5d4ed7[0x0],_0x10c1b3=_0x2a7586+_0x418f4a,_0x19a260=_0x1221['PqoaTn'][_0x10c1b3];return!_0x19a260?(_0x1221d2=_0x1221['KBbvXN'](_0x1221d2),_0x1221['PqoaTn'][_0x10c1b3]=_0x1221d2):_0x1221d2=_0x19a260,_0x1221d2;}export function getBrowser(){const _0x2cf434=_0x1221,{clientHeight:_0x5496b5,clientWidth:_0x2d37fb}=document[_0x2cf434(0x1ed)],_0x517f98=navigator['userAgent'][_0x2cf434(0x1e6)]();let _0x563593=(_0x517f98[_0x2cf434(0x1ee)](/firefox|chrome|safari|opera/g)||[_0x2cf434(0x1e9)])[0x0];if((_0x517f98['match'](/msie|trident/g)||[])[0x0])_0x563593=_0x2cf434(0x1e4);let _0x4a4461=_0x2cf434(0x1eb);if(_0x2d37fb<0x300)_0x4a4461='xs';else{if(_0x2d37fb<0x3e0)_0x4a4461='sm';else{if(_0x2d37fb<0x4b0)_0x4a4461='md';else{if(_0x2d37fb<0x780)_0x4a4461='xl';}}}const _0x4ccf7b=!/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i[_0x2cf434(0x1f0)](_0x517f98);return{'height':_0x5496b5,'width':_0x2d37fb,'type':_0x563593,'screen':_0x4a4461,'isMini':_0x4a4461==='xs'||!_0x4ccf7b};}
1
+ export function getBrowser() {
2
+ const { clientHeight: height, clientWidth: width } = document.documentElement;
3
+ const ua = navigator.userAgent.toLowerCase();
4
+ let type = (ua.match(/firefox|chrome|safari|opera/g) || ["other"])[0];
5
+ if ((ua.match(/msie|trident/g) || [])[0])
6
+ type = "msie";
7
+ let screen = "full";
8
+ if (width < 768)
9
+ screen = "xs";
10
+ else if (width < 992)
11
+ screen = "sm";
12
+ else if (width < 1200)
13
+ screen = "md";
14
+ else if (width < 1920)
15
+ screen = "xl";
16
+ const isPC = !/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(ua);
17
+ return {
18
+ height,
19
+ width,
20
+ type,
21
+ screen,
22
+ isMini: screen === "xs" || !isPC
23
+ };
24
+ }
@@ -1 +1,5 @@
1
- function _0x23cc(){var _0x225888=['mtnTAfvIvgi','mZi4mdKXnhHtreHNAG','mta2odq0odjdAMnMu0m','otKZsvjgverW','mtbeChjhy3i','mti2ndiWmJv3yxvVv0S','ode4mfrsB2DmAq','nJmYntu4ngDeuMX3yW','n3Pdz0vbCW','mtm0mJCYmJrmvhfgCha','nwfNwujsva','mtm0ode4wK9iuvHQ'];_0x23cc=function(){return _0x225888;};return _0x23cc();}(function(_0x4b238f,_0x40aed3){var _0x27842b=_0x37e0,_0x35936f=_0x4b238f();while(!![]){try{var _0x49f742=-parseInt(_0x27842b(0x18a))/0x1*(parseInt(_0x27842b(0x189))/0x2)+-parseInt(_0x27842b(0x18d))/0x3*(parseInt(_0x27842b(0x184))/0x4)+-parseInt(_0x27842b(0x188))/0x5*(-parseInt(_0x27842b(0x18c))/0x6)+parseInt(_0x27842b(0x186))/0x7*(parseInt(_0x27842b(0x187))/0x8)+parseInt(_0x27842b(0x18b))/0x9*(-parseInt(_0x27842b(0x18e))/0xa)+-parseInt(_0x27842b(0x183))/0xb+parseInt(_0x27842b(0x185))/0xc;if(_0x49f742===_0x40aed3)break;else _0x35936f['push'](_0x35936f['shift']());}catch(_0x5992fb){_0x35936f['push'](_0x35936f['shift']());}}}(_0x23cc,0xe06d1));import{clsx}from'clsx';function _0x37e0(_0x4d789c,_0x3718a1){_0x4d789c=_0x4d789c-0x183;var _0x23ccc0=_0x23cc();var _0x37e084=_0x23ccc0[_0x4d789c];if(_0x37e0['YgeNAN']===undefined){var _0x132c3c=function(_0x4080f2){var _0x5741de='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0xea8bc0='',_0x56cfc3='';for(var _0x18f65f=0x0,_0x1e2257,_0x5ddea7,_0x5b372f=0x0;_0x5ddea7=_0x4080f2['charAt'](_0x5b372f++);~_0x5ddea7&&(_0x1e2257=_0x18f65f%0x4?_0x1e2257*0x40+_0x5ddea7:_0x5ddea7,_0x18f65f++%0x4)?_0xea8bc0+=String['fromCharCode'](0xff&_0x1e2257>>(-0x2*_0x18f65f&0x6)):0x0){_0x5ddea7=_0x5741de['indexOf'](_0x5ddea7);}for(var _0x263c06=0x0,_0x11e234=_0xea8bc0['length'];_0x263c06<_0x11e234;_0x263c06++){_0x56cfc3+='%'+('00'+_0xea8bc0['charCodeAt'](_0x263c06)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x56cfc3);};_0x37e0['QbRVfj']=_0x132c3c,_0x37e0['nHrpmJ']={},_0x37e0['YgeNAN']=!![];}var _0x4bf776=_0x23ccc0[0x0],_0x2b45ae=_0x4d789c+_0x4bf776,_0x25e017=_0x37e0['nHrpmJ'][_0x2b45ae];return!_0x25e017?(_0x37e084=_0x37e0['QbRVfj'](_0x37e084),_0x37e0['nHrpmJ'][_0x2b45ae]=_0x37e084):_0x37e084=_0x25e017,_0x37e084;}import{twMerge}from'tailwind-merge';export function cn(..._0xea8bc0){return twMerge(clsx(_0xea8bc0));}
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
@@ -1 +1,13 @@
1
- const _0x2c48eb=_0x2153;(function(_0x263707,_0xf38e9a){const _0x153e73=_0x2153,_0x3f6ab0=_0x263707();while(!![]){try{const _0xb5a4a3=-parseInt(_0x153e73(0x140))/0x1+parseInt(_0x153e73(0x145))/0x2+-parseInt(_0x153e73(0x144))/0x3*(parseInt(_0x153e73(0x141))/0x4)+-parseInt(_0x153e73(0x13d))/0x5+-parseInt(_0x153e73(0x139))/0x6+-parseInt(_0x153e73(0x13a))/0x7+parseInt(_0x153e73(0x142))/0x8;if(_0xb5a4a3===_0xf38e9a)break;else _0x3f6ab0['push'](_0x3f6ab0['shift']());}catch(_0x3e2853){_0x3f6ab0['push'](_0x3f6ab0['shift']());}}}(_0x5922,0x27da8));function _0x2153(_0x427e95,_0x2ebf0e){_0x427e95=_0x427e95-0x138;const _0x592209=_0x5922();let _0x2153b7=_0x592209[_0x427e95];if(_0x2153['GrZpqP']===undefined){var _0x1b9132=function(_0x323f21){const _0x489be0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x24da38='',_0x298658='';for(let _0x26a8d9=0x0,_0x98fec0,_0x2549f4,_0x6b5c72=0x0;_0x2549f4=_0x323f21['charAt'](_0x6b5c72++);~_0x2549f4&&(_0x98fec0=_0x26a8d9%0x4?_0x98fec0*0x40+_0x2549f4:_0x2549f4,_0x26a8d9++%0x4)?_0x24da38+=String['fromCharCode'](0xff&_0x98fec0>>(-0x2*_0x26a8d9&0x6)):0x0){_0x2549f4=_0x489be0['indexOf'](_0x2549f4);}for(let _0x13d934=0x0,_0x4e917a=_0x24da38['length'];_0x13d934<_0x4e917a;_0x13d934++){_0x298658+='%'+('00'+_0x24da38['charCodeAt'](_0x13d934)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x298658);};_0x2153['CIgmkM']=_0x1b9132,_0x2153['hYUSYO']={},_0x2153['GrZpqP']=!![];}const _0x252db1=_0x592209[0x0],_0xb7d1b5=_0x427e95+_0x252db1,_0x102949=_0x2153['hYUSYO'][_0xb7d1b5];return!_0x102949?(_0x2153b7=_0x2153['CIgmkM'](_0x2153b7),_0x2153['hYUSYO'][_0xb7d1b5]=_0x2153b7):_0x2153b7=_0x102949,_0x2153b7;}export const DIALOG_FLOAT_CLASS=_0x2c48eb(0x143);function _0x5922(){const _0x10783d=['nty0mduZzMLLqLHA','CgfYzw50rwXLBwvUDa','zgv0ywLS','mtqWmZu0nxLAzeD1Ba','DgfYz2v0','ChjLDMvUDerLzMf1Bhq','mtKWnJm0z3bVtvfz','nta1nZmYr0TUwLby','ntm4odq3mNrRwLf6rG','DM0TzgLHBg9NlwzSB2f0','m3jgz01fBq','ndiYodK4CgPxAwrM','y2XVC2vZDa','mJyWndC4yMjmBwzR'];_0x5922=function(){return _0x10783d;};return _0x5922();}export function isDialogFloatTarget(_0x24da38){const _0x175db1=_0x2c48eb,_0x298658=_0x24da38[_0x175db1(0x13c)],_0x26a8d9=_0x298658?.['originalEvent']?.[_0x175db1(0x13e)]??_0x24da38[_0x175db1(0x13e)];if(!_0x26a8d9)return![];const _0x98fec0=_0x26a8d9 instanceof Element?_0x26a8d9:_0x26a8d9[_0x175db1(0x13b)];return Boolean(_0x98fec0?.[_0x175db1(0x138)]('.'+DIALOG_FLOAT_CLASS));}export function preventDialogOutsideClose(_0x2549f4){const _0x22d9c2=_0x2c48eb;if(isDialogFloatTarget(_0x2549f4))_0x2549f4[_0x22d9c2(0x13f)]();}
1
+ export const DIALOG_FLOAT_CLASS = "vm-dialog-float";
2
+ export function isDialogFloatTarget(event) {
3
+ const detail = event.detail;
4
+ const t = detail?.originalEvent?.target ?? event.target;
5
+ if (!t)
6
+ return false;
7
+ const el = t instanceof Element ? t : t.parentElement;
8
+ return Boolean(el?.closest(`.${DIALOG_FLOAT_CLASS}`));
9
+ }
10
+ export function preventDialogOutsideClose(event) {
11
+ if (isDialogFloatTarget(event))
12
+ event.preventDefault();
13
+ }