zxq-com 0.0.13 → 0.0.14
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.
- package/dist/index.d.ts +6 -2
- package/dist/zxq-com.js +6 -2
- package/dist/zxq-com.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ declare const _default: {
|
|
|
45
45
|
export default _default;
|
|
46
46
|
|
|
47
47
|
export declare const EVENT_TYPE: {
|
|
48
|
+
readonly CLIENT_NAME: "__client-name";
|
|
48
49
|
readonly DEV1: "dev-1";
|
|
49
50
|
readonly DEV2: "dev-2";
|
|
50
51
|
};
|
|
@@ -74,6 +75,7 @@ export declare const ws: {
|
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
export declare interface WsConfig {
|
|
78
|
+
name: string;
|
|
77
79
|
url: string;
|
|
78
80
|
trustIp?: string;
|
|
79
81
|
}
|
|
@@ -81,8 +83,10 @@ export declare interface WsConfig {
|
|
|
81
83
|
export declare interface WsMessage {
|
|
82
84
|
event: WsMessageEvent;
|
|
83
85
|
payload: any;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
target?: string[];
|
|
87
|
+
readonly source?: string;
|
|
88
|
+
readonly sourceIp?: string;
|
|
89
|
+
readonly timestamp?: number;
|
|
86
90
|
}
|
|
87
91
|
|
|
88
92
|
export declare type WsMessageEvent = typeof EVENT_TYPE[keyof typeof EVENT_TYPE] | string;
|
package/dist/zxq-com.js
CHANGED
|
@@ -13497,6 +13497,7 @@ function isDevelopment() {
|
|
|
13497
13497
|
return typeof process < "u" && process?.env && typeof process.env.NODE_ENV == "string" ? process.env.NODE_ENV === "development" : typeof __DEV__ < "u" ? typeof __DEV__ == "boolean" ? __DEV__ : !1 : !!(typeof window < "u" && window.__VUE_DEVTOOLS_GLOBAL_HOOK__);
|
|
13498
13498
|
}
|
|
13499
13499
|
const EVENT_TYPE = {
|
|
13500
|
+
CLIENT_NAME: "__client-name",
|
|
13500
13501
|
DEV1: "dev-1",
|
|
13501
13502
|
DEV2: "dev-2"
|
|
13502
13503
|
};
|
|
@@ -13527,7 +13528,10 @@ const ws = {
|
|
|
13527
13528
|
var subscribeMap = /* @__PURE__ */ new Map();
|
|
13528
13529
|
function zwqWs(e, t) {
|
|
13529
13530
|
urlRef.value || (urlRef.value = t.url, open()), watch(status, (e) => {
|
|
13530
|
-
log("ws status", e)
|
|
13531
|
+
log("ws status", e), e === "OPEN" && sendMsg({
|
|
13532
|
+
event: EVENT_TYPE.CLIENT_NAME,
|
|
13533
|
+
payload: { name: t.name }
|
|
13534
|
+
});
|
|
13531
13535
|
}), watch(data, (e) => {
|
|
13532
13536
|
if (e !== "pong") try {
|
|
13533
13537
|
let { sourceIp: n, event: r, payload: i } = JSON.parse(e);
|
|
@@ -13584,6 +13588,6 @@ function useWs(e, t) {
|
|
|
13584
13588
|
var components = [Button_default], src_default = { install(e, t) {
|
|
13585
13589
|
setConfig(t || {}), e.use(regCom_default), components.forEach((t) => {
|
|
13586
13590
|
e.component(t.name, t);
|
|
13587
|
-
}), e.use(icon_default);
|
|
13591
|
+
}), e.use(icon_default), t?.ws && e.use(zwqWs, t.ws);
|
|
13588
13592
|
} };
|
|
13589
13593
|
export { EVENT_TYPE, Button_default as ZButton, Icon_default as ZIcon, IconInput_default as ZIconInput, IconPicker_default as ZIconPicker, src_default as default, loadLocalSvgIcons, useWs, ws, zwqWs };
|
package/dist/zxq-com.umd.cjs
CHANGED
|
@@ -1316,4 +1316,4 @@
|
|
|
1316
1316
|
-webkit-user-select: none;
|
|
1317
1317
|
pointer-events: none;
|
|
1318
1318
|
opacity: var(--n-opacity-spinning);
|
|
1319
|
-
`)])]),t_={small:20,medium:18,large:16};let n_=Object.assign(Object.assign({},Z.props),{contentClass:String,contentStyle:[Object,String],description:String,stroke:String,size:{type:[String,Number],default:`medium`},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number});var r_=(0,t.defineComponent)({name:`Spin`,props:n_,slots:Object,setup(e){process.env.NODE_ENV!==`production`&&(0,t.watchEffect)(()=>{e.spinning!==void 0&&Wr(`spin`,"`spinning` is deprecated, please use `show` instead.")});let{mergedClsPrefixRef:n,inlineThemeDisabled:r}=ci(e),i=Z(`Spin`,`-spin`,e_,$g,e,n),a=(0,t.computed)(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:r}=i.value,{opacitySpinning:a,color:o,textColor:s}=r,c=typeof t==`number`?pe(t):r[H(`size`,t)];return{"--n-bezier":n,"--n-opacity-spinning":a,"--n-size":c,"--n-color":o,"--n-text-color":s}}),o=r?li(`spin`,(0,t.computed)(()=>{let{size:t}=e;return typeof t==`number`?String(t):t[0]}),a,e):void 0,s=ct(e,[`spinning`,`show`]),c=(0,t.ref)(!1);return(0,t.watchEffect)(t=>{let n;if(s.value){let{delay:r}=e;if(r){n=window.setTimeout(()=>{c.value=!0},r),t(()=>{clearTimeout(n)});return}}c.value=s.value}),{mergedClsPrefix:n,active:c,mergedStrokeWidth:(0,t.computed)(()=>{let{strokeWidth:t}=e;if(t!==void 0)return t;let{size:n}=e;return t_[typeof n==`number`?`medium`:n]}),cssVars:r?void 0:a,themeClass:o?.themeClass,onRender:o?.onRender}},render(){var e;let{$slots:n,mergedClsPrefix:r,description:i}=this,a=n.icon&&this.rotate,o=(i||n.description)&&(0,t.h)(`div`,{class:`${r}-spin-description`},i||n.description?.call(n)),s=n.icon?(0,t.h)(`div`,{class:[`${r}-spin-body`,this.themeClass]},(0,t.h)(`div`,{class:[`${r}-spin`,a&&`${r}-spin--rotate`],style:n.default?``:this.cssVars},n.icon()),o):(0,t.h)(`div`,{class:[`${r}-spin-body`,this.themeClass]},(0,t.h)(Ep,{clsPrefix:r,style:n.default?``:this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${r}-spin`}),o);return(e=this.onRender)==null||e.call(this),n.default?(0,t.h)(`div`,{class:[`${r}-spin-container`,this.themeClass],style:this.cssVars},(0,t.h)(`div`,{class:[`${r}-spin-content`,this.active&&`${r}-spin-content--spinning`,this.contentClass],style:this.contentStyle},n),(0,t.h)(t.Transition,{name:`fade-in-transition`},{default:()=>this.active?s:null})):s}}),i_=`2.43.2`;function a_({componentPrefix:e=`N`,components:t=[]}={}){let n=[];function r(t,n,r){t.component(e+n)||t.component(e+n,r)}function i(e){n.includes(e)||(n.push(e),t.forEach(t=>{let{name:n,alias:i}=t;r(e,n,t),i&&i.forEach(n=>{r(e,n,t)})}))}return{version:i_,componentPrefix:e,install:i}}var o_=a_;function s_(e,t=.2){if(!e)return``;e=e.replace(`#`,``),e.length===3&&(e=e.split(``).map(e=>e+e).join(``));let n=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),i=parseInt(e.slice(4,6),16);return n=Math.floor(n*(1-t)),r=Math.floor(r*(1-t)),i=Math.floor(i*(1-t)),`#`+[n,r,i].map(e=>e.toString(16).padStart(2,`0`)).join(``)}function c_(e,t=.2){if(!e)return``;e=e.replace(`#`,``),e.length===3&&(e=e.split(``).map(e=>e+e).join(``));let n=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),i=parseInt(e.slice(4,6),16);return n=Math.min(255,Math.floor(n+(255-n)*t)),r=Math.min(255,Math.floor(r+(255-r)*t)),i=Math.min(255,Math.floor(i+(255-i)*t)),`#`+[n,r,i].map(e=>e.toString(16).padStart(2,`0`)).join(``)}var l_=o_({components:[Yh,Ph,nh,Og,bg,r_,Zg]}),u_={inlineThemeDisabled:!0,mergedBorderedRef:(0,t.ref)(),mergedBreakpointsRef:(0,t.ref)(),mergedClsPrefixRef:(0,t.ref)(`n`),mergedComponentPropsRef:(0,t.ref)(),mergedDateLocaleRef:(0,t.ref)(),mergedHljsRef:(0,t.ref)(),mergedIconsRef:(0,t.ref)(),mergedKatexRef:(0,t.ref)(),mergedLocaleRef:(0,t.ref)(`zh-CN`),mergedNamespaceRef:(0,t.ref)(),mergedRtlRef:(0,t.ref)(),mergedThemeHashRef:(0,t.ref)(`15czh83`),mergedThemeRef:(0,t.ref)(),preflightStyleDisabled:!1,styleMountTarget:void 0,mergedThemeOverridesRef:(0,t.ref)()},d_={install(e){if(e.use(l_),r.theme){let{primaryColor:e,primaryColorHover:n,primaryColorPressed:i,primaryColorSuppl:a}=r.theme?.common||{};e&&(r.theme.common={primaryColor:e,primaryColorHover:n||c_(e,.3),primaryColorPressed:i||s_(e,.3),primaryColorSuppl:a||e}),Object.assign(u_,{mergedThemeOverridesRef:(0,t.ref)(r?.theme)})}e.provide(`n-config-provider`,u_)}},f_={class:`zxq-button`},p_=(0,t.defineComponent)({name:`ZButton`,__name:`Button`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,f_,[(0,t.renderSlot)(e.$slots,`default`)]))}}),m_=/^[a-z0-9]+(-[a-z0-9]+)*$/,h_=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!g_(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!g_(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!g_(e,n)?null:e}return null},g_=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1,__=Object.freeze({left:0,top:0,width:16,height:16}),v_=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),y_=Object.freeze({...__,...v_}),b_=Object.freeze({...y_,body:``,hidden:!1});function x_(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function S_(e,t){let n=x_(e,t);for(let r in b_)r in v_?r in e&&!(r in n)&&(n[r]=v_[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function C_(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}function w_(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=S_(r[e]||i[e],a)}return o(t),n.forEach(o),S_(e,a)}function T_(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=C_(e);for(let i in r){let a=r[i];a&&(t(i,w_(e,i,a)),n.push(i))}return n}var E_={provider:``,aliases:{},not_found:{},...__};function D_(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function O_(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!D_(e,E_))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!D_(t,b_))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!D_(t,b_))return null}return t}var k_=Object.create(null);function A_(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function j_(e,t){let n=k_[e]||(k_[e]=Object.create(null));return n[t]||(n[t]=A_(e,t))}function M_(e,t){return O_(t)?T_(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function N_(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var P_=!1;function F_(e){return typeof e==`boolean`&&(P_=e),P_}function I_(e){let t=typeof e==`string`?h_(e,!0,P_):e;if(t){let e=j_(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function L_(e,t){let n=h_(e,!0,P_);if(!n)return!1;let r=j_(n.provider,n.prefix);return t?N_(r,n.name,t):(r.missing.add(n.name),!0)}function R_(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),P_&&!t&&!e.prefix){let t=!1;return O_(e)&&(e.prefix=``,T_(e,(e,n)=>{L_(e,n)&&(t=!0)})),t}let n=e.prefix;return g_({prefix:n,name:`a`})?!!M_(j_(t,n),e):!1}var z_=Object.freeze({width:null,height:null}),B_=Object.freeze({...z_,...v_}),V_=/(-?[0-9.]*[0-9]+[0-9.]*)/g,H_=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function U_(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(V_);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=H_.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function W_(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function G_(e,t){return e?`<defs>`+e+`</defs>`+t:t}function K_(e,t,n){let r=W_(e);return G_(r.defs,t+r.content+n)}var q_=e=>e===`unset`||e===`undefined`||e===`none`;function J_(e,t){let n={...y_,...e},r={...B_,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=K_(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=U_(d,c/l)):(u=o===`auto`?c:o,d=s===null?U_(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{q_(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var Y_=/\sid="(\S+)"/g,X_=`IconifyId`+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Z_=0;function Q_(e,t=X_){let n=[],r;for(;r=Y_.exec(e);)n.push(r[1]);if(!n.length)return e;let i=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(n=>{let r=typeof t==`function`?t(n):t+(Z_++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+a+`)([")]|\\.[a-z])`,`g`),`$1`+r+i+`$3`)}),e=e.replace(new RegExp(i,`g`),``),e}var $_=Object.create(null);function ev(e,t){$_[e]=t}function tv(e){return $_[e]||$_[``]}function nv(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var rv=Object.create(null),iv=[`https://api.simplesvg.com`,`https://api.unisvg.com`],av=[];iv.length>0;)iv.length===1||Math.random()>.5?av.push(iv.shift()):av.push(iv.pop());rv[``]=nv({resources:[`https://api.iconify.design`].concat(av)});function ov(e,t){let n=nv(t);return n===null?!1:(rv[e]=n,!0)}function sv(e){return rv[e]}var cv=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function lv(e,t){let n=sv(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{let n=t;e=Math.max(e,n.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function uv(e){return e===404}var dv=(e,t,n)=>{let r=[],i=lv(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function fv(e){if(typeof e==`string`){let t=sv(e);if(t)return t.path}return`/`}var pv={prepare:dv,send:(e,t,n)=>{if(!cv){n(`abort`,424);return}let r=fv(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;cv(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(uv(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function mv(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=j_(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function hv(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function gv(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||hv([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var _v=0;function vv(e,t,n){let r=_v++,i=hv.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function yv(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?h_(e,t,n):e;i&&r.push(i)}),r}var bv={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function xv(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function Sv(e){let t={...bv,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=xv(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function Cv(){}var wv=Object.create(null);function Tv(e){if(!wv[e]){let t=sv(e);if(!t)return;wv[e]={config:t,redundancy:Sv(t)}}return wv[e]}function Ev(e,t,n){let r,i;if(typeof e==`string`){let t=tv(e);if(!t)return n(void 0,424),Cv;i=t.send;let a=Tv(e);a&&(r=a.redundancy)}else{let t=nv(e);if(t){r=Sv(t);let n=tv(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),Cv):r.query(t,i,n)().abort}function Dv(){}function Ov(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,gv(e)}))}function kv(e){let t=[],n=[];return e.forEach(e=>{(e.match(m_)?t:n).push(e)}),{valid:t,invalid:n}}function Av(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!M_(e,n).length){r();return}}catch(e){console.error(e)}r(),Ov(e)}function jv(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function Mv(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){jv(e.loadIcons(r,n,t),t=>{Av(e,r,t)});return}if(i){r.forEach(r=>{jv(i(r,n,t),t=>{Av(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=kv(r);if(o.length&&Av(e,o,null),!a.length)return;let s=n.match(m_)?tv(t):null;if(!s){Av(e,a,null);return}s.prepare(t,n,a).forEach(n=>{Ev(t,n,t=>{Av(e,n.icons,t)})})}))}var Nv=(e,t)=>{let n=mv(yv(e,!0,F_()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,Dv)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(j_(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=j_(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&Mv(e,t)}),t?vv(t,n,i):Dv};function Pv(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in z_?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Fv=/[\s,]+/;function Iv(e,t){t.split(Fv).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function Lv(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function Rv(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function zv(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Bv(e){return`data:image/svg+xml,`+zv(e)}function Vv(e){return`url("`+Bv(e)+`")`}var Hv={...B_,inline:!1},Uv={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},Wv={display:`inline-block`},Gv={backgroundColor:`currentColor`},Kv={backgroundColor:`transparent`},qv={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},Jv={webkitMask:Gv,mask:Gv,background:Kv};for(let e in Jv){let t=Jv[e];for(let n in qv)t[e+n]=qv[n]}var Yv={};[`horizontal`,`vertical`].forEach(e=>{let t=e.slice(0,1)+`Flip`;Yv[e+`-flip`]=t,Yv[e.slice(0,1)+`-flip`]=t,Yv[e+`Flip`]=t});function Xv(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var Zv=(e,n)=>{let r=Pv(Hv,n),i={...Uv},a=n.mode||`svg`,o={},s=n.style,c=typeof s==`object`&&!(s instanceof Array)?s:{};for(let e in n){let t=n[e];if(t!==void 0)switch(e){case`icon`:case`style`:case`onLoad`:case`mode`:case`ssr`:break;case`inline`:case`hFlip`:case`vFlip`:r[e]=t===!0||t===`true`||t===1;break;case`flip`:typeof t==`string`&&Iv(r,t);break;case`color`:o.color=t;break;case`rotate`:typeof t==`string`?r[e]=Lv(t):typeof t==`number`&&(r[e]=t);break;case`ariaHidden`:case`aria-hidden`:t!==!0&&t!==`true`&&delete i[`aria-hidden`];break;default:{let n=Yv[e];n?(t===!0||t===`true`||t===1)&&(r[n]=!0):Hv[e]===void 0&&(i[e]=t)}}}let l=J_(e,r),u=l.attributes;if(r.inline&&(o.verticalAlign=`-0.125em`),a===`svg`){i.style={...o,...c},Object.assign(i,u);let e=0,r=n.id;return typeof r==`string`&&(r=r.replace(/-/g,`_`)),i.innerHTML=Q_(l.body,r?()=>r+`ID`+ e++:`iconifyVue`),(0,t.h)(`svg`,i)}let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=Rv(d,{...u,width:f+``,height:p+``});return i.style={...o,"--svg":Vv(h),width:Xv(u.width),height:Xv(u.height),...Wv,...m?Gv:Kv,...c},(0,t.h)(`span`,i)};if(F_(!0),ev(``,pv),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!R_(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;ov(e,r)||console.error(n)}catch{console.error(n)}}}}var Qv={...y_,body:``},$v=(0,t.defineComponent)((e,{emit:n})=>{let r=(0,t.ref)(null);function i(){r.value&&=(r.value.abort?.(),null)}let a=(0,t.ref)(!!e.ssr),o=(0,t.ref)(``),s=(0,t.shallowRef)(null);function c(){let a=e.icon;if(typeof a==`object`&&a&&typeof a.body==`string`)return o.value=``,{data:a};let s;if(typeof a!=`string`||(s=h_(a,!1,!0))===null)return null;let c=I_(s);if(!c){let e=r.value;return(!e||e.name!==a)&&(c===null?r.value={name:a}:r.value={name:a,abort:Nv([s],l)}),null}i(),o.value!==a&&(o.value=a,(0,t.nextTick)(()=>{n(`load`,a)}));let u=e.customise;if(u){c=Object.assign({},c);let e=u(c.body,s.name,s.prefix,s.provider);typeof e==`string`&&(c.body=e)}let d=[`iconify`];return s.prefix!==``&&d.push(`iconify--`+s.prefix),s.provider!==``&&d.push(`iconify--`+s.provider),{data:c,classes:d}}function l(){let e=c();e?e.data!==s.value?.data&&(s.value=e):s.value=null}return a.value?l():(0,t.onMounted)(()=>{a.value=!0,l()}),(0,t.watch)(()=>e.icon,l),(0,t.onUnmounted)(i),()=>{let t=s.value;if(!t)return Zv(Qv,e);let n=e;return t.classes&&(n={...e,class:t.classes.join(` `)}),Zv({...y_,...t.data},n)}},{props:[`icon`,`mode`,`ssr`,`width`,`height`,`style`,`color`,`inline`,`rotate`,`hFlip`,`horizontalFlip`,`vFlip`,`verticalFlip`,`flip`,`id`,`ariaHidden`,`customise`,`title`],emits:[`load`]}),ey=(0,t.defineComponent)({name:`ZIcon`,__name:`Icon`,props:{icon:{}},setup(e){let n=e,r=(0,t.computed)(()=>typeof n.icon==`string`);return(n,i)=>r.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)($v),{key:0,icon:e.icon},null,8,[`icon`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon),{key:1}))}});function ty(){let e=(0,t.inject)(`n-config-provider`,{});return{themeVarRef:(0,t.computed)(()=>e.mergedThemeOverridesRef.value.common)}}var ny={class:`z-icon-picker overflow-hidden flex w-full`,style:{height:`300px`}},ry=[`onClick`],iy={class:`flex-1 overflow-hidden flex flex-col h-full`},ay={class:`category flex overflow-auto items-center gap-[10px] pr-[10px]`},oy={key:0},sy={class:`icon-list overflow-auto flex-1`},cy=[`onClick`],ly=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({name:`ZIconPicker`,__name:`IconPicker`,props:{host:{default:r?.iconApi}},emits:[`select`],setup(e,{emit:n}){(0,t.useCssVars)(e=>({v30412ec1:(0,t.unref)(C),b2fd4700:(0,t.unref)(w)}));let r=e,i=n,a={collections:r.host+`/collections`,collection:r.host+`/collection`,search:r.host+`/search`},o=(0,t.ref)(!1),s=(0,t.ref)([]);c();async function c(){o.value=!0;try{let e=await(await fetch(a.collections)).json();o.value=!1;let t=[];for(let[n,r]of Object.entries(e))!r.hidden&&![`Archive / Unmaintained`].includes(r.category)&&t.push({name:r.name,prefix:n});s.value=t,f(s.value[0])}catch{o.value=!1}}let l=(0,t.computed)(()=>{let e=[{label:`ALl`,key:``}];return d.value?.icons?.categories&&Object.keys(d.value?.icons?.categories).forEach(t=>{e.push({label:t,key:t})}),e}),u=(0,t.ref)(!1),d=(0,t.ref)({});async function f(e){if(d.value=e,!e.icons){u.value=!0;let t=await(await fetch(a.collection+`?prefix=`+e.prefix)).json();u.value=!1;let n=new Set;if(t.categories){for(let e of Object.values(t.categories))e.forEach(e=>n.add(e));t.all=[...n]}else t.all=t.uncategorized;e.icons=t}p.value=``,g.value=1}let p=(0,t.ref)(``);function m(e){g.value=1,p.value=e}let h=(0,t.computed)(()=>d.value.icons?p.value?d.value.icons.categories[p.value]:[...d.value.icons.all]:[]),g=(0,t.ref)(1),_=(0,t.ref)(50);(0,t.watch)(_,()=>g.value=1);let v=(0,t.computed)(()=>h.value.slice((g.value-1)*_.value,g.value*_.value));function y(e){i(`select`,d.value.prefix+`:`+e)}let b=(0,t.ref)(``);(0,t.watch)(b,e=>{e?x(e):c()});async function x(e){let t=await(await fetch(a.search+`?query=`+e)).json();if(t.total>0){let e=[];for(let[n,r]of Object.entries(t.collections))!r.hidden&&![`Archive / Unmaintained`].includes(r.category)&&e.push({name:r.name,prefix:n,icons:{all:t.icons.filter(e=>e.startsWith(n+`:`)).map(e=>e.replace(n+`:`,``))}});s.value=e,f(s.value[0])}else s.value=[],d.value={}}let{themeVarRef:S}=ty(),{primaryColor:C}=S.value,w=c_(C,.95);return(e,n)=>{let r=(0,t.resolveComponent)(`n-spin`),i=(0,t.resolveComponent)(`n-button`),a=(0,t.resolveComponent)(`n-dropdown`),c=(0,t.resolveComponent)(`n-input`),x=(0,t.resolveComponent)(`n-pagination`),S=(0,t.resolveComponent)(`n-tooltip`);return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,ny,[(0,t.createVNode)(r,{show:o.value,class:`overflow-auto h-full set min-w-[300px]`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`item`,{selected:d.value.name===e.name}]),key:e.name,onClick:t=>f(e)},(0,t.toDisplayString)(e.name),11,ry))),128))]),_:1},8,[`show`]),(0,t.createElementVNode)(`div`,iy,[(0,t.createVNode)(r,{show:u.value,class:`h-full`,"content-class":`h-full overflow-hidden flex flex-col`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,ay,[l.value.length>1?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,oy,[(0,t.createVNode)(a,{class:`z-icon-picker-dropdown`,trigger:`click`,options:l.value,onSelect:m},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(i,{size:`small`},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)(ey,{icon:`lets-icons:folder-dublicate-duotone-line`})]),default:(0,t.withCtx)(()=>[(0,t.createTextVNode)(` `+(0,t.toDisplayString)(p.value||`All`),1)]),_:1})]),_:1},8,[`options`])])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(c,{class:`flex-1`,value:b.value,"onUpdate:value":n[0]||=e=>b.value=e,valueModifiers:{trim:!0},size:`small`,placeholder:`搜索图标`,clearable:``},{prefix:(0,t.withCtx)(()=>[(0,t.createVNode)(ey,{icon:`icon-park-outline:search`})]),_:1},8,[`value`]),(0,t.createVNode)(x,{page:g.value,"onUpdate:page":n[1]||=e=>g.value=e,"page-size":_.value,"onUpdate:pageSize":n[2]||=e=>_.value=e,"item-count":h.value.length,"show-size-picker":!1,simple:``,"page-sizes":[50,100,200,500]},null,8,[`page`,`page-size`,`item-count`])]),(0,t.createElementVNode)(`div`,sy,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(v.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e,onClick:t=>y(e)},[(0,t.createVNode)(S,{trigger:`hover`,delay:500},{trigger:(0,t.withCtx)(()=>[(0,t.createVNode)(ey,{class:`icon`,icon:d.value.prefix+`:`+e},null,8,[`icon`])]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(d.value.prefix+`:`+e),1)]),_:2},1024)],8,cy))),128))])]),_:1},8,[`show`])])])}}}),[[`__scopeId`,`data-v-0f4d48cc`]]),uy=(0,t.defineComponent)({name:`IconInput`,__name:`IconInput`,props:{value:{default:``},valueModifiers:{}},emits:[`update:value`],setup(e){let n=(0,t.useModel)(e,`value`);function r(e){n.value=e,i.value=!1}let i=(0,t.ref)(!1);function a(e){i.value=e}return(e,o)=>{let s=(0,t.resolveComponent)(`n-input`),c=(0,t.resolveComponent)(`n-popover`);return(0,t.openBlock)(),(0,t.createBlock)(c,{show:i.value,trigger:`click`,"on-update:show":a,"content-style":`width: 750px;`},{trigger:(0,t.withCtx)(()=>[(0,t.createVNode)(s,(0,t.mergeProps)(e.$attrs,{value:n.value,"onUpdate:value":o[0]||=e=>n.value=e}),{prefix:(0,t.withCtx)(()=>[(0,t.createVNode)(ey,{icon:n.value||`qlementine-icons:empty-slot-16`,style:{"font-size":`20px`}},null,8,[`icon`])]),_:1},16,[`value`])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(ly,{onSelect:r})]),_:1},8,[`show`])}}});r.iconApi&&ov(``,{resources:[r.iconApi]});async function dy(e,t=`svg`){await Promise.all(Object.entries(e).map(e=>{let[n,r]=e,i=n.lastIndexOf(`/`)+1,a=n.lastIndexOf(`.`);return L_(`${t}:${n.slice(i,a)}`,{...fy(typeof r==`object`?r.default:r)})}))}function fy(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement,n=[...t.childNodes].filter(e=>e.nodeType===Node.ELEMENT_NODE).map(e=>new XMLSerializer().serializeToString(e)).join(``),[r,i,a,o]=(t.getAttribute(`viewBox`)||``).split(` `).map(e=>{let t=Number(e);return Number.isNaN(t)?void 0:t});return{body:n,height:o,left:r,top:i,width:a}}var py=[ey,ly,uy],my={install(e){py.forEach(t=>{e.component(t.name,t)})}};function hy(e=``){return e+(crypto?.randomUUID?.()||`${Date.now()}_${Math.random().toString(16).slice(2)}`)}function gy(...e){_y()&&console.log(`【zxqWs】`,...e)}function _y(){return typeof process<`u`&&process?.env&&typeof process.env.NODE_ENV==`string`?process.env.NODE_ENV===`development`:typeof __DEV__<`u`?typeof __DEV__==`boolean`?__DEV__:!1:!!(typeof window<`u`&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__)}let vy={DEV1:`dev-1`,DEV2:`dev-2`};var yy=(0,t.ref)(),{status:by,data:xy,send:Sy,close:Cy,open:wy}=(0,n.useWebSocket)(yy,{immediate:!1,autoConnect:!1,heartbeat:{message:`ping`,interval:5e3,pongTimeout:15e3},autoReconnect:{retries:3,delay:1e4,onFailed(){console.error(`超过重连次数`)}}});function Ty(e){Sy(JSON.stringify(e))}let Ey={sendMsg:Ty,close:Cy,status:by};var Dy=new Map;function Oy(e,n){yy.value||(yy.value=n.url,wy()),(0,t.watch)(by,e=>{gy(`ws status`,e)}),(0,t.watch)(xy,e=>{if(e!==`pong`)try{let{sourceIp:t,event:r,payload:i}=JSON.parse(e);if(n?.trustIp&&t!==n.trustIp)return;let a=Dy.get(r);a&&a.forEach(({fn:e,off:t})=>{e(i),t&&t()})}catch(e){console.error(`ws 数据格式有误`,e)}})}function ky(e,n){n&&Oy(null,n),by.value===`CLOSED`&&yy.value&&wy();let r=hy();function i(t){let n=Dy.get(e);if(n)n.set(r,{fn:t});else{let n=new Map().set(r,{fn:t});Dy.set(e,n)}}function a(){let t=Dy.get(e);t&&t.has(r)&&(t.delete(r),t.size===0&&Dy.delete(e))}function o(t){gy(`ws once`);let n=Dy.get(e);if(n)n.set(r,{fn:t});else{let n=new Map().set(r,{fn:t,off:a});Dy.set(e,n)}}(0,t.onBeforeUnmount)(()=>{a()});function s(e){Ty(e)}return{on:i,off:a,once:o,emit:s}}var Ay=[p_];e.EVENT_TYPE=vy,e.ZButton=p_,e.ZIcon=ey,e.ZIconInput=uy,e.ZIconPicker=ly,e.default={install(e,t){i(t||{}),e.use(d_),Ay.forEach(t=>{e.component(t.name,t)}),e.use(my)}},e.loadLocalSvgIcons=dy,e.useWs=ky,e.ws=Ey,e.zwqWs=Oy});
|
|
1319
|
+
`)])]),t_={small:20,medium:18,large:16};let n_=Object.assign(Object.assign({},Z.props),{contentClass:String,contentStyle:[Object,String],description:String,stroke:String,size:{type:[String,Number],default:`medium`},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number});var r_=(0,t.defineComponent)({name:`Spin`,props:n_,slots:Object,setup(e){process.env.NODE_ENV!==`production`&&(0,t.watchEffect)(()=>{e.spinning!==void 0&&Wr(`spin`,"`spinning` is deprecated, please use `show` instead.")});let{mergedClsPrefixRef:n,inlineThemeDisabled:r}=ci(e),i=Z(`Spin`,`-spin`,e_,$g,e,n),a=(0,t.computed)(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:r}=i.value,{opacitySpinning:a,color:o,textColor:s}=r,c=typeof t==`number`?pe(t):r[H(`size`,t)];return{"--n-bezier":n,"--n-opacity-spinning":a,"--n-size":c,"--n-color":o,"--n-text-color":s}}),o=r?li(`spin`,(0,t.computed)(()=>{let{size:t}=e;return typeof t==`number`?String(t):t[0]}),a,e):void 0,s=ct(e,[`spinning`,`show`]),c=(0,t.ref)(!1);return(0,t.watchEffect)(t=>{let n;if(s.value){let{delay:r}=e;if(r){n=window.setTimeout(()=>{c.value=!0},r),t(()=>{clearTimeout(n)});return}}c.value=s.value}),{mergedClsPrefix:n,active:c,mergedStrokeWidth:(0,t.computed)(()=>{let{strokeWidth:t}=e;if(t!==void 0)return t;let{size:n}=e;return t_[typeof n==`number`?`medium`:n]}),cssVars:r?void 0:a,themeClass:o?.themeClass,onRender:o?.onRender}},render(){var e;let{$slots:n,mergedClsPrefix:r,description:i}=this,a=n.icon&&this.rotate,o=(i||n.description)&&(0,t.h)(`div`,{class:`${r}-spin-description`},i||n.description?.call(n)),s=n.icon?(0,t.h)(`div`,{class:[`${r}-spin-body`,this.themeClass]},(0,t.h)(`div`,{class:[`${r}-spin`,a&&`${r}-spin--rotate`],style:n.default?``:this.cssVars},n.icon()),o):(0,t.h)(`div`,{class:[`${r}-spin-body`,this.themeClass]},(0,t.h)(Ep,{clsPrefix:r,style:n.default?``:this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${r}-spin`}),o);return(e=this.onRender)==null||e.call(this),n.default?(0,t.h)(`div`,{class:[`${r}-spin-container`,this.themeClass],style:this.cssVars},(0,t.h)(`div`,{class:[`${r}-spin-content`,this.active&&`${r}-spin-content--spinning`,this.contentClass],style:this.contentStyle},n),(0,t.h)(t.Transition,{name:`fade-in-transition`},{default:()=>this.active?s:null})):s}}),i_=`2.43.2`;function a_({componentPrefix:e=`N`,components:t=[]}={}){let n=[];function r(t,n,r){t.component(e+n)||t.component(e+n,r)}function i(e){n.includes(e)||(n.push(e),t.forEach(t=>{let{name:n,alias:i}=t;r(e,n,t),i&&i.forEach(n=>{r(e,n,t)})}))}return{version:i_,componentPrefix:e,install:i}}var o_=a_;function s_(e,t=.2){if(!e)return``;e=e.replace(`#`,``),e.length===3&&(e=e.split(``).map(e=>e+e).join(``));let n=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),i=parseInt(e.slice(4,6),16);return n=Math.floor(n*(1-t)),r=Math.floor(r*(1-t)),i=Math.floor(i*(1-t)),`#`+[n,r,i].map(e=>e.toString(16).padStart(2,`0`)).join(``)}function c_(e,t=.2){if(!e)return``;e=e.replace(`#`,``),e.length===3&&(e=e.split(``).map(e=>e+e).join(``));let n=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),i=parseInt(e.slice(4,6),16);return n=Math.min(255,Math.floor(n+(255-n)*t)),r=Math.min(255,Math.floor(r+(255-r)*t)),i=Math.min(255,Math.floor(i+(255-i)*t)),`#`+[n,r,i].map(e=>e.toString(16).padStart(2,`0`)).join(``)}var l_=o_({components:[Yh,Ph,nh,Og,bg,r_,Zg]}),u_={inlineThemeDisabled:!0,mergedBorderedRef:(0,t.ref)(),mergedBreakpointsRef:(0,t.ref)(),mergedClsPrefixRef:(0,t.ref)(`n`),mergedComponentPropsRef:(0,t.ref)(),mergedDateLocaleRef:(0,t.ref)(),mergedHljsRef:(0,t.ref)(),mergedIconsRef:(0,t.ref)(),mergedKatexRef:(0,t.ref)(),mergedLocaleRef:(0,t.ref)(`zh-CN`),mergedNamespaceRef:(0,t.ref)(),mergedRtlRef:(0,t.ref)(),mergedThemeHashRef:(0,t.ref)(`15czh83`),mergedThemeRef:(0,t.ref)(),preflightStyleDisabled:!1,styleMountTarget:void 0,mergedThemeOverridesRef:(0,t.ref)()},d_={install(e){if(e.use(l_),r.theme){let{primaryColor:e,primaryColorHover:n,primaryColorPressed:i,primaryColorSuppl:a}=r.theme?.common||{};e&&(r.theme.common={primaryColor:e,primaryColorHover:n||c_(e,.3),primaryColorPressed:i||s_(e,.3),primaryColorSuppl:a||e}),Object.assign(u_,{mergedThemeOverridesRef:(0,t.ref)(r?.theme)})}e.provide(`n-config-provider`,u_)}},f_={class:`zxq-button`},p_=(0,t.defineComponent)({name:`ZButton`,__name:`Button`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,f_,[(0,t.renderSlot)(e.$slots,`default`)]))}}),m_=/^[a-z0-9]+(-[a-z0-9]+)*$/,h_=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!g_(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!g_(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!g_(e,n)?null:e}return null},g_=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1,__=Object.freeze({left:0,top:0,width:16,height:16}),v_=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),y_=Object.freeze({...__,...v_}),b_=Object.freeze({...y_,body:``,hidden:!1});function x_(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function S_(e,t){let n=x_(e,t);for(let r in b_)r in v_?r in e&&!(r in n)&&(n[r]=v_[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function C_(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}function w_(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=S_(r[e]||i[e],a)}return o(t),n.forEach(o),S_(e,a)}function T_(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=C_(e);for(let i in r){let a=r[i];a&&(t(i,w_(e,i,a)),n.push(i))}return n}var E_={provider:``,aliases:{},not_found:{},...__};function D_(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function O_(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!D_(e,E_))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!D_(t,b_))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!D_(t,b_))return null}return t}var k_=Object.create(null);function A_(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function j_(e,t){let n=k_[e]||(k_[e]=Object.create(null));return n[t]||(n[t]=A_(e,t))}function M_(e,t){return O_(t)?T_(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function N_(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var P_=!1;function F_(e){return typeof e==`boolean`&&(P_=e),P_}function I_(e){let t=typeof e==`string`?h_(e,!0,P_):e;if(t){let e=j_(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function L_(e,t){let n=h_(e,!0,P_);if(!n)return!1;let r=j_(n.provider,n.prefix);return t?N_(r,n.name,t):(r.missing.add(n.name),!0)}function R_(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),P_&&!t&&!e.prefix){let t=!1;return O_(e)&&(e.prefix=``,T_(e,(e,n)=>{L_(e,n)&&(t=!0)})),t}let n=e.prefix;return g_({prefix:n,name:`a`})?!!M_(j_(t,n),e):!1}var z_=Object.freeze({width:null,height:null}),B_=Object.freeze({...z_,...v_}),V_=/(-?[0-9.]*[0-9]+[0-9.]*)/g,H_=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function U_(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(V_);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=H_.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function W_(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function G_(e,t){return e?`<defs>`+e+`</defs>`+t:t}function K_(e,t,n){let r=W_(e);return G_(r.defs,t+r.content+n)}var q_=e=>e===`unset`||e===`undefined`||e===`none`;function J_(e,t){let n={...y_,...e},r={...B_,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=K_(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=U_(d,c/l)):(u=o===`auto`?c:o,d=s===null?U_(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{q_(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var Y_=/\sid="(\S+)"/g,X_=`IconifyId`+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Z_=0;function Q_(e,t=X_){let n=[],r;for(;r=Y_.exec(e);)n.push(r[1]);if(!n.length)return e;let i=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(n=>{let r=typeof t==`function`?t(n):t+(Z_++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+a+`)([")]|\\.[a-z])`,`g`),`$1`+r+i+`$3`)}),e=e.replace(new RegExp(i,`g`),``),e}var $_=Object.create(null);function ev(e,t){$_[e]=t}function tv(e){return $_[e]||$_[``]}function nv(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var rv=Object.create(null),iv=[`https://api.simplesvg.com`,`https://api.unisvg.com`],av=[];iv.length>0;)iv.length===1||Math.random()>.5?av.push(iv.shift()):av.push(iv.pop());rv[``]=nv({resources:[`https://api.iconify.design`].concat(av)});function ov(e,t){let n=nv(t);return n===null?!1:(rv[e]=n,!0)}function sv(e){return rv[e]}var cv=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function lv(e,t){let n=sv(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{let n=t;e=Math.max(e,n.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function uv(e){return e===404}var dv=(e,t,n)=>{let r=[],i=lv(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function fv(e){if(typeof e==`string`){let t=sv(e);if(t)return t.path}return`/`}var pv={prepare:dv,send:(e,t,n)=>{if(!cv){n(`abort`,424);return}let r=fv(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;cv(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(uv(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function mv(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=j_(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function hv(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function gv(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||hv([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var _v=0;function vv(e,t,n){let r=_v++,i=hv.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function yv(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?h_(e,t,n):e;i&&r.push(i)}),r}var bv={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function xv(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function Sv(e){let t={...bv,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=xv(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function Cv(){}var wv=Object.create(null);function Tv(e){if(!wv[e]){let t=sv(e);if(!t)return;wv[e]={config:t,redundancy:Sv(t)}}return wv[e]}function Ev(e,t,n){let r,i;if(typeof e==`string`){let t=tv(e);if(!t)return n(void 0,424),Cv;i=t.send;let a=Tv(e);a&&(r=a.redundancy)}else{let t=nv(e);if(t){r=Sv(t);let n=tv(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),Cv):r.query(t,i,n)().abort}function Dv(){}function Ov(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,gv(e)}))}function kv(e){let t=[],n=[];return e.forEach(e=>{(e.match(m_)?t:n).push(e)}),{valid:t,invalid:n}}function Av(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!M_(e,n).length){r();return}}catch(e){console.error(e)}r(),Ov(e)}function jv(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function Mv(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){jv(e.loadIcons(r,n,t),t=>{Av(e,r,t)});return}if(i){r.forEach(r=>{jv(i(r,n,t),t=>{Av(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=kv(r);if(o.length&&Av(e,o,null),!a.length)return;let s=n.match(m_)?tv(t):null;if(!s){Av(e,a,null);return}s.prepare(t,n,a).forEach(n=>{Ev(t,n,t=>{Av(e,n.icons,t)})})}))}var Nv=(e,t)=>{let n=mv(yv(e,!0,F_()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,Dv)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(j_(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=j_(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&Mv(e,t)}),t?vv(t,n,i):Dv};function Pv(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in z_?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Fv=/[\s,]+/;function Iv(e,t){t.split(Fv).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function Lv(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function Rv(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function zv(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Bv(e){return`data:image/svg+xml,`+zv(e)}function Vv(e){return`url("`+Bv(e)+`")`}var Hv={...B_,inline:!1},Uv={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},Wv={display:`inline-block`},Gv={backgroundColor:`currentColor`},Kv={backgroundColor:`transparent`},qv={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},Jv={webkitMask:Gv,mask:Gv,background:Kv};for(let e in Jv){let t=Jv[e];for(let n in qv)t[e+n]=qv[n]}var Yv={};[`horizontal`,`vertical`].forEach(e=>{let t=e.slice(0,1)+`Flip`;Yv[e+`-flip`]=t,Yv[e.slice(0,1)+`-flip`]=t,Yv[e+`Flip`]=t});function Xv(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var Zv=(e,n)=>{let r=Pv(Hv,n),i={...Uv},a=n.mode||`svg`,o={},s=n.style,c=typeof s==`object`&&!(s instanceof Array)?s:{};for(let e in n){let t=n[e];if(t!==void 0)switch(e){case`icon`:case`style`:case`onLoad`:case`mode`:case`ssr`:break;case`inline`:case`hFlip`:case`vFlip`:r[e]=t===!0||t===`true`||t===1;break;case`flip`:typeof t==`string`&&Iv(r,t);break;case`color`:o.color=t;break;case`rotate`:typeof t==`string`?r[e]=Lv(t):typeof t==`number`&&(r[e]=t);break;case`ariaHidden`:case`aria-hidden`:t!==!0&&t!==`true`&&delete i[`aria-hidden`];break;default:{let n=Yv[e];n?(t===!0||t===`true`||t===1)&&(r[n]=!0):Hv[e]===void 0&&(i[e]=t)}}}let l=J_(e,r),u=l.attributes;if(r.inline&&(o.verticalAlign=`-0.125em`),a===`svg`){i.style={...o,...c},Object.assign(i,u);let e=0,r=n.id;return typeof r==`string`&&(r=r.replace(/-/g,`_`)),i.innerHTML=Q_(l.body,r?()=>r+`ID`+ e++:`iconifyVue`),(0,t.h)(`svg`,i)}let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=Rv(d,{...u,width:f+``,height:p+``});return i.style={...o,"--svg":Vv(h),width:Xv(u.width),height:Xv(u.height),...Wv,...m?Gv:Kv,...c},(0,t.h)(`span`,i)};if(F_(!0),ev(``,pv),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!R_(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;ov(e,r)||console.error(n)}catch{console.error(n)}}}}var Qv={...y_,body:``},$v=(0,t.defineComponent)((e,{emit:n})=>{let r=(0,t.ref)(null);function i(){r.value&&=(r.value.abort?.(),null)}let a=(0,t.ref)(!!e.ssr),o=(0,t.ref)(``),s=(0,t.shallowRef)(null);function c(){let a=e.icon;if(typeof a==`object`&&a&&typeof a.body==`string`)return o.value=``,{data:a};let s;if(typeof a!=`string`||(s=h_(a,!1,!0))===null)return null;let c=I_(s);if(!c){let e=r.value;return(!e||e.name!==a)&&(c===null?r.value={name:a}:r.value={name:a,abort:Nv([s],l)}),null}i(),o.value!==a&&(o.value=a,(0,t.nextTick)(()=>{n(`load`,a)}));let u=e.customise;if(u){c=Object.assign({},c);let e=u(c.body,s.name,s.prefix,s.provider);typeof e==`string`&&(c.body=e)}let d=[`iconify`];return s.prefix!==``&&d.push(`iconify--`+s.prefix),s.provider!==``&&d.push(`iconify--`+s.provider),{data:c,classes:d}}function l(){let e=c();e?e.data!==s.value?.data&&(s.value=e):s.value=null}return a.value?l():(0,t.onMounted)(()=>{a.value=!0,l()}),(0,t.watch)(()=>e.icon,l),(0,t.onUnmounted)(i),()=>{let t=s.value;if(!t)return Zv(Qv,e);let n=e;return t.classes&&(n={...e,class:t.classes.join(` `)}),Zv({...y_,...t.data},n)}},{props:[`icon`,`mode`,`ssr`,`width`,`height`,`style`,`color`,`inline`,`rotate`,`hFlip`,`horizontalFlip`,`vFlip`,`verticalFlip`,`flip`,`id`,`ariaHidden`,`customise`,`title`],emits:[`load`]}),ey=(0,t.defineComponent)({name:`ZIcon`,__name:`Icon`,props:{icon:{}},setup(e){let n=e,r=(0,t.computed)(()=>typeof n.icon==`string`);return(n,i)=>r.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)($v),{key:0,icon:e.icon},null,8,[`icon`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon),{key:1}))}});function ty(){let e=(0,t.inject)(`n-config-provider`,{});return{themeVarRef:(0,t.computed)(()=>e.mergedThemeOverridesRef.value.common)}}var ny={class:`z-icon-picker overflow-hidden flex w-full`,style:{height:`300px`}},ry=[`onClick`],iy={class:`flex-1 overflow-hidden flex flex-col h-full`},ay={class:`category flex overflow-auto items-center gap-[10px] pr-[10px]`},oy={key:0},sy={class:`icon-list overflow-auto flex-1`},cy=[`onClick`],ly=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({name:`ZIconPicker`,__name:`IconPicker`,props:{host:{default:r?.iconApi}},emits:[`select`],setup(e,{emit:n}){(0,t.useCssVars)(e=>({v30412ec1:(0,t.unref)(C),b2fd4700:(0,t.unref)(w)}));let r=e,i=n,a={collections:r.host+`/collections`,collection:r.host+`/collection`,search:r.host+`/search`},o=(0,t.ref)(!1),s=(0,t.ref)([]);c();async function c(){o.value=!0;try{let e=await(await fetch(a.collections)).json();o.value=!1;let t=[];for(let[n,r]of Object.entries(e))!r.hidden&&![`Archive / Unmaintained`].includes(r.category)&&t.push({name:r.name,prefix:n});s.value=t,f(s.value[0])}catch{o.value=!1}}let l=(0,t.computed)(()=>{let e=[{label:`ALl`,key:``}];return d.value?.icons?.categories&&Object.keys(d.value?.icons?.categories).forEach(t=>{e.push({label:t,key:t})}),e}),u=(0,t.ref)(!1),d=(0,t.ref)({});async function f(e){if(d.value=e,!e.icons){u.value=!0;let t=await(await fetch(a.collection+`?prefix=`+e.prefix)).json();u.value=!1;let n=new Set;if(t.categories){for(let e of Object.values(t.categories))e.forEach(e=>n.add(e));t.all=[...n]}else t.all=t.uncategorized;e.icons=t}p.value=``,g.value=1}let p=(0,t.ref)(``);function m(e){g.value=1,p.value=e}let h=(0,t.computed)(()=>d.value.icons?p.value?d.value.icons.categories[p.value]:[...d.value.icons.all]:[]),g=(0,t.ref)(1),_=(0,t.ref)(50);(0,t.watch)(_,()=>g.value=1);let v=(0,t.computed)(()=>h.value.slice((g.value-1)*_.value,g.value*_.value));function y(e){i(`select`,d.value.prefix+`:`+e)}let b=(0,t.ref)(``);(0,t.watch)(b,e=>{e?x(e):c()});async function x(e){let t=await(await fetch(a.search+`?query=`+e)).json();if(t.total>0){let e=[];for(let[n,r]of Object.entries(t.collections))!r.hidden&&![`Archive / Unmaintained`].includes(r.category)&&e.push({name:r.name,prefix:n,icons:{all:t.icons.filter(e=>e.startsWith(n+`:`)).map(e=>e.replace(n+`:`,``))}});s.value=e,f(s.value[0])}else s.value=[],d.value={}}let{themeVarRef:S}=ty(),{primaryColor:C}=S.value,w=c_(C,.95);return(e,n)=>{let r=(0,t.resolveComponent)(`n-spin`),i=(0,t.resolveComponent)(`n-button`),a=(0,t.resolveComponent)(`n-dropdown`),c=(0,t.resolveComponent)(`n-input`),x=(0,t.resolveComponent)(`n-pagination`),S=(0,t.resolveComponent)(`n-tooltip`);return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,ny,[(0,t.createVNode)(r,{show:o.value,class:`overflow-auto h-full set min-w-[300px]`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`item`,{selected:d.value.name===e.name}]),key:e.name,onClick:t=>f(e)},(0,t.toDisplayString)(e.name),11,ry))),128))]),_:1},8,[`show`]),(0,t.createElementVNode)(`div`,iy,[(0,t.createVNode)(r,{show:u.value,class:`h-full`,"content-class":`h-full overflow-hidden flex flex-col`},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,ay,[l.value.length>1?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,oy,[(0,t.createVNode)(a,{class:`z-icon-picker-dropdown`,trigger:`click`,options:l.value,onSelect:m},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(i,{size:`small`},{icon:(0,t.withCtx)(()=>[(0,t.createVNode)(ey,{icon:`lets-icons:folder-dublicate-duotone-line`})]),default:(0,t.withCtx)(()=>[(0,t.createTextVNode)(` `+(0,t.toDisplayString)(p.value||`All`),1)]),_:1})]),_:1},8,[`options`])])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(c,{class:`flex-1`,value:b.value,"onUpdate:value":n[0]||=e=>b.value=e,valueModifiers:{trim:!0},size:`small`,placeholder:`搜索图标`,clearable:``},{prefix:(0,t.withCtx)(()=>[(0,t.createVNode)(ey,{icon:`icon-park-outline:search`})]),_:1},8,[`value`]),(0,t.createVNode)(x,{page:g.value,"onUpdate:page":n[1]||=e=>g.value=e,"page-size":_.value,"onUpdate:pageSize":n[2]||=e=>_.value=e,"item-count":h.value.length,"show-size-picker":!1,simple:``,"page-sizes":[50,100,200,500]},null,8,[`page`,`page-size`,`item-count`])]),(0,t.createElementVNode)(`div`,sy,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(v.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e,onClick:t=>y(e)},[(0,t.createVNode)(S,{trigger:`hover`,delay:500},{trigger:(0,t.withCtx)(()=>[(0,t.createVNode)(ey,{class:`icon`,icon:d.value.prefix+`:`+e},null,8,[`icon`])]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(d.value.prefix+`:`+e),1)]),_:2},1024)],8,cy))),128))])]),_:1},8,[`show`])])])}}}),[[`__scopeId`,`data-v-0f4d48cc`]]),uy=(0,t.defineComponent)({name:`IconInput`,__name:`IconInput`,props:{value:{default:``},valueModifiers:{}},emits:[`update:value`],setup(e){let n=(0,t.useModel)(e,`value`);function r(e){n.value=e,i.value=!1}let i=(0,t.ref)(!1);function a(e){i.value=e}return(e,o)=>{let s=(0,t.resolveComponent)(`n-input`),c=(0,t.resolveComponent)(`n-popover`);return(0,t.openBlock)(),(0,t.createBlock)(c,{show:i.value,trigger:`click`,"on-update:show":a,"content-style":`width: 750px;`},{trigger:(0,t.withCtx)(()=>[(0,t.createVNode)(s,(0,t.mergeProps)(e.$attrs,{value:n.value,"onUpdate:value":o[0]||=e=>n.value=e}),{prefix:(0,t.withCtx)(()=>[(0,t.createVNode)(ey,{icon:n.value||`qlementine-icons:empty-slot-16`,style:{"font-size":`20px`}},null,8,[`icon`])]),_:1},16,[`value`])]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(ly,{onSelect:r})]),_:1},8,[`show`])}}});r.iconApi&&ov(``,{resources:[r.iconApi]});async function dy(e,t=`svg`){await Promise.all(Object.entries(e).map(e=>{let[n,r]=e,i=n.lastIndexOf(`/`)+1,a=n.lastIndexOf(`.`);return L_(`${t}:${n.slice(i,a)}`,{...fy(typeof r==`object`?r.default:r)})}))}function fy(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement,n=[...t.childNodes].filter(e=>e.nodeType===Node.ELEMENT_NODE).map(e=>new XMLSerializer().serializeToString(e)).join(``),[r,i,a,o]=(t.getAttribute(`viewBox`)||``).split(` `).map(e=>{let t=Number(e);return Number.isNaN(t)?void 0:t});return{body:n,height:o,left:r,top:i,width:a}}var py=[ey,ly,uy],my={install(e){py.forEach(t=>{e.component(t.name,t)})}};function hy(e=``){return e+(crypto?.randomUUID?.()||`${Date.now()}_${Math.random().toString(16).slice(2)}`)}function gy(...e){_y()&&console.log(`【zxqWs】`,...e)}function _y(){return typeof process<`u`&&process?.env&&typeof process.env.NODE_ENV==`string`?process.env.NODE_ENV===`development`:typeof __DEV__<`u`?typeof __DEV__==`boolean`?__DEV__:!1:!!(typeof window<`u`&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__)}let vy={CLIENT_NAME:`__client-name`,DEV1:`dev-1`,DEV2:`dev-2`};var yy=(0,t.ref)(),{status:by,data:xy,send:Sy,close:Cy,open:wy}=(0,n.useWebSocket)(yy,{immediate:!1,autoConnect:!1,heartbeat:{message:`ping`,interval:5e3,pongTimeout:15e3},autoReconnect:{retries:3,delay:1e4,onFailed(){console.error(`超过重连次数`)}}});function Ty(e){Sy(JSON.stringify(e))}let Ey={sendMsg:Ty,close:Cy,status:by};var Dy=new Map;function Oy(e,n){yy.value||(yy.value=n.url,wy()),(0,t.watch)(by,e=>{gy(`ws status`,e),e===`OPEN`&&Ty({event:vy.CLIENT_NAME,payload:{name:n.name}})}),(0,t.watch)(xy,e=>{if(e!==`pong`)try{let{sourceIp:t,event:r,payload:i}=JSON.parse(e);if(n?.trustIp&&t!==n.trustIp)return;let a=Dy.get(r);a&&a.forEach(({fn:e,off:t})=>{e(i),t&&t()})}catch(e){console.error(`ws 数据格式有误`,e)}})}function ky(e,n){n&&Oy(null,n),by.value===`CLOSED`&&yy.value&&wy();let r=hy();function i(t){let n=Dy.get(e);if(n)n.set(r,{fn:t});else{let n=new Map().set(r,{fn:t});Dy.set(e,n)}}function a(){let t=Dy.get(e);t&&t.has(r)&&(t.delete(r),t.size===0&&Dy.delete(e))}function o(t){gy(`ws once`);let n=Dy.get(e);if(n)n.set(r,{fn:t});else{let n=new Map().set(r,{fn:t,off:a});Dy.set(e,n)}}(0,t.onBeforeUnmount)(()=>{a()});function s(e){Ty(e)}return{on:i,off:a,once:o,emit:s}}var Ay=[p_];e.EVENT_TYPE=vy,e.ZButton=p_,e.ZIcon=ey,e.ZIconInput=uy,e.ZIconPicker=ly,e.default={install(e,t){i(t||{}),e.use(d_),Ay.forEach(t=>{e.component(t.name,t)}),e.use(my),t?.ws&&e.use(Oy,t.ws)}},e.loadLocalSvgIcons=dy,e.useWs=ky,e.ws=Ey,e.zwqWs=Oy});
|